This commit is contained in:
deathbybandaid 2022-05-05 12:36:41 -04:00
parent c5bc9d0839
commit 1069f87333
2 changed files with 10 additions and 5 deletions

View File

@ -57,8 +57,10 @@ def prerun():
# Run function # Run function
function(bot, trigger, comrun, *args, **kwargs) function(bot, trigger, comrun, *args, **kwargs)
# if not comrun.is_pipe_command: # If not piping the replies into pipe, let'sprint to IRC now
# bot.say(comrun.say) if not comrun.is_pipe_command:
for say_message in comrun._say:
bot.say(say_message)
return internal_prerun return internal_prerun
return actual_decorator return actual_decorator
@ -104,6 +106,10 @@ class ComRun():
self.bot = bot self.bot = bot
self.trigger = trigger self.trigger = trigger
self.function = function self.function = function
self._say = []
def say(self, message):
self._say.append(message)
@property @property
def is_real_command(self): def is_real_command(self):

View File

@ -8,14 +8,13 @@ from sopel_SpiceBot_Core_Prerun import prerun
@prerun() @prerun()
@plugin.command('testoa') @plugin.command('testoa')
def commands_output_a(bot, trigger, comrun): def commands_output_a(bot, trigger, comrun):
bot.say("%s" % trigger.raw) comrun.say("this is test a")
bot.say("%s" % comrun.trigger.raw)
@prerun() @prerun()
@plugin.command('testob') @plugin.command('testob')
def commands_output_b(bot, trigger, comrun): def commands_output_b(bot, trigger, comrun):
bot.say("%s" % trigger.raw) comrun.say("this is test b")
@prerun() @prerun()