This commit is contained in:
deathbybandaid 2022-02-23 12:23:10 -05:00
parent f383f85811
commit 54d165ae4e
2 changed files with 11 additions and 9 deletions

View File

@ -34,7 +34,10 @@ def prerun(rulematch=False):
# This is where we rebuild trigger # This is where we rebuild trigger
# we validate a few things here # we validate a few things here
trigger, redispatch = validate_trigger(trigger, commands[0]) trigger = validate_trigger(trigger, commands[0])
# Get list of trigger command(s) by | split
commands = sb.commands.get_commands_split(trigger, "|")
# Now we have a single valid command # Now we have a single valid command
# we are going to validate the command # we are going to validate the command

View File

@ -1,24 +1,23 @@
import sopel
from sopel_SpiceBot_Core_1 import sb from sopel_SpiceBot_Core_1 import sb
def validate_trigger(trigger, trigger_dict): def validate_trigger(trigger, trigger_dict):
redispatch = False
print(trigger.group(0)) print(trigger.group(0))
print(trigger.group(1)) print(trigger.group(1))
print(trigger.args) print(trigger.args)
if trigger_dict["trigger_type"] == "command": if trigger_dict["trigger_type"] == "command":
trigger._pretrigger = sb.commands.generate_pretrigger_command(trigger_dict) pretrigger = sb.commands.generate_pretrigger_command(trigger_dict)
elif trigger_dict["trigger_type"] == "nickname_command": elif trigger_dict["trigger_type"] == "nickname_command":
trigger._pretrigger = sb.commands.generate_pretrigger_nickname_command(trigger_dict) pretrigger = sb.commands.generate_pretrigger_nickname_command(trigger_dict)
elif trigger_dict["trigger_type"] == "action_command": elif trigger_dict["trigger_type"] == "action_command":
trigger._pretrigger = sb.commands.generate_pretrigger_action_command(trigger_dict) pretrigger = sb.commands.generate_pretrigger_action_command(trigger_dict)
print(trigger.group(0)) matches = sopel.rules.get_triggered_rules(sopel, pretrigger)
print(trigger.group(1)) print(matches)
print(trigger.args)
return trigger, redispatch return trigger