This commit is contained in:
deathbybandaid 2022-02-10 09:55:13 -05:00
parent 09ab9b0d88
commit ad7c8ae2fa
2 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,14 @@
import functools
def prerun(sb, t_command_type='module'):
def actual_decorator(function):
@functools.wraps(function)
def internal_prerun(bot, trigger, *args, **kwargs):
bot.say(str(id(trigger)))
return internal_prerun
return actual_decorator

View File

@ -10,6 +10,7 @@ import pathlib
from sopel import plugin
from .SBCore import SpiceBotCore_OBJ
from .SBCore.prerun import prerun
SCRIPT_DIR = pathlib.Path(os.path.dirname(os.path.abspath(__file__)))
@ -20,6 +21,7 @@ def setup(bot):
sb.setup(bot)
@prerun(sb, 'nickname')
@plugin.nickname_command('test')
def sb_nickname_command(bot, trigger):
bot.say("Testing the bot")