Skip to content

Commit

Permalink
avoid proactive bans if they are blob patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
williamkray committed Oct 16, 2024
1 parent 000f3ef commit 0e0ae9c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions community/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,9 @@ async def check_ban_event(self, evt:StateEvent) -> None:
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:
Expand Down
2 changes: 1 addition & 1 deletion maubot.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
maubot: 0.1.0
id: org.jobmachine.communitybot
version: 0.1.13
version: 0.1.14
license: MIT
modules:
- community
Expand Down

0 comments on commit 0e0ae9c

Please sign in to comment.