Skip to content

Instantly share code, notes, and snippets.

@dewanshDT
Last active September 7, 2022 19:28
Show Gist options
  • Save dewanshDT/eaf93ef90f2f40b3ccd1b2435f8b6dac to your computer and use it in GitHub Desktop.
Save dewanshDT/eaf93ef90f2f40b3ccd1b2435f8b6dac to your computer and use it in GitHub Desktop.
This is the WhatsApp spam bot made with JavaScript by dewanshDT.
/*
* This is a whatsapp web spam bot made with vanilla javascript.
*
* -> copy and paste this spam function defination in the console after opening the console.
* -> paste enter and then done! your bot is ready to use.
*
* <--------- To use the bot --------->
*
* just use this function as shown below ->
*
* spam(text string: "sample text", count number: 0);
*
* e.g. spam("hello world", 100);
*
* this example sends hello world message 100 times.
*
* made with <3 by @ThakurDewansh follow me on twitter.
*/
function spam(text, count) {
const textField = document.querySelectorAll("._2lMWa");
let runCount = 0;
while (runCount < count) {
if (textField) {
var evt = new InputEvent("input", {
bubbles: true,
composer: true,
});
textField[1].innerHTML = text;
textField[1].dispatchEvent(evt);
const button = document.querySelector(".tvf2evcx.oq44ahr5.lb5m6g5c.svlsagor.p2rjqpw5.epia9gcq");
if (button) {
button.click();
} else {
console.error("button does not exist");
break;
}
} else {
console.error("text field does not exist");
break;
}
runCount++;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment