getting-started
getting-started copied to clipboard
Wechaty contact-bot does not give the desired results
0. Report Issue Guide
- Please run the following command and check whether the problem has been fixed:
rm -rf package-lock.json
rm -rf node_modules
npm install
-
Please search in FAQ List first, and make sure your problem has not been solved before.
-
Please search in the issue first, and make sure your problem had not been reported before
1. Versions
-
What is your wechaty version? Answer: 0.11.4
-
Which puppet are you using for wechaty? (padchat/puppeteer/padpro/...) Answer: wechaty-puppet-whatsapp
-
What is your wechaty-puppet-XXX(padchat/puppeteer/) version? Answer: -
-
What is your node version? (run
node --version
) Answer:14.17.0 -
What os are you using Answer: Linux
2. Describe the bug
The contact-bot is not showing desired Results. I have around 200 contacts on my phone yet it always displays BOT contact number 0 as an output.
3. To Reproduce
This part is very important: if you can not provide any reproduce steps, then the problem will be very hard to be recognised.
Steps to reproduce the behaviour:
- git clone
https://github.com/wechaty/wechaty-getting-started
2.npm install 3.npm install - rm -rf package-lock.json
- rm -rf node_modules
- export WECHATY_LOG=verbose
- export WECHATY_PUPPET=wechaty-puppet-whatsapp
- node examples/basic/contact-bot.js
4. Expected behaviour
I expected it to show a list of all whatsapp contacts on my phone.
5. Actual behavior
The bot showed ) contacts. However I have a few contacts on my phone.
6. Full Output Logs
Set env WECHATY_LOG=silly
in order to set log level to silly, then we can get the full log (If you dosen't set log env, log level is info as default, we cannot get the full log)
We need full log instead of log screenshot or log fragments!
$ WECHATY_LOG=silly node yourbot.js
Question: Paste your FULL(DO NOT ONLY PROVIDE FRAGMENTS) log messages
Answer:
17:42:59 VERB MemoryCard <puppet> set(PUPPET_WHATSAPP, [object Object])
17:42:59 VERB MemoryCard <> save() to N/A
17:42:59 VERB MemoryCard save() no storage, NOOP
17:42:59 SILL StateSwitch <PuppetWhatsapp> on() is pending
17:42:59 VERB StateSwitch <PuppetWhatsapp> on(true) <- (pending)
17:42:59 VERB PuppetWhatsApp start() whatsapp.initialize() done
17:42:59 VERB Contact load(***********@c.us) init pool
17:42:59 SILL Contact constructor(**********@c.us)
17:42:59 SILL Contact ready() @ Puppet#0<PuppetWhatsapp>() with id="[email protected]"
17:42:59 SILL Puppet contactPayload([email protected]) cache MISS
17:42:59 VERB PuppetWhatsApp contactRawPayload([email protected])
17:43:00 SILL Puppet contactPayload([email protected]) cache SET
Contact<[email protected]> login
17:43:00 VERB Contact findAll()
17:43:00 VERB Puppet contactSearch(query=undefined, )
17:43:00 VERB PuppetWhatsApp contactList()
17:43:00 SILL Puppet contactSearch() searchIdList.length = 0
17:43:00 INFO Bot #######################
17:43:00 INFO Bot Contact number: 0
</details>
## 7. Additional context
*Note :* I have relaced my phone number with **********.
[bug]
I'm afraid that the Whatsapp contact function is either not implemented or buggy.
We can skip this example bot, thanks.