test
This commit is contained in:
parent
e4ccb7d4cb
commit
ab17ba2c4e
@ -37,7 +37,6 @@ def prerun():
|
||||
if comrun.has_command_been_sanitized:
|
||||
if comrun.is_pipe_command:
|
||||
trigger_dict = rebuild_pipes(comrun.commands)
|
||||
print(trigger_dict)
|
||||
else:
|
||||
trigger_dict = comrun.command
|
||||
sb.commands.dispatch(trigger_dict)
|
||||
@ -53,7 +52,7 @@ def prerun():
|
||||
return
|
||||
|
||||
# At this point, we update the re.match for trigger
|
||||
comrun.trigger = rebuild_trigger(comrun, function)
|
||||
trigger = rebuild_trigger(comrun, function)
|
||||
|
||||
# Run function
|
||||
function(bot, trigger, comrun, *args, **kwargs)
|
||||
@ -105,6 +104,7 @@ class ComRun():
|
||||
|
||||
def __init__(self, bot, trigger, function):
|
||||
self.bot = bot
|
||||
self.orig_trigger = trigger
|
||||
self.trigger = trigger
|
||||
self.function = function
|
||||
self._say = []
|
||||
@ -126,36 +126,36 @@ class ComRun():
|
||||
|
||||
@property
|
||||
def is_multi_command(self):
|
||||
if sb.commands.multi_split_key in self.trigger.args[1]:
|
||||
if sb.commands.multi_split_key in self.orig_trigger.args[1]:
|
||||
return True
|
||||
return False
|
||||
|
||||
@property
|
||||
def is_pipe_command(self):
|
||||
if sb.commands.pipe_split_key in self.trigger.args[1]:
|
||||
if sb.commands.pipe_split_key in self.orig_trigger.args[1]:
|
||||
return True
|
||||
return False
|
||||
|
||||
@property
|
||||
def multi_split_count(self):
|
||||
if self.is_multi_command:
|
||||
return len([x.strip() for x in self.trigger.args[1].split(sb.commands.multi_split_key)])
|
||||
return len([x.strip() for x in self.orig_trigger.args[1].split(sb.commands.multi_split_key)])
|
||||
return "N/A"
|
||||
|
||||
@property
|
||||
def pipe_split_count(self):
|
||||
if self.is_pipe_command:
|
||||
return len([x.strip() for x in self.trigger.args[1].split(sb.commands.pipe_split_key)])
|
||||
return len([x.strip() for x in self.orig_trigger.args[1].split(sb.commands.pipe_split_key)])
|
||||
return "N/A"
|
||||
|
||||
@property
|
||||
def commands(self):
|
||||
if self.is_multi_command:
|
||||
return sb.commands.get_commands_split(self.trigger, sb.commands.multi_split_key)
|
||||
return sb.commands.get_commands_split(self.orig_trigger, sb.commands.multi_split_key)
|
||||
elif self.is_pipe_command:
|
||||
return sb.commands.get_commands_split(self.trigger, sb.commands.pipe_split_key)
|
||||
return sb.commands.get_commands_split(self.orig_trigger, sb.commands.pipe_split_key)
|
||||
else:
|
||||
return sb.commands.get_commands_nosplit(self.trigger)
|
||||
return sb.commands.get_commands_nosplit(self.orig_trigger)
|
||||
|
||||
@property
|
||||
def command(self):
|
||||
@ -163,7 +163,7 @@ class ComRun():
|
||||
|
||||
@property
|
||||
def has_command_been_sanitized(self):
|
||||
trigger_command = sb.commands.get_command_from_trigger(self.trigger)
|
||||
trigger_command = sb.commands.get_command_from_trigger(self.orig_trigger)
|
||||
if trigger_command != self.command["trigger_command"]:
|
||||
return True
|
||||
return False
|
||||
|
||||
Loading…
Reference in New Issue
Block a user