This commit is contained in:
deathbybandaid 2022-02-12 18:56:45 -05:00
parent cefdeb9ccc
commit c8c5a32671

View File

@ -61,14 +61,12 @@ def get_commands(bot, trigger):
else: else:
command_types = ["command", "nickname_command", "action_command"] command_types = ["command", "nickname_command", "action_command"]
# TODO Assume same command type until proven otherwise # TODO Assume same command type until proven otherwise
trigger_type = first_trigger_type assumed_trigger_type = first_trigger_type
trigger_prefix = first_trigger_prefix assumed_trigger_prefix = first_trigger_prefix
trigger_str = trigger_str
trigger_command = trigger_str.split(" ")[0]
# Still under the assumption that the command is most likely the same type as first command # Still under the assumption that the command is most likely the same type as first command
command_types.remove(trigger_type) command_types.remove(assumed_trigger_type)
command_types.insert(0, trigger_type) command_types.insert(0, assumed_trigger_type)
found = [] found = []
for command_type in command_types: for command_type in command_types:
@ -85,6 +83,15 @@ def get_commands(bot, trigger):
if len(found): if len(found):
trigger_type = found[0] trigger_type = found[0]
if trigger_type == "command":
trigger_prefix = sb.config.prefix_list[0]
elif trigger_type == "nickname_command":
trigger_prefix = "%s," % bot.nick
elif trigger_type == "action_command":
trigger_prefix = "ACTION"
else:
trigger_type = assumed_trigger_type
trigger_prefix = assumed_trigger_prefix
commands.append({ commands.append({
"trigger_type": trigger_type, "trigger_type": trigger_type,