Takeover conflict implementation

This commit is contained in:
Adhiraj
2020-07-10 12:44:31 +05:30
parent 2dad372e75
commit 2a7d179822
4 changed files with 29 additions and 6 deletions

View File

@@ -27,7 +27,10 @@ async function example() {
fs.writeFileSync('./auth_info.json', JSON.stringify(authInfo, null, '\t')) // save this info to a file
/* Note: one can take this auth_info.json file and login again from any computer without having to scan the QR code,
and get full access to one's WhatsApp. Despite the convenience, be careful with this file */
client.setOnTakenOver (async () => {
// uncomment to reconnect whenever the connection gets taken over from somewhere else
// await client.connect ()
})
client.setOnPresenceUpdate(json => console.log(json.id + ' presence is ' + json.type))
client.setOnMessageStatusChange(json => {
const participant = json.participant ? ' (' + json.participant + ')' : '' // participant exists when the message is from a group