发送图片 Failed with Message.say() received unknown msg
Created by: suntong
0. Report Issue Guide
- Please run the following command and check whether the problem has been fixed:
npm install wechaty-puppet-padlus@next
Not fixed.
- Please search in the issue first, and make sure your problem had not been reported before
Not reported before.
1. Versions
- What is your wechaty version?
- What is your wechaty-puppet-XXX(padchat/puppeteer/) version?
npm ls wechaty wechaty-puppet wechaty-puppet-mock wechaty-puppet-padplus
wechaty-getting-started@0.1.20 /path/to/wechaty-examples
├─┬ wechaty@0.48.10
│ └── UNMET PEER DEPENDENCY wechaty-puppet@0.32.3 deduped
├── UNMET PEER DEPENDENCY wechaty-puppet@0.32.3
├── wechaty-puppet-mock@0.28.1
└─┬ wechaty-puppet-padplus@0.7.40
└─┬ wechaty-puppet-cache@0.1.10
└── wechaty-puppet@0.24.0
-
What is your node version? (run
node --version
) Answer: v10.21.0 -
What os are you using Answer:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04 LTS
Release: 20.04
Codename: focal
2. Describe the bug
Recently 发送图片 failed with Message.say() received unknown msg
:
FileBox {
name: 'bot-qr-code.png',
boxType: 2,
mimeType: 'image/png',
remoteUrl: 'https://wechaty.github.io/wechaty/images/bot-qr-code.png' }
(node:1014552) UnhandledPromiseRejectionWarning: Error: Message.say() received unknown msg: FileBox#Url<bot-qr-code.png>
at WechatifiedMessage.say (/path/to/node_modules/wechaty/dist/src/user/message.js:439:19)
at Wechaty.onMessage (/path/to/my/on-message.js:197:15)
(node:1014552) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:1014552) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
I'm just following https://github.com/wechaty/wechaty/blob/70edb1d695c3a03e3b10edbb355f7acc753a8138/examples/ding-dong-bot.ts#L144-L150
like this:
const fileBox = FileBox.fromUrl('https://wechaty.github.io/wechaty/images/bot-qr-code.png')
console.log(fileBox)
await msg.say(fileBox)
console.info('REPLY: %s', fileBox.toString())
It happened after https://github.com/wechaty/wechaty-getting-started/issues/129
3. To Reproduce
Steps to reproduce the behavior:
- make sure to start with a personal account that has many big groups that are close to 500 users.
- run the
ding-dong-bot.js
from https://github.com/wechaty/wechaty-getting-started/ withwechaty-puppet-padplus
as the puppet - Send
ding
to it.
4. Expected behavior
Not seeing such error, image sent just work.
5. Actual behavior
I'm getting such errors recently.
6. Full Output Logs
As above.
7. Additional context
N.A.
[bug]