mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-17 19:26:20 +00:00
Added delete event message(#33)
* A hacky way of doing things but seems to work. Also after client restart.
This commit is contained in:
13
example.js
13
example.js
@@ -127,6 +127,19 @@ client.on('message_create', (msg) => {
|
||||
}
|
||||
});
|
||||
|
||||
client.on('message_revoke_everyone', async (after, before) => {
|
||||
// Fired whenever a message is deleted by anyone (including you)
|
||||
console.log(after); // message after it was deleted.
|
||||
if (before) {
|
||||
console.log(before); // message before it was deleted.
|
||||
}
|
||||
});
|
||||
|
||||
client.on('message_revoke_me', async (msg) => {
|
||||
// Fired whenever a message is only deleted in your own view.
|
||||
console.log(msg.body); // message before it was deleted.
|
||||
});
|
||||
|
||||
client.on('disconnected', () => {
|
||||
console.log('Client was logged out');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user