SpiceBot/sopel_SpiceBot_Core_Prerun/validate_trigger.py
deathbybandaid 867fae3af8 test
2022-02-23 12:03:14 -05:00

21 lines
661 B
Python

from sopel_SpiceBot_Core_1 import sb
def validate_trigger(trigger, trigger_dict):
redispatch = False
if trigger_dict["trigger_type"] == "command":
trigger._pretrigger = sb.commands.generate_pretrigger_command(trigger_dict)
elif trigger_dict["trigger_type"] == "nickname_command":
trigger._pretrigger = sb.commands.generate_pretrigger_nickname_command(trigger_dict)
elif trigger_dict["trigger_type"] == "action_command":
trigger._pretrigger = sb.commands.generate_pretrigger_action_command(trigger_dict)
print(trigger.group(0))
print(trigger.group(1))
print(trigger.args)
return trigger, redispatch