Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG - Spam filter should not use image filenames #439

Open
Crambor opened this issue May 28, 2024 · 0 comments
Open

BUG - Spam filter should not use image filenames #439

Crambor opened this issue May 28, 2024 · 0 comments
Assignees
Labels
BUG Something isn't working EASY Easy issues

Comments

@Crambor
Copy link
Member

Crambor commented May 28, 2024

Many screenshot tools, or simply copied images into the discord textbox, will have the exact same image filename as a result. We currently use filenames for spam detection which can lead to false positives, with users being unnecessarily quarantined.

The below code should be modified to use something like an image checksum for attachment comparison:

self.records[message.author.id] = {
"last_message": message.content if message.content != "" else message.attachments[0].filename
, "occurrence": 1
, "1st": {"message_id": message.id, "channel_id": message.channel.id, "file_name": message.attachments[0].filename if message.content == "" else None, "file_url": message.attachments[0].url if message.content == "" else None}
, "2nd": {}
, "3rd": {}
}
# Old speaker. We are watching you...
else:
# Check if the last message is the same as the new one.
the_archive = self.records[message.author.id]
if the_archive["last_message"] == (message.content if message.content != "" else message.attachments[0].filename):

@Crambor Crambor added BUG Something isn't working EASY Easy issues labels May 28, 2024
@Crambor Crambor self-assigned this May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG Something isn't working EASY Easy issues
Projects
None yet
Development

No branches or pull requests

1 participant