diff --git a/sopel_SpiceBot_Core_Prerun/__init__.py b/sopel_SpiceBot_Core_Prerun/__init__.py index 2f21417..2685b3e 100644 --- a/sopel_SpiceBot_Core_Prerun/__init__.py +++ b/sopel_SpiceBot_Core_Prerun/__init__.py @@ -12,16 +12,15 @@ def prerun(rulematch=False): def internal_prerun(bot, trigger, *args, **kwargs): # trigger_type = [x for x in dir(function) if not x.startswith("__")][1] - try: + if hasattr(function, 'commands'): + print("commands") print(function.commands) - except AttributeError: - try: - print(function.nickname_commands) - except AttributeError: - try: - print(function.action_commands) - except AttributeError: - print("nothing here") + if hasattr(function, 'nickname_commands'): + print("nickname_commands") + print(function.nickname_commands) + if hasattr(function, 'action_commands'): + print("action_commands") + print(function.action_commands) # Get list of trigger command(s) by && split commands = sb.commands.get_commands_split(trigger, "&&")