diff --git a/coolq/event.go b/coolq/event.go index 5555563..a2dfcd1 100644 --- a/coolq/event.go +++ b/coolq/event.go @@ -422,8 +422,8 @@ func (bot *CQBot) otherClientStatusChangedEvent(c *client.QQClient, e *client.Ot bot.dispatchEventMessage(MSG{ "post_type": "notice", "notice_type": "client_status", + "online": e.Online, "client": MSG{ - "online": e.Online, "app_id": e.Client.AppId, "device_name": e.Client.DeviceName, "device_kind": e.Client.DeviceKind, diff --git a/docs/cqhttp.md b/docs/cqhttp.md index f5686b6..f660e64 100644 --- a/docs/cqhttp.md +++ b/docs/cqhttp.md @@ -850,6 +850,30 @@ JSON数组: > 不提供起始序号将默认获取最新的消息 +### 获取当前账号在线客户端列表 + +终结点:`/get_online_clients` + +**参数** + +| 字段 | 类型 | 说明 | +| ---------- | ------ | ------------------------- | +| `no_cache` | bool | 是否无视缓存 | + +**响应数据** + +| 字段 | 类型 | 说明 | +| ---------- | ---------- | ------------ | +| `clients` | []Device | 在线客户端列表 | + +**Device** + +| 字段 | 类型 | 说明 | +| ---------- | ---------- | ------------ | +| `app_id` | int64 | 客户端ID | +| `device_name` | string | 设备名称 | +| `device_kind` | string | 设备类型 | + ### 获取用户VIP信息 终结点:`/_get_vip_info` @@ -1013,3 +1037,14 @@ JSON数组: | `name` | string | | 文件名 | | `size` | int64 | | 文件大小 | | `url` | string | | 下载链接 | + +### 其他客户端在线状态变更 + +**上报数据** + +| 字段 | 类型 | 可能的值 | 说明 | +| ------------- | ------ | -------------- | -------- | +| `post_type` | string | `notice` | 上报类型 | +| `notice_type` | string | `client_status` | 消息类型 | +| `client` | Device | | 客户端信息 | +| `online` | bool | | 当前是否在线 | \ No newline at end of file