This commit is contained in:
deathbybandaid 2022-02-10 10:26:29 -05:00
parent 13efd210b3
commit 46c38d01a8
2 changed files with 20 additions and 3 deletions

View File

@ -3,7 +3,24 @@ import functools
from sopel_SpiceBot_Core_1 import sb
def prerun(t_command_type='module'):
def prerun_command():
def actual_decorator(function):
@functools.wraps(function)
def internal_prerun(bot, trigger, *args, **kwargs):
bot.say(str(id(trigger)))
sb.osd("test", trigger.sender)
function(bot, trigger, *args, **kwargs)
return internal_prerun
return actual_decorator
def prerun_nickname_command():
def actual_decorator(function):

View File

@ -4,10 +4,10 @@ from sopel import plugin
from sopel_SpiceBot_Core_1 import sb
from sopel_SpiceBot_Core_Prerun import prerun
from sopel_SpiceBot_Core_Prerun import prerun_nickname_command
@prerun('nickname')
@prerun_nickname_command()
@plugin.nickname_command('test')
def sb_nickname_command(bot, trigger):
bot.say("Testing the bot")