aboutsummaryrefslogtreecommitdiff
path: root/modules/auto_mode.py
blob: 37875bf247dde3e42276b93e1c161898a119e79a (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import Utils


class Module(object):
    def __init__(self, bot):
        self.bot = bot

        bot.events.on("postboot").on("configure").on(
            "channelset").assure_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["mode_args"]

    def on_join(self, event):
        if event["channel"].get_setting("automode", False):
            pass