Closed bobaoapae closed 3 years ago
Eric sendmessage function is not a promise anymore, i made the fix below:
//.then( function checkmessage() { function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); }
var trials = 0;
function check() {
for (let i = chat.msgs.models.length - 1; i >= 0; i--) {
let msg = chat.msgs.models[i];
if (!msg.senderObj.isMe || msg.body != message) {
continue;
}
done(WAPI._serializeMessageObj(msg));
return true;
}
trials += 1;
console.log(trials);
if (trials > 30) {
done(true);
return;
}
sleep(500).then(check);
}
check();
} //);
checkmessage();
SendMessage not found
VM209:372 Uncaught TypeError: Cannot read property 'apply' of undefined
at Object.found.sendMessage (
window.Store.sendMessage = function (e) { window.Store.SendTextMsgToChat(this, ...arguments); };
'modelClass' of undefined
Been getting cyclic object value after applying the changes proposed. anything I should be aware of?
UPDATE: Problem related to custom outdated code, seems to be fine.
sendMessage send the message but in whatsapp "your message could not be sent"
WhatsApp Web: 2.2106.5