Select Add reaction
button for target message
Last active
February 5, 2020 01:16
-
-
Save shavidzet/622b7755547fd52d4a47b55fdb756405 to your computer and use it in GitHub Desktop.
Slack message emoji spammer
This file contains hidden or 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
(async () => { | |
const toggleEmojiList = () => document.querySelector('#add-reaction').click() | |
const getEmojiNodes = () => document.querySelectorAll('[id^=emoji]:not(.hidden)[aria-label*=emoji]') | |
const sleep = (ms) => new Promise((resolve, reject) => setTimeout(resolve, ms)) | |
let emojiN = 0 | |
let emojiLength = null | |
if (!emojiLength) { | |
toggleEmojiList() | |
emojiLength = getEmojiNodes().length | |
console.log(emojiLength) | |
toggleEmojiList() | |
} | |
if (!emojiLength) { | |
console.error("Can't find emojiLength") | |
return | |
} | |
for (let i = emojiN; i < emojiLength; i++) { | |
toggleEmojiList() | |
await sleep(500) | |
getEmojiNodes()[i].click() | |
emojiN++ | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment