feat: send photo/video as a view once message (#2317)
* added isViewOnce property * docs updated * added usage example * fix: ESLint
This commit is contained in:
parent
c8c2f09f20
commit
8ff5bceca0
4 changed files with 16 additions and 4 deletions
|
|
@ -140,6 +140,12 @@ client.on('message', async msg => {
|
|||
const attachmentData = await quotedMsg.downloadMedia();
|
||||
client.sendMessage(msg.from, attachmentData, { caption: 'Here\'s your requested media.' });
|
||||
}
|
||||
} else if (msg.body === '!isviewonce' && msg.hasQuotedMsg) {
|
||||
const quotedMsg = await msg.getQuotedMessage();
|
||||
if (quotedMsg.hasMedia) {
|
||||
const media = await quotedMsg.downloadMedia();
|
||||
await client.sendMessage(msg.from, media, { isViewOnce: true });
|
||||
}
|
||||
} else if (msg.body === '!location') {
|
||||
msg.reply(new Location(37.422, -122.084, 'Googleplex\nGoogle Headquarters'));
|
||||
} else if (msg.location) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue