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/commands.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'modules/commands.py') diff --git a/modules/commands.py b/modules/commands.py index 5084f690..e3c4c00e 100644 --- a/modules/commands.py +++ b/modules/commands.py @@ -45,7 +45,7 @@ class StdErr(Out): self.module_name, Utils.FONT_RESET) class Module(object): - def __init__(self, bot, events): + def __init__(self, bot, events, exports): self.bot = bot self.events = events events.on("received").on("message").on("channel").hook( @@ -60,9 +60,8 @@ class Module(object): events.on("received").on("command").on("more").hook(self.more, help="Get more output from the last command", skip_out=True) - events.on("postboot").on("configure").on( - "channelset").assure_call(setting="command-prefix", - help="Set the command prefix used in this channel") + exports.add("channelset", {"setting": "command-prefix", + "help": "Set the command prefix used in this channel"}) events.on("new").on("user", "channel").hook(self.new) events.on("send").on("stdout").hook(self.send_stdout) -- cgit v1.3.1-10-gc9f91