Skip to content
This repository was archived by the owner on Mar 11, 2026. It is now read-only.

Commit 222378b

Browse files
author
astrbot-docs-agent[bot]
committed
docs: update for AstrBotDevs/AstrBot#5208
1 parent 3b58129 commit 222378b

File tree

4 files changed

+120
-804
lines changed

4 files changed

+120
-804
lines changed

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

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,48 @@ async def test(self, event: AstrMessageEvent):
129129
```
130130

131131
![Sending group forward messages](https://files.astrbot.app/docs/source/images/plugin/image-4.png)
132+
133+
## Other Message Types
134+
135+
> Some platforms may not support all of the following message types.
136+
137+
**JSON Card**
138+
139+
```python
140+
Comp.Json(data={...})
141+
```
142+
143+
**Share**
144+
145+
```python
146+
Comp.Share(url="...", title="...", content="...", image="...")
147+
```
148+
149+
**Music Share**
150+
151+
```python
152+
# Method 1: Specify platform and ID
153+
Comp.Music(type="qq", id="...")
154+
# Method 2: Custom
155+
Comp.Music(type="custom", url="...", audio="...", title="...", content="...", image="...")
156+
```
157+
158+
**Location**
159+
160+
```python
161+
Comp.Location(lat=..., lon=..., title="...", content="...")
162+
```
163+
164+
**Contact (Friend/Group)**
165+
166+
```python
167+
Comp.Contact(type="qq", id="...")
168+
```
169+
170+
**Magic Emoticons/Actions**
171+
172+
```python
173+
Comp.Shake() # Window shake/Poke
174+
Comp.Dice() # Roll a dice
175+
Comp.RPS() # Rock-paper-scissors
176+
```

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class AstrBotMessage:
5454
- `Record`:语音消息段
5555
- `Video`:视频消息段
5656
- `File`:文件消息段
57+
- `Music`:音乐分享消息段
5758

5859
大多数消息平台都支持上面的消息段类型。
5960

@@ -63,6 +64,13 @@ class AstrBotMessage:
6364
- `Node`:合并转发消息中的一个节点
6465
- `Nodes`:合并转发消息中的多个节点
6566
- `Poke`:戳一戳消息段
67+
- `Json`:JSON 卡片消息段
68+
- `Share`:分享消息段
69+
- `Location`:位置消息段
70+
- `Contact`:推荐好友/群消息段
71+
- `Shake`:窗口抖动/戳一戳消息段
72+
- `Dice`:掷骰子消息段
73+
- `RPS`:猜拳消息段
6674

6775
在 AstrBot 中,消息链表示为 `List[BaseMessageComponent]` 类型的列表。
6876

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

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,3 +129,48 @@ async def test(self, event: AstrMessageEvent):
129129
```
130130

131131
![发送群合并转发消息](https://files.astrbot.app/docs/source/images/plugin/image-4.png)
132+
133+
## 其他消息类型
134+
135+
> 部分平台可能不支持以下所有消息类型。
136+
137+
**JSON 卡片**
138+
139+
```python
140+
Comp.Json(data={...})
141+
```
142+
143+
**分享 Share**
144+
145+
```python
146+
Comp.Share(url="...", title="...", content="...", image="...")
147+
```
148+
149+
**音乐分享 Music**
150+
151+
```python
152+
# 方式 1:指定平台和 ID
153+
Comp.Music(type="qq", id="...")
154+
# 方式 2:自定义
155+
Comp.Music(type="custom", url="...", audio="...", title="...", content="...", image="...")
156+
```
157+
158+
**位置 Location**
159+
160+
```python
161+
Comp.Location(lat=..., lon=..., title="...", content="...")
162+
```
163+
164+
**推荐好友/群 Contact**
165+
166+
```python
167+
Comp.Contact(type="qq", id="...")
168+
```
169+
170+
**魔法表情/动作**
171+
172+
```python
173+
Comp.Shake() # 窗口抖动/戳一戳
174+
Comp.Dice() # 掷骰子
175+
Comp.RPS() # 猜拳
176+
```

0 commit comments

Comments
 (0)