get_online_clients

get_online_clients只读扩展
获取在线客户端

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

Parameters

Param Type Required Default Description
no_cache bool false 是否强制刷新;QQ 当前仅暴露本地快照,true 会明确失败

Returns (data)

{ clients }:QQ 本次会话最近推送的在线设备快照。

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

Field Type Required Description
clients object[] 在线设备列表
Raw JSON Schema
{
  "type": "object",
  "properties": {
    "clients": {
      "type": "array",
      "description": "在线设备列表",
      "items": {
        "type": "object",
        "properties": {
          "app_id": {
            "type": "integer",
            "description": "客户端 ID"
          },
          "device_name": {
            "type": "string",
            "description": "设备名称"
          },
          "device_kind": {
            "type": "string",
            "enum": [
              "电脑",
              "Pad",
              "手机",
              "未知设备"
            ],
            "description": "设备类别"
          }
        },
        "required": [
          "app_id",
          "device_name",
          "device_kind"
        ]
      }
    }
  },
  "required": [
    "clients"
  ]
}

Examples

curl
Python
JavaScript
Go
SnowLuma SDK
curl -X POST http://127.0.0.1:3000/get_online_clients \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer <access-token>' \
  -d '{"no_cache":false}'
Using an AI assistant?

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