Closed System233 closed 2 years ago
Is there any other user who can confirm this problem?
I can not understand why this happens and I believe it can work before.
With the web protocol, you might not be able to save images from the messages sent by yourself.
The reason for this is related to the Web WeChat angular implementation and the Wechaty implementation bug.
- if(msg.type()==bot.Message.Type.Image){
+ if(msg.type()==bot.Message.Type.Image && !msg.self()){
const file=await msg.toFileBox();
console.log(`收到图片:${file.name}`)
const path="received-"+file.name;
await file.toFile(path);
console.log(`保存图片:${path}`)
}
Steps to reproduce
0.
npm install wechaty wechaty-puppet-wechat file-box qrcode-terminal
test.png
in current directoryimage
from WeChat client to anywhere.received-test.png
in current directory.received-test.png
is a empty file