This commit is contained in:
deathbybandaid 2022-05-05 14:29:46 -04:00
parent a0edd673a8
commit 7e308082e3

View File

@ -83,37 +83,31 @@ def rebuild_pipes(commands, trigger_str_add=None):
if not trigger_str_add: if not trigger_str_add:
repipe_trigger_dict = commands[0] repipe_trigger_dict = commands[0]
index_value = 1
else: else:
repipe_trigger_dict = commands[1] repipe_trigger_dict = commands[1]
repipe_trigger_dict["trigger_str"] += " %s" % trigger_str_add
index_value = 2
trigger_number = 1 for trigger_dict in commands[index_value:]:
for trigger_dict in commands[1:]:
trigger_str = trigger_dict["trigger_str"]
splitkey_str = " %s " % sb.commands.pipe_split_key
if trigger_str_add and trigger_number == 1:
trigger_str += " %s" % trigger_str_add
splitkey_str = ""
if trigger_dict["trigger_type"] == "command": if trigger_dict["trigger_type"] == "command":
repipe_trigger_dict["trigger_str"] += "%s%s%s %s" % (splitkey_str, 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_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" % (splitkey_str, 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_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" % (splitkey_str, 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_str) trigger_dict["trigger_str"])
trigger_number += 1
return repipe_trigger_dict return repipe_trigger_dict