victornpb / undiscord Goto Github PK
View Code? Open in Web Editor NEWUndiscord - Delete all messages in a Discord server / channel or DM (Easy and fast) Bulk delete
Home Page: https://victornpb.github.io/undiscord
License: MIT License
Undiscord - Delete all messages in a Discord server / channel or DM (Easy and fast) Bulk delete
Home Page: https://victornpb.github.io/undiscord
License: MIT License
Every once in a while, there will be a few stray messages that are not deleted. (This is not a graphical issue, because after reloading they still exist.) - Running the script again seems to work for removing them.
If you run the script in a direct chat group, this script tries to delete system message which contents are "Perflyst added xxx to the group."
Error deleting message, API responded with status 403! {"message":"Cannot execute action on a system message","code":50021} Related object: {"hit":true,"attachments":[],"tts":false,"embeds":[],"timestamp":"201xxxxxx","mention_everyone":false,"id":"xx","pinned":false,"edited_timestamp":null,"author":{"username":"Perflyst","discriminator":"xx","id":"xx","avatar":"xxxx"},"mention_roles":[],"content":"","channel_id":"xx","mentions":[{"username":"User2","discriminator":"xx","id":"xx","avatar":"xx"}],"type":1}
there's no popup for confirming you want to delete the messages when it has to index a channel/dm. It just jumps straight to deleteing messages after the 2sec wait.
This channel wasn't indexed, waiting 2000ms for discord to index it...
(I've only been able to test this in dms btw)
So that we can start the the oldest message to the newer ones.
I used your deleteDiscordMessages. It's extremely, EXTREMELY useful. I've managed to purge tens of thousands of messages. Do you have a donation anywhere? I'll glad donate you $5 USD.
Hi,
so after i successfully deleted all my messages by hand, I used your .js to delete my correspondent's messages.
but I got this error:
{"message":"Cannot execute action on a DM channel","code":50003}
Also minor thing but the counter always increment:
295.92% (145/49) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
Anyway thank you for sharing this
I was deleting and this happened
"Error searching messages, API responded with status 404!
{"message":"404: Not Found","code":0}"
WARNING: Github Issues are publicly visible, do not post sensitive information here.
You may want to check "Hide sensitive information" before taking screenshots or copying logs.
Describe the bug
When being rate limited, the script will increase delete delay, but, way too much.
To Reproduce
Steps to reproduce the behavior:
Screenshots / Logs
Total messages found: 182 (Messages in current page: 25, Author: 25, System: 0) offset: 0
Delete delay: 100ms, Search delay: 100ms Last Ping: 592ms, Average Ping: 592ms
Estimated time remaining: 0h 2m 6s
Waiting for your confirmation...
OK
0.55% (1/182) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
1.10% (2/182) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
1.65% (3/182) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
2.20% (4/182) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED REDACTED
2.75% (5/182) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
3.30% (6/182) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
3.85% (7/182) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
4.40% (8/182) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
4.95% (9/182) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
5.49% (10/182) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
6.04% (11/182) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
6.59% (12/182) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
7.14% (13/182) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
7.69% (14/182) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED REDACTED
8.24% (15/182) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
8.79% (16/182) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
9.34% (17/182) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
9.89% (18/182) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
10.44% (19/182) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
10.99% (20/182) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
11.54% (21/182) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
12.09% (22/182) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
12.64% (23/182) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
13.19% (24/182) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED REDACTED
13.74% (25/182) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
Searching next messages in 100ms...
Total messages found: 158 (Messages in current page: 24, Author: 24, System: 0) offset: 0
Delete delay: 100ms, Search delay: 100ms Last Ping: 440ms, Average Ping: 242ms
Estimated time remaining: 0h 0m 54s
14.29% (26/182) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
14.84% (27/182) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
15.38% (28/182) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
15.93% (29/182) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
16.48% (30/182) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
Being rate limited by the API for 63138ms! Adjusted delete delay to 63238ms.
Delete delay: 63238ms, Search delay: 100ms Last Ping: 160ms, Average Ping: 244ms
Cooling down for 126276ms before retrying...
21.98% (40/182) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
Searching next messages in 100ms...
Total messages found: 143 (Messages in current page: 25, Author: 25, System: 0) offset: 0
Delete delay: 109525ms, Search delay: 100ms Last Ping: 429ms, Average Ping: 220ms
Estimated time remaining: 4h 21m 34s
Affects (Add an X to items that apply)
System:
Describe the bug
Delete request throwed an error: {"fileName":"","lineNumber":0,"columnNumber":0,"message":"NetworkError when attempting to fetch resource."}
To Reproduce
Steps to reproduce the behavior:
Screenshots / Logs
If applicable, add screenshots and or copy log to help explain your problem.
Delete request throwed an error: {"fileName":"","lineNumber":0,"columnNumber":0,"message":"NetworkError when attempting to fetch resource."}
Affects
System:
EDIT: NEVER MIND! Just replace all discordapp.com urls with discord.com! FIXED!
WARNING: Github Issues are publicly visible, do not post sensitive information here.
You may want to check "Hide sensitive information" before taking screenshots or copying logs.
Error searching messages, API responded with status 404!
{"message":"404: Not Found","code":0}
whenever i put in the required info and try to delete DMs i get this message :(
The deleter deleter doesnt work, it finds the 2000 odd messages in the dm's but instead of deleting gives the reason "Ended because API returned an empty page." for not deleting any messages.
Using the latest version from the repo I get this error when attempting to delete:
Started at 03/12/2019, 11:54:16
authorId="my id" guildId="guild id" channelId="channel id" afterMessageId="" beforeMessageId="" hasLink=false hasFile=false
Error searching messages, API responded with status 403!
{"message":"Missing Access","code":50001}
Using Chrome for this.
I keep getting 404 error, although discord does not report any of its API being down, or having issues finding the messages using search
It works very well, thanks a lot for providing us this piece of software! Really useful !
[deleted]
Only delete messages with certain prefix or suffix, useful for delete bot commands without affecting normal dialogue.
VM231:6 Uncaught TypeError: popup.document.write is not a function
at :6:20
at :304:3us>:304:3
On some accounts, it deletes only some of the messages. On other accounts, it deletes all of it. Why is this happening?
When attempting to use the code, the following occurs:
Started at 12/7/2019, 11:53:50 PM
authorId="##################" guildId="@me" channelId="##################" afterMessageId="" beforeMessageId="" hasLink=false hasFile=false
Error searching messages, API responded with status 404!
{"message":"404: Not Found","code":0}
Total messages found: 4841 (Messages in current page: 25, Author: 25, System: 0) offset: 0
Delete delay: 100ms, Search delay: 100ms Last Ping: 1100ms, Average Ping: 1100ms
Estimated time remaining: 1h 37m 8s
Waiting for your confirmation...
OK
0.02% (1/4841) Deleting ID:{id} {username} (1/17/2020, 1:11:20 PM\): {message}
Error deleting message, API responded with status 404! {"message":"404: Not Found","code":0}
Related object: {"id":"{id}","type":0,"content":"lol where did you get it?","channel_id":"358933713549262857","author":{"id":"516704923996651540","username":".Ras","avatar":"e2aa0383ad1293e516a85cabd08a0a89","discriminator":"5894"},"attachments":[],"embeds":[],"mentions":[],"mention_roles":[],"pinned":false,"mention_everyone":false,"tts":false,"timestamp":"2020-01-17T13:11:20.815000+00:00","edited_timestamp":null,"flags":0,"hit":true}
0.04% (2/4841) Deleting ID:{id} {username} (1/17/2020, 1:05:59 PM\): {message}
Error deleting message, API responded with status 404! {"message":"404: Not Found","code":0}
...
Just an idea: Making a handy bookmarklet for it?
Tried to minify the code and paste it like javascript:(function(){...
as bookmarklet.
PopUp opens fine. This line however makes the whole page go blank/white with the text "Looking good!". Removing the line seems to work. getting the AuthToken, AuthorID and ChannelID appears to work as well, but deleting does't. I guess the bookmarklet doesn't have access to the same context in which devtools is running, but haven't had time to debug in depth
an option that wipes all messages, leaves/deletes all servers and unfriends all friends however a filter would be nice so you can keep certain servers or friends
I did use multiple revisions of this script in past and everything worked great however after trying to remove all my messages in one of the DM conversation I get an error:
Do you want to delete ~1 messages?
Estimated time: 0h 0m 0s---- Preview ----
Myusername#1234:
I get this error in both Firefox and Chrome. They are both latest version. The script log after error:
Started at 2/3/2020, 9:05:43 PM
authorId="123456" guildId="@me" channelId="123456" afterMessageId="" beforeMessageId="" hasLink=false hasFile=false
Total messages found: 1 (Messages in current page: 1, Author: 0, System: 1) offset: 0
Delete delay: 100ms, Search delay: 100ms Last Ping: 327ms, Average Ping: 327ms
Estimated time remaining: 0h 0m 0s
Waiting for your confirmation...
Aborted by you!
Ended at 2/3/2020, 9:06:38 PM! Total time: 0h 0m 54s
Delete delay: 100ms, Search delay: 100ms Last Ping: 327ms, Average Ping: 327ms
Rate Limited: 0 times. Total time throttled: 0h 0m 0s.
Deleted 0 messages, 0 failed.
Hello,
First of all - thank you for creating this!
I had a couple suggestions. Don't know if they are possible, but if they are I think they would be useful.
Option to delete just attachments/files/images.
Option to delete just links.
Reason: Users have tens (and sometimes hundreds) of thousands of messages in separate servers & conversations, which takes a lot of time to delete (on top of the occasional errors occur and if user isn't present to restart the process it takes even longer).
Images, files, links (which could be images shared on other websites and posted on discord via link instead of directly, links to social media or accounts on various websites, e-mail addresses) often contain most sensitive personal information. Therefore it would be useful to delete these first instead of going through all of the messages.
When deleting messages it always jumps to top (first messages deleted) and you have to manually scroll down (and hold it) to see the progress/current messages being deleted. Would be convenient if either it didn't jump to top or current messages would be added on top instead of bottom.
it allows me to paste the script but when I click enter here is no popup, just motif that Microsoft needs an app to read it, hen says Microsoft does not have apps to recommend. So I cant proceed. recomendations?
Okay FINE, not an issue. I just wanted to say thanks. Had to nuke a #channel and this was the first script that I was able to understand (good for learning so thanks :) ) while reading through, and the UI was ππππππππππ perfect.
So, uh, yeah. Thanks! ^_^
self-resolved.
After hitting Start I get this error in console
VM81:171 Uncaught (in promise) TypeError: Cannot read property 'type' of undefined
at :171:65
at Array.filter ()
at recurse (:171:47)
at async deleteMessages (:249:16)
Assuming I do have the channels' IDs, is this possible?
So when I hit the rate limit when deleting around 31 messages, the script doubles the delete delay timer to cool down. That's fine. But when we chilled a bit, and the time is up, the deleting process became very very slow.
My current approach is that delete 31 messages, stop it. Then wait 30 seconds or more, and restart the deletion. This way is much more a hassle, but more quicker compare to those slow snail-like deletion after chilled down from the rate limit.
Is there any chance to fix this issue?
What about importing the Discord Data package's information such as Channel ID's? This can be used for automatic deleting most chats
It would be handy to include the javascript as a bookmarklet to simplify running the script in maintenance-heavy situations.
Describe the bug
When running deleter on a channel, it deletes most of the messages, I then ran through all messages on each channel of the group, but if I do a from:username, stuff that I pinned (the actual pin message, not the content I pinned) shows up, and also a few random messages still never got deleted (just messages, emotes, etc.) which should've. Not sure why. It seems to be detecting all my messages, I ran it in one chat, and ran through like 8k+ messages no errors. I ran it over again and it said nothing to delete, but it seems like there is.
System:
When attempting to delete, using the code, I get the following response
Error searching messages, API responded with status 404!
{"message":"404: Not Found","code":0}
Not sure what the issue is, followed the readme
Hi! First of all, thanks for all your effort of coding this thing!
For some reason though, every time I try to delete the messages in DM it stops after 26 messages:
0.12% (26/22548) Deleting ID:641395138689630220 User#9999 (5-11-2019 22:55:17): Wat?
Searching next messages in 100ms...
Total messages found: 22548 (Messages in current page: 0, Author: 0, System: 0) offset: 0
Delete delay: 365ms, Search delay: 100ms Last Ping: 253ms, Average Ping: 198ms
Estimated time remaining: 3h 33m 18s
Ended because API returned an empty page.
Ended at 20-11-2019 13:58:47! Total time: 0h 0m 18s
Delete delay: 365ms, Search delay: 100ms Last Ping: 253ms, Average Ping: 198ms
Rate Limited: 1 times. Total time throttled: 0h 0m 0s.
Deleted 26 messages, 0 failed.
Am I doing something wrong here? Using Chrome.
Is your feature request related to a problem? Please describe.
If someone wants to remove / clean his discord history and account he probably also wants to get rid of his reactions
Describe the solution you'd like
The script should also remove reactions on other peoples messages
Also, add a way to skip the current one (in case of infinite loop glitch) and to restart current or go back one (because sometimes it skips messages)
Hey, you did an amazing job and as a moderator I appreciate the ability to nuke certain users but I'd like to have a smalll request.
Is is possible to delete a message that contains a mention of a certain user? Typing "@Nickname" in the filter doesn't work.
Hey,
Whenever I run the script on a channel it returns with this: {"message":"Missing Access","code":50001}
It works fine on dms
Hello,
so I tried pretty much everything but I still come up with :
Started at 16/12/2019, 06:48:17
authorId="--" guildId="@me" channelId="--" afterMessageId="" beforeMessageId="--" hasLink=false hasFile=false
Error searching messages, API responded with status 401!
{"message":"401: Unauthorized","code":0}
I also had your old version of the code, but I switched it too to be sure, any idea where it comes from ?
Search from discord works again as well
Thank you
I am trying to delete messages about 20 months ago(2018.02). When I press 'Start' button, result says there are 770 messages but deletes 0 message. I scrolled to that message and tried again. Same thing happened.
In this case, I didn't set 'Range' option. But When I set 'Range' option starting from very first message I've sent to last message I've sent, It stops to delete message at 26th deletion, so #23 might be related to.
Started at 2019. 11. 22. μ€μ 12:44:29
authorId="REDACTED" channelId="REDACTED" afterMessageId="REDACTED" beforeMessageId="REDACTED" hasLink=false hasFile=false
Total messages found: 704 (Messages in current page: 25, Author: 25, System: 0) offset: 0
Delete delay: 100ms, Search delay: 100ms Last Ping: 681ms, Average Ping: 681ms
Estimated time remaining: 0h 9m 12s
Waiting for your confirmation...
OK
0.14% (1/704) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
0.28% (2/704) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
0.43% (3/704) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
0.57% (4/704) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
0.71% (5/704) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
0.85% (6/704) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
0.99% (7/704) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
1.14% (8/704) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
1.28% (9/704) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
1.42% (10/704) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
1.56% (11/704) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
1.70% (12/704) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
1.85% (13/704) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
1.99% (14/704) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
2.13% (15/704) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
2.27% (16/704) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
2.41% (17/704) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
2.56% (18/704) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
2.70% (19/704) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
2.84% (20/704) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
2.98% (21/704) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
3.13% (22/704) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
3.27% (23/704) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
3.41% (24/704) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
3.55% (25/704) Deleting ID:REDACTED REDACTED (REDACTED): REDACTED
Searching next messages in 100ms...
Total messages found: 704 (Messages in current page: 0, Author: 0, System: 0) offset: 0
Delete delay: 100ms, Search delay: 100ms Last Ping: 301ms, Average Ping: 277ms
Estimated time remaining: 0h 4m 28s
Ended because API returned an empty page.
Ended at 2019. 11. 22. μ€μ 12:44:40! Total time: 0h 0m 10s
Delete delay: 100ms, Search delay: 100ms Last Ping: 301ms, Average Ping: 277ms
Rate Limited: 0 times. Total time throttled: 0h 0m 0s.
Deleted 25 messages, 0 failed.
I tried to find a way to do so but cant.
Possible to add a nuclear option? Delete from everywhere: all servers, all channels, all dms.
Possibly with an exclude list in case you want to leave one server/chat/dm untouched for example.
Hello. I would like to thank author for this script, it's very useful and works well. I just have one problem.
My messages in a certain DM have over 100k messages so of course it will take very long to delete them all, so it is not ideal for me when I just really want to delete hundreds messages containing a certain word. E.g. I want it to look for my all messages in a DM that contain "foo" and delete them all. Is this possible at all? I understand what I am requesting for might be a lot of work or even impossible so I understand if it isn't doable. :) Thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.