mukulhase / WebWhatsapp-Wrapper

An API for sending and receiving messages over web.whatsapp [Working as of 18th May 2018]
https://webwhatsapi.readthedocs.io/en/latest/
MIT License
2.02k stars 796 forks source link

checkNumberStatus and WapQuery.queryExist error #1106

Open luidigo opened 2 years ago

luidigo commented 2 years ago

Hey,

I'am having problem with this function. It's not returning anything. This problem began with new whatsapp multi-device version.

{ id: 'WapQuery', conditions: (module) => (module.default && module.default.queryExist) ? module.default : null }

and

Store.WapQuery.queryExist("1111111111@c.us")

Anyone with same problem?

jeferssonlemes commented 2 years ago

here too

fabiomello commented 2 years ago

Use this:

id: "WapQuery", conditions: (module) => module.queryExist ? module

and put '+' at the beggining of number Store.WapQuery.queryExist("+1111111111@c.us")

luidigo commented 2 years ago

Use this:

id: "WapQuery", conditions: (module) => module.queryExist ? module

and put '+' at the beggining of number Store.WapQuery.queryExist("+1111111111@c.us")

Didn't work here. Same behaviour (no response).

Are you in last Whatsapp version (multi-device)?

Thank you

fabiomello commented 2 years ago

Sorry, i send only the half of code { id: "WapQuery", conditions: (module) => module.queryExist ? module : null }

after that: Store.WapQuery.queryExist("+1111111111@c.us")

finally: Check the variable _value at return, will return 'wid' with server, user and _serialized, if the number doesnt exist, the _value will return null

(edited)

luidigo commented 2 years ago

Sorry, i send only the half of code { id: "WapQuery", conditions: (module) => module.queryExist ? module : null }

after that: Store.WapQuery.queryExist("+1111111111@c.us")

finally: Check the variable _value at return, will return 'wid' with server, user and _serialized, if the number doesnt exist, the _value will return null

(edited)

That did the trick! Thank you.

In time, How do you check if it's multi-device version?

This code works ONLY for "non Multi-Device"

conditions: (module) => (module.default && module.default.queryExist) ? module.default : null

and this works only for multi device

conditions: (module) => module.queryExist ? module : null

Cheers!

hkpanchani commented 2 years ago

Sorry, i send only the half of code { id: "WapQuery", conditions: (module) => module.queryExist ? module : null }

after that: Store.WapQuery.queryExist("+1111111111@c.us")

finally: Check the variable _value at return, will return 'wid' with server, user and _serialized, if the number doesnt exist, the _value will return null

(edited)

Its returning the same response whether the number is having whatsapp or not image

Shvan11 commented 2 years ago

Store.WapQuery.queryExist("+1111111111@c.us")

I'm also getting value undefined !

Masterxv commented 2 years ago

still not fixed... in beta mode

eduardoff19 commented 2 years ago

any updates on this new number check update in beta mode?

robertoclebio commented 2 years ago

I replaced the queryExist with this one

if (window.WAPI.checkNumberStatus(id)) {

eduardoff19 commented 2 years ago

it didn't work for me, follow my code image

**window.WAPI.checkNumberStatus = function (id, done) { window.Store.WapQuery.queryExist(id).then((result) => { if( done !== undefined) { if (result.jid === undefined) throw 404; done(window.WAPI._serializeNumberStatusObj(result)); } }).catch((e) => { if (done !== undefined) { done(window.WAPI._serializeNumberStatusObj({ status: e, jid : id })); } });

return true;

};**

how do i update the two lines? image

{ id: "WapQuery", conditions: (module) => (module.queryExist) ? module : ((module.default && module.default.queryExist) ? module.default : null) },

jonyhandoko commented 2 years ago

I replaced the queryExist with this one

if (window.WAPI.checkNumberStatus(id)) {

hi, how do u replace ? can u share the injector.js file? thx

hoangatpaygate commented 2 years ago

Sorry, i send only the half of code { id: "WapQuery", conditions: (module) => module.queryExist ? module : null } after that: Store.WapQuery.queryExist("+1111111111@c.us") finally: Check the variable _value at return, will return 'wid' with server, user and _serialized, if the number doesnt exist, the _value will return null (edited)

Its returning the same response whether the number is having whatsapp or not image

did you solve this issue? Please share your solution if you can fix it! Thanks