From 79b75e0521a8597a17f9d606daf23e62bd3fe2a6 Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Thu, 24 Feb 2022 10:34:41 -0500 Subject: [PATCH] test --- sopel_SpiceBot_Core_Prerun/__init__.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/sopel_SpiceBot_Core_Prerun/__init__.py b/sopel_SpiceBot_Core_Prerun/__init__.py index f619dcb..8b9a9d1 100644 --- a/sopel_SpiceBot_Core_Prerun/__init__.py +++ b/sopel_SpiceBot_Core_Prerun/__init__.py @@ -16,16 +16,20 @@ def prerun(): # Since there was more than one command, # we are going to redispatch commands # This will give sopel the appearance of recieving individual commands - print(comrun.commands) - if len(comrun.commands) > 1: - if comrun.is_rulematch: - if not comrun.is_real_command: + if comrun.is_multi_command: + if len(comrun.commands) > 1: + + # Handling for first command in series + if comrun.is_rulematch: + if not comrun.is_real_command: + sb.commands.dispatch(comrun.command) + else: sb.commands.dispatch(comrun.command) - else: - sb.commands.dispatch(comrun.command) - for trigger_dict in comrun.commands[1:]: - sb.commands.dispatch(trigger_dict) - return + + # All other commands + for trigger_dict in comrun.commands[1:]: + sb.commands.dispatch(trigger_dict) + return # If the original trigger is not the same after && or | split # so we will now redispatch to help get the correct function passed