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