diff options
| author | 2018-08-31 12:55:52 +0100 | |
|---|---|---|
| committer | 2018-08-31 12:55:52 +0100 | |
| commit | 9874f79b498e1f8ae5ebec9a240963e908b645b0 (patch) | |
| tree | d5d887ac82f3e50f0ea295953981363c1c5e7c5a /modules/auto_mode.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/auto_mode.py')
| -rw-r--r-- | modules/auto_mode.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/modules/auto_mode.py b/modules/auto_mode.py index 2c33f260..3e800591 100644 --- a/modules/auto_mode.py +++ b/modules/auto_mode.py @@ -1,16 +1,16 @@ import Utils class Module(object): - def __init__(self, bot): + def __init__(self, bot, events): self.bot = bot - bot.events.on("postboot").on("configure").on( + events.on("postboot").on("configure").on( "channelset").assure_call(setting="automode", help="Disable/Enable automode", validate=Utils.bool_or_none) - bot.events.on("channel").on("mode").hook(self.on_mode) - bot.events.on("received").on("join").hook(self.on_join) + events.on("channel").on("mode").hook(self.on_mode) + events.on("received").on("join").hook(self.on_join) def on_mode(self, event): if event["channel"].get_setting("automode", False): |
