Skip to content
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

Implement interactive deletion #18

Open
RayKoopa opened this issue Jul 14, 2019 · 6 comments
Open

Implement interactive deletion #18

RayKoopa opened this issue Jul 14, 2019 · 6 comments
Labels
enhancement New feature or request

Comments

@RayKoopa
Copy link

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.

@cedws cedws added the awaiting-reply Awaiting reply from the issue author. label Sep 21, 2019
@cedws
Copy link
Owner

cedws commented Sep 21, 2019

Is this occurring with the full deletion method?

@RayKoopa
Copy link
Author

RayKoopa commented Sep 21, 2019

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.

@cedws
Copy link
Owner

cedws commented Sep 21, 2019

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.

@RayKoopa
Copy link
Author

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.

@cedws
Copy link
Owner

cedws commented Sep 21, 2019

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?

@RayKoopa
Copy link
Author

RayKoopa commented Sep 21, 2019

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.

@cedws cedws added enhancement New feature or request and removed awaiting-reply Awaiting reply from the issue author. labels Sep 22, 2019
@cedws cedws changed the title If a server replied with Forbidden, the whole channel should be skipped Implement interactive deletion Sep 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants