From 801a3edb72bb6c326af326b1e63dda6fedd0eab3 Mon Sep 17 00:00:00 2001 From: Slipstream Date: Sat, 7 Jun 2025 03:02:00 +0000 Subject: [PATCH] Applying previous commit. --- cogs/aimod_cog.py | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/cogs/aimod_cog.py b/cogs/aimod_cog.py index 44ad223..828a2a9 100644 --- a/cogs/aimod_cog.py +++ b/cogs/aimod_cog.py @@ -1135,10 +1135,11 @@ After considering the above, pay EXTREME attention to rules 5 (Pedophilia) and 5 Progressive Discipline Guide (unless overridden by severity): - First minor offense: "WARN" (and "DELETE" if content is removable like Rule 1/4). - Second minor offense / First moderate offense: "TIMEOUT_SHORT" (e.g., 10 minutes). - - Repeated moderate offenses: "TIMEOUT_MEDIUM" (e.g., 1 hour). - - Multiple/severe offenses: "TIMEOUT_LONG" (e.g., 1 day), "KICK", or "BAN". - Spamming: - - If a user continuously sends very long messages that are off-topic, repetitive, or appear to be meaningless spam (e.g., character floods, nonsensical text), suggest "TIMEOUT_MEDIUM" or "TIMEOUT_LONG" depending on severity and history, even if the content itself doesn't violate other specific rules. This is to maintain chat readability. + - Repeated moderate offenses: "TIMEOUT_MEDIUM" (e.g., 1 hour). + - Multiple/severe offenses: "TIMEOUT_LONG" (e.g., 1 day), "KICK", or "BAN". + - Use "BAN" on a user's **first infraction only in extremely severe cases** such as posting gore or content involving real minors (e.g., CSAM or pedophilia). Slurs alone or other less serious content should **not** result in an immediate ban. + Spamming: + - If a user continuously sends very long messages that are off-topic, repetitive, or appear to be meaningless spam (e.g., character floods, nonsensical text), suggest "TIMEOUT_MEDIUM" or "TIMEOUT_LONG" depending on severity and history, even if the content itself doesn't violate other specific rules. This is to maintain chat readability. Rule Severity Guidelines (use your judgment): - Consider the severity of each rule violation on its own merits. - Consider the user's history of past infractions when determining appropriate action. @@ -1693,6 +1694,25 @@ CRITICAL: Do NOT output anything other than the required JSON response. except Exception as e: print(f"Failed to POST initial action info: {e}") + # --- Adjust action for first-time offenses --- + user_history_list = get_user_infraction_history(guild_id, user_id) + if action == "BAN" and not user_history_list: + combined_text = f"{rule_violated} {reasoning}".lower() + severe_keywords = [ + "gore", + "csam", + "pedophilia", + "child", + "5a", + "5", + "irl porn", + ] + if not any(keyword in combined_text for keyword in severe_keywords): + print( + "Downgrading BAN to TIMEOUT_LONG due to first offense and lack of severe content." + ) + action = "TIMEOUT_LONG" + # --- Prepare Notification --- notification_embed = discord.Embed( title="🚨 Rule Violation Detected 🚨",