Add 'bot-channel' config in bot.conf.example and use it, if present, in

bot_channel.py
This commit is contained in:
jesopo 2018-12-06 12:13:59 +00:00
parent 7d59898485
commit 3e0bd3ee85
2 changed files with 6 additions and 2 deletions

View file

@ -7,6 +7,9 @@ tls-certificate =
tls-api-key = tls-api-key =
tls-api-certificate = tls-api-certificate =
# the default channel BitBot automatically joins
bot-channel =
# https://openweathermap.org/api # https://openweathermap.org/api
openweathermap-api-key = openweathermap-api-key =

View file

@ -5,5 +5,6 @@ from src import ModuleManager, utils
class Module(ModuleManager.BaseModule): class Module(ModuleManager.BaseModule):
@utils.hook("received.numeric.001") @utils.hook("received.numeric.001")
def do_join(self, event): def do_join(self, event):
event["server"].send_join(event["server"].get_setting("bot-channel", bot_channel = event["server"].get_setting("bot-channel",
"#bitbot")) self.bot.config.get("bot-channel", "#bitbot"))
event["server"].send_join(bot_channel)