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