test
This commit is contained in:
parent
f383f85811
commit
54d165ae4e
@ -34,7 +34,10 @@ def prerun(rulematch=False):
|
||||
|
||||
# This is where we rebuild trigger
|
||||
# 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
|
||||
# we are going to validate the command
|
||||
|
||||
@ -1,24 +1,23 @@
|
||||
|
||||
import sopel
|
||||
|
||||
from sopel_SpiceBot_Core_1 import sb
|
||||
|
||||
|
||||
def validate_trigger(trigger, trigger_dict):
|
||||
redispatch = False
|
||||
|
||||
print(trigger.group(0))
|
||||
print(trigger.group(1))
|
||||
print(trigger.args)
|
||||
|
||||
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":
|
||||
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":
|
||||
trigger._pretrigger = sb.commands.generate_pretrigger_action_command(trigger_dict)
|
||||
pretrigger = sb.commands.generate_pretrigger_action_command(trigger_dict)
|
||||
|
||||
print(trigger.group(0))
|
||||
print(trigger.group(1))
|
||||
print(trigger.args)
|
||||
matches = sopel.rules.get_triggered_rules(sopel, pretrigger)
|
||||
print(matches)
|
||||
|
||||
return trigger, redispatch
|
||||
return trigger
|
||||
|
||||
Loading…
Reference in New Issue
Block a user