feat: send messages with attachments

close #3
This commit is contained in:
Pedro Lopez
2020-02-03 23:40:49 -04:00
parent e717915f94
commit a098d61b03
7 changed files with 161 additions and 26 deletions

View File

@@ -116,6 +116,13 @@ client.on('message', async msg => {
Timestamp: ${quotedMsg.timestamp}
Has Media? ${quotedMsg.hasMedia}
`);
} else if(msg.body == '!resendmedia' && msg.hasQuotedMsg) {
const quotedMsg = await msg.getQuotedMessage();
if(quotedMsg.hasMedia) {
const attachmentData = await quotedMsg.downloadMedia();
client.sendMessage(msg.from, attachmentData, {caption: 'Here\'s your requested media.'});
}
}
});