bot icon indicating copy to clipboard operation
bot copied to clipboard

Attachment spam limits to 6 attachments but messages can contain 10 attachments

Open onerandomusername opened this issue 2 months ago • 8 comments

Example: https://discord.com/channels/267624335836053506/463035268514185226/1431497703447199774

This leads to some false positives when a gallery of 7 or more attachments are sent on a message.

https://github.com/python-discord/bot/blob/2640aaa5665426e5350b3ce81a743a9f4c3898aa/bot/exts/filtering/_filters/antispam/attachments.py#L12-L21

It would be great to support full 10 attachments before triggering this rule so a single message with 10 attachments doesn't trigger the antispam rule.

onerandomusername avatar Oct 25 '25 04:10 onerandomusername

If this gets approved I can work on it if @onerandomusername is not interested.

DragonSenseiGuy avatar Oct 30 '25 13:10 DragonSenseiGuy

I am changing the scope slightly of this.

We will not support messages with more than 6 attachments still, as anything over that just generates huge screen filling messages that don't really have a place in Python Discord.

However, for the first instance of a user posting >6 attachments we should not mute, just delete & notify the user (all should be possible through the existing filter system).

If a user then continues to post attachments within a certain cooldown period (let's say 2 minutes), we should then apply the filter in the regular fashion and apply a tempmute.

jb3 avatar Nov 01 '25 19:11 jb3

I see no harm in allowing 10 attachments when we allow three embeds from websites:

Image Image

The ten (media) attachments is smaller than 3 embeds from GitHub. This should be considered when moderating 10 attachments on messages.

onerandomusername avatar Nov 01 '25 21:11 onerandomusername

Not all attachments form media galleries.

jb3 avatar Nov 01 '25 21:11 jb3

We could filter and run introspection on the types of attachments and allow 10 in specific cases.

onerandomusername avatar Nov 01 '25 21:11 onerandomusername

Six file embeds is still longer than a gallery of ten images. Which would still be allowed.

Image

onerandomusername avatar Nov 01 '25 21:11 onerandomusername

Specifically, how I should have made this issue:

when all attachments are media image files, they should not be deleted if the user sends more than 6 of other kinds, they should be warned but not immediately timed out.

onerandomusername avatar Nov 01 '25 21:11 onerandomusername

This has been discussed internally amongst Moderators and the specified behaviour above maintaining the max 6 attachments (but improving the UX for users caught by the filter) is what has been decided.

In future (and in separate issues), maybe we should think about:

  • Auto-suppressing embeds when a message has loads of them, because it is just as noisy
  • Lowering the attachment limit to something lower (e.g. 3) if the attachments are non-images.

For this specific issue though, the specification here is what should be implemented.

jb3 avatar Nov 01 '25 21:11 jb3