notice: discord explicity prohibits the use of unauthorized third-party scripts through their TOS. so, usage of this script can result in consequences such as account suspension, bans, etc. Please use at your own risk.
github / greasyfork
mass delete all discord messages from any dm or channel.
fork of undiscord
download a userscripts manager (eg. ViolentMonkey)
- download this script from GreasyFork or the JS file here
- open discord in the browser
- enable script
- open the dm or channel you want to delete
- press the new
trash iconin top right-hand corner - press all the blue
getbuttons in the popup - configure options (default: all)
- press green
startbutton - ** "prevent automatically sleeping on power adapter"
- run a few more times to delete any skipped messages (quicker than first time)
- ** re-enable allowing computer to sleep
- done! - you can disable the userscript until the next time you need it
** you only need to prevent sleep if you have a lot of messages to delete and/or will likely not be using your computer the whole time (ie. display turns off and computer sleeps) (instructions for macOS, please google for this setting for other OS)
self-explanatory. See original documentation if you need help, refer to the wiki.
find message ids by right-clicking them
adjust delay in ms to test for optimal deletion rate
Rangebefore dateafter dateAfter message idBefore message id
Search Delayrec: 1000Delete Delayrec: 800Search messagesContaining TextHas: LinkHas: FileInclude Pinned
sample options for dm - here i pressed the get buttons, selected date range and adjusted the delete delay with screenshot mode
this is what it looks like right after pressing start. total number of messages to delete (might be slightly inaccurate due to system messages)
when rate limited, might only delete 1-3 messages are between short delays. The script adjusts the delete api call delays according to response (usually 0.5 - 2 ms)

when not being ratelimited, it goes pretty fast.

bug where percent deleted exceeds or below 100% -- i think it might be off by ~1000s of messages. you can see the datetime of the latest messages deleted and estimate how many are left since the beginning / end of your messaging history until this is fixed

once all messages are found and deleted, the script will end automatically. I recommend you press start again to delete any messages it missed - not sure why this happens, but its only a small percent that get missed

only few 100s of messages were found the 2nd time, idk im paranoid so, run it few more times just in case!

after rerunning obsessively, it'll eventually get to 0. I recommend you skim through the entire chat to confirm.

I didn't test all the features so, read up on it in wiki and use at your own risk the following features:
- non-mac m1
- non-chrome browser
- deleting messages from a channel
- NSFW
- Import
- after message id
- search message
- manually entering the
getvalues
I don't plan to maintain this regularly, but I can confirm it works as of this initial upload date. I might have to update it the next time I send a regrettable message to someone (hoping not for a while). If victornpb/undiscord becomes active again, I'll likely cherry-pick commits into this fork to have my own copy.
I'll accept easy to review changes (eg. few lines of code & test screenshots) or steps on how to make it work for other browser / OS.
this is a modification of victornpb/undiscord which hasn't been updated in over a year, so i forked it to fix small bugs. I've only fixed the bugs that made the script pause or quit prematurely - i didn't add any new features.
If this ever breaks, I recommend you first check out:
Though I am a fork, I adhere to the original creator's Privacy Policy

