This commit is contained in:
deathbybandaid 2022-02-23 13:48:51 -05:00
parent bd7649aaba
commit 56abecef95
2 changed files with 13 additions and 1 deletions

View File

@ -103,6 +103,18 @@ class Commands():
) )
return pretrigger return pretrigger
def get_command_from_trigger(self, trigger):
commstring = trigger.args[1]
if commstring.startswith(tuple(self.config.prefix_list)):
command = commstring[1:].split(" ")[0]
elif commstring.startswith(self.bot.nick):
command = " ".join(commstring.split(" ")[1:]).split(" ")[0]
elif "intent" in trigger.tags and trigger.tags["intent"] == "ACTION":
command = commstring.split(" ")[0]
else:
command = ""
return command
def get_commands_split(self, trigger, splitkey): def get_commands_split(self, trigger, splitkey):
commands = [] commands = []

View File

@ -31,7 +31,7 @@ def prerun(rulematch=False):
for trigger_dict in commands: for trigger_dict in commands:
sb.commands.dispatch(trigger_dict) sb.commands.dispatch(trigger_dict)
return return
elif trigger.args[1][1:].split("&&")[0] != commands[0]["trigger_command"]: elif sb.commands.get_command_from_trigger(trigger) != commands[0]["trigger_command"]:
print(trigger.args[1].split("&&")[0]) print(trigger.args[1].split("&&")[0])
print(commands[0]["trigger_command"]) print(commands[0]["trigger_command"])