From 0c8678d44fbccc03395b5a0cd44f0cfaf4467764 Mon Sep 17 00:00:00 2001 From: jesopo Date: Mon, 12 Nov 2018 22:59:21 +0000 Subject: [PATCH] Add a way to tell bitbot to only response to highlight-based commands (e.g. "bitbot: ping") but ignore prefixed commands (e.g. "!ping") --- modules/commands.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/commands.py b/modules/commands.py index cb20e7df..d06c7f46 100644 --- a/modules/commands.py +++ b/modules/commands.py @@ -203,10 +203,13 @@ class Module(ModuleManager.BaseModule): commands_enabled = event["channel"].get_setting("commands", True) if not commands_enabled: return + prefixed_commands = event["channel"].get_setting("prefixed-commands", True) command_prefix = event["channel"].get_setting("command-prefix", event["server"].get_setting("command-prefix", "!")) if event["message_split"][0].startswith(command_prefix): + if not prefixed_commands: + return command = event["message_split"][0].replace( command_prefix, "", 1).lower() self.message(event, command)