question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Message filtering did not account for message with only attachments

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
Akarys42commented, Oct 25, 2019

Hi, I would like to work on it please.

0reactions
Akarys42commented, Oct 28, 2019

Done in python-discord/site#303.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom message filtering - missing attachment presence option
hello, when creating new message filter in TB I cannt find option "attachment", so I cannot create rule forwarding messages with attachment.
Read more >
Determining why Attachment Filtering blocked or allowed a ...
In this article, you will learn how to determine why the Attachment Filtering plug-in blocked or allowed a message as part of the ......
Read more >
How to filter messages that do NOT have attachments using ...
So you could have it filter select messages with attachments to an attachment label and have the select messages without a user label...
Read more >
Filter emails in Mail on iPhone - Apple Support
In the Mail app , you can use filters to temporarily show only certain messages—the ones that meet all the criteria you select...
Read more >
Find all messages with attachments - Microsoft Support
Use Outlook's built-in filters to search for all messages with attachments. Outlook has a number of built-in filters that you can use to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found