-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discord API changes have partially broken message deletion #21
Comments
It isn't, it should delete everything it can find on the first run. However, I have some ideas why this might be happening. Are you using the latest release? And do you see any errors in the output? (pass |
INFO[0048] Deleting message 647243810 from channel 647149098 This is what it looks like when it ends. No other errors are raised. |
Everything in the log seems normal. There's probably a bug with the message querying algorithm. Question: in the groups that it fails to clear all messages from, are there a lot of calls? Discord actually considers these messages but they have a different numeric type, so the code has to increment an offset when it finds these. |
The failures are fairly well distributed, and are equally present in servers lacking a voice channel/calls altogether. |
I'm able to reproduce this issue... it's not looking good. I think Discord have broken the way the program finds messages. Some queries are returning zero results. Still looking for a solution. |
Interestingly enough recently the only other Discord deletion app on GitHub also died in a similar way, with errors related to "Got an empty page from the server". I noticed that on the webUI doing a search in a server for messages you sent sometimes didn't return results either. Clicking "next page" several times always returned results, and seems to just increment the offset by 25 each time. It looks like the search endpoint they are using is /guilds/55...76/messages/66...78/?author....but the official deletion api uses /channels. |
Yep, their API is completely broken. It's returning empty pages and 500s all the time now. I hope this won't be a problem forever, because it makes this tool unusable. There's no way around it other than brute-force searching, which is only really practical for DMs. I've just committed c61c770 which might help a bit, but really, the issue is on Discord's side. Not much that I can do. I will leave this issue open and hopefully we'll see them resolve this within the next few weeks. Thanks for the report as always. |
It looks like this new commit has resolved the problem and it was able to clear out everything it missed. Thanks! With that said the way search works is definitely broken on their end. It still says that there are messages remaining and 20 pages, even though none of them are populated in the official app. Maybe it takes them a while to update that index. |
I fixed this issue and posted a working script to highlight the fix. The issue is that discord api is returning a positive number of results, but then the messages array is empty. This happens when you delete messages, however discord isnt updating its internal database properly and causes empty messages to be returned that must be skipped. The solution is to first iterate to get all of the posts, and store them in your own array, then go back and run delete on those message's. https://github.com/blawar/discordnuke/blob/master/discordnuke.js |
Thanks, but the solution seems a bit over the top. All you need to do is increment the offset when you find an empty page. This was done in c61c770. |
hey @cedws i'm getting an error saying |
@zyrodos Happens for me too. It looks like another API update has broken the tool. I'll get back to you when there's a fix. |
What on earth... search doesn't work in the client either. I think their API is outright broken. Try doing a message search in Discord. Do you see |
I am getting the same message when I try to search, yes. Interesting. @cedws |
I just ran it a few times, and it only removed things from certain channels. It did not remove any DMs. |
Yeah apparently this is a known ongoing issue. It may be a week or so before the results are fixed. |
Just pushed release 1.1.5. Discord's backend appears to be fixed, and the API behaviour has reverted to how it was before 1.1.4. Please upgrade to this release and let me know if you have any problems. |
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,
The text was updated successfully, but these errors were encountered: