From b7cf524e9869828ff85954cb731f7fee98bee8d9 Mon Sep 17 00:00:00 2001 From: jesopo Date: Fri, 31 Aug 2018 12:55:52 +0100 Subject: Give modules event objects with "context"s, to facilitate purging all the event hooks for a module --- modules/auto_mode.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'modules/auto_mode.py') 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): -- cgit v1.3.1-10-gc9f91