diff options
| author | 2018-09-02 19:54:45 +0100 | |
|---|---|---|
| committer | 2018-09-02 19:54:45 +0100 | |
| commit | 8c6ab17e579cf8f4e510ec324fc98b010ff01cb0 (patch) | |
| tree | c0437f76bbe9dea31f5f4599450ed5b492eedcd6 /modules/commands.py | |
| parent | IRCLogging -> Logging (diff) | |
| signature | ||
give an Exports object (actually, ExportsContex object) to each module, to
facilitate things like !set and !channelset without using the events system
Diffstat (limited to 'modules/commands.py')
| -rw-r--r-- | modules/commands.py | 7 |
1 files changed, 3 insertions, 4 deletions
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) |
