From 8c6ab17e579cf8f4e510ec324fc98b010ff01cb0 Mon Sep 17 00:00:00 2001 From: jesopo Date: Sun, 2 Sep 2018 19:54:45 +0100 Subject: give an Exports object (actually, ExportsContex object) to each module, to facilitate things like !set and !channelset without using the events system --- modules/auto_mode.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'modules/auto_mode.py') diff --git a/modules/auto_mode.py b/modules/auto_mode.py index 3e800591..08fd94de 100644 --- a/modules/auto_mode.py +++ b/modules/auto_mode.py @@ -1,13 +1,12 @@ import Utils class Module(object): - def __init__(self, bot, events): + def __init__(self, bot, events, exports): self.bot = bot - events.on("postboot").on("configure").on( - "channelset").assure_call(setting="automode", - help="Disable/Enable automode", - validate=Utils.bool_or_none) + exports.add("channelset", {"setting": "automode", + "help": "Disable/Enable automode", + "validate": Utils.bool_or_none}) events.on("channel").on("mode").hook(self.on_mode) events.on("received").on("join").hook(self.on_join) -- cgit v1.3.1-10-gc9f91