avoid proactive bans if they are blob patterns
This commit is contained in:
@@ -264,6 +264,9 @@ class CommunityBot(Plugin):
|
|||||||
entity = evt.content["entity"]
|
entity = evt.content["entity"]
|
||||||
recommendation = evt.content["recommendation"]
|
recommendation = evt.content["recommendation"]
|
||||||
self.log.debug(f"DEBUG new ban rule found: {entity} should have action {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)):
|
if bool(re.search('ban$', recommendation)):
|
||||||
await self.ban_this_user(entity)
|
await self.ban_this_user(entity)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
maubot: 0.1.0
|
maubot: 0.1.0
|
||||||
id: org.jobmachine.communitybot
|
id: org.jobmachine.communitybot
|
||||||
version: 0.1.13
|
version: 0.1.14
|
||||||
license: MIT
|
license: MIT
|
||||||
modules:
|
modules:
|
||||||
- community
|
- community
|
||||||
|
|||||||
Reference in New Issue
Block a user