cedws / discord-delete Goto Github PK
View Code? Open in Web Editor NEWTool to delete Discord message history
License: GNU General Public License v3.0
Tool to delete Discord message history
License: GNU General Public License v3.0
I would like to be able to run some tests to ensure messages are being deleted properly in the partial deletion mode.
I think ideally a mock backend would be written in a way that properly stress tests the partial deletion code. It will need to throw curveballs like 429s, 500s, latency just like the real backend does.
I currently build releases on my own machine, which is somewhat acceptable because the binaries are reproducible. But to take some effort out of making new releases, I'd like to have CI automatically create a release when a merge to master is made.
At the moment this repository uses Sourcehut CI (which is very good), but I'm not sure if it has anything built in to create GitHub releases. I can try to find a way to do this in the manifest, or switch to use GitHub Actions.
It's evident that a portion of users of this tool aren't developers and often struggle to get it working, which I can completely understand. Having to install Python and the modules is a pain if you don't know what you're doing.
I'm considering rebuilding the tool in a compiled language, and including a GUI to make it easy to use. I'm not sure how I'll do this. My go-to language would be Rust, but it doesn't have any strong GUI libraries currently.
I am quite confused by the meaning of "partial" when running this command.
Does it only delete a subset of all your messages so it's "partial"? If it is, I can't find any documentation about it other than skipping channels but that seems unrelated. Otherwise, shouldn't it have a different name?
# github.com/keybase/go-keychain
cgo-gcc-prolog:53:11: warning: 'SecKeychainItemDelete' is deprecated: first deprecated in macOS 10.10 - SecKeychain is deprecated [-Wdeprecated-declarations]
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Security.framework/Headers/SecKeychainItem.h:257:10: note: 'SecKeychainItemDelete' has been explicitly marked deprecated here
Following on from discussions in a related project, I am investigating how bans for self-botting could be mitigated. For now, I have implemented UA and super properties spoofing to make the program look more like the official client - I'm waiting to see if this will work.
I suspect that the way Discord's heuristics works is that users with a high number of transactions are subject to special logic which scrutinises requests and checks whether they look like they are coming from the official client.
Yesterday, when I was using this tool, I got my account flagged for phone verification.
I would request you to either implement a functioning rate limiter or use a library that has rate limiting functionality.
You could also add a parameter for request delay(as described in #40)
I've read a bit on the documentation and didn't see any way of accomplishing this.
Is it possible to run this program but retain messages the last X days?
The use case would be to regularly clean up old messages in small batches, which would likely reduce your chance of bans as well.
Hi!
I love the idea of this as i share your concerns about my data.
I have been on a discord server for quite many years now and as I am leaving it I wanted to delete a lot of old personal posts. I just installed this and gave it a try but it seems to me its not actually deleting anything, at least not on the server I am on.
I have had powershell open for a few hours now and it keeps posting lines like:
INFO:root: - 518879316566867970
INFO:root: - 518879285331886082
INFO:root: - 518879261164306443
but when I search for my msgs or check history it doesnt seem like the total number of msgs posted (100k+) changes and the recent msgs I can find still seem to be there. As the script continues, it seems to do SOMETHING, is it fetching IDs to delete them at the end or should they be deleted 1 by 1?
Or is it fetching msgs from old servers I am no longer in and it hasnt even catched up and started with the main server I am currently in right now?
Does it matter if I have discord open in browser or the app while doing this, or that I answered a PM while script running? Would love some help or clarification and can provide with testing feedback. Do you have any discord you are on so I could get in touch with you via PM?
Thank you for your work!
Best regards,
Andy
When attempting to run the code in Powershell on Windows, I get a Syntax Error:
python : File "C:\Users\[user]\Downloads\discord-delete-master\discord_delete.py", line 71
At line:1 char:1
+ python C:\Users\[user]\Downloads\discord-delete-master\discord_delete. ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: ( File "C:\User...te.py", line 71:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
async def __aenter__(self):
^
SyntaxError: invalid syntax
At least to my experience, if you receive a "Forbidden" result on a channel, trying to delete any message from that channel will fail in Forbidden.
To speed up the script, the remainder of the channel should be skipped then.
Not sure on what the cause of this is.
When running full deletion;
File "./discord-delete.py", line 73
async def __aenter__(self):
^
SyntaxError: invalid syntax
I'm on macOS using Python3.
I have used this application for almost 2 years now, and up until a month ago it was without being banned. In the last month I have been banned twice. Both times were within hours of running the program. Seems discord upd their game and decided to start caring?
I am using windows, I have verified my token is correct, and I am using PowerShell to use the commands.
The error message is: /discord-delete-windows.exe : The term '/discord-delete-windows.exe' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the
path is correct and try again.
At line:1 char:1
+ CategoryInfo : ObjectNotFound: (/discord-delete-windows.exe:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Hello!
I recently developed this tool, it is for opening all your discord DMs from your discord data folder. Our projects both together can be used for much easier message deletion automation as I have mentioned here
I would like you to mention my tool to your Github repo as this will help both the project and I have personally tried this method and it worked like a charm.
Request:
Please may a feature be added to skip inputted servers and channels? For example if I wanted to skip deletion of messages in my favourite server I would add the argument -skip "https://discord.com/channels/896848632576878238"
or -skip "896848632576878238"
, 896848632576878238
being the ID of the server located in the address bar. Ideally the same argument could be used to only skip specific channels for example if I wanted to skip my PMs to my best friend I would add the argument -skip "https://discord.com/channels/@me/239683589746734632"
or -skip "@me/239683589746734632"
. If I wanted to skip a single channel in a server instead of skipping the whole server I could use the argument -skip "https://discord.com/channels/435695963835744643/746945884567556432"
or -skip "435695963835744643/746945884567556432"
. Another ideality would be the ability to add multiple servers and channels to the same argument, for example if I wanted to skip my favourite server and my PMs to my best friend I would use the command -skip "https://discord.com/channels/896848632576878238" "https://discord.com/channels/@me/239683589746734632"
or -skip "896848632576878238" "@me/239683589746734632"
.
Thanks for making this awesome tool! It saves me a lot of time and I'm a big fan of automation. If this feature request is unable to be fulfilled that is okay, if I was able to do it myself I would however I'm not a programmer.
Conclusion:
-skip "https://discord.com/channels/[server ID]"
or -skip "[server ID]"
-skip "https://discord.com/channels/[server ID]/[channel ID]"
or -skip "[server ID]/[channel ID]"
-skip "https://discord.com/channels/@me/[channel ID]"
or -skip "@me/[channel ID]"
-skip "https://discord.com/channels/[server ID]" "https://discord.com/channels/[server ID]/[channel ID]" "https://discord.com/channels/@me/[channel ID]"
or -skip "[server ID]" "[server ID]/[channel ID]" "@me/[channel ID]"
partial
WARNING:root:Server sent Forbidden
Hello. I've tried using this tool as usual over the past week however it is not deleting all messages. I cannot seem to find anything in common with the messages it doesn't delete however I have plenty left over.
This didn't happen before. I've tried using both the Windows and Linux client and I'm still experiencing the issue.
Hi,
I am receiving the error as follows:
INFO[0264] Deleting message 8xxxxx from channel 8xxxxxxxx
DEBU[0264] DELETE https://discord.com/api/v8/channels/8xxxxxxx/messages/8xxxxxxxxxx
DEBU[0264] Server returned status Bad Request
FATA[0264] Error deleting message: Bad status code Bad Request
When I manually put this channel ID into the web Discord, it shows that the channel name is of an archived thread in a server that has some threads that were auto archived. These are not deletable, even in the UI.
Since this appears to stop the process and block, I am wondering if it would be possible to detect this case and skip the messages, possibly notifying the user of this situation.
Thanks
The script currently just does a partial and then tries full deletion (if a messages
directory exists).
This is for obvious reasons pretty terrible. I would like to extend the script to have partial
and full
deletion subcommands, along with various other parameters.
I'll probably use argparse
for this.
One other thing - the script currently requires being passed a DISCORD_TOKEN
variable that will be logged to .bash_history
or some equivalent depending on OS/shell. This is not ideal, so I would like to try and find another way for the user to pass this token.
as the title says i get an error when the program runs for 15-20 mins+ (maybe its just for me) and this is the 2 time happening in an hour maybe. this is the error i got in the console:
time="2021-01-15T03:50:31+01:00" level=fatal msg="Error deleting message: Error sending request: Delete "https://discord.com/api/v6/channels/censored/messages/censored\": unexpected EOF"
obviously the program exits after i get that
Add a parameter that, if used, will skip deletion of messages that are pinned.
It looks like many messages are being left behind when running the Go version - I have run it manually several times and each time it finishes with a significant number of messages remaining in threads. I know the tool is hitting them because newer messages are deleted, but there are a lot remaining. Is this an expected behaviour? The Python version worked correctly last I tried it,
I completely forgot that the Go compiler embeds build paths into produced binaries. This means that all the builds I've uploaded so far are not reproducible.
I think most people use Docker to work around this... but I'd rather not take this approach.
The full deletion mode which uses data request packages is currently not exposed to the user. I'm waiting on a data request package from Discord so I can reimplement this function and have it automatically extract/search the package.
After this is complete, the script should be suitable for use by others.
I would like to delete my discord messages with your program, however I have zero understanding regarding which dependencies and programs I need or how to use them. If you could provide me any information on how to successfully install your program I would greatly appreciate it.
Thank you
I'm using the latest Windows executable and currently I'm unable to delete my server messages in one go.
The tools deletes on the first run, or after a restart with enough elapsed time, 25 messages from the guild and after that it reports no messages left in the guild and skips to the next. A manual search in Discord shows that this is untrue and thousands of messages still remain in this guild. I have to wait 1 or 2 minutes before restarting the deletion so that Discord has time to repopulate the search results. Without this delay it finds only few messages or none for deletion.
I also observed when I do a manual deletion while searching my messages, it takes some time to update the search results on the first search page and in the meantime it shows no messages at all. If I select the second or third search page it displays my remaining messages just fine.
So currently I'm stuck with stopping and restarting the deletion every few minutes or doing all by hand.
Edit: I already had the same problem 1 month ago, but luckily on that occasion it fixed itself in the following days. So this problem is only sporadic and somehow related to the responsiveness of the Discord search.
It would be nice to have a way to specify what channels we would like to have deleted rather than having to specify all the channels we want to skip deletion on. Basically the inverse of the skip flag.
How can I use this script to delete messages from one specific server channel only?
Please may request delay parameters be added? For example --min-delay-seconds
and --max-delay-seconds
. My thinking is that a random delay between these two values will be generated between each request to Discord and used to set a delay. If Discord is rate limiting us already and the rate limit is shorter than our delay then the new delay should be our delay minis the rate limit.
I believe making very quick requests to Discord rings some alarm bells and flags your account as suspicious forcing the user to attach a phone number to the account. I'd be really cool if I was able to set a custom yet random sleep time between each request to try and mitigate this issue.
Nice app BTW, awesome work!
Pretty much self explanatory. Would be very useful for myself.
Nice app BTW! Awesome work!
Discord have not only moved the session tokens in LevelDB to _https://discord.com\x00\x01tokens
, they are now apparently stored using Electron's safeStorage
API which encrypts at rest. Not sure yet how to decrypt them but for now auto token retrieval will be broken.
See #10 (comment).
Full deletion doesn't seem to work as expected. If the script attempts to delete messages from a server the user no longer participates in, it will receive a 403 Forbidden error. I believe this worked in the past but I'm not 100%.
I might have introduced a bug, or perhaps Discord changed their API. If they have, I can try to find another way of implementing full deletion.
Instead of merely deleting messages, they should first be overwritten N times. The data with which to overwrite the messages should be no shorter in length than that which it replaces and either randomly generated or user-configurable, repeating if necessary to meet the length requirement.
There is a very good possibility that when a request to delete a message is made, Discord simply marks that message as deleted and retains the actual message content. By overwriting the message first, we reduce the risk of the message content being retained.
Of course, this measure will fail to achieve our goal if Discord saves the complete edit history. But there is little we can do in that event.
hello, sorry this isn't really an issue i really do not know how to use this site. i made a couple changes to the script to suit my needs, choosing what servers not to delete messages on and providing my discord token in the command prompt directly instead of registering a powershell symbol or whatever, and i was wondering if that could interest you. the code added is kinda messy garbage but it does the job and should still work under linux.
thanks so much for making this and i hope you come across a solution to the full deletion 403 problem (thought i doubt it's in your hands)
Discord's API now has a bulk delete endpoint but it's not clear whether regular users can utilise this.
https://discord.com/developers/docs/resources/channel#bulk-delete-messages
I have tried to use the syntax ./discord-delete-darwin-arm64 partial -v -o 60 --skip 8xxxxxxx 6xxxxxxx 6xxxxxxxxx, but the application appears to have deleted some threads with those channel IDs.
Is there any way to have the application show what it believes the excluded channels are?
Thanks!
The error message is FATA[0002] Error fetching messages for channel: Bad status code Internal Server Error
This has happened with the older non-Go version as well, it looks like. I "fixed" it by wrapping it in a script that called it over and over again non stop, but that isn't an elegant solution.
Thanks
instead of deleting all messages, allow a user to pick a specific channel.
Hello. I'm trying to run this app on my Ubuntu Desktop machine. It is a fully up-to-date install of Ubuntu Desktop 20.04.1. When I attempt to run the app I am thrown this error message: ./discord-delete-linux: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by ./discord-delete-linux)
.
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.