mirror of
https://github.com/cheveguerra/whatsapp-web.js.git
synced 2026-04-18 03:29:14 +00:00
added ack constants and brief example
This commit is contained in:
16
example.js
16
example.js
@@ -193,6 +193,22 @@ client.on('message_revoke_me', async (msg) => {
|
||||
console.log(msg.body); // message before it was deleted.
|
||||
});
|
||||
|
||||
client.on('message_ack', (msg, ack) => {
|
||||
/*
|
||||
== ACK VALUES ==
|
||||
ACK_ERROR: -1
|
||||
ACK_PENDING: 0
|
||||
ACK_SERVER: 1
|
||||
ACK_DEVICE: 2
|
||||
ACK_READ: 3
|
||||
ACK_PLAYED: 4
|
||||
*/
|
||||
|
||||
if(ack == 3) {
|
||||
// The message was read
|
||||
}
|
||||
});
|
||||
|
||||
client.on('disconnected', (reason) => {
|
||||
console.log('Client was logged out', reason);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user