[Cleanup] Delete important amount of attachment #4813

Closed
opened 2021-02-14 03:56:32 +01:00 by madebylydia · 7 comments
madebylydia commented 2021-02-14 03:56:32 +01:00 (Migrated from github.com)

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.

  • Pred.
**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. - Pred.
Jackenmen commented 2021-02-14 04:01:38 +01:00 (Migrated from github.com)

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.

The messages with attachments are not included in deletion [on purpose](https://github.com/Cog-Creators/Red-DiscordBot/pull/3688/files/da68dbfcc77727b94031b92931948b7455c9042c#r398499330) 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.
madebylydia commented 2021-02-14 04:05:12 +01:00 (Migrated from github.com)

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.

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.
Flame442 commented 2021-02-14 04:21:24 +01:00 (Migrated from github.com)

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.

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`.
Twentysix26 commented 2021-02-14 13:17:09 +01:00 (Migrated from github.com)

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.

> 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.
palmtree5 commented 2021-03-13 22:15:22 +01:00 (Migrated from github.com)

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

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
Flame442 commented 2021-03-13 22:18:47 +01:00 (Migrated from github.com)

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.

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.
Jackenmen commented 2021-06-28 02:52:16 +02:00 (Migrated from github.com)

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.

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.
Sign in to join this conversation.
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Mrcoolgamer11/Red-DiscordBot#4813
No description provided.