get_online_clients

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

通过 POST http://127.0.0.1:3000/get_online_clients(请求体为 JSON 参数)或 WebSocket 调用。

输入参数

参数 类型 必填 默认 说明
no_cache bool false 是否强制刷新;QQ 当前仅暴露本地快照,true 会明确失败

返回 (data)

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

所有响应都包裹在标准信封中:{ "status": "ok", "retcode": 0, "data": ... }。下表描述 data 字段。

字段 类型 必填 说明
clients object[] 在线设备列表
原始 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"
  ]
}

调用示例

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}'
在用 AI 助手?

支持 MCP 的客户端可直接发现并调用本动作,无需手写 HTTP。见 MCP 接入