Fixed promise bug

This commit is contained in:
Adhiraj
2020-05-09 19:01:22 +05:30
parent 91cfbd1412
commit eb7387b6fb
5 changed files with 15 additions and 13 deletions

View File

@@ -4,7 +4,7 @@
module.exports = function(WhatsAppWeb) {
// check if given number is registered on WhatsApp
WhatsAppWeb.prototype.isOnWhatsApp = function (jid) {
return this.query(["query", "exist", jid])
return this.query(["query", "exist", jid]).then (([m, q]) => [m.status === 200, q[2]])
}
// check the presence status of a given jid
WhatsAppWeb.prototype.requestPresenceUpdate = function (jid) {