Skip to content

Message filtering did not account for message with only attachments #549

@ikuyarihS

Description

@ikuyarihS

There was a mute issued to an user after posting 5 messages with 5 attachments. The bot issued a mute and treated accordingly against message spamming behaviour, however in this case there are two problems:

  • They were messages with empty message contents, only attachments.
  • The attachments were completely deleted, and there is no way to know what they were.

The log of the case looks like this

Deleted by: Python#4329
Date: Oct. 23, 2019, 6:54 a.m.
A̷k̴a̴s̵h̶#4646Oct. 23, 2019, 6:54 a.m. | User ID: 330256174098284554
A̷k̴a̴s̵h̶#4646Oct. 23, 2019, 6:54 a.m. | User ID: 330256174098284554
A̷k̴a̴s̵h̶#4646Oct. 23, 2019, 6:54 a.m. | User ID: 330256174098284554
A̷k̴a̴s̵h̶#4646Oct. 23, 2019, 6:54 a.m. | User ID: 330256174098284554
A̷k̴a̴s̵h̶#4646Oct. 23, 2019, 6:54 a.m. | User ID: 330256174098284554

The following codes might be of interest:

    """Detects duplicated messages sent by a single user."""
    relevant_messages = tuple(
        msg
        for msg in recent_messages
        if (
            msg.author == last_message.author
            and msg.content == last_message.content
        )
    )

    total_duplicated = len(relevant_messages)

    if total_duplicated > config['max']:
        ...

Which is in duplicates.py

Metadata

Metadata

Assignees

Labels

a: APIRelated to or causes API changesa: filtersRelated to message filters: (antimalware, antispam, filtering, token_remover)good first issueGood for newcomersp: 3 - lowLow Prioritys: WIPWork In Progresst: bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions