diff --git a/base-config.yaml b/base-config.yaml index f99e872..d4fc5ef 100644 --- a/base-config.yaml +++ b/base-config.yaml @@ -29,6 +29,8 @@ templates: default_flags: - ignorecase +ignored_users: [] + antispam: room: max: 1 diff --git a/reactbot/bot.py b/reactbot/bot.py index 5868dda..0585a36 100644 --- a/reactbot/bot.py +++ b/reactbot/bot.py @@ -91,7 +91,9 @@ class ReactBot(Plugin): @event.on(EventType.ROOM_MESSAGE) async def event_handler(self, evt: MessageEvent) -> None: - if evt.sender == self.client.mxid or evt.content.msgtype not in self.allowed_msgtypes: + ignored_mxids = self.config["ignored_users"] + ignored_mxids.append(self.client.mxid) + if evt.sender in ignored_mxids or evt.content.msgtype not in self.allowed_msgtypes: return for name, rule in self.config.rules.items(): match = rule.match(evt) diff --git a/reactbot/config.py b/reactbot/config.py index efbf9ae..8256446 100644 --- a/reactbot/config.py +++ b/reactbot/config.py @@ -37,6 +37,7 @@ class Config(BaseProxyConfig): helper.copy("rules") helper.copy("templates") helper.copy("default_flags") + helper.copy("ignored_users") helper.copy("antispam.user.max") helper.copy("antispam.user.delay") helper.copy("antispam.room.max")