SpiceBot/sopel_SpiceBot_Core_Prerun/pipe_split.py
deathbybandaid aa46faac7e test
2022-02-23 14:26:24 -05:00

18 lines
828 B
Python

def rebuild_pipes(commands):
print(commands)
repipe_trigger_dict = commands[0]
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"])
elif trigger_dict["trigger_type"] == "nickname_command":
repipe_trigger_dict["trigger_str"] += " | %s %s %s" % (trigger_dict["trigger_prefix"], trigger_dict["trigger_command"], trigger_dict["trigger_str"])
elif trigger_dict["trigger_type"] == "action_command":
repipe_trigger_dict["trigger_str"] += " | %s %s %s" % ("/me", trigger_dict["trigger_command"], trigger_dict["trigger_str"])
return repipe_trigger_dict