Add ignored_users
config option
This commit is contained in:
parent
feb1a37e11
commit
bb01ecdecf
3 changed files with 6 additions and 1 deletions
|
@ -29,6 +29,8 @@ templates:
|
|||
default_flags:
|
||||
- ignorecase
|
||||
|
||||
ignored_users: []
|
||||
|
||||
antispam:
|
||||
room:
|
||||
max: 1
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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")
|
||||
|
|
Loading…
Reference in a new issue