refactor(energy): 移除is_sleeping方法对wakeup_manager的依赖

将`schedule_manager.is_sleeping`的调用从`is_sleeping(self.context.wakeup_manager)`修改为`is_sleeping()`,以解耦对`wakeup_manager`的直接依赖。

同时,在`napcat_adapter_plugin`中将`enable_plugin`的默认值修改为`False`。
This commit is contained in:
minecraft1024a
2025-08-29 20:04:05 +08:00
parent 16a1568f65
commit 65fee5458a
2 changed files with 2 additions and 2 deletions

View File

@@ -206,7 +206,7 @@ class APITestHandler(BaseEventHandler):
@register_plugin @register_plugin
class NapcatAdapterPlugin(BasePlugin): class NapcatAdapterPlugin(BasePlugin):
plugin_name = CONSTS.PLUGIN_NAME plugin_name = CONSTS.PLUGIN_NAME
enable_plugin: bool = True enable_plugin: bool = False
dependencies: List[str] = [] # 插件依赖列表 dependencies: List[str] = [] # 插件依赖列表
python_dependencies: List[str] = [] # Python包依赖列表 python_dependencies: List[str] = [] # Python包依赖列表
config_file_name: str = "config.toml" # 配置文件名 config_file_name: str = "config.toml" # 配置文件名

View File

@@ -94,7 +94,7 @@ class EnergyManager:
continue continue
# 判断当前是否为睡眠时间 # 判断当前是否为睡眠时间
is_sleeping = schedule_manager.is_sleeping(self.context.wakeup_manager) is_sleeping = schedule_manager.is_sleeping()
if is_sleeping: if is_sleeping:
# 睡眠中:减少睡眠压力 # 睡眠中:减少睡眠压力