Skip to content

消息列表

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-idstring获取消息对象ID
用户: 使用userId
群: 使用groupId
chat-typestring获取消息对象类型
用户: user
群: group
message-idstring消息ID,不填时可以配合before参数返回最近的N条消息
beforeint指定消息ID前N条,默认0条
afterint指定消息ID后N条,默认0条
字段类型说明
codeint响应代码
msgstring响应信息,包括异常信息
dataObject返回数据
// 获取群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"
}