mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-16 17:47:06 +08:00
- Introduced LoadedCapability class to manage plugin capabilities. - Updated load_plugin function to discover and load capabilities alongside handlers. - Enhanced Peer class to handle remote provided capabilities during initialization. - Added tests for capability registration and invocation in legacy plugins. - Improved MessageChain and message component handling in legacy plugins. - Added comprehensive tests for legacy plugin integration and compatibility. - Updated protocol messages to include provided capabilities in initialization. - Enhanced top-level module imports to include capability-related functions.
33 lines
700 B
Python
33 lines
700 B
Python
"""AstrBot SDK 的顶层公共 API。
|
|
|
|
这里仅重新导出 v4 推荐直接导入的稳定入口。
|
|
旧版兼容能力由 ``astrbot_sdk.api`` 与 ``astrbot_sdk.compat`` 承接,
|
|
避免把迁移层和原生 API 混在同一个包入口里。
|
|
"""
|
|
|
|
from .context import Context
|
|
from .decorators import (
|
|
on_command,
|
|
on_event,
|
|
on_message,
|
|
on_schedule,
|
|
provide_capability,
|
|
require_admin,
|
|
)
|
|
from .errors import AstrBotError
|
|
from .events import MessageEvent
|
|
from .star import Star
|
|
|
|
__all__ = [
|
|
"AstrBotError",
|
|
"Context",
|
|
"MessageEvent",
|
|
"Star",
|
|
"on_command",
|
|
"on_event",
|
|
"on_message",
|
|
"on_schedule",
|
|
"provide_capability",
|
|
"require_admin",
|
|
]
|