Install
openclaw skills install feishu-forward-reader读取和解析飞书合并转发消息(merge_forward)的详细内容。当收到飞书转发消息显示为"Merged and Forwarded Message"时使用此 skill 获取原始消息内容。
openclaw skills install feishu-forward-reader读取飞书合并转发消息的详细内容。
飞书的合并转发消息 (merge_forward) 在 OpenClaw 中默认只显示 "Merged and Forwarded Message",无法看到实际转发的内容。此 skill 通过飞书 API 获取转发消息的完整子消息列表。
脚本会自动从以下位置获取飞书凭证(按优先级):
--app-id / --app-secretFEISHU_APP_ID / FEISHU_APP_SECRET~/.openclaw/openclaw.json 中的 channels.feishu.appId/appSecret如果已配置 OpenClaw 飞书插件,无需额外配置即可使用。
# 自动从 OpenClaw 配置读取凭证
python3 scripts/parse_forward.py <message_id>
# 或手动指定凭证
python3 scripts/parse_forward.py <message_id> --app-id <id> --app-secret <secret>
# JSON 格式输出
python3 scripts/parse_forward.py <message_id> --format json
# 不查询用户名(更快)
python3 scripts/parse_forward.py <message_id> --no-names
# 自动从配置读取凭证
./scripts/read_forward.sh <message_id>
# 或手动指定
./scripts/read_forward.sh <message_id> <app_id> <app_secret>
# 获取 token
TOKEN=$(curl -s -X POST 'https://open.feishu.cn/open-apis/auth/v3/tenant_access_token/internal' \
-H 'Content-Type: application/json' \
-d '{"app_id":"YOUR_APP_ID","app_secret":"YOUR_APP_SECRET"}' | jq -r '.tenant_access_token')
# 获取消息详情
curl -s "https://open.feishu.cn/open-apis/im/v1/messages/<message_id>" \
-H "Authorization: Bearer $TOKEN" | jq .
{
"code": 0,
"data": {
"items": [
{
"message_id": "om_xxx",
"msg_type": "merge_forward",
"body": {"content": "Merged and Forwarded Message"}
},
{
"message_id": "om_yyy",
"msg_type": "text",
"body": {"content": "{\"text\":\"实际消息内容\"}"},
"upper_message_id": "om_xxx",
"sender": {"id": "ou_xxx", "sender_type": "user"},
"create_time": "1234567890000"
}
]
}
}
msg_type: merge_forward)upper_message_id 指向父消息| 类型 | 说明 | 解析方式 |
|---|---|---|
text | 文本消息 | body.content → JSON → text |
post | 富文本消息 | body.content → JSON → title + content |
interactive | 卡片消息 | body.content → JSON → title + elements |
image | 图片 | 显示 [图片] |
file | 文件 | 显示 [文件] |
audio | 语音 | 显示 [语音] |
video | 视频 | 显示 [视频] |
飞书应用需要以下权限:
im:message:readonly - 获取群组中所有消息(敏感权限)contact:contact.base:readonly - 获取用户基本信息(可选,用于显示用户名)📨 合并转发消息 (3 条)
来源群: oc_xxxxxxxxxxxxxxxxxxxx
----------------------------------------
[02-25 14:02] 张三
大家好,这是一条测试消息
[02-25 14:03] ou_yyyyyyyyyyy...
收到,我看看
[02-25 14:05] 李四
已处理完成
注:可见范围内的用户显示真实姓名,范围外的显示 ID 前缀。