This commit is contained in:
deathbybandaid 2022-02-22 12:56:29 -05:00
parent 2b7071a5e0
commit 7758627452
5 changed files with 12 additions and 18 deletions

View File

@ -18,9 +18,6 @@ def prerun():
@functools.wraps(function) @functools.wraps(function)
def internal_prerun(bot, trigger, comrun, *args, **kwargs): def internal_prerun(bot, trigger, comrun, *args, **kwargs):
if not comrun.continuerun:
return
function(bot, trigger, comrun, *args, **kwargs) function(bot, trigger, comrun, *args, **kwargs)
bot.say(comrun.say) bot.say(comrun.say)

View File

@ -9,9 +9,6 @@ def command_args():
@functools.wraps(function) @functools.wraps(function)
def internal_command_args(bot, trigger, comrun, *args, **kwargs): def internal_command_args(bot, trigger, comrun, *args, **kwargs):
if not comrun.continuerun:
return
function(bot, trigger, comrun, *args, **kwargs) function(bot, trigger, comrun, *args, **kwargs)
return internal_command_args return internal_command_args

View File

@ -4,8 +4,15 @@ import functools
class ComRun(): class ComRun():
def __init__(self): def __init__(self):
self.continuerun = True
self.say = "" self.say = ""
self.trigger_dict = {
"trigger_type": None,
"trigger_prefix": None,
"trigger_str": None,
"trigger_command": None,
"trigger_hostmask": None,
"trigger_sender": None
}
def comrun_create(): def comrun_create():

View File

@ -16,15 +16,12 @@ def dispatch_multi():
# Get list of trigger command(s) # Get list of trigger command(s)
commands = sb.commands.get_commands_split(trigger, "&&") commands = sb.commands.get_commands_split(trigger, "&&")
if len(commands) == 1:
comrun.trigger_dict = commands[0] comrun.trigger_dict = commands[0]
del commands[0]
function(bot, trigger, comrun, *args, **kwargs) function(bot, trigger, comrun, *args, **kwargs)
else:
if len(commands):
for trigger_dict in commands: for trigger_dict in commands:
sb.commands.dispatch(trigger_dict) sb.commands.dispatch(trigger_dict)
comrun.continuerun = False
return internal_dispatch_multi return internal_dispatch_multi
return actual_decorator return actual_decorator

View File

@ -14,9 +14,6 @@ def pipe_split():
@functools.wraps(function) @functools.wraps(function)
def internal_pipe_split(bot, trigger, comrun, *args, **kwargs): def internal_pipe_split(bot, trigger, comrun, *args, **kwargs):
if not comrun.continuerun:
return
# Get list of trigger command(s) # Get list of trigger command(s)
pipes = sb.commands.get_commands_split(trigger, "|") pipes = sb.commands.get_commands_split(trigger, "|")
@ -28,7 +25,6 @@ def pipe_split():
if len(pipes): if len(pipes):
repipe_trigger_dict = reassemble_pipes(pipes, comrun.say) repipe_trigger_dict = reassemble_pipes(pipes, comrun.say)
sb.commands.dispatch(repipe_trigger_dict) sb.commands.dispatch(repipe_trigger_dict)
comrun.continuerun = False
return internal_pipe_split return internal_pipe_split
return actual_decorator return actual_decorator