get_friend_msg_history

get_friend_msg_history只读扩展
获取好友消息历史(无锚点时从服务器获取最新双向记录)

Call via POST http://127.0.0.1:3000/get_friend_msg_history (JSON params as the body) or WebSocket.

Parameters

Param Type Required Default Description
user_id uint
message_id int 0
count int 20 无锚点时从 QQ 服务器获取最新双向历史;服务器或身份解析失败时动作失败,不返回不完整的本地缓存
reverse_order bool true 仅在 message_id 非 0 时生效;true 返回锚点及更旧消息,false 返回锚点及更新消息

Returns (data)

{ messages }:好友消息事件对象数组(每项为 OneBot 消息事件,内部字段不固定)。

Every response is wrapped in the standard envelope: { "status": "ok", "retcode": 0, "data": ... }. The table below describes data.

Field Type Required Description
messages object[] 消息事件对象数组
Raw JSON Schema
{
  "type": "object",
  "properties": {
    "messages": {
      "type": "array",
      "description": "消息事件对象数组",
      "items": {
        "type": "object"
      }
    }
  },
  "required": [
    "messages"
  ]
}

Examples

curl
Python
JavaScript
Go
SnowLuma SDK
curl -X POST http://127.0.0.1:3000/get_friend_msg_history \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <access-token>' \
  -d '{"user_id":10001,"message_id":0,"count":20,"reverse_order":true}'
Using an AI assistant?

MCP-capable clients can discover and call this action directly — no hand-written HTTP. See MCP.