Open vilsonei opened 2 years ago
Solution:
// Create user
var idx = new window.Store.UserConstructor('xxxxx@c.us', {intentionallyUsePrivateConstructor: true});
// Get chat
var chat = window.Store.Chat.find(idx);
// Send message
chat._value.sendMessage('Text');
use FindChat
{ id: 'FindChat', conditions: (module) => (module && module.findChat) ? module : null },
Solution:
// Create user var idx = new window.Store.UserConstructor('xxxxx@c.us', {intentionallyUsePrivateConstructor: true}); // Get chat var chat = window.Store.Chat.find(idx); // Send message chat._value.sendMessage('Text');
HI Vilsonei,
Where should I insert those lines into the code?
// 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');
In the new version of WhatsApp Beta when I try to send a message to a new number that is not in the phonebook the method window.Store.Chat.get('xxxx@c.us') always returns undefined.
Has anyone managed to solve it?