diff options
| author | 2018-09-02 19:54:45 +0100 | |
|---|---|---|
| committer | 2018-09-02 19:54:45 +0100 | |
| commit | 8c6ab17e579cf8f4e510ec324fc98b010ff01cb0 (patch) | |
| tree | c0437f76bbe9dea31f5f4599450ed5b492eedcd6 /modules/ducks.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/ducks.py')
| -rw-r--r-- | modules/ducks.py | 8 |
1 files changed, 3 insertions, 5 deletions
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) |
