diff options
| author | 2018-09-26 18:27:17 +0100 | |
|---|---|---|
| committer | 2018-09-26 18:27:17 +0100 | |
| commit | 51a52e2b0e54031cce5876f54d1d48c268b5441c (patch) | |
| tree | a4c0e8e86c55aa701b06297d5b5a2ceebeaab60d /modules/sed.py | |
| parent | Also use docstrings to check if a command has help available, allow one-string (diff) | |
Switch to using @Utils.hook and docstrings for event hooks
Diffstat (limited to 'modules/sed.py')
| -rw-r--r-- | modules/sed.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/modules/sed.py b/modules/sed.py index c9ef778d..bae45656 100644 --- a/modules/sed.py +++ b/modules/sed.py @@ -6,9 +6,7 @@ REGEX_SED = re.compile("^s/") class Module(object): def __init__(self, bot, events, exports): - self.bot = bot self.events = events - events.on("received.message.channel").hook(self.channel_message) exports.add("channelset", {"setting": "sed", "help": "Disable/Enable sed in a channel", @@ -17,6 +15,7 @@ class Module(object): "help": "Disable/Enable sed only looking at the messages " "sent by the user", "validate": Utils.bool_or_none}) + @Utils.hook("received.message.channel") def channel_message(self, event): sed_split = re.split(REGEX_SPLIT, event["message"], 3) if event["message"].startswith("s/") and len(sed_split) > 2: |
