Add a way to tell bitbot to only response to highlight-based commands (e.g. "bitbot: ping") but ignore prefixed commands (e.g. "!ping")

This commit is contained in:
jesopo 2018-11-12 22:59:21 +00:00
parent 49a21b2d36
commit 0c8678d44f

View file

@ -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)