diff --git a/sopel_modules/SpiceBot_CommandsQuery/CommandsQuery.py b/sopel_modules/SpiceBot_CommandsQuery/CommandsQuery.py index c8bafaa..27d1fe6 100644 --- a/sopel_modules/SpiceBot_CommandsQuery/CommandsQuery.py +++ b/sopel_modules/SpiceBot_CommandsQuery/CommandsQuery.py @@ -12,8 +12,7 @@ from operator import itemgetter import threading -from sopel_modules.SpiceBot_SBTools.BotEvents import set_bot_event - +from sopel_modules.SpiceBot_Botevents.BotEvents import set_bot_event import spicemanip @@ -50,11 +49,12 @@ def setup_thread(bot): # pypi installed try: import sopel_modules - pypi_modules = os.path.dirname(os.path.abspath(sopel_modules.__file__)) - pypi_modules_dir = os.path.join(pypi_modules, 'modules') - filepathlisting.append(pypi_modules_dir) - except Exception: - pass + for plugin_dir in set(sopel_modules.__path__): + for pathname in os.listdir(plugin_dir): + pypi_modules_dir = os.path.join(plugin_dir, pathname) + filepathlisting.append(pypi_modules_dir) + except Exception as e: + stderr("[Sopel-CommandsQuery] sopel_modules not loaded :" + str(e)) # Extra directories filepathlist = [] @@ -159,7 +159,6 @@ def query_detection(bot, trigger): # command must start with if not str(trigger).startswith(tuple(['?'])): return - stderr(trigger.args) commands_list = dict() for commandstype in bot.memory['Sopel-CommandsQuery'].keys():