avoid proactive bans if they are blob patterns

This commit is contained in:
William Kray
2024-10-16 12:24:48 -07:00
parent 000f3efb29
commit 0e0ae9c63b
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -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:
+1 -1
View File
@@ -1,6 +1,6 @@
maubot: 0.1.0
id: org.jobmachine.communitybot
version: 0.1.13
version: 0.1.14
license: MIT
modules:
- community