This commit is contained in:
deathbybandaid 2022-02-22 10:19:26 -05:00
parent c2148fa7e3
commit 6170d930fc
2 changed files with 9 additions and 2 deletions

View File

@ -3,6 +3,11 @@ import functools
from sopel_SpiceBot_Core_1 import sb from sopel_SpiceBot_Core_1 import sb
class ComRun():
def __init__(self):
pass
def dispatch(): def dispatch():
""" """
This splits the given command by `&&` and re-dispatches it internally to the bot. This splits the given command by `&&` and re-dispatches it internally to the bot.
@ -57,10 +62,12 @@ def prerun():
def internal_prerun(bot, trigger, *args, **kwargs): def internal_prerun(bot, trigger, *args, **kwargs):
bot.say("prerun") bot.say("prerun")
comrun = "test comrun" comrun = ComRun()
function(bot, trigger, comrun, *args, **kwargs) function(bot, trigger, comrun, *args, **kwargs)
print(comrun.test)
return internal_prerun return internal_prerun
return actual_decorator return actual_decorator

View File

@ -11,7 +11,7 @@ from sopel_SpiceBot_Core_Prerun import prerun
@plugin.command('test', "testnew") @plugin.command('test', "testnew")
def commands_test(bot, trigger, comrun): def commands_test(bot, trigger, comrun):
bot.say("%s" % trigger.raw) bot.say("%s" % trigger.raw)
bot.say(comrun) comrun.test = "this is a real test"
@prerun() @prerun()