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
772 stars 342 forks source link

Message ready() payload.talkerId not exist #287

Open JoyfulAndSpeedyMan opened 1 year ago

JoyfulAndSpeedyMan commented 1 year ago

Important:Please file the issue follow the template, or we won't help you to solve the problem.

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

Give a clear and concise description of what the bug is.

3. To Reproduce

I tried using the steps in the tutorial

npm install
set WECHATY_LOG=verbose
set WECHATY_PUPPET=wechaty-puppet-wechat
npm start

After the startup was successful, I used A wechat code scan to log in successfully, and then I tried to use B wechat signal to send A message, and then the console threw the following error message

15:00:49 INFO StarterBot Starter Bot Started.
15:00:50 INFO StarterBot Contact<@d9a9efd5f8cefbf7319d15086ede1ebbadf36c6178ce56eecf8cdf513fee477a> login
15:00:51 WARN Message ready() payload.talkerId not exist! See: https://github.com/wechaty/puppet/issues/187
Puppet: wechaty-puppet-wechat4u<wechaty-puppet>@1.11.1<1.20.2>
Error
    at WechatifiedUserClass.ready (file:///D:/workspace/git-repo/getting-started/node_modules/wechaty/src/user-modules/message.ts:818:21)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Promise.all (index 0)
    at async Function.findAll (file:///D:/workspace/git-repo/getting-started/node_modules/wechaty/src/user-modules/message.ts:137:7)
    at async Function.find (file:///D:/workspace/git-repo/getting-started/node_modules/wechaty/src/user-modules/message.ts:110:25)
    at async PuppetWechat4u.<anonymous> (file:///D:/workspace/git-repo/getting-started/node_modules/wechaty/src/wechaty-mixins/puppet-mixin.ts:275:29)
15:00:51 WARN Message ready() payload.listenerId should be set! See: https://github.com/wechaty/puppet/issues/187
Puppet: wechaty-puppet-wechat4u<wechaty-puppet>@1.11.1<1.20.2>
Error
    at WechatifiedUserClass.ready (file:///D:/workspace/git-repo/getting-started/node_modules/wechaty/src/user-modules/message.ts:832:21)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Promise.all (index 0)
    at async Function.findAll (file:///D:/workspace/git-repo/getting-started/node_modules/wechaty/src/user-modules/message.ts:137:7)
    at async Function.find (file:///D:/workspace/git-repo/getting-started/node_modules/wechaty/src/user-modules/message.ts:110:25)
    at async PuppetWechat4u.<anonymous> (file:///D:/workspace/git-repo/getting-started/node_modules/wechaty/src/wechaty-mixins/puppet-mixin.ts:275:29)
15:00:51 WARN Message talker() payload.talkerId not exist! See: https://github.com/wechaty/puppet/issues/187
Puppet: wechaty-puppet-wechat4u<wechaty-puppet>@1.11.1<1.20.2>
Error
    at WechatifiedUserClass.talker (file:///D:/workspace/git-repo/getting-started/node_modules/wechaty/src/user-modules/message.ts:283:21)
    at WechatifiedUserClass.toString (file:///D:/workspace/git-repo/getting-started/node_modules/wechaty/src/user-modules/message.ts:207:21)
    at WechatyImpl.onMessage (file:///D:/workspace/git-repo/getting-started/examples/ding-dong-bot.ts:44:30)
    at WechatyImpl.emit (node:events:513:28)
    at WechatyImpl.emit (node:domain:489:12)
    at WechatyImpl.emit (file:///D:/workspace/git-repo/getting-started/node_modules/wechaty/src/wechaty-mixins/gerror-mixin.ts:44:22)
    at PuppetWechat4u.<anonymous> (file:///D:/workspace/git-repo/getting-started/node_modules/wechaty/src/wechaty-mixins/puppet-mixin.ts:281:22)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
  ... 

Then I try to suggest https://github.com/wechaty/puppet/issues/187 to find the answer, in the abnormal but didn't find how to solve this problem

4. Expected behavior

Give a clear and concise description of what you expected to happen.

5. Actual behavior

If applicable, add screenshots to help explain your problem. But do not paste log screenshots here.

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!

Show Logs ```shell $ WECHATY_LOG=silly node yourbot.js Question: Paste your FULL(DO NOT ONLY PROVIDE FRAGMENTS) log messages Answer: ```

7. Additional context

Add any other context about the problem here.

[bug]

evachxji commented 4 months ago

edit package.json, change wechaty-puppet-wechat4u version to ~1.13.15 then npm install, npm start