mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-13 06:59:53 -05:00
CommandsQuery: Update Logic for sopel_modules
This commit is contained in:
parent
0dc6858e5e
commit
cb9ef6c436
@ -50,11 +50,12 @@ def setup_thread(bot):
|
|||||||
# pypi installed
|
# pypi installed
|
||||||
try:
|
try:
|
||||||
import sopel_modules
|
import sopel_modules
|
||||||
pypi_modules = os.path.dirname(os.path.abspath(sopel_modules.__file__))
|
for plugin_dir in set(sopel_modules.__path__):
|
||||||
pypi_modules_dir = os.path.join(pypi_modules, 'modules')
|
for pathname in os.listdir(plugin_dir):
|
||||||
|
pypi_modules_dir = os.path.join(plugin_dir, pathname)
|
||||||
filepathlisting.append(pypi_modules_dir)
|
filepathlisting.append(pypi_modules_dir)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
stderr("[Sopel-CommandsQuery] sopel_modules not found:" + str(e))
|
stderr("[Sopel-CommandsQuery] sopel_modules not loaded :" + str(e))
|
||||||
|
|
||||||
# Extra directories
|
# Extra directories
|
||||||
filepathlist = []
|
filepathlist = []
|
||||||
@ -159,7 +160,6 @@ def query_detection(bot, trigger):
|
|||||||
# command must start with
|
# command must start with
|
||||||
if not str(trigger).startswith(tuple(['?'])):
|
if not str(trigger).startswith(tuple(['?'])):
|
||||||
return
|
return
|
||||||
stderr(trigger.args)
|
|
||||||
|
|
||||||
commands_list = dict()
|
commands_list = dict()
|
||||||
for commandstype in bot.memory['Sopel-CommandsQuery'].keys():
|
for commandstype in bot.memory['Sopel-CommandsQuery'].keys():
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user