cedws / discord-delete

Tool to delete Discord message history
GNU General Public License v3.0
125 stars 18 forks source link

Allow skipping message deletion for specific channels #27

Closed git-bruh closed 3 years ago

git-bruh commented 3 years ago

Allows skipping channels/guilds/DMs with the -s flag discord-delete partial -s "777867765434664961 735863939876343539"

Closes #26

cedws commented 3 years ago

Many thanks, I appreciate this. Just a few things to address, I've left some review comments.

cedws commented 3 years ago

Nice work! There's a few things I want to try before making a release for this but I don't want to take up any more of your time. Thanks again.

git-bruh commented 3 years ago

No problem! 👍

cedws commented 3 years ago

Just found a problem with the way we did filtering in guilds:

FATA[0024] Error fetching messages for guild: Status code Request URI Too Long is unhandled

Discord's backend doesn't like it when the URI is too long. This is reproducible if you join a guild with a lot of channels and use -s.

Will have to try and think of a solution for this, hopefully a way that doesn't involve iterating over channels.

git-bruh commented 3 years ago

Hmm, a super ugly solution i can think of to check how many channels have been passed, get messages multiple times depending on the limit, and merge all the responses?

Also, how many channels does it take to error out? If the number is high, maybe we can calculate how many channels have been passed and just error out early with a message telling the user to skip the full guild instead?

Another option i can think of is allowing to pass something like --delete so that in such cases, only the specified channel will be in the &include and rest will not be deleted from that guild.

All of these are pretty meh but can't think of anything else 😕