diff --git a/sopel_SpiceBot_Core_Prerun/__init__.py b/sopel_SpiceBot_Core_Prerun/__init__.py index 2f6a1c4..b04186b 100644 --- a/sopel_SpiceBot_Core_Prerun/__init__.py +++ b/sopel_SpiceBot_Core_Prerun/__init__.py @@ -3,7 +3,24 @@ import functools 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): diff --git a/sopel_SpiceBot_Runtime_Commands/__init__.py b/sopel_SpiceBot_Runtime_Commands/__init__.py index d357986..c921010 100644 --- a/sopel_SpiceBot_Runtime_Commands/__init__.py +++ b/sopel_SpiceBot_Runtime_Commands/__init__.py @@ -4,10 +4,10 @@ from sopel import plugin 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') def sb_nickname_command(bot, trigger): bot.say("Testing the bot")