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

media-file-bot save file to local not work #38

Closed
3014zhangshuo opened this issue Jul 16, 2018 · 5 comments
Closed

media-file-bot save file to local not work #38

3014zhangshuo opened this issue Jul 16, 2018 · 5 comments

Comments

@3014zhangshuo
Copy link

Hi,
I clone Chatie/wechaty-getting-started and Chatie/wechaty, run the media-file-bot example with two projects, but when I send a pdf file to the robot,file save not be trigger msg.type() !== bot.Message.Type.Text will be return false, only return something like this RECV: Message#Text(🗣Contact<张硕>👤Contact<WonderCV小助手>)<&lt;msg&gt;&lt;appmsg appid="" sdkver="0"&gt;&lt;title&gt;xxx.pdf&lt;/>.

I also clone lijiarui/wechaty-puppet-padchat add the code to examples/wechaty-padchat-bot onMessage function

  if (msg.type() !== Message.Type.Text) {
    const file = await msg.toFileBox()
    const name = file.name
     console.log('Save file to: ' + name)
     file.toFile(name)
  }

I try again that console throw unsupport type: StatusNotify(51) because it is not fully implemented yet

Does this mean that the feature is not yet supported? , or is there a problem with the version I am running? Three projects are cloned master branch.
I look forward to your answer. thank you .

@3014zhangshuo
Copy link
Author

I forget rm -f package-lock.json. I will try to reinstall dependencies first.

@huan
Copy link
Member

huan commented Jul 16, 2018

Yes, save the attachment to file is not fully implementated by PuppetPadchat.

See: wechaty/wechaty-puppet-padchat#101

@huan huan added the duplicate label Jul 16, 2018
@huan
Copy link
Member

huan commented Jul 16, 2018

BTW: If you want to download those files and do not care about which puppet you are using, then you can try puppeteer, it supports download almost all kinds of the attachments.

Start Wechaty with WECHATY_PUPPET=puppeteer to use PuppetPuppeteer.

@3014zhangshuo
Copy link
Author

3014zhangshuo commented Jul 16, 2018

Thank you for your answer,but i want usePuppetPadchat to broke wechat limitations,Looking forward to perfecting this feature. Thank you for making wechaty,It's very cool.

@huan
Copy link
Member

huan commented Jul 16, 2018

You are welcome.

Please close this issue if there are no other questions, have a nice day!

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

No branches or pull requests

2 participants