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

Store.WapQuery.queryExist stop working #1162

Closed gustavoaf90 closed 1 year ago

gustavoaf90 commented 1 year ago

Store.WapQuery.queryExist stop working after whatsappweb update:

var query = await Store.WapQuery.queryExist("+NUMBER@c.us") bootstrap_qr.23ad9ad330d5249cc805.js:formatted:96321 Uncaught Error: user must have an id or a phone at t.USyncUser.validate (bootstrap_qr.23ad9ad330d5249cc805.js:formatted:78070) at bootstrap_qr.23ad9ad330d5249cc805.js:formatted:77672 at Array.filter () at t.USyncQuery._buildStanza (bootstrap_qr.23ad9ad330d5249cc805.js:formatted:77670) at bootstrap_qr.23ad9ad330d5249cc805.js:formatted:77712 at Generator.next () at t (vendor1~bootstrap_qr.479b880772705c9f1664.js:formatted:4058) at s (vendor1~bootstrap_qr.479b880772705c9f1664.js:formatted:4072) at vendor1~bootstrap_qr.479b880772705c9f1664.js:formatted:4077 at Y (bootstrap_qr.23ad9ad330d5249cc805.js:formatted:19777)

phenriquec commented 1 year ago

same here

vilsonei commented 1 year ago

WhatsApp changed the way to call the queryExist, use it this way:

const _number = '553499999999';
Store.QueryExist.queryExist({ type: 'phone', phone: _number }).then(data => {
   if (!data) {
      throw 'Not found!';
   }

    return {
      status: 200,
      jid: data.wid
    };
  })
});
vilsonei commented 1 year ago

See my -> WAPI.js

chirag90851 commented 1 year ago

it's working.. How you can identify code changes by WhatsApp ?

vilsonei commented 1 year ago

it's working.. How you can identify code changes by WhatsApp ?

In WAPI.js, I insert "debugger" in the method, then debug the code when going into WhatsApp functions.

image

marcosdemelo commented 1 year ago

Thanks @vilsonei, Do you maintain a repo with WAPI.js up to date?

rajeshshettysrs commented 1 year ago

See my -> WAPI.js

Working sir,but its always returning true for all mobile numbers[mobile numbers which does have whatsapp and for invalid numbers also].Please verify once.

vilsonei commented 1 year ago

Thanks @vilsonei, Do you maintain a repo with WAPI.js up to date?

I have a project that uses wapi.js so I make some corrections to suit my project.

Parveen-Mothsara commented 1 year ago

WhatsApp changed the way to call the queryExist, use it this way:

const _number = '553499999999';
Store.QueryExist.queryExist({ type: 'phone', phone: _number }).then(data => {
   if (!data) {
      throw 'Not found!';
   }

    return {
      status: 200,
      jid: data.wid
    };
  })
});

Hi @vilsonei

After using above code its return data always null,Please help

vilsonei commented 1 year ago

WhatsApp changed the way to call the queryExist, use it this way:

const _number = '553499999999';
Store.QueryExist.queryExist({ type: 'phone', phone: _number }).then(data => {
   if (!data) {
      throw 'Not found!';
   }

    return {
      status: 200,
      jid: data.wid
    };
  })
});

Hi @vilsonei

After using above code its return data always null,Please help

See my WAPI.js, there really were changes after I posted the solution.

Parveen-Mothsara commented 1 year ago

WhatsApp changed the way to call the queryExist, use it this way:

const _number = '553499999999';
Store.QueryExist.queryExist({ type: 'phone', phone: _number }).then(data => {
   if (!data) {
      throw 'Not found!';
   }

    return {
      status: 200,
      jid: data.wid
    };
  })
});

Hi @vilsonei After using above code its return data always null,Please help

See my WAPI.js, there really were changes after I posted the solution.

HI @vilsonei
getting below response after using your wapi.js ,but this no on whatsapp {id: "91XXXXXXXXXX@c.us", status: 404, isBusiness: false, canReceiveMessage: false}

vilsonei commented 1 year ago

WhatsApp changed the way to call the queryExist, use it this way:

const _number = '553499999999';
Store.QueryExist.queryExist({ type: 'phone', phone: _number }).then(data => {
   if (!data) {
      throw 'Not found!';
   }

    return {
      status: 200,
      jid: data.wid
    };
  })
});

Hi @vilsonei After using above code its return data always null,Please help

See my WAPI.js, there really were changes after I posted the solution.

HI @vilsonei getting below response after using your wapi.js ,but this no on whatsapp {id: "91XXXXXXXXXX@c.us", status: 404, isBusiness: false, canReceiveMessage: false}

Post your code here so we can take a look.

Parveen-Mothsara commented 1 year ago

WhatsApp changed the way to call the queryExist, use it this way:

const _number = '553499999999';
Store.QueryExist.queryExist({ type: 'phone', phone: _number }).then(data => {
   if (!data) {
      throw 'Not found!';
   }

    return {
      status: 200,
      jid: data.wid
    };
  })
});

Hi @vilsonei After using above code its return data always null,Please help

See my WAPI.js, there really were changes after I posted the solution.

HI @vilsonei getting below response after using your wapi.js ,but this no on whatsapp {id: "91XXXXXXXXXX@c.us", status: 404, isBusiness: false, canReceiveMessage: false}

Post your code here so we can take a look.

Hi @vilsonei Please find code WAPIMD.js thanks for your cooperation

vilsonei commented 1 year ago

WhatsApp changed the way to call the queryExist, use it this way:

const _number = '553499999999';
Store.QueryExist.queryExist({ type: 'phone', phone: _number }).then(data => {
   if (!data) {
      throw 'Not found!';
   }

    return {
      status: 200,
      jid: data.wid
    };
  })
});

Hi @vilsonei After using above code its return data always null,Please help

See my WAPI.js, there really were changes after I posted the solution.

HI @vilsonei getting below response after using your wapi.js ,but this no on whatsapp {id: "91XXXXXXXXXX@c.us", status: 404, isBusiness: false, canReceiveMessage: false}

Post your code here so we can take a look.

Hi @vilsonei Please find code WAPIMD.js thanks for your cooperation

image

Parveen-Mothsara commented 1 year ago

WhatsApp changed the way to call the queryExist, use it this way:

const _number = '553499999999';
Store.QueryExist.queryExist({ type: 'phone', phone: _number }).then(data => {
   if (!data) {
      throw 'Not found!';
   }

    return {
      status: 200,
      jid: data.wid
    };
  })
});

Hi @vilsonei After using above code its return data always null,Please help

See my WAPI.js, there really were changes after I posted the solution.

HI @vilsonei getting below response after using your wapi.js ,but this no on whatsapp {id: "91XXXXXXXXXX@c.us", status: 404, isBusiness: false, canReceiveMessage: false}

Post your code here so we can take a look.

Hi @vilsonei Please find code WAPIMD.js thanks for your cooperation

WhatsApp changed the way to call the queryExist, use it this way:

const _number = '553499999999';
Store.QueryExist.queryExist({ type: 'phone', phone: _number }).then(data => {
   if (!data) {
      throw 'Not found!';
   }

    return {
      status: 200,
      jid: data.wid
    };
  })
});

Hi @vilsonei After using above code its return data always null,Please help

See my WAPI.js, there really were changes after I posted the solution.

HI @vilsonei getting below response after using your wapi.js ,but this no on whatsapp {id: "91XXXXXXXXXX@c.us", status: 404, isBusiness: false, canReceiveMessage: false}

Post your code here so we can take a look.

Hi @vilsonei Please find code WAPIMD.js thanks for your cooperation

image

@vilsonei Please check this WAPIMD.js Thanks for your kind support.

Parveen-Mothsara commented 1 year ago

WhatsApp changed the way to call the queryExist, use it this way:

const _number = '553499999999';
Store.QueryExist.queryExist({ type: 'phone', phone: _number }).then(data => {
   if (!data) {
      throw 'Not found!';
   }

    return {
      status: 200,
      jid: data.wid
    };
  })
});

Hi @vilsonei After using above code its return data always null,Please help

See my WAPI.js, there really were changes after I posted the solution.

HI @vilsonei getting below response after using your wapi.js ,but this no on whatsapp {id: "91XXXXXXXXXX@c.us", status: 404, isBusiness: false, canReceiveMessage: false}

Post your code here so we can take a look.

Hi @vilsonei Please find code WAPIMD.js thanks for your cooperation

WhatsApp changed the way to call the queryExist, use it this way:

const _number = '553499999999';
Store.QueryExist.queryExist({ type: 'phone', phone: _number }).then(data => {
   if (!data) {
      throw 'Not found!';
   }

    return {
      status: 200,
      jid: data.wid
    };
  })
});

Hi @vilsonei After using above code its return data always null,Please help

See my WAPI.js, there really were changes after I posted the solution.

HI @vilsonei getting below response after using your wapi.js ,but this no on whatsapp {id: "91XXXXXXXXXX@c.us", status: 404, isBusiness: false, canReceiveMessage: false}

Post your code here so we can take a look.

Hi @vilsonei Please find code WAPIMD.js thanks for your cooperation

image

@vilsonei Please check this WAPIMD.js Thanks for your kind support.

@vilsonei Please help

koresDevel commented 1 year ago

try like this: let number = '5541xxxxxxxx' WAPI.findJidFromNumber(number).then(data => { if (!data) { throw 'Not found!'; }

return {

   data 
};

}) ;

koresDevel commented 1 year ago

WhatsApp changed the way to call the queryExist, use it this way:

const _number = '553499999999';
Store.QueryExist.queryExist({ type: 'phone', phone: _number }).then(data => {
   if (!data) {
      throw 'Not found!';
   }

    return {
      status: 200,
      jid: data.wid
    };
  })
});

Hi @vilsonei After using above code its return data always null,Please help

See my WAPI.js, there really were changes after I posted the solution.

HI @vilsonei getting below response after using your wapi.js ,but this no on whatsapp {id: "91XXXXXXXXXX@c.us", status: 404, isBusiness: false, canReceiveMessage: false}

Post your code here so we can take a look.

Hi @vilsonei Please find code WAPIMD.js thanks for your cooperation

WhatsApp changed the way to call the queryExist, use it this way:

const _number = '553499999999';
Store.QueryExist.queryExist({ type: 'phone', phone: _number }).then(data => {
   if (!data) {
      throw 'Not found!';
   }

    return {
      status: 200,
      jid: data.wid
    };
  })
});

Hi @vilsonei After using above code its return data always null,Please help

See my WAPI.js, there really were changes after I posted the solution.

HI @vilsonei getting below response after using your wapi.js ,but this no on whatsapp {id: "91XXXXXXXXXX@c.us", status: 404, isBusiness: false, canReceiveMessage: false}

Post your code here so we can take a look.

Hi @vilsonei Please find code WAPIMD.js thanks for your cooperation

image

@vilsonei Please check this WAPIMD.js Thanks for your kind support.

@vilsonei Please help

I'm using:

WAPI.findJidFromNumber('554199999999')

rajeshshettysrs commented 1 year ago

See my -> WAPI.js

Dear sir,can you please share latest code,because after whatsapp update checkNumberStatus is not working,for invalid number also its returning true

rajeshshettysrs commented 1 year ago

WhatsApp changed the way to call the queryExist, use it this way:

const _number = '553499999999';
Store.QueryExist.queryExist({ type: 'phone', phone: _number }).then(data => {
   if (!data) {
      throw 'Not found!';
   }

    return {
      status: 200,
      jid: data.wid
    };
  })
});

Hi @vilsonei After using above code its return data always null,Please help

See my WAPI.js, there really were changes after I posted the solution.

HI @vilsonei getting below response after using your wapi.js ,but this no on whatsapp {id: "91XXXXXXXXXX@c.us", status: 404, isBusiness: false, canReceiveMessage: false}

Post your code here so we can take a look.

Hi @vilsonei Please find code WAPIMD.js thanks for your cooperation

WhatsApp changed the way to call the queryExist, use it this way:

const _number = '553499999999';
Store.QueryExist.queryExist({ type: 'phone', phone: _number }).then(data => {
   if (!data) {
      throw 'Not found!';
   }

    return {
      status: 200,
      jid: data.wid
    };
  })
});

Hi @vilsonei After using above code its return data always null,Please help

See my WAPI.js, there really were changes after I posted the solution.

HI @vilsonei getting below response after using your wapi.js ,but this no on whatsapp {id: "91XXXXXXXXXX@c.us", status: 404, isBusiness: false, canReceiveMessage: false}

Post your code here so we can take a look.

Hi @vilsonei Please find code WAPIMD.js thanks for your cooperation

image

@vilsonei Please check this WAPIMD.js Thanks for your kind support.

@vilsonei Please help

I'm using:

WAPI.findJidFromNumber('554199999999')

sir i am getting 404 while using checkNumberStatus and findJidFromNumber and checkNumberStatusNew is always returning true for valid and invalid whatsapp numbers

iaron commented 1 year ago

Change: Store.QueryExist.queryExist({type:"phone", phone: number}) to Store.QueryExist.queryExist('phone', number)

Note that now number must have format +9999999999@c.us

marcosdemelo commented 1 year ago

I use: { id: "WapQueryMD", conditions: (module) => module.queryExists && module.queryPhoneExists ? module : null},

And: await window.Store.WapQueryMD.queryPhoneExists('55xxxxxxxxx') Or: await window.Store.WapQueryMD.queryPhoneExists('xxxxxxxxx')

This working for me!

ionictemplate-app commented 1 year ago

@marcosdemelo

hi sir

can you share your WAPI.js to my email: [rock9987621@gmail.com]

Masterxv commented 1 year ago

I use: { id: "WapQueryMD", conditions: (module) => module.queryExists && module.queryPhoneExists ? module : null},

And: await window.Store.WapQueryMD.queryPhoneExists('55xxxxxxxxx') Or: await window.Store.WapQueryMD.queryPhoneExists('xxxxxxxxx')

This working for me!

not working now

ionictemplate-app commented 1 year ago

@Masterxv hi sir
can you share your full WAPI.js

Masterxv commented 1 year ago

@Masterxv hi sir can you share your full WAPI.js

check this WAPIMD.js

xavfo commented 1 year ago

Hi,

are you sure you are validating the phone like this?:

window.WAPI.checkNumberStatus = function (id, done) {
     id = ***@***.***';
window.Store.QueryExist.queryExist({type:'phone',phone:id}).then((result)
=> {
     if( done !== undefined) {
     if (!result) {
     done(window.WAPI._serializeNumberStatusObj({
     status: 404,
     jid   : id.slice(1)
     }));
     throw 404;
     }
     done(window.WAPI._serializeNumberStatusObj({
     status: 200,
     jid   : { server : id.split('@')[1], user :
id.split('@')[0].slice(1), _serialized : id.slice(1)  }
     }));
     }
     }).catch((e) => {
     if (done !== undefined && !result) {
     done(window.WAPI._serializeNumberStatusObj({
     status: 404,
     jid   : id
     }));
     };
     });
     return true;
     }

Xavier Freire Ortiz

+593 (9) 99597697

@.**@.>

@xavfo

LinkedIn: https://goo.gl/juM9ynhttps://goo.gl/juM9yn

Skype: @.**@.>

On 25-Nov-22 02:35, Masterxv wrote:

I use: |{ id: "WapQueryMD", conditions: (module) =>
module.queryExists && module.queryPhoneExists ? module : null},|

And: |await
window.Store.WapQueryMD.queryPhoneExists('55xxxxxxxxx')| Or:
|await window.Store.WapQueryMD.queryPhoneExists('xxxxxxxxx')|

This working for me!

not working now

— Reply to this email directly, view it on GitHub https://github.com/mukulhase/WebWhatsapp-Wrapper/issues/1162#issuecomment-1327111918, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJSSN3WOA6SE5B3OQMXRQJTWKBT5VANCNFSM525GP3KQ. You are receiving this because you are subscribed to this thread.Message ID: @.***>

ionictemplate-app commented 1 year ago

@Masterxv

it's not work!

await window.WAPI.checkNumberStatus('201152123310@c.us'); {id: undefined, status: 404, isBusiness: false, canReceiveMessage: false}

Masterxv commented 1 year ago

geting same problem again

marcosdemelo commented 1 year ago

This works for me...

  const queryExist = window.Store.QueryExist || window.Store.QueryWidExists
  const contact = await queryExist.queryPhoneExists(id)
  const chat = contact?.jid || contact?.wid

  Store.FindChat.findChat(chat)
    .then(chat => chat.sendMessage(message))
    .catch(e => console.error(`sendMessage error: ${id} (${message})`, e.message))

And

function getStore(modules) {
  ...
  { id: "QueryExist", conditions: (module) => (module.queryExist) ? module : null },
  { id: "QueryWidExists", conditions: (module) => module.queryWidExists ? module : null },
  ...
Masterxv commented 2 months ago

I use: { id: "WapQueryMD", conditions: (module) => module.queryExists && module.queryPhoneExists ? module : null},

And: await window.Store.WapQueryMD.queryPhoneExists('55xxxxxxxxx') Or: await window.Store.WapQueryMD.queryPhoneExists('xxxxxxxxx')

its not working now.. any fix