wechaty / getting-started

A Starter Project Template for Wechaty works out-of-the-box
https://gitpod.io/#https://github.com/wechaty/wechaty-getting-started
Apache License 2.0
779 stars 344 forks source link

Wechaty contact-bot does not give the desired results #186

Open vasvi-sood opened 3 years ago

vasvi-sood commented 3 years ago

0. Report Issue Guide

  1. Please run the following command and check whether the problem has been fixed:

    rm -rf package-lock.json
    rm -rf node_modules
    npm install
  2. Please search in FAQ List first, and make sure your problem has not been solved before.

  3. Please search in the issue first, and make sure your problem had not been reported before

1. Versions

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:

  1. git clone https://github.com/wechaty/wechaty-getting-started 2.npm install 3.npm install
  2. rm -rf package-lock.json
  3. rm -rf node_modules
  4. export WECHATY_LOG=verbose
  5. export WECHATY_PUPPET=wechaty-puppet-whatsapp
  6. 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

Output 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!

```shell $ WECHATY_LOG=silly node yourbot.js Question: Paste your FULL(DO NOT ONLY PROVIDE FRAGMENTS) log messages Answer: 17:42:59 VERB MemoryCard 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 on() is pending 17:42:59 VERB StateSwitch 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() with id="917018161701@c.us" 17:42:59 SILL Puppet contactPayload(917018161701@c.us) cache MISS 17:42:59 VERB PuppetWhatsApp contactRawPayload(917018161701@c.us) 17:43:00 SILL Puppet contactPayload(917018161701@c.us) cache SET Contact<917018161701@c.us> 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

7. Additional context

Note : I have relaced my phone number with **. [bug]

huan commented 2 years ago

I'm afraid that the Whatsapp contact function is either not implemented or buggy.

We can skip this example bot, thanks.