feat: Edit message (#2254)

* function edit message
This commit is contained in:
tofers 2023-06-15 18:49:38 +03:00 • committed by GitHub
commit 8e8d0c9b3e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 138 additions and 3 deletions

View file

@ -201,6 +201,15 @@ client.on('message', async msg => {
client.sendMessage(msg.from, list);
} else if (msg.body === '!reaction') {
msg.react('👍');
} else if (msg.body === '!edit') {
if (msg.hasQuotedMsg) {
const quotedMsg = await msg.getQuotedMessage();
if (quotedMsg.fromMe) {
quotedMsg.edit(msg.body.replace('!edit', ''));
} else {
msg.reply('I can only edit my own messages');
}
}
}
});