diff options
| author | 2016-04-03 13:23:47 +0100 | |
|---|---|---|
| committer | 2016-04-03 13:23:47 +0100 | |
| commit | e10ba5f293ff2a60dc8218569280f4710ce2a868 (patch) | |
| tree | ee8979ee4a17f9a19fe7e529eb962c415f43a244 /modules | |
| parent | tinkered with some modules and fixed a few bugs, also added the skeleton for ... (diff) | |
added some more to the skeleton of the auto_mode module.
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/auto_mode.py | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/modules/auto_mode.py b/modules/auto_mode.py index 3fbdc96c..f58c7bee 100644 --- a/modules/auto_mode.py +++ b/modules/auto_mode.py @@ -3,16 +3,25 @@ class Module(object): def __init__(self, bot): self.bot = bot + bot.events.on("boot").on("done").hook(self.book_done) bot.events.on("channel").on("mode").hook(self.on_mode) bot.events.on("received").on("join").hook(self.on_join) + def validate_setchannel(self, s): + return s.lower() == "true" + def boot_done(self, event): + self.bot.events.on("postboot").on("configure").on( + "channelset").call(setting="automode", + help="Disable/Enable automode", + validate=self.validate_setchannel) + def on_mode(self, event): - if event["channel"].get_setting("auto-mode", False): + if event["channel"].get_setting("automode", False): remove = event["remove"] channel = event["channel"] mode = event["mode"] args = event["args"] def on_join(self, event): - if event["channel"].get_setting("auto-mode", False): + if event["channel"].get_setting("automode", False): pass |
