This commit is contained in:
deathbybandaid 2022-02-10 09:59:07 -05:00
parent ad7c8ae2fa
commit b7d016a750
2 changed files with 6 additions and 4 deletions

View File

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

View File

@ -21,9 +21,9 @@ def setup(bot):
sb.setup(bot)
@prerun(sb, 'nickname')
@prerun('nickname')
@plugin.nickname_command('test')
def sb_nickname_command(bot, trigger):
def sb_nickname_command(bot, trigger, sb):
bot.say("Testing the bot")
bot.say("Attributes: %s" % [x for x in dir(sb) if not x.startswith("__")])
bot.say("%s" % sb.versions.dict)