Skip to content

Instantly share code, notes, and snippets.

@shavidzet
Created August 13, 2019 03:03
Show Gist options
  • Save shavidzet/26c1a1ed126b47bdcb9718b7221f51be to your computer and use it in GitHub Desktop.
Save shavidzet/26c1a1ed126b47bdcb9718b7221f51be to your computer and use it in GitHub Desktop.
Telegram spammer
;(async () => {
for (let i = 0; i < 999999999999; i++) {
await sleep(1000)
sendMessage(`Hi bitch ${i}`)
}
})()
function setInputMessage (message) {
document
.querySelector('.composer_rich_textarea')
.innerText = message
}
function triggerClick () {
document
.querySelector('.im_submit.im_submit_send')
.dispatchEvent(new Event('mousedown'))
}
function sendMessage (message) {
setInputMessage(message)
triggerClick()
}
function sleep (ms) {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve()
}, ms)
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment