test
This commit is contained in:
parent
120372c8cf
commit
e8fe785228
@ -13,16 +13,32 @@ def rule_match():
|
|||||||
|
|
||||||
returnfunc = True
|
returnfunc = True
|
||||||
|
|
||||||
|
# Applies to non-command rule matching
|
||||||
if comrun.rulematch:
|
if comrun.rulematch:
|
||||||
|
|
||||||
|
first_full_trigger_str = trigger.args[1]
|
||||||
|
|
||||||
if comrun.trigger_dict["trigger_type"] == "command":
|
if comrun.trigger_dict["trigger_type"] == "command":
|
||||||
commands_list = sb.commands.valid_sopel_commands
|
commands_list = sb.commands.valid_sopel_commands
|
||||||
|
first_trigger_noprefix = first_full_trigger_str[1:]
|
||||||
|
first_trigger_command = first_trigger_noprefix.split(" ")[0]
|
||||||
|
|
||||||
elif comrun.trigger_dict["trigger_type"] == "nickname_command":
|
elif comrun.trigger_dict["trigger_type"] == "nickname_command":
|
||||||
commands_list = sb.commands.valid_sopel_nickname_commands
|
commands_list = sb.commands.valid_sopel_nickname_commands
|
||||||
|
first_trigger_noprefix = " ".join(first_full_trigger_str.split(" ")[1:])
|
||||||
|
first_trigger_command = first_trigger_noprefix.split(" ")[0]
|
||||||
|
|
||||||
elif comrun.trigger_dict["trigger_type"] == "action_command":
|
elif comrun.trigger_dict["trigger_type"] == "action_command":
|
||||||
commands_list = sb.commands.valid_sopel_action_commands
|
commands_list = sb.commands.valid_sopel_action_commands
|
||||||
|
first_trigger_noprefix = first_full_trigger_str
|
||||||
|
first_trigger_command = first_trigger_noprefix.split(" ")[0]
|
||||||
|
|
||||||
|
# Ignore if the command was caught
|
||||||
|
# handle if the command was triggered with && or | too close to the command
|
||||||
if comrun.trigger_dict["trigger_command"] in commands_list:
|
if comrun.trigger_dict["trigger_command"] in commands_list:
|
||||||
|
if first_trigger_command != comrun.trigger_dict["trigger_command"]:
|
||||||
|
sb.commands.dispatch(comrun.trigger_dict)
|
||||||
|
else:
|
||||||
returnfunc = False
|
returnfunc = False
|
||||||
|
|
||||||
if returnfunc:
|
if returnfunc:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user