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

SendMessage don't Work. File: WAPI.js on new number #1070

Open mraakashjoshi opened 2 years ago

mraakashjoshi commented 2 years ago

When we are trying to send message on new number of which chat does not exist. then message is not sending. but when we are sending message for which chat already exist then message sending is working.

maticzd commented 2 years ago

Same issue here

andlb commented 2 years ago

This solution fixed the issue for me:

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

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

By @mouhammad-zd

santirlopez1124 commented 2 years ago

@andlb Thanks! It works for me

maticzd commented 2 years ago

Yes, thanks!

This https://github.com/mukulhase/WebWhatsapp-Wrapper/issues/1068#issuecomment-910232992 works too.

pablodosreis commented 2 years ago

Tks. It works for me too.

bhatpatil commented 2 years ago

It is not working for me, can someone share whole WAPI.Js here please.

Thanks in advance.

mraakashjoshi commented 2 years ago

Not working for Business whatsapp account..

tetradox commented 2 years ago

thanks.

duzaq commented 2 years ago

// use this code window.WAPI.sendMessageToID2 = function (id, message, done) { try { // Create user var idx = new window.Store.UserConstructor(id, {intentionallyUsePrivateConstructor: true}); // Get chat var chat = window.Store.Chat.find(idx); // Send message chat._value.sendMessage(message); } catch (e) { return false;

}
if (done !== undefined) done(false);
return false;

}; //window.WAPI.sendMessageToID2 ('0000000000@c.us','oi');