Created
January 25, 2022 23:30
-
-
Save loganlinn/6ee0cdf3fab5ca89df61a25fa9366f31 to your computer and use it in GitHub Desktop.
Bulk delete custom Slack emojis with filter
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
intervalId = setInterval(function() { | |
els = Array.from( | |
document.getElementsByClassName("c-virtual_list__item") | |
).filter( | |
(el) => el.innerText.includes(":azure_") | |
) | |
console.log("Matches found:", els.length) | |
if (!els.length) { | |
clearInterval(intervalId) | |
console.log("All done") | |
return | |
} | |
let el = els[0]; // delete one at a time | |
console.log("Deleting", el.querySelector(".c-table_view_row_item_value").innerText) | |
let deleteButton = el.querySelector("button [emoji-type=enabled]") | |
deleteButton.click() | |
setTimeout( | |
() => document.getElementsByClassName("c-button--danger")[0].click(), 300); | |
}, 2000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment