aboutsummaryrefslogtreecommitdiff
path: root/modules/auto_mode.py
diff options
context:
space:
mode:
authorGravatar jesopo2018-09-02 19:54:45 +0100
committerGravatar jesopo2018-09-02 19:54:45 +0100
commit8c6ab17e579cf8f4e510ec324fc98b010ff01cb0 (patch)
treec0437f76bbe9dea31f5f4599450ed5b492eedcd6 /modules/auto_mode.py
parentIRCLogging -> 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/auto_mode.py')
-rw-r--r--modules/auto_mode.py9
1 files changed, 4 insertions, 5 deletions
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)