From e2c6150d4e2b4123e5a22f3ca2804f95f2388f8c Mon Sep 17 00:00:00 2001 From: deathbybandaid Date: Fri, 6 May 2022 10:18:59 -0400 Subject: [PATCH] test --- sopel_SpiceBot_Core_Prerun/__init__.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sopel_SpiceBot_Core_Prerun/__init__.py b/sopel_SpiceBot_Core_Prerun/__init__.py index c23f3d3..e8d5a6d 100644 --- a/sopel_SpiceBot_Core_Prerun/__init__.py +++ b/sopel_SpiceBot_Core_Prerun/__init__.py @@ -1,5 +1,6 @@ import functools import re +import inspect from sopel.trigger import Trigger @@ -14,10 +15,16 @@ def prerun(): @functools.wraps(function) def internal_prerun(bot, trigger, *args, **kwargs): - print(function._decorators) - comrun = ComRun(bot, trigger, function) + source = inspect.getsource(function) + index = source.find("def ") + print([ + line.strip().split()[0] + for line in source[:index].strip().splitlines() + if line.strip()[0] == "@" + ]) + # Since there was more than one command, # we are going to redispatch commands # This will give sopel the appearance of recieving individual commands