aboutsummaryrefslogtreecommitdiff
path: root/modules/auto_mode.py
diff options
context:
space:
mode:
authorGravatar jesopo2017-12-26 10:32:36 +0000
committerGravatar jesopo2017-12-26 10:32:36 +0000
commit0cc72d5d66bc3a6abf7757c7202905bd656ddf1d (patch)
treea2591a46c4e25f359b7ed6990f31d91be22d4d1d /modules/auto_mode.py
parentNR: Indicate interesting activity at locations (diff)
signature
Added a "replay" system to EventManager hooks, to replay missed .calls
Diffstat (limited to 'modules/auto_mode.py')
-rw-r--r--modules/auto_mode.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/modules/auto_mode.py b/modules/auto_mode.py
index 2d7370a4..4d0c3a0b 100644
--- a/modules/auto_mode.py
+++ b/modules/auto_mode.py
@@ -3,22 +3,21 @@ import Utils
class Module(object):
def __init__(self, bot):
self.bot = bot
- bot.events.on("boot").on("done").hook(self.boot_done)
- bot.events.on("channel").on("mode").hook(self.on_mode)
- bot.events.on("received").on("join").hook(self.on_join)
- def boot_done(self, event):
- self.bot.events.on("postboot").on("configure").on(
+ bot.events.on("postboot").on("configure").on(
"channelset").call(setting="automode",
help="Disable/Enable automode",
validate=Utils.bool_or_none)
+ bot.events.on("channel").on("mode").hook(self.on_mode)
+ bot.events.on("received").on("join").hook(self.on_join)
+
def on_mode(self, event):
if event["channel"].get_setting("automode", False):
remove = event["remove"]
channel = event["channel"]
mode = event["mode"]
- args = event["args"]
+ args = event["mode_args"]
def on_join(self, event):
if event["channel"].get_setting("automode", False):