test
This commit is contained in:
parent
13efd210b3
commit
46c38d01a8
@ -3,7 +3,24 @@ import functools
|
|||||||
from sopel_SpiceBot_Core_1 import sb
|
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):
|
def actual_decorator(function):
|
||||||
|
|
||||||
|
|||||||
@ -4,10 +4,10 @@ from sopel import plugin
|
|||||||
|
|
||||||
from sopel_SpiceBot_Core_1 import sb
|
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')
|
@plugin.nickname_command('test')
|
||||||
def sb_nickname_command(bot, trigger):
|
def sb_nickname_command(bot, trigger):
|
||||||
bot.say("Testing the bot")
|
bot.say("Testing the bot")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user