Last active
April 7, 2025 05:32
-
-
Save ScottMaclure/80adda47040b039965248289c37cfe8b to your computer and use it in GitHub Desktop.
Slack Draft Deleter
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
// Remove all drafts from your drafts view | |
// Navigate to drafts | |
// F12 to raise dev console | |
// Paste the below | |
(async function(x) { | |
for (let e = document.querySelector('[type="trash"]'); e != null; e = document.querySelector('[type="trash"]')) { | |
e.click(); | |
await new Promise(resolve => setTimeout(resolve, 500)) | |
document.querySelector('[data-qa="drafts_page_draft_delete_confirm"]').click(); | |
await new Promise(resolve => setTimeout(resolve, 1500)) | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Don't know if just me (I'm awful at JS) but I was getting a
Uncaught SyntaxError: Unexpected identifier 'document'
when I tried to run it. Since I stink at JS (see previous), I asked GPT and it said the semicolons were missing from both setTimeouts.Again, could be I had something set wrong in my Chrome console (on Mac Chrome), but like an obedient servant to my robot overlords, I put the semicolors in, tried again and, boom! worked.
Here's what I ran, only delta is the two semi-colons:
If I'm stating something obvious to everyone, my apologies. Intentions were pure. JS knowledge, not so much.
Thank you to everyone who contributed. I'd built up 110 drafts in Slack and it was going to drive me crazy clearing 'em out.