From 46c38d01a8cdc7b904199ca2f0dffcc8bd0d0f5b Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Thu, 10 Feb 2022 10:26:29 -0500 Subject: [PATCH] test --- sopel_SpiceBot_Core_Prerun/__init__.py | 19 ++++++++++++++++++- sopel_SpiceBot_Runtime_Commands/__init__.py | 4 ++-- 2 files changed, 20 insertions(+), 3 deletions(-) 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")