Open chirag90851 opened 2 years ago
Same for me, any update?
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) => {});
It's not working
This issue on business WhatsApp only
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
@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
It's work . Thank you
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
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)
add line 👇
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 }) }
Store.Chat.find(e.jid).then((chat) => not working in latest version of web whatsapp