From 21691724c211cd4bb1cd79653b6bc340127c0e93 Mon Sep 17 00:00:00 2001 From: diamante0018 Date: Tue, 3 Feb 2026 15:32:48 +0100 Subject: [PATCH] fix: regression from last commit --- bot/events_handlers/message_events.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/bot/events_handlers/message_events.py b/bot/events_handlers/message_events.py index 9ae3961..a753207 100644 --- a/bot/events_handlers/message_events.py +++ b/bot/events_handlers/message_events.py @@ -66,9 +66,17 @@ async def handle_at_everyone(message): if spam_role: try: - # Check if we can actually assign the role - await message.author.add_roles(spam_role, reason="Spam mention") - logger.info("Role added successfully") + if spam_role not in message.author.roles: + # Check if we can actually assign the role + await message.author.add_roles(spam_role, reason="Spam mention") + + # Add the user to the database + add_user_to_role( + message.author.id, SPAM_ROLE_ID, message.author.name + ) + logger.info("Role added successfully") + else: + logger.info("User already has the spam role") await message.reply( f"Dink Donk! Time to ping everyone! {spam_role.mention}",