don't respond to !botlist automatically

This commit is contained in:
jesopo 2019-11-15 10:57:29 +00:00
parent d0d6fc967b
commit 718a026beb

View file

@ -3,8 +3,11 @@ from src import ModuleManager, utils
COMMANDS = ["!botlist", "!rollcall"] COMMANDS = ["!botlist", "!rollcall"]
MESSAGE = "Hi! I'm BitBot (https://git.io/bitbot) " MESSAGE = "Hi! I'm BitBot (https://git.io/bitbot) "
@utils.export("botset", utils.BoolSetting("botlist",
"Whether or not I should respond to !botlist commands"))
class Module(ModuleManager.BaseModule): class Module(ModuleManager.BaseModule):
@utils.hook("received.message.channel") @utils.hook("received.message.channel")
def channel_message(self, event): def channel_message(self, event):
if event["message"].strip() in COMMANDS: if (event["message"].strip() in COMMANDS and
self.bot.get_setting("botlist", False)):
event["channel"].send_message(MESSAGE) event["channel"].send_message(MESSAGE)