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 797 forks source link

the api dont send message to id #1033

Open maticzd opened 3 years ago

maticzd commented 3 years ago

this is new issue the function send_message_to_id is not working but the function send_media is still working

3dluis commented 3 years ago

What is the problem? Can you send a screen of the error?

demontrasea commented 3 years ago

this is new issue the function send_message_to_id is not working but the function send_media is still working

maybe this is not best solution, but work for me in file init.py under function send_message_to_id i change to this from def send_message_to_id(self, recipient, message): return self.wapi_functions.sendMessageToId(recipient, message)

to

def send_message_to_id(self, recipient, message): return self.wapi_functions.sendMessage(recipient, message)

mouhammad-zd commented 3 years ago

@demontrasea

Try this solution it worked for me

https://github.com/open-wa/wa-automate-nodejs/issues/1748#issuecomment-853545581

ghost commented 3 years ago

i have the same error. send message to ID dont work. someone can help me? Sem título

ojixzzz commented 3 years ago

i have the same error. send message to ID dont work. someone can help me? Sem título

https://github.com/open-wa/wa-automate-nodejs/issues/1748#issuecomment-853545581

edit your wapi.js

duzaq commented 2 years ago

/// replace in your code

window.WAPI.sendMessageToID = 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; }; //Teste window.WAPI.sendMessageToID2 ('00000000000@c.us','test');