diff options
| author | 2018-08-31 12:55:52 +0100 | |
|---|---|---|
| committer | 2018-08-31 12:55:52 +0100 | |
| commit | 9874f79b498e1f8ae5ebec9a240963e908b645b0 (patch) | |
| tree | d5d887ac82f3e50f0ea295953981363c1c5e7c5a /modules/words.py | |
| parent | Merge pull request #7 from dngfx/master (diff) | |
| signature | ||
Give modules event objects with "context"s, to facilitate purging all the event
hooks for a module
Diffstat (limited to 'modules/words.py')
| -rw-r--r-- | modules/words.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/modules/words.py b/modules/words.py index 502bee3b..1cb432b0 100644 --- a/modules/words.py +++ b/modules/words.py @@ -2,21 +2,21 @@ import time import Utils class Module(object): - def __init__(self, bot): + def __init__(self, bot, events): self.bot = bot - bot.events.on("received").on("message").on("channel" + events.on("received").on("message").on("channel" ).hook(self.channel_message) - bot.events.on("self").on("message").on("channel" + events.on("self").on("message").on("channel" ).hook(self.self_channel_message) - bot.events.on("received").on("command").on("words" + events.on("received").on("command").on("words" ).hook(self.words, channel_only=True, usage="<nickname>", help= "See how many words you or the given nickname have used") - bot.events.on("received").on("command").on("trackword" + events.on("received").on("command").on("trackword" ).hook(self.track_word, min_args=1, help="Start tracking a word", usage="<word>", permission="track-word") - bot.events.on("received").on("command").on("wordusers" + events.on("received").on("command").on("wordusers" ).hook(self.word_users, min_args=1, help="Show who has used a tracked word the most", usage="<word>") |
