From d5bda6fe5fbddf7f2a6ec353a13f5ea7aaf83b71 Mon Sep 17 00:00:00 2001 From: fretuks Date: Sat, 15 Nov 2025 14:44:27 +0100 Subject: [PATCH] Important fix for moderation --- helper_moderation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helper_moderation.py b/helper_moderation.py index c11cfdf..165b59e 100644 --- a/helper_moderation.py +++ b/helper_moderation.py @@ -149,7 +149,7 @@ async def handle_moderation(message): ping_staff=(count >= WARN_THRESHOLD) ) return - if any(w in text for w in DRUG_KEYWORDS): + if any(re.search(rf"\b{re.escape(w)}\b", text, re.IGNORECASE) for w in DRUG_KEYWORDS): count = await increment_warning(uid) await add_warn_log(uid, "Drug mention") await message.channel.send(