diff --git a/en/dev/star/guides/send-message.md b/en/dev/star/guides/send-message.md index 417b60e..621d8c4 100644 --- a/en/dev/star/guides/send-message.md +++ b/en/dev/star/guides/send-message.md @@ -69,6 +69,11 @@ Similarly, Comp.File(file="path/to/file.txt", name="file.txt") # Not supported by some platforms ``` +> [!NOTE] +> - The `file` parameter supports local absolute paths, `file:///` URI format, and HTTP/HTTPS URLs. +> - In the OneBot v11 (aiocqhttp) adapter, local absolute paths are automatically converted to `file://` URI format to comply with the protocol requirements. +> - Cross-platform compatibility: Uses `pathlib.Path.as_uri()` to generate standard URIs, ensuring proper functionality on both Linux and Windows systems. + **Audio Record** ```py diff --git a/zh/dev/star/guides/send-message.md b/zh/dev/star/guides/send-message.md index 84eaf8e..5a0c0f7 100644 --- a/zh/dev/star/guides/send-message.md +++ b/zh/dev/star/guides/send-message.md @@ -69,6 +69,11 @@ async def helloworld(self, event: AstrMessageEvent): Comp.File(file="path/to/file.txt", name="file.txt") # 部分平台不支持 ``` +> [!NOTE] +> - `file` 参数支持本地绝对路径、`file:///` URI 格式以及 HTTP/HTTPS URL。 +> - 在 OneBot v11 (aiocqhttp) 适配器中,本地绝对路径会自动转换为 `file://` URI 格式以符合协议要求。 +> - 跨平台兼容性:使用 `pathlib.Path.as_uri()` 生成标准 URI,确保在 Linux 和 Windows 系统下均能正常工作。 + **语音 Record** ```py