mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-16 01:40:15 +08:00
- Updated `LegacyContext.send_message` to handle rich message chains using `send_chain`. - Introduced `LegacyStar` class for backward compatibility with legacy plugins. - Added `register` decorator for legacy plugin metadata. - Enhanced `MessageChain` class with `to_payload` and `is_plain_text_only` methods. - Updated `AstrMessageEvent.send` method to utilize `send_chain` for rich messages. - Implemented `send_chain` method in `PlatformClient` for sending complex message structures. - Added capability routing for `platform.send_chain`. - Introduced tests for new functionality, ensuring compatibility with legacy plugins and message handling.
62 lines
845 B
Python
62 lines
845 B
Python
"""旧版 ``astrbot_sdk.api.message_components`` 的兼容导出。"""
|
|
|
|
from .message.components import (
|
|
At,
|
|
AtAll,
|
|
BaseMessageComponent,
|
|
ComponentTypes,
|
|
ComponentType,
|
|
CompT,
|
|
Contact,
|
|
Dice,
|
|
Face,
|
|
File,
|
|
Forward,
|
|
Image,
|
|
Json,
|
|
Location,
|
|
Music,
|
|
Node,
|
|
Nodes,
|
|
Plain,
|
|
Poke,
|
|
Record,
|
|
Reply,
|
|
RPS,
|
|
Shake,
|
|
Share,
|
|
Unknown,
|
|
Video,
|
|
WechatEmoji,
|
|
)
|
|
|
|
__all__ = [
|
|
"At",
|
|
"AtAll",
|
|
"BaseMessageComponent",
|
|
"ComponentTypes",
|
|
"ComponentType",
|
|
"CompT",
|
|
"Contact",
|
|
"Dice",
|
|
"Face",
|
|
"File",
|
|
"Forward",
|
|
"Image",
|
|
"Json",
|
|
"Location",
|
|
"Music",
|
|
"Node",
|
|
"Nodes",
|
|
"Plain",
|
|
"Poke",
|
|
"Record",
|
|
"Reply",
|
|
"RPS",
|
|
"Shake",
|
|
"Share",
|
|
"Unknown",
|
|
"Video",
|
|
"WechatEmoji",
|
|
]
|