群聊消息
合并转发
群聊消息中的 forward 消息段说明、查询逐条消息与自定义上传规则。
群聊消息中的合并转发卡片消息段,type 为 "forward"。
forward 字段说明
| 字段 | 类型 | 说明 |
|---|---|---|
service_id | uint32 | 转发卡片服务类型值,原样保留 |
res_id | string(可选) | 合并转发资源 ID,为空时省略;查询逐条内容时原样传给 get_forward_message |
user_id | uint64(可选) | 卡片发送人 QQ 号,未提供时省略;查询逐条内容时原样传给 get_forward_message |
title | string | 卡片标题 |
summary | string | 卡片摘要 |
preview | string[] | 预览文案数组 |
count | uint64(可选) | 顶层消息条数,未提供时省略 |
messages | ForwardMessage[](可选) | 内嵌展开的转发记录数组,未提供时省略 |
使用说明
- 收到
forward段时,从同一个forward段的data.user_id和data.res_id取出参数,连同同次回调的self_id、platform传给get_forward_message查询逐条内容(不需要群号或完整消息段)。 - 通过
upload_forward_message上传自定义合并转发后,返回的result->message含一条forward段,其data.count为顶层条数。 - 嵌套引用已有转发时,取同一账号、平台和目标上传结果的
result->message数组中唯一的forward对象,原样放入当前记录的message数组,不要传整个数组、只传res_id或添加user_id。
GroupMessage 公共字段
| 字段 | 类型 | 说明 |
|---|---|---|
self_id | uint64_t | 收到消息的 Bot 账号 |
platform | const char * | 所属平台 PLATFORM_* |
group_id | uint64_t | 群号 |
user_id | uint64_t | 发送人 QQ 号 |
msg_seq | uint64_t | 消息序号 |
msg_uid | uint64_t | 消息唯一编号 |
random | uint64_t | 消息随机数 |
msg_time | uint64_t | 发送时间(Unix 秒) |
level | uint64_t | 发送人的群成员等级,没有时为 0 |
group_name | const char * | 群名称 |
nickname | const char * | 发送人昵称(设置了群名片时为群名片) |
role | const char * | 发送人身份:"owner" 群主、"admin" 管理员、"member" 成员 |
title | const char * | 发送人头衔,没有时为 "" |
message | const char * | 消息段 UTF-8 JSON 数组(Segment[]) |