Skip to content

Instantly share code, notes, and snippets.

@loganlinn
Created January 25, 2022 23:30
Show Gist options
  • Save loganlinn/6ee0cdf3fab5ca89df61a25fa9366f31 to your computer and use it in GitHub Desktop.
Save loganlinn/6ee0cdf3fab5ca89df61a25fa9366f31 to your computer and use it in GitHub Desktop.
Bulk delete custom Slack emojis with filter
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