bitbot-3.11-fork/modules/auto_mode.py
jesopo 8c6ab17e57 give an Exports object (actually, ExportsContex object) to each module, to
facilitate things like !set and !channelset without using the events system
2018-09-02 19:54:45 +01:00

23 lines
722 B
Python

import Utils
class Module(object):
def __init__(self, bot, events, exports):
self.bot = bot
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)
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