test
This commit is contained in:
parent
c2d26a77b3
commit
6148bf9f0d
@ -1,10 +1,12 @@
|
|||||||
import functools
|
import functools
|
||||||
|
|
||||||
from .comrun import comrun_create
|
from sopel_SpiceBot_Core_1 import sb
|
||||||
from .dispatch_multi import dispatch_multi
|
|
||||||
from .pipe_split import pipe_split
|
# from .comrun import comrun_create
|
||||||
from .command_args import command_args
|
# from .dispatch_multi import dispatch_multi
|
||||||
from .rule_match import rule_match
|
# from .pipe_split import pipe_split
|
||||||
|
# from .command_args import command_args
|
||||||
|
# from .rule_match import rule_match
|
||||||
|
|
||||||
|
|
||||||
def prerun(rulematch=False):
|
def prerun(rulematch=False):
|
||||||
@ -12,18 +14,26 @@ def prerun(rulematch=False):
|
|||||||
|
|
||||||
def actual_decorator(function):
|
def actual_decorator(function):
|
||||||
|
|
||||||
@comrun_create(rulematch)
|
# @comrun_create(rulematch)
|
||||||
@dispatch_multi()
|
# @dispatch_multi()
|
||||||
@pipe_split()
|
# @pipe_split()
|
||||||
@command_args()
|
# @command_args()
|
||||||
@rule_match()
|
# @rule_match()
|
||||||
@functools.wraps(function)
|
@functools.wraps(function)
|
||||||
def internal_prerun(bot, trigger, comrun, *args, **kwargs):
|
def internal_prerun(bot, trigger, comrun, *args, **kwargs):
|
||||||
|
|
||||||
|
# Get list of trigger command(s)
|
||||||
|
commands = sb.commands.get_commands_split(trigger, "&&")
|
||||||
|
|
||||||
|
if len(commands) > 1:
|
||||||
|
for trigger_dict in commands[1:]:
|
||||||
|
sb.commands.dispatch(trigger_dict)
|
||||||
|
return
|
||||||
|
|
||||||
function(bot, trigger, comrun, *args, **kwargs)
|
function(bot, trigger, comrun, *args, **kwargs)
|
||||||
|
|
||||||
if not comrun.piped:
|
# if not comrun.piped:
|
||||||
bot.say(comrun.say)
|
# bot.say(comrun.say)
|
||||||
|
|
||||||
return internal_prerun
|
return internal_prerun
|
||||||
return actual_decorator
|
return actual_decorator
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user