feat: send audio with waveform (#2309)
* added generateWaveform * docs updated * added usage example * ESLint fix * fixed: undefined returned on waveform generation failure * fix: ESLint
This commit is contained in:
parent
b47998878a
commit
df1b070d54
4 changed files with 45 additions and 2 deletions
|
|
@ -140,6 +140,10 @@ client.on('message', async msg => {
|
|||
const attachmentData = await quotedMsg.downloadMedia();
|
||||
client.sendMessage(msg.from, attachmentData, { caption: 'Here\'s your requested media.' });
|
||||
}
|
||||
if (quotedMsg.hasMedia && quotedMsg.type === 'audio') {
|
||||
const audio = await quotedMsg.downloadMedia();
|
||||
await client.sendMessage(msg.from, audio, { sendAudioAsVoice: true });
|
||||
}
|
||||
} else if (msg.body === '!isviewonce' && msg.hasQuotedMsg) {
|
||||
const quotedMsg = await msg.getQuotedMessage();
|
||||
if (quotedMsg.hasMedia) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue