oops, forgot some things
This commit is contained in:
@@ -89,3 +89,9 @@ censor_wordlist:
|
||||
# your bot MUST be in the banlist room already!
|
||||
banlists:
|
||||
- '#community-moderation-effort-bl:neko.dev'
|
||||
|
||||
# should we ban proactively? this will generate ban events across all rooms every time
|
||||
# the ban lists have a new policy added, which may be noisy. however, without this enabled,
|
||||
# an account may join your rooms, THEN get added to the banlist, and you will have to manually
|
||||
# ban them from your rooms.
|
||||
proactive_banning: true
|
||||
|
||||
+5
-1
@@ -41,6 +41,7 @@ class Config(BaseProxyConfig):
|
||||
helper.copy("censor_wordlist")
|
||||
helper.copy("censor_files")
|
||||
helper.copy("banlists")
|
||||
helper.copy("proactive_banning")
|
||||
|
||||
|
||||
class CommunityBot(Plugin):
|
||||
@@ -177,7 +178,7 @@ class CommunityBot(Plugin):
|
||||
else:
|
||||
pass
|
||||
except Exception as e:
|
||||
self.log.debug(f"Found something funny in the banlist {l} for {rule['content']}: {e}")
|
||||
self.log.debug(f"Found something funny in the banlist {list_id} for {rule['content']}: {e}")
|
||||
pass
|
||||
# if we haven't exited by now, we must not be banned!
|
||||
return is_banned
|
||||
@@ -237,6 +238,9 @@ class CommunityBot(Plugin):
|
||||
|
||||
@event.on(BAN_STATE_EVENT)
|
||||
async def check_ban_event(self, evt:StateEvent) -> None:
|
||||
if not self.config["proactive_banning"]:
|
||||
return
|
||||
|
||||
banlist_roomids = await self.get_banlist_roomids()
|
||||
# we only care about ban events in rooms in the banlist
|
||||
if evt.room_id not in banlist_roomids:
|
||||
|
||||
Reference in New Issue
Block a user