From c8c5a32671e5cbdc09a552bf03cac91a029c7cbe Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Sat, 12 Feb 2022 18:56:45 -0500 Subject: [PATCH] test --- sopel_SpiceBot_Core_Prerun/__init__.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/sopel_SpiceBot_Core_Prerun/__init__.py b/sopel_SpiceBot_Core_Prerun/__init__.py index 6768383..382a29e 100644 --- a/sopel_SpiceBot_Core_Prerun/__init__.py +++ b/sopel_SpiceBot_Core_Prerun/__init__.py @@ -61,14 +61,12 @@ def get_commands(bot, trigger): else: command_types = ["command", "nickname_command", "action_command"] # TODO Assume same command type until proven otherwise - trigger_type = first_trigger_type - trigger_prefix = first_trigger_prefix - trigger_str = trigger_str - trigger_command = trigger_str.split(" ")[0] + assumed_trigger_type = first_trigger_type + assumed_trigger_prefix = first_trigger_prefix # Still under the assumption that the command is most likely the same type as first command - command_types.remove(trigger_type) - command_types.insert(0, trigger_type) + command_types.remove(assumed_trigger_type) + command_types.insert(0, assumed_trigger_type) found = [] for command_type in command_types: @@ -85,6 +83,15 @@ def get_commands(bot, trigger): if len(found): 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({ "trigger_type": trigger_type,