Use is-ignored export in karma to allow ignoring users for karma

This commit is contained in:
jesopo 2019-04-27 14:51:26 +01:00
parent 5f4d5eb270
commit a5f8bb7d3d

View file

@ -29,6 +29,11 @@ class Module(ModuleManager.BaseModule):
def channel_message(self, event):
match = re.match(REGEX_KARMA, event["message"].strip())
if match and not event["action"]:
is_ignored_f = short_url = self.exports.get_one("is-ignored",
lambda _1, _2: False)
if is_ignored_f(event["user"], "karma"):
return
verbose = event["channel"].get_setting("karma-verbose", False)
nickname_only = event["server"].get_setting("karma-nickname-only",
False)