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

ncaught TypeError: this._find is not a function #1068

Open chirag90851 opened 2 years ago

chirag90851 commented 2 years ago

Store.Chat.find(e.jid).then((chat) => not working in latest version of web whatsapp

roysG commented 2 years ago

Same for me, any update?

mouhammad-zd commented 2 years ago

Try to use contact id directly ,

If you are sending message to group use find with group id directly Store.Chat.find('xxxxxxxxxxx-xxxxxxxxxx@g.us').then((chat) => {});

If you are sending message to private chat use find with chontact id directly Store.Chat.find('xxxxxxxxxxx@c.us').then((chat) => {});

chirag90851 commented 2 years ago

It's not working

chirag90851 commented 2 years ago

This issue on business WhatsApp only

dekkardnexus5 commented 2 years ago

on wapi.js file, add this:

window.Store.Chat._find = e => { const target = window.Store.Chat.get(e) return target ? Promise.resolve(target) : Promise.resolve({ id: e }) }

after these rows: let neededStore = neededObjects.find((needObj) => needObj.id === "Store"); window.Store = neededStore.foundedModule ? neededStore.foundedModule : {};

As in this solution: https://github.com/pedroslopez/whatsapp-web.js/issues/856#issuecomment-910063046

mouhammad-zd commented 2 years ago

@chirag90851

Try to add this object in your wapi.js to the neededObjects array :

{ id: 'FindChat', conditions: (module) => (module && module.findChat)?module : null}

then instead of Store.Chat.find use Store.FindChat.findChat

And let me know if it works

chirag90851 commented 2 years ago

It's work . Thank you

eduardoff19 commented 2 years ago

on wapi.js file, add this:

window.Store.Chat._find = e => { const target = window.Store.Chat.get(e) return target ? Promise.resolve(target) : Promise.resolve({ id: e }) }

after these rows: let neededStore = neededObjects.find((needObj) => needObj.id === "Store"); window.Store = neededStore.foundedModule ? neededStore.foundedModule : {};

As in this solution: pedroslopez/whatsapp-web.js#856 (comment)

tranks BRO

eduardoff19 commented 2 years ago

on wapi.js file, add this:

window.Store.Chat._find = e => { const target = window.Store.Chat.get(e) return target ? Promise.resolve(target) : Promise.resolve({ id: e }) }

after these rows: let neededStore = neededObjects.find((needObj) => needObj.id === "Store"); window.Store = neededStore.foundedModule ? neededStore.foundedModule : {};

As in this solution: pedroslopez/whatsapp-web.js#856 (comment)

image

add line 👇

image

must include this line 👆

window.Store.Chat._find = e => { const target = window.Store.Chat.get(e) return target ? Promise.resolve(target) : Promise.resolve({ id: e }) }