aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar jesopo2018-11-12 22:59:21 +0000
committerGravatar jesopo2018-11-12 22:59:21 +0000
commit0c8678d44fbccc03395b5a0cd44f0cfaf4467764 (patch)
treea3992232b473e15f6e4f9ef4dbf30f319bc905fb
parentAdd a way to prevent responses to commands at all in specific channels (diff)
signature
Add a way to tell bitbot to only response to highlight-based commands (e.g. "bitbot: ping") but ignore prefixed commands (e.g. "!ping")
-rw-r--r--modules/commands.py3
1 files changed, 3 insertions, 0 deletions
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)