From 65fee5458a82b21a5ff484ead36b6d7c0d7f21f7 Mon Sep 17 00:00:00 2001 From: minecraft1024a Date: Fri, 29 Aug 2025 20:04:05 +0800 Subject: [PATCH] =?UTF-8?q?refactor(energy):=20=E7=A7=BB=E9=99=A4is=5Fslee?= =?UTF-8?q?ping=E6=96=B9=E6=B3=95=E5=AF=B9wakeup=5Fmanager=E7=9A=84?= =?UTF-8?q?=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将`schedule_manager.is_sleeping`的调用从`is_sleeping(self.context.wakeup_manager)`修改为`is_sleeping()`,以解耦对`wakeup_manager`的直接依赖。 同时,在`napcat_adapter_plugin`中将`enable_plugin`的默认值修改为`False`。 --- plugins/napcat_adapter_plugin/plugin.py | 2 +- src/chat/chat_loop/energy_manager.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/napcat_adapter_plugin/plugin.py b/plugins/napcat_adapter_plugin/plugin.py index ce94ece9e..9fb1c5697 100644 --- a/plugins/napcat_adapter_plugin/plugin.py +++ b/plugins/napcat_adapter_plugin/plugin.py @@ -206,7 +206,7 @@ class APITestHandler(BaseEventHandler): @register_plugin class NapcatAdapterPlugin(BasePlugin): plugin_name = CONSTS.PLUGIN_NAME - enable_plugin: bool = True + enable_plugin: bool = False dependencies: List[str] = [] # 插件依赖列表 python_dependencies: List[str] = [] # Python包依赖列表 config_file_name: str = "config.toml" # 配置文件名 diff --git a/src/chat/chat_loop/energy_manager.py b/src/chat/chat_loop/energy_manager.py index 55e5f9556..5e5e5eea5 100644 --- a/src/chat/chat_loop/energy_manager.py +++ b/src/chat/chat_loop/energy_manager.py @@ -94,7 +94,7 @@ class EnergyManager: continue # 判断当前是否为睡眠时间 - is_sleeping = schedule_manager.is_sleeping(self.context.wakeup_manager) + is_sleeping = schedule_manager.is_sleeping() if is_sleeping: # 睡眠中:减少睡眠压力