This commit is contained in:
deathbybandaid 2022-02-23 14:24:30 -05:00
parent 93034aa041
commit 384854f52b

View File

@ -1,20 +1,11 @@
def rebuild_pipes(pipes):
first_pipe = pipes[0]
del pipes[0]
def rebuild_pipes(commands):
repipe_trigger_dict = {
"trigger_type": first_pipe["trigger_type"],
"trigger_prefix": first_pipe["trigger_prefix"],
"trigger_str": first_pipe["trigger_str"],
"trigger_command": first_pipe["trigger_command"],
"trigger_hostmask": first_pipe["trigger_hostmask"],
"trigger_sender": first_pipe["trigger_sender"]
}
repipe_trigger_dict = commands[0]
repipe_trigger_dict["trigger_str"] += " | "
for trigger_dict in pipes:
for trigger_dict in commands[1:]:
print(trigger_dict)
if trigger_dict["trigger_type"] == "command":
repipe_trigger_dict["trigger_str"] += " | %s%s %s" % (trigger_dict["trigger_prefix"], trigger_dict["trigger_command"], trigger_dict["trigger_str"])