test
This commit is contained in:
parent
2b7071a5e0
commit
7758627452
@ -18,9 +18,6 @@ def prerun():
|
||||
@functools.wraps(function)
|
||||
def internal_prerun(bot, trigger, comrun, *args, **kwargs):
|
||||
|
||||
if not comrun.continuerun:
|
||||
return
|
||||
|
||||
function(bot, trigger, comrun, *args, **kwargs)
|
||||
|
||||
bot.say(comrun.say)
|
||||
|
||||
@ -9,9 +9,6 @@ def command_args():
|
||||
@functools.wraps(function)
|
||||
def internal_command_args(bot, trigger, comrun, *args, **kwargs):
|
||||
|
||||
if not comrun.continuerun:
|
||||
return
|
||||
|
||||
function(bot, trigger, comrun, *args, **kwargs)
|
||||
|
||||
return internal_command_args
|
||||
|
||||
@ -4,8 +4,15 @@ import functools
|
||||
class ComRun():
|
||||
|
||||
def __init__(self):
|
||||
self.continuerun = True
|
||||
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():
|
||||
|
||||
@ -16,15 +16,12 @@ def dispatch_multi():
|
||||
# Get list of trigger command(s)
|
||||
commands = sb.commands.get_commands_split(trigger, "&&")
|
||||
|
||||
comrun.trigger_dict = commands[0]
|
||||
del commands[0]
|
||||
|
||||
function(bot, trigger, comrun, *args, **kwargs)
|
||||
|
||||
if len(commands):
|
||||
if len(commands) == 1:
|
||||
comrun.trigger_dict = commands[0]
|
||||
function(bot, trigger, comrun, *args, **kwargs)
|
||||
else:
|
||||
for trigger_dict in commands:
|
||||
sb.commands.dispatch(trigger_dict)
|
||||
comrun.continuerun = False
|
||||
|
||||
return internal_dispatch_multi
|
||||
return actual_decorator
|
||||
|
||||
@ -14,9 +14,6 @@ def pipe_split():
|
||||
@functools.wraps(function)
|
||||
def internal_pipe_split(bot, trigger, comrun, *args, **kwargs):
|
||||
|
||||
if not comrun.continuerun:
|
||||
return
|
||||
|
||||
# Get list of trigger command(s)
|
||||
pipes = sb.commands.get_commands_split(trigger, "|")
|
||||
|
||||
@ -28,7 +25,6 @@ def pipe_split():
|
||||
if len(pipes):
|
||||
repipe_trigger_dict = reassemble_pipes(pipes, comrun.say)
|
||||
sb.commands.dispatch(repipe_trigger_dict)
|
||||
comrun.continuerun = False
|
||||
|
||||
return internal_pipe_split
|
||||
return actual_decorator
|
||||
|
||||
Loading…
Reference in New Issue
Block a user