From 7758627452c35b2c0219123ed204145eab9dddc9 Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Tue, 22 Feb 2022 12:56:29 -0500 Subject: [PATCH] test --- sopel_SpiceBot_Core_Prerun/__init__.py | 3 --- sopel_SpiceBot_Core_Prerun/command_args.py | 3 --- sopel_SpiceBot_Core_Prerun/comrun.py | 9 ++++++++- sopel_SpiceBot_Core_Prerun/dispatch_multi.py | 11 ++++------- sopel_SpiceBot_Core_Prerun/pipe_split.py | 4 ---- 5 files changed, 12 insertions(+), 18 deletions(-) diff --git a/sopel_SpiceBot_Core_Prerun/__init__.py b/sopel_SpiceBot_Core_Prerun/__init__.py index 6efd535..7806b9d 100644 --- a/sopel_SpiceBot_Core_Prerun/__init__.py +++ b/sopel_SpiceBot_Core_Prerun/__init__.py @@ -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) diff --git a/sopel_SpiceBot_Core_Prerun/command_args.py b/sopel_SpiceBot_Core_Prerun/command_args.py index 1c13401..cf1258a 100644 --- a/sopel_SpiceBot_Core_Prerun/command_args.py +++ b/sopel_SpiceBot_Core_Prerun/command_args.py @@ -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 diff --git a/sopel_SpiceBot_Core_Prerun/comrun.py b/sopel_SpiceBot_Core_Prerun/comrun.py index 019c4f9..6f5d03e 100644 --- a/sopel_SpiceBot_Core_Prerun/comrun.py +++ b/sopel_SpiceBot_Core_Prerun/comrun.py @@ -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(): diff --git a/sopel_SpiceBot_Core_Prerun/dispatch_multi.py b/sopel_SpiceBot_Core_Prerun/dispatch_multi.py index c00075b..53a1e64 100644 --- a/sopel_SpiceBot_Core_Prerun/dispatch_multi.py +++ b/sopel_SpiceBot_Core_Prerun/dispatch_multi.py @@ -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 diff --git a/sopel_SpiceBot_Core_Prerun/pipe_split.py b/sopel_SpiceBot_Core_Prerun/pipe_split.py index cd0b42f..af75ad9 100644 --- a/sopel_SpiceBot_Core_Prerun/pipe_split.py +++ b/sopel_SpiceBot_Core_Prerun/pipe_split.py @@ -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