wechaty / puppet-official-account

Wechaty Puppet for WeChat Official Account
https://wechaty.js.org/2020/11/06/wechaty-puppet-oa-released-en/
Apache License 2.0
16 stars 7 forks source link

enable sending voice message through messageSendFile() #20

Closed MachengShen closed 3 years ago

MachengShen commented 3 years ago

Support sending amr/mp3 files through messageSendFile(), will check the mimetype of the Filebox file, and correspondingly adjust the request header sent to wechat OA server.

Test plan:

let fileBox_audio = FileBox.fromFile('xxx.mp3')
if (msgPayload.fromId){
  await puppet.messageSendFile(msgPayload.fromId!, fileBox_audio)
}  

Anticipated result: user should receive a voice message (recorded in 'xxx.mp3') from the wechat OA.

Link to https://github.com/wechaty/wechaty-puppet-official-account/issues/19

CLAassistant commented 3 years ago

CLA assistant check
All committers have signed the CLA.

huan commented 3 years ago

Thank you very much for your contribution!

You are welcome to join Wechaty Contributor Program

1. Join Wechaty Organization

You've invited MachengShen to Wechaty! They'll be receiving an email shortly. They can also visit https://github.com/wechaty to accept the invitation.

I have invited you to join our Wechaty GitHub Organization, please accept it by following the above message.

2. Update Your Wechaty Contributor Profile

Please open Contributor Hall of Fame and add yourself to the end of the list, so that other contributors will know you better!

3. Join The Contributor Only WeChat Room

We also have a WeChat room for contributors only which can discuss Wechaty at a deeper level, you are welcome to join and if you are interested.

Please add @lijiarui wechat: _ruirui0914 and send her this pr link. She will invite you into Wechaty Contributor Room

Cheers!

huan commented 3 years ago

This PR has been published on wechaty-puppet-office-account@0.5.42