From 497ff30cfd2d8a534886d170f4007de2aa3e6391 Mon Sep 17 00:00:00 2001 From: diamante0018 Date: Mon, 3 Feb 2025 18:55:20 +0100 Subject: [PATCH] chore: update spam detection method --- aw.py | 7 +++++++ patterns.json | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/aw.py b/aw.py index 2e5e4f7..d9c91e0 100644 --- a/aw.py +++ b/aw.py @@ -406,6 +406,13 @@ async def on_message(message): continue if msg.author == message.author and msg.content == message.content: + current_time = aware_utcnow() + message_time = msg.created_at + + time_difference = current_time - message_time + if time_difference >= timedelta(minutes=5): + continue + await message.channel.send( f"Hey {message.author.name}, you've already sent this message in {channel.mention}!" ) diff --git a/patterns.json b/patterns.json index d43f08e..762478b 100644 --- a/patterns.json +++ b/patterns.json @@ -58,5 +58,9 @@ { "regex": "steam(\\s)*deck", "response": "Are you wondering how to install our clients on the Steam Deck? Check out this guide: https://forum.alterware.dev/t/playing-alterware-on-linux-guide-desktop-handheld/1036" + }, + { + "regex": "0x593A1A", + "response": "This is a known issue. Try to delete the players to reset your stats. This issue is known to happen to modded servers. You may try to join a non-modded server for the time being." } ] \ No newline at end of file