Created
September 20, 2021 14:49
-
-
Save EmersonGarrido/c1749cd1ed27fb889ea87392669db985 to your computer and use it in GitHub Desktop.
Send Message Whatsapp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function sendMessage() { | |
const button = document.querySelector("#startNonContactChat > div"); | |
button.click(); | |
const number = "67993109148"; | |
const input = document.querySelector("div.alerty-content > div > input[type=text]"); | |
input.value = input.value + number; | |
document.querySelector("div.alerty-action > a.btn-ok").click(); | |
const message = "Mensagem"; | |
var t = document.querySelector("#main > footer > div._2BU3P.tm2tP.copyable-area > div > div > div._2lMWa > div.p3_M1 > div > div._13NKt.copyable-text.selectable-text"); | |
var y = document.createTextNode(message); | |
t.appendChild(y); | |
var mouseEvent = document.createEvent('MouseEvents'); | |
mouseEvent.initEvent('teste', true, true); | |
t.dispatchEvent(mouseEvent); | |
} | |
sendMessage(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment