From f82e3536f0aa8adc8ae5f8855de57697bdc8043f Mon Sep 17 00:00:00 2001 From: jesopo Date: Wed, 26 Feb 2020 17:30:36 +0000 Subject: move bot_channel.py to core_modules, default to no bot channel --- modules/bot_channel.py | 12 ------------ src/core_modules/bot_channel.py | 13 +++++++++++++ 2 files changed, 13 insertions(+), 12 deletions(-) delete mode 100644 modules/bot_channel.py create mode 100644 src/core_modules/bot_channel.py diff --git a/modules/bot_channel.py b/modules/bot_channel.py deleted file mode 100644 index 32f3f1fc..00000000 --- a/modules/bot_channel.py +++ /dev/null @@ -1,12 +0,0 @@ -#--depends-on config - -from src import ModuleManager, utils - -@utils.export("serverset", utils.Setting("bot-channel", - "Set main channel", example="#bitbot")) -class Module(ModuleManager.BaseModule): - @utils.hook("received.001") - def do_join(self, event): - bot_channel = event["server"].get_setting("bot-channel", - self.bot.config.get("bot-channel", "#bitbot")) - event["server"].send_join(bot_channel) diff --git a/src/core_modules/bot_channel.py b/src/core_modules/bot_channel.py new file mode 100644 index 00000000..60237792 --- /dev/null +++ b/src/core_modules/bot_channel.py @@ -0,0 +1,13 @@ +#--depends-on config + +from src import ModuleManager, utils + +@utils.export("serverset", utils.Setting("bot-channel", + "Set main channel", example="#bitbot")) +class Module(ModuleManager.BaseModule): + @utils.hook("received.001") + def do_join(self, event): + bot_channel = event["server"].get_setting("bot-channel", + self.bot.config.get("bot-channel", None)) + if not bot_channel == None: + event["server"].send_join(bot_channel) -- cgit v1.3.1-10-gc9f91