mikelustosa / Projeto-TInject

Projeto TInject
250 stars 131 forks source link

WAPI.sendMessageToID not working #81

Closed ono77 closed 4 months ago

ono77 commented 4 months ago

WAPI.sendMessageToID('number@c.us','test')

gives this error:

VM60:1804 Uncaught TypeError: Cannot read properties of undefined (reading 'findChat') at window.WAPI.sendMessageToID (:1804:34) at :1:6

sergey-chechaev commented 4 months ago

So you need to change findChat to findOrCreateLatestChat

Fix, change

conditions: (module) => (module && module.findChat) ? module : null

to

conditions: (module) => (module && module.findOrCreateLatestChat) ? module : null

And then use chat = Store.FindChat.findOrCreateLatestChat(idUser)

danielsantb commented 4 months ago

Same here, this fix dont work!

mikelustosa commented 4 months ago

Fix js.abr v.3.0.2.0