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/ducks.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'modules/ducks.py') diff --git a/modules/ducks.py b/modules/ducks.py index 83251cef..06194b85 100644 --- a/modules/ducks.py +++ b/modules/ducks.py @@ -14,7 +14,7 @@ DUCK_LIST = [ ] class Module(object): - def __init__(self, bot, events): + def __init__(self, bot, events, exports): self.bot = bot self.events = events @@ -33,10 +33,8 @@ class Module(object): "stats!") - events.on("postboot").on("configure").on( - "channelset").assure_call(setting="ducks-enabled", - help="Toggles ducks!", - validate=Utils.bool_or_none) + exports.add("channelset", {"setting": "ducks-enabled", + "help": "Toggle ducks!", "validate": Utils.bool_or_none}) events.on("received.numeric.366").hook(self.bootstrap) -- cgit v1.3.1-10-gc9f91