join.py -> bot_channel.py, make the bot channel (default #bitbot) configurable

This commit is contained in:
jesopo 2018-09-12 15:44:50 +01:00
parent 461b4f4083
commit 6db97c7df5
2 changed files with 12 additions and 8 deletions

12
modules/bot_channel.py Normal file
View file

@ -0,0 +1,12 @@
class Module(object):
def __init__(self, bot, events, exports):
events.on("received").on("numeric").on("001").hook(self.do_join)
exports.add("serverset", {"setting": "bot-channel",
"help": "Set main channel"})
def do_join(self, event):
event["server"].send_join(event["server"].get_setting("bot-channel",
"#bitbot"))

View file

@ -1,8 +0,0 @@
class Module(object):
def __init__(self, bot, events, exports):
events.on("received").on("numeric").on("001").hook(self.do_join)
def do_join(self, event):
event["server"].send_join("#bitbot")