test
This commit is contained in:
parent
c2d26a77b3
commit
6148bf9f0d
@ -1,10 +1,12 @@
|
||||
import functools
|
||||
|
||||
from .comrun import comrun_create
|
||||
from .dispatch_multi import dispatch_multi
|
||||
from .pipe_split import pipe_split
|
||||
from .command_args import command_args
|
||||
from .rule_match import rule_match
|
||||
from sopel_SpiceBot_Core_1 import sb
|
||||
|
||||
# from .comrun import comrun_create
|
||||
# from .dispatch_multi import dispatch_multi
|
||||
# from .pipe_split import pipe_split
|
||||
# from .command_args import command_args
|
||||
# from .rule_match import rule_match
|
||||
|
||||
|
||||
def prerun(rulematch=False):
|
||||
@ -12,18 +14,26 @@ def prerun(rulematch=False):
|
||||
|
||||
def actual_decorator(function):
|
||||
|
||||
@comrun_create(rulematch)
|
||||
@dispatch_multi()
|
||||
@pipe_split()
|
||||
@command_args()
|
||||
@rule_match()
|
||||
# @comrun_create(rulematch)
|
||||
# @dispatch_multi()
|
||||
# @pipe_split()
|
||||
# @command_args()
|
||||
# @rule_match()
|
||||
@functools.wraps(function)
|
||||
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)
|
||||
|
||||
if not comrun.piped:
|
||||
bot.say(comrun.say)
|
||||
# if not comrun.piped:
|
||||
# bot.say(comrun.say)
|
||||
|
||||
return internal_prerun
|
||||
return actual_decorator
|
||||
|
||||
Loading…
Reference in New Issue
Block a user