Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save pvsousalima/c820a20175671d82244faf97d8203f1a to your computer and use it in GitHub Desktop.
Save pvsousalima/c820a20175671d82244faf97d8203f1a to your computer and use it in GitHub Desktop.
Como fazer alguém te responder no whatsapp
var counter = 0;
var mensagens = document.getElementsByClassName("message-in");
var quantidadeMsg = mensagens.length
var i = setInterval(function(){
window.InputEvent = window.Event || window.InputEvent;
var d = new Date();
var event = new InputEvent('input', {bubbles: true});
var textbox = document.querySelector('#main > footer > div.block-compose > div.input-container > div.pluggable-input.pluggable-input-compose > div.pluggable-input-body.copyable-text.selectable-text');
textbox.textContent = "Me responde!";
textbox.dispatchEvent(event);
document.querySelector("button.compose-btn-send").click();
counter++;
console.log("Já enviei " + counter + ' mensagens.')
if(quantidadeMsg != mensagens.length)
clearInterval(i);
}, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment