From 3e0bd3ee857d90b218bbbaf5f913802e308e8a2d Mon Sep 17 00:00:00 2001 From: jesopo Date: Thu, 6 Dec 2018 12:13:59 +0000 Subject: Add 'bot-channel' config in bot.conf.example and use it, if present, in bot_channel.py --- bot.conf.example | 3 +++ modules/bot_channel.py | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bot.conf.example b/bot.conf.example index 28be3183..6e16d8a9 100644 --- a/bot.conf.example +++ b/bot.conf.example @@ -7,6 +7,9 @@ tls-certificate = tls-api-key = tls-api-certificate = +# the default channel BitBot automatically joins +bot-channel = + # https://openweathermap.org/api openweathermap-api-key = diff --git a/modules/bot_channel.py b/modules/bot_channel.py index 2fe4e1fd..6f0f4d04 100644 --- a/modules/bot_channel.py +++ b/modules/bot_channel.py @@ -5,5 +5,6 @@ from src import ModuleManager, utils class Module(ModuleManager.BaseModule): @utils.hook("received.numeric.001") def do_join(self, event): - event["server"].send_join(event["server"].get_setting("bot-channel", - "#bitbot")) + bot_channel = event["server"].get_setting("bot-channel", + self.bot.config.get("bot-channel", "#bitbot")) + event["server"].send_join(bot_channel) -- cgit v1.3.1-10-gc9f91