From 555fcfa7de8d47fc5604add66eece40cfdc5e62c Mon Sep 17 00:00:00 2001 From: Irmia <1269541505@qq.com> Date: Wed, 1 Jul 2026 00:36:00 +0800 Subject: [PATCH] fix: skip _unbind_plugin for inactivated plugins in reload() --- astrbot/core/star/star_manager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/astrbot/core/star/star_manager.py b/astrbot/core/star/star_manager.py index 53ee5045e3..c804189c77 100644 --- a/astrbot/core/star/star_manager.py +++ b/astrbot/core/star/star_manager.py @@ -996,7 +996,7 @@ async def reload(self, specified_plugin_name=None): logger.warning( f"插件 {smd.name} 未被正常终止: {e!s}, 可能会导致该插件运行不正常。", ) - if smd.name and smd.module_path: + if smd.name and smd.module_path and smd.activated: await self._unbind_plugin(smd.name, smd.module_path) star_handlers_registry.clear() @@ -1013,7 +1013,7 @@ async def reload(self, specified_plugin_name=None): logger.warning( f"插件 {smd.name} 未被正常终止: {e!s}, 可能会导致该插件运行不正常。", ) - if smd.name: + if smd.name and smd.activated: await self._unbind_plugin(smd.name, specified_module_path) result = await self.load(specified_module_path)