test
This commit is contained in:
parent
ad7c8ae2fa
commit
b7d016a750
@ -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
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user