From 51a52e2b0e54031cce5876f54d1d48c268b5441c Mon Sep 17 00:00:00 2001 From: jesopo Date: Wed, 26 Sep 2018 18:27:17 +0100 Subject: Switch to using @Utils.hook and docstrings for event hooks --- modules/check_urls.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'modules/check_urls.py') diff --git a/modules/check_urls.py b/modules/check_urls.py index fa05695e..b0438ec8 100644 --- a/modules/check_urls.py +++ b/modules/check_urls.py @@ -10,8 +10,6 @@ class Module(object): def __init__(self, bot, events, exports): self.bot = bot self.events = events - events.on("received.message.channel").hook(self.message) - exports.add("channelset", {"setting": "check-urls", "help": "Enable/Disable automatically checking for " "malicious URLs", "validate": Utils.bool_or_none}) @@ -22,6 +20,7 @@ class Module(object): "help": "Enable/Disable automatically kicking users that " "send malicious URLs", "validate": Utils.bool_or_none}) + @Utils.hook("received.message.channel") def message(self, event): match = RE_URL.search(event["message"]) if match and event["channel"].get_setting("check-urls", -- cgit v1.3.1-10-gc9f91