From eb55760eace888a5f63f64a66899ffb79a840f50 Mon Sep 17 00:00:00 2001 From: Hitesh Yadav Date: Wed, 5 May 2021 13:22:24 +0530 Subject: [PATCH] Updating README for fixes in event type. (#480) --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d16aa19..38b8d06 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,7 @@ import * as fs from 'fs' const conn = new WAConnection() // this will be called as soon as the credentials are updated -conn.on ('credentials-updated', () => { +conn.on ('open', () => { // save credentials whenever updated console.log (`credentials updated!`) const authInfo = conn.base64EncodedAuthInfo() // get all the auth info we need to restore this session @@ -450,7 +450,7 @@ await conn.toggleDisappearingMessages(jid, 0) - To get someone's presence (if they're typing, online) ``` ts // the presence update is fetched and called here - conn.on ('user-presence-update', json => console.log(json.id + " presence is " + json.type)) + conn.on ('CB:Presence', json => console.log(json.id + " presence is " + json.type)) await conn.requestPresenceUpdate ("xyz@c.us") // request the update ``` - To search through messages