This commit is contained in:
deathbybandaid 2022-05-05 14:45:59 -04:00
parent 0166950b7a
commit e9df0721a2
2 changed files with 21 additions and 17 deletions

View File

@ -149,7 +149,7 @@ class Commands():
elif trigger_dict["trigger_type"] == "action_command": elif trigger_dict["trigger_type"] == "action_command":
commands_list = self.valid_sopel_action_commands commands_list = self.valid_sopel_action_commands
return (trigger_dict["trigger_command"] in commands_list) return (trigger_dict["trigger_command"].lower() in [x.lower() for x in commands_list])
def is_catchall(self, function, command_type): def is_catchall(self, function, command_type):
"""Determine if function could be called with a rule match""" """Determine if function could be called with a rule match"""

View File

@ -89,25 +89,29 @@ def rebuild_pipes(commands, trigger_str_add=None):
repipe_trigger_dict["trigger_str"] += " %s" % trigger_str_add repipe_trigger_dict["trigger_str"] += " %s" % trigger_str_add
next_index_value = 2 next_index_value = 2
for trigger_dict in commands[next_index_value:]: try:
for trigger_dict in commands[next_index_value:]:
if trigger_dict["trigger_type"] == "command": if trigger_dict["trigger_type"] == "command":
repipe_trigger_dict["trigger_str"] += " %s %s%s %s" % (sb.commands.pipe_split_key, repipe_trigger_dict["trigger_str"] += " %s %s%s %s" % (sb.commands.pipe_split_key,
trigger_dict["trigger_prefix"], trigger_dict["trigger_prefix"],
trigger_dict["trigger_command"], trigger_dict["trigger_command"],
trigger_dict["trigger_str"]) trigger_dict["trigger_str"])
elif trigger_dict["trigger_type"] == "nickname_command": elif trigger_dict["trigger_type"] == "nickname_command":
repipe_trigger_dict["trigger_str"] += " %s %s %s %s" % (sb.commands.pipe_split_key, repipe_trigger_dict["trigger_str"] += " %s %s %s %s" % (sb.commands.pipe_split_key,
trigger_dict["trigger_prefix"], trigger_dict["trigger_prefix"],
trigger_dict["trigger_command"], trigger_dict["trigger_command"],
trigger_dict["trigger_str"]) trigger_dict["trigger_str"])
elif trigger_dict["trigger_type"] == "action_command": elif trigger_dict["trigger_type"] == "action_command":
repipe_trigger_dict["trigger_str"] += " %s %s %s %s" % (sb.commands.pipe_split_key, repipe_trigger_dict["trigger_str"] += " %s %s %s %s" % (sb.commands.pipe_split_key,
"/me", "/me",
trigger_dict["trigger_command"], trigger_dict["trigger_command"],
trigger_dict["trigger_str"]) trigger_dict["trigger_str"])
except IndexError:
repipe_trigger_dict = repipe_trigger_dict
return repipe_trigger_dict return repipe_trigger_dict