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 import functools
def prerun(sb, t_command_type='module'): def prerun(t_command_type='module', t_command_subtype=None):
def actual_decorator(function): def actual_decorator(function):
@functools.wraps(function) @functools.wraps(function)
def internal_prerun(bot, trigger, *args, **kwargs): def internal_prerun(bot, trigger, sb, *args, **kwargs):
bot.say(str(id(trigger))) bot.say(str(id(trigger)))
sb.osd("test", trigger.sender)
return internal_prerun return internal_prerun
return actual_decorator return actual_decorator

View File

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