From 0945181dbe18070b36d2b914cccaded6c25aca16 Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Tue, 22 Feb 2022 12:49:33 -0500 Subject: [PATCH] test --- sopel_SpiceBot_Core_Prerun/comrun.py | 1 + sopel_SpiceBot_Core_Prerun/dispatch_multi.py | 10 ++++++---- sopel_SpiceBot_Core_Prerun/pipe_split.py | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/sopel_SpiceBot_Core_Prerun/comrun.py b/sopel_SpiceBot_Core_Prerun/comrun.py index bac2c8c..019c4f9 100644 --- a/sopel_SpiceBot_Core_Prerun/comrun.py +++ b/sopel_SpiceBot_Core_Prerun/comrun.py @@ -5,6 +5,7 @@ class ComRun(): def __init__(self): self.continuerun = True + self.say = "" def comrun_create(): diff --git a/sopel_SpiceBot_Core_Prerun/dispatch_multi.py b/sopel_SpiceBot_Core_Prerun/dispatch_multi.py index ed50ed2..c00075b 100644 --- a/sopel_SpiceBot_Core_Prerun/dispatch_multi.py +++ b/sopel_SpiceBot_Core_Prerun/dispatch_multi.py @@ -16,10 +16,12 @@ def dispatch_multi(): # Get list of trigger command(s) commands = sb.commands.get_commands_split(trigger, "&&") - if len(commands) == 1: - function(bot, trigger, comrun, *args, **kwargs) - comrun.trigger_dict = commands[0] - else: + comrun.trigger_dict = commands[0] + del commands[0] + + function(bot, trigger, comrun, *args, **kwargs) + + if len(commands): for trigger_dict in commands: sb.commands.dispatch(trigger_dict) comrun.continuerun = False diff --git a/sopel_SpiceBot_Core_Prerun/pipe_split.py b/sopel_SpiceBot_Core_Prerun/pipe_split.py index 42e3476..0392d9d 100644 --- a/sopel_SpiceBot_Core_Prerun/pipe_split.py +++ b/sopel_SpiceBot_Core_Prerun/pipe_split.py @@ -25,7 +25,7 @@ def pipe_split(): function(bot, trigger, comrun, *args, **kwargs) - if len(pipes) > 1: + if len(pipes): repipe_trigger_dict = reassemble_pipes(pipes, comrun.say) sb.commands.dispatch(repipe_trigger_dict) return