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:
parent
49a21b2d36
commit
0c8678d44f
1 changed files with 3 additions and 0 deletions
|
@ -203,10 +203,13 @@ class Module(ModuleManager.BaseModule):
|
||||||
commands_enabled = event["channel"].get_setting("commands", True)
|
commands_enabled = event["channel"].get_setting("commands", True)
|
||||||
if not commands_enabled:
|
if not commands_enabled:
|
||||||
return
|
return
|
||||||
|
prefixed_commands = event["channel"].get_setting("prefixed-commands", True)
|
||||||
|
|
||||||
command_prefix = event["channel"].get_setting("command-prefix",
|
command_prefix = event["channel"].get_setting("command-prefix",
|
||||||
event["server"].get_setting("command-prefix", "!"))
|
event["server"].get_setting("command-prefix", "!"))
|
||||||
if event["message_split"][0].startswith(command_prefix):
|
if event["message_split"][0].startswith(command_prefix):
|
||||||
|
if not prefixed_commands:
|
||||||
|
return
|
||||||
command = event["message_split"][0].replace(
|
command = event["message_split"][0].replace(
|
||||||
command_prefix, "", 1).lower()
|
command_prefix, "", 1).lower()
|
||||||
self.message(event, command)
|
self.message(event, command)
|
||||||
|
|
Loading…
Reference in a new issue