消息列表
https://chat-go.jwzhd.com/open-apis/v1/bot/messages?token=xxxxxxxxxx
GET
curl --location 'https://chat-go.jwzhd.com/open-apis/v1/bot/messages?token=xxxx&chat-id=xxxx&chat-type=group&message-id=dad25257f71f41098f733a5079183080&before=2'Content-Type: "application/json; charset=utf-8"| 字段 | 类型 | 是否必填 | 说明 |
|---|---|---|---|
| chat-id | string | 是 | 获取消息对象ID 用户: 使用userId 群: 使用groupId |
| chat-type | string | 是 | 获取消息对象类型 用户: user 群: group |
| message-id | string | 否 | 消息ID,不填时可以配合before参数返回最近的N条消息 |
| before | int | 否 | 指定消息ID前N条,默认0条 |
| after | int | 否 | 指定消息ID后N条,默认0条 |
| 字段 | 类型 | 说明 |
|---|---|---|
| code | int | 响应代码 |
| msg | string | 响应信息,包括异常信息 |
| data | Object | 返回数据 |
// 获取群ID【xxx】中最新 10 条消息,共返回 10 条消息https://chat-go.jwzhd.com/open-apis/v1/bot/messages?token=xxxxx&chat-id=xxx&chat-type=group&before=10
// 获取群ID【xxx】中消息 ID【xxxx】前 10 条消息,共返回 11 条消息https://chat-go.jwzhd.com/open-apis/v1/bot/messages?token=xxxxx&chat-id=xxx&chat-type=group&message-id=xxxx&before=10
// 获取群ID【xxx】中消息 ID【xxxx】后 10 条消息,共返回 11 条消息https://chat-go.jwzhd.com/open-apis/v1/bot/messages?token=xxxxx&chat-id=xxx&chat-type=group&message-id=xxxx&after=10
// 获取群ID【xxx】中消息 ID【xxxx】前后各 10 条消息,共返回 21 条消息https://chat-go.jwzhd.com/open-apis/v1/bot/messages?token=xxxxx&chat-id=xxx&chat-type=group&message-id=xxxx&before=10&after=10
// 获取用户ID【xxx】中消息 ID【xxxx】前 10 条消息,共返回 11 条消息https://chat-go.jwzhd.com/open-apis/v1/bot/messages?token=xxxxx&chat-id=xxx&chat-type=user&message-id=xxxx&before=10{ "code": 1, "data": { "list": [ { "msgId": "dad25257f71f41098f733a5079183080", "parentId": "", "senderId": "7999713", "senderType": "user", "senderNickname": "NH₃·H₂O", "contentType": "markdown", "content": { "text": "#不要潜水快来嗨皮啊" }, "sendTime": 1709102439694, "commandName": "", "commandId": 0 }, { "msgId": "672d5171b9474c7e870ac311361ac85b", "parentId": "", "senderId": "8380181", "senderType": "user", "senderNickname": "梵高", "contentType": "text", "content": { "text": "是在潜水" }, "sendTime": 1708751609482, "commandName": "", "commandId": 0 } ], "total": 2 }, "msg": "success"}