Skip to content

Commit c7057f9

Browse files
authored
Merge pull request #79 from QingFeng-awa/fix/complete-missing-prompts
移动 aiocqhttp 适配器对于 `plain` 类型消息使用 `strip()` 方法的提示
2 parents 12aa316 + 9750719 commit c7057f9

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

en/dev/star/guides/send-message.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ async def helloworld(self, event: AstrMessageEvent):
5858

5959
The above constructs a `message chain`, which will ultimately send a message containing both images and text while preserving the order.
6060

61+
> [!TIP]
62+
> In the aiocqhttp message adapter, for messages of type `plain`, the `strip()` method is used during sending to remove spaces and line breaks. You can add zero-width spaces `\u200b` before and after the message to resolve this issue.
63+
6164
Similarly,
6265

6366
**File**

zh/dev/star/guides/listen-message-event.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,6 @@ class AstrBotMessage:
6464
- `Nodes`:合并转发消息中的多个节点
6565
- `Poke`:戳一戳消息段
6666

67-
> [!TIP]
68-
>
69-
> 在aiocqhttp消息适配器中,对于 `plain` 类型的消息,在发送中会自动使用 `strip()` 方法去除空格及换行符,可以使用零宽空格 `\u200b` 解决限制。
70-
7167
在 AstrBot 中,消息链表示为 `List[BaseMessageComponent]` 类型的列表。
7268

7369
## 指令

zh/dev/star/guides/send-message.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ async def helloworld(self, event: AstrMessageEvent):
5858

5959
上面构建了一个 `message chain`,也就是消息链,最终会发送一条包含了图片和文字的消息,并且保留顺序。
6060

61+
> [!TIP]
62+
> 在 aiocqhttp 消息适配器中,对于 `plain` 类型的消息,在发送中会使用 `strip()` 方法去除空格及换行符,可以在消息前后添加零宽空格 `\u200b` 以解决这个问题。
63+
6164
类似地,
6265

6366
**文件 File**

0 commit comments

Comments
 (0)