mikelustosa / Projeto-TInject

Projeto TInject
246 stars 132 forks source link

WAPI.sendMessageToID not working #81

Closed ono77 closed 1 month ago

ono77 commented 1 month 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 1 month 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 1 month ago

Same here, this fix dont work!

mikelustosa commented 1 month ago

Fix js.abr v.3.0.2.0