aboutsummaryrefslogtreecommitdiff
path: root/modules/check_urls.py
diff options
context:
space:
mode:
authorGravatar jesopo2018-09-26 18:27:17 +0100
committerGravatar jesopo2018-09-26 18:27:17 +0100
commit51a52e2b0e54031cce5876f54d1d48c268b5441c (patch)
treea4c0e8e86c55aa701b06297d5b5a2ceebeaab60d /modules/check_urls.py
parentAlso use docstrings to check if a command has help available, allow one-string (diff)
signature
Switch to using @Utils.hook and docstrings for event hooks
Diffstat (limited to 'modules/check_urls.py')
-rw-r--r--modules/check_urls.py3
1 files changed, 1 insertions, 2 deletions
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",