Whatsapp-web.js: Send audios in ptt format instead of audio file format

Created on 14 Apr 2020  路  2Comments  路  Source: pedroslopez/whatsapp-web.js

Send audios in ptt format instead of audio file format when explicitly requested.

ptt format
Captura de tela 2020-04-14 16 47 47

audio file format
Captura de tela 2020-04-14 16 47 18

enhancement

Most helpful comment

Thanks for the feature request!

I've now added a new option for messages: sendAudioAsVoice. When set to true, it will send audio files as voice notes instead of regular audio messages. The default is set to false, so this doesn't change anything for existing users.

Implementation would look a little something like this:

chat.sendMessage(attachmentData, { sendAudioAsVoice: true });

All 2 comments

That could be an good enhancement, if you need help to code, please let me know, just say me what to do for help.

Thanks for the feature request!

I've now added a new option for messages: sendAudioAsVoice. When set to true, it will send audio files as voice notes instead of regular audio messages. The default is set to false, so this doesn't change anything for existing users.

Implementation would look a little something like this:

chat.sendMessage(attachmentData, { sendAudioAsVoice: true });
Was this page helpful?
0 / 5 - 0 ratings