依赖注入示例

This commit is contained in:
LIghtJUNction
2025-11-03 23:28:13 +08:00
parent 5719dbd8b2
commit fb56ac9f47
35 changed files with 168 additions and 134 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ from importlib.metadata import version
import click
from astrbot.base import LOGO
from astrbot_api import LOGO
from .commands import conf, init, plug, run
+4 -1
View File
@@ -3,8 +3,11 @@ import shutil
from pathlib import Path
import click
from astrbot_api.abc import IAstrbotPaths
from astrbot.base import AstrbotPaths
from astrbot_sdk import sync_base_container
AstrbotPaths: type[IAstrbotPaths] = sync_base_container.get(type[IAstrbotPaths])
from ..utils import (
PluginStatus,
+3 -1
View File
@@ -2,9 +2,11 @@ import warnings
from pathlib import Path
import click
from astrbot_api.abc import IAstrbotPaths
from astrbot.base import AstrbotPaths
from astrbot_sdk import sync_base_container
AstrbotPaths = sync_base_container.get(type[IAstrbotPaths])
def check_astrbot_root(path: str | Path) -> bool:
"""检查路径是否为 AstrBot 根目录"""