Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

部分图片不勾选为原图发送 message.toFileBox 无响应 #175

Open
scholar-wei opened this issue Jul 22, 2019 · 2 comments
Open

Comments

@scholar-wei
Copy link

1. 提供你的包版本信息

  • wechaty 版本:"^0.23"
  • wechaty-puppet-padpro 版本:"^0.2.1"
  • node 版本:"v10.15.3"
  • 你使用的操作系统:CentOS or Mac

2. Bug 描述

部分图片不勾选为原图发送,wechaty接收到消息之后 message.toFileBox 无响应,图片无法保存下来

3. 复现的步骤 (或者解决的步骤)

  • 微信消息选择指定图片,不勾选原图,发送到指定群中
  • wechaty 在message中下载发送的图片,下载失败
    相关代码:
.on('message',async message=>{
     if (message.type() === 6) {
         const fileBox = await message.toFileBox();
         await fileBox.toFile();
     }
})

4. 期待程序运行的结果

图片能够正常保存到本地

5. 程序实际运行的结果

图片没有被保存

6. 完整的日志信息:

无任何日志输出

[bug]

@su-chang
Copy link
Member

su-chang commented Jul 25, 2019

我根据你提供的复现代码,是可以下载图片的。
图片会默认保存在根目录,类似1601427582.jpg这样的名字
可以在toFile()方法内添加参数指定图片的存储位置,例如await fileBox.toFile('/tmp/logo.jpg')

@scholar-wei
Copy link
Author

我根据你提供的复现代码,是可以下载图片的。
图片会默认保存在根目录,类似1601427582.jpg这样的名字
可以在toFile()方法内添加参数指定图片的存储位置,例如await fileBox.toFile('/tmp/logo.jpg')

有些图片是会出现问题的,需要勾选原图

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants