Closed madebylydia closed 3 years ago
The messages with attachments are not included in deletion on purpose as there's no good way to figure out if the messages are equivalent in such a case.
This can be reconsidered, but we would need a more specific proposal as I'm not sure how it is supposed to be done so that we remove message with attachments that are spam, rather than actually meaningful messages.
I think message with no content but only attachment can be considered as spam at the moment there is more than 10 (Maybe 5, probably) times only attachment, which would let more safety for non spam messages. That's my only idea, so far, I honestly have no idea on how else the command could check for spam.
A bool could be added to the command params to include attachments, however normally cleanup uses a bool to delete pinned, so I don't know how good of an idea that would be.
If all the messages were from the same user, I would recommend [p]cleanup user
, otherwise you can use [p]cleanup between
.
I think message with no content but only attachment can be considered as spam at the moment there is more than 10 (Maybe 5, probably) times only attachment, which would let more safety for non spam messages.
I don't think this is the way to go, I personally wouldn't like if the command assumed that some messages in sequence were duplicates simply because they have attachments, when in reality they might be different from each other. Also my suggestion, other than what Flame442 said, is to use the days parameter of the ban / massban command, which is a way quicker (and reliable) way to instanuke gross things from your server. This command sounds like the wrong tool for the job for what you were trying to do.
One way to do it would be to compare the raw bytes of the attachments (i.e. compare the return value of Attachment.read
) but I could see that leading to false negatives somehow
At that point with how easy it would be to circumvent, it would be a better idea to just use one of the other cleanup
commands. I personally don't think cleanup spam
should be modified to include images, as there are other commands that can do effectively the same job already.
The command was renamed from cleanup spam
to cleanup duplicates
to be less vague. I don't think that comparing the full contents of attachments is that good of an idea so I guess we could just add a note saying that messages containing attachments are ignored when checking for duplicate messages.
What component of Red (cog, command, API) would you like to see improvements on?
Cleanup, the command
cleanup spam
.Describe the enhancement you're suggesting.
Listen kids, it's the story of a nice server that got raided yesterday the 13 February 2021. This story happened on a nice place to visit and very calm, a Discord server. But problems started when the bad guys came in my server and sent those horrible things. His image... I am still shocked... He sent his... his... His weird shit!
My members was troubled. I was troubled, everyone did their best to stay calm and handle the situation. When I came, I was extremely shocked: Over 20 messages no contents with only attachments. His image. Only... his terrible image, wrote forever in my head. I'll never forget the content of it. Of those images.
We handled the situation, time has come: We had to delete the shit. I had the super idea to use Red-DiscordBot with the powerful cleanup cog, one of the most powerful cog to delete bad messages! I used the command that was the most suggestive to the situation,
[p]cleanup spam
. The command was deleted, everyone felt like everything come back to normal, but then, I scrolled to the top and... HORROR! Images were still here! My phone dropped, my hands were shaking, my eyes were fixed on the floor. My mind was starting to ask ton of questions; "What happened?" "Is Red bad? Must I change?" "Did we got Rick rolled?" "Am I unable to handle this by myself?" "What are we gonna do?"I took my phone back, then deleted all messages correctly. Finally, everyone was fine, emergency was removed and everyone talked like before, like nothing happened.
The story says the main hero wrote this story and made his best to ask to solve this problem. "The problem is that
cleanup spam
does not delete spammy messages that only have an attachment, but no content, but that would be super useful for this kind of use case!"The End.