2016-04-10 16:40:58 +00:00
|
|
|
import Utils
|
2016-04-03 12:20:05 +00:00
|
|
|
|
|
|
|
class Module(object):
|
2018-09-02 18:54:45 +00:00
|
|
|
def __init__(self, bot, events, exports):
|
2016-04-03 12:20:05 +00:00
|
|
|
self.bot = bot
|
|
|
|
|
2018-09-02 18:54:45 +00:00
|
|
|
exports.add("channelset", {"setting": "automode",
|
|
|
|
"help": "Disable/Enable automode",
|
|
|
|
"validate": Utils.bool_or_none})
|
2016-04-03 12:23:47 +00:00
|
|
|
|
2018-08-31 11:55:52 +00:00
|
|
|
events.on("channel").on("mode").hook(self.on_mode)
|
|
|
|
events.on("received").on("join").hook(self.on_join)
|
2017-12-26 10:32:36 +00:00
|
|
|
|
2016-04-03 12:20:05 +00:00
|
|
|
def on_mode(self, event):
|
2016-04-03 12:23:47 +00:00
|
|
|
if event["channel"].get_setting("automode", False):
|
2016-04-03 12:20:05 +00:00
|
|
|
remove = event["remove"]
|
|
|
|
channel = event["channel"]
|
|
|
|
mode = event["mode"]
|
2017-12-26 10:32:36 +00:00
|
|
|
args = event["mode_args"]
|
2016-04-03 12:20:05 +00:00
|
|
|
|
|
|
|
def on_join(self, event):
|
2016-04-03 12:23:47 +00:00
|
|
|
if event["channel"].get_setting("automode", False):
|
2016-04-03 12:20:05 +00:00
|
|
|
pass
|