aboutsummaryrefslogtreecommitdiff
path: root/src/core_modules/bot_channel.py
blob: 602377922ff881e7c963734cf2dd3b5728ca20a3 (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
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)