discord-delete icon indicating copy to clipboard operation
discord-delete copied to clipboard

Implement interactive deletion

Open RayKoopa opened this issue 4 years ago • 6 comments

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.

RayKoopa avatar Jul 14 '19 10:07 RayKoopa

Is this occurring with the full deletion method?

cedws avatar Sep 21 '19 20:09 cedws

Yes, it's the only deletion method I use.

EDIT: Very, very rarely, there may be only one or two forbidden replies for weird messages. Maybe the channel should be skipped at 10 forbidden replies.

RayKoopa avatar Sep 21 '19 20:09 RayKoopa

I see. "Full" deletion will probably be deprecated soon as it doesn't work as intended. Discord's API won't allow messages to be deleted from a channel if you're not a member anymore. That's why it's sending Forbidden. Hence, there's not really a difference between partial and full deletion except that downloading a data archive might allow you hackily select what channels to delete messages from. I would recommend proceeding by using the partial deletion mode, and ensuring that all messages are deleted from a channel before you leave.

cedws avatar Sep 21 '19 21:09 cedws

I see, that's what I thought too, seeing several many year old messages of long-left servers.

I'm extensively using the blacklist though (in fact, modified the code to have a commented list in Python of channel IDs I want to skip). I'd need that for "partial" deletion mode too, so I stick to my "extended" black list code for now.

If one was allowed to dream a bit here, the blacklisting would be interactive, retrieving all channels deletable first, displaying them with their name and then allowing you to select them before actually starting deletion.

RayKoopa avatar Sep 21 '19 21:09 RayKoopa

I like the idea of a prompt that asks what should be deleted. I'd probably add a -y flag though to auto-answer "yes" to any prompts, kind of like how fsck does it.

Although, it might become irritating if you need to repeatedly run a deletion selectively. Any further thoughts?

cedws avatar Sep 21 '19 21:09 cedws

About the channel selection, it would be "best" (but a lot more work to add) to have a real list to move through with your cursor (or UI), to set it all up, and then just kick off the deletion and lean back - continually having to check back whether the next channel is about to be deleted to acknowledge it may be a bit tiresome.

Maybe found channels can be written to a file channels.ini/json/whatevs, and configured in there, so you can reuse this "configuration" file for later runs. That would also remove the need for a UI-like list as mentioned in my first paragraph.

RayKoopa avatar Sep 21 '19 21:09 RayKoopa