From 0e0ae9c63bd702dd662ca927aa61cb1975826194 Mon Sep 17 00:00:00 2001 From: William Kray Date: Wed, 16 Oct 2024 12:24:48 -0700 Subject: [PATCH] avoid proactive bans if they are blob patterns --- community/bot.py | 3 +++ maubot.yaml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/community/bot.py b/community/bot.py index 2bcd99e..e9c1e97 100644 --- a/community/bot.py +++ b/community/bot.py @@ -264,6 +264,9 @@ class CommunityBot(Plugin): entity = evt.content["entity"] recommendation = evt.content["recommendation"] self.log.debug(f"DEBUG new ban rule found: {entity} should have action {recommendation}") + if bool(re.search(r"[*?]", entity)): + self.log.debug(f"DEBUG ban rule appears to be glob pattern, skipping proactive measures.") + return if bool(re.search('ban$', recommendation)): await self.ban_this_user(entity) except Exception as e: diff --git a/maubot.yaml b/maubot.yaml index 91ad7c6..7e23ff4 100644 --- a/maubot.yaml +++ b/maubot.yaml @@ -1,6 +1,6 @@ maubot: 0.1.0 id: org.jobmachine.communitybot -version: 0.1.13 +version: 0.1.14 license: MIT modules: - community