diff --git a/sopel_SpiceBot_Core_Prerun/__init__.py b/sopel_SpiceBot_Core_Prerun/__init__.py index 053a94a..7b717ea 100644 --- a/sopel_SpiceBot_Core_Prerun/__init__.py +++ b/sopel_SpiceBot_Core_Prerun/__init__.py @@ -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