From 1069f87333d45c272820683c0c491df82597002b Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Thu, 5 May 2022 12:36:41 -0400 Subject: [PATCH] test --- sopel_SpiceBot_Core_Prerun/__init__.py | 10 ++++++++-- sopel_SpiceBot_Runtime_Commands/__init__.py | 5 ++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/sopel_SpiceBot_Core_Prerun/__init__.py b/sopel_SpiceBot_Core_Prerun/__init__.py index 20c4a6e..e01e787 100644 --- a/sopel_SpiceBot_Core_Prerun/__init__.py +++ b/sopel_SpiceBot_Core_Prerun/__init__.py @@ -57,8 +57,10 @@ def prerun(): # Run function function(bot, trigger, comrun, *args, **kwargs) - # if not comrun.is_pipe_command: - # bot.say(comrun.say) + # If not piping the replies into pipe, let'sprint to IRC now + if not comrun.is_pipe_command: + for say_message in comrun._say: + bot.say(say_message) return internal_prerun return actual_decorator @@ -104,6 +106,10 @@ class ComRun(): self.bot = bot self.trigger = trigger self.function = function + self._say = [] + + def say(self, message): + self._say.append(message) @property def is_real_command(self): diff --git a/sopel_SpiceBot_Runtime_Commands/__init__.py b/sopel_SpiceBot_Runtime_Commands/__init__.py index e6c04bc..0a1a93b 100644 --- a/sopel_SpiceBot_Runtime_Commands/__init__.py +++ b/sopel_SpiceBot_Runtime_Commands/__init__.py @@ -8,14 +8,13 @@ from sopel_SpiceBot_Core_Prerun import prerun @prerun() @plugin.command('testoa') def commands_output_a(bot, trigger, comrun): - bot.say("%s" % trigger.raw) - bot.say("%s" % comrun.trigger.raw) + comrun.say("this is test a") @prerun() @plugin.command('testob') def commands_output_b(bot, trigger, comrun): - bot.say("%s" % trigger.raw) + comrun.say("this is test b") @prerun()