added querying for numbers

This commit is contained in:
Adhiraj
2020-04-03 14:13:55 +05:30
parent c6930e83ec
commit 6629c08c70
6 changed files with 78 additions and 31 deletions

View File

@@ -18,6 +18,17 @@ module.exports = function(WhatsAppWeb) {
this.chats[jid].user.count = 0 // reset read count
}
}
// check if given number is registered on WhatsApp
WhatsAppWeb.prototype.isOnWhatsApp = function (jid, callback) {
const json = [
"query",
"exist",
jid
]
this.sendJSON(json) // send
this.queryCallbacks.push({queryJSON: json, callback: callback})
}
// tell someone about your presence -- online, typing, offline etc.
WhatsAppWeb.prototype.updatePresence = function (jid, type) {
const json = [