From 3003dfad55b8ad130acf8d93ee51a9291efe7a97 Mon Sep 17 00:00:00 2001 From: Snowykami Date: Sun, 29 Dec 2024 15:57:11 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BC=98=E5=8C=96=E6=8F=92?= =?UTF-8?q?=E4=BB=B6=E5=8A=A0=E8=BD=BD=E9=80=BB=E8=BE=91=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=86=85=E7=BD=AE=E6=8F=92=E4=BB=B6=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98,=E5=8A=A8=E6=80=81=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=E5=86=85=E7=BD=AE=E6=8F=92=E4=BB=B6=E5=B9=B6=E5=A2=9E?= =?UTF-8?q?=E5=BC=BA=E5=AF=B9sys.path=E4=B8=8B=E5=8C=85=E7=9A=84=E6=94=AF?= =?UTF-8?q?=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nonebot_plugin_marshoai/azure.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/nonebot_plugin_marshoai/azure.py b/nonebot_plugin_marshoai/azure.py index c55a6b42..82724b68 100644 --- a/nonebot_plugin_marshoai/azure.py +++ b/nonebot_plugin_marshoai/azure.py @@ -128,12 +128,13 @@ async def _(): if config.marshoai_enable_plugins: marshoai_plugin_dirs = config.marshoai_plugin_dirs # 外部插件目录列表 """加载内置插件""" - marshoai_plugin_dirs.insert( - 0, Path(__file__).parent / "plugins" - ) # 预置插件目录 + for p in os.listdir(Path(__file__).parent / "plugins"): + load_plugin(f"{__package__}.plugins.{p}") + """加载指定目录插件""" load_plugins(*marshoai_plugin_dirs) - """加载sys.path下的包""" + + """加载sys.path下的包, 包括从pip安装的包""" for package_name in config.marshoai_plugins: load_plugin(package_name) logger.info(