Coder Social home page Coder Social logo

Comments (17)

cedws avatar cedws commented on June 25, 2024

Is this an expected behaviour?

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 -v if you aren't doing so already)

from discord-delete.

larryqiann avatar larryqiann commented on June 25, 2024

INFO[0048] Deleting message 647243810 from channel 647149098
DEBU[0048] DELETE https://discordapp.com/api/v6/channels/647**9098/messages/647**143810
DEBU[0048] Server returned status No Content
DEBU[0048] Skipping context message
DEBU[0048] Skipping context message
INFO[0048] Deleting message 6474855 from channel 647149098
DEBU[0048] DELETE https://discordapp.com/api/v6/channels/6471***98/messages/6472***855
DEBU[0048] Server returned status No Content
DEBU[0048] Skipping context message
DEBU[0048] Skipping context message
INFO[0048] Deleting message 64703 from channel 64719098
DEBU[0048] DELETE https://discordapp.com/api/v6/channels/64718***9098/messages/6472***4803
DEBU[0048] Server returned status Too Many Requests
INFO[0048] Server asked us to sleep for 518 milliseconds
DEBU[0049] DELETE https://discordapp.com/api/v6/channels/6471***9098/messages/647***803
DEBU[0049] Server returned status No Content
DEBU[0049] Skipping context message
DEBU[0049] Skipping context message
INFO[0049] Deleting message 647888 from channel 64775
DEBU[0049] DELETE https://discordapp.com/api/v6/channels/647***875/messages/647***888
DEBU[0049] Server returned status No Content
DEBU[0049] GET https://discordapp.com/api/v6/guilds/643***24/messages/search?author_id=247***0945&include_nsfw=true&offset=0&limit=25
DEBU[0049] Server returned status OK
INFO[0049] No more messages to delete for guild '*********'
larryqian@Larrys-MacBook-Pro Downloads %

This is what it looks like when it ends. No other errors are raised.
I do get "No more messages to delete for $server" messages though.

from discord-delete.

cedws avatar cedws commented on June 25, 2024

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.

from discord-delete.

larryqiann avatar larryqiann commented on June 25, 2024

The failures are fairly well distributed, and are equally present in servers lacking a voice channel/calls altogether.

from discord-delete.

cedws avatar cedws commented on June 25, 2024

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.

from discord-delete.

larryqiann avatar larryqiann commented on June 25, 2024

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.

from discord-delete.

cedws avatar cedws commented on June 25, 2024

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.

from discord-delete.

larryqiann avatar larryqiann commented on June 25, 2024

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.

from discord-delete.

blawar avatar blawar commented on June 25, 2024

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

from discord-delete.

cedws avatar cedws commented on June 25, 2024

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.

from discord-delete.

zyrodos avatar zyrodos commented on June 25, 2024

hey @cedws i'm getting an error saying level=fatal msg="Error fetching messages for channel: Status code Not Found is unhandled" now, any idea how to get around this?

from discord-delete.

cedws avatar cedws commented on June 25, 2024

@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.

from discord-delete.

cedws avatar cedws commented on June 25, 2024

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 Uh... can you try searching again??

from discord-delete.

zyrodos avatar zyrodos commented on June 25, 2024

I am getting the same message when I try to search, yes. Interesting. @cedws

from discord-delete.

zyrodos avatar zyrodos commented on June 25, 2024

I just ran it a few times, and it only removed things from certain channels. It did not remove any DMs.

from discord-delete.

cedws avatar cedws commented on June 25, 2024

Yeah apparently this is a known ongoing issue. It may be a week or so before the results are fixed.

from discord-delete.

cedws avatar cedws commented on June 25, 2024

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.

from discord-delete.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.