Skip to content

Commit 44d05bf

Browse files
committed
[milky] add get_user_profile API
1 parent 0de8ab7 commit 44d05bf

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

markdown/api/system.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,29 @@
2727
| qq_protocol_type | enum (string) | 协议端使用的 QQ 协议平台,可能值:`windows`, `linux`, `macos`, `android_pad`, `android_phone`, `ipad`, `iphone`, `harmony`, `watch` |
2828
| milky_version | string | 协议端实现的 Milky 协议版本,目前为 `1.0` |
2929

30+
## `get_user_profile` 获取用户个人信息
31+
32+
### 参数
33+
34+
| 字段名 | 类型 | 描述 |
35+
| --- | --- | --- |
36+
| user_id | int32 | 用户 QQ 号 |
37+
38+
### 返回值
39+
40+
| 字段名 | 类型 | 描述 |
41+
| --- | --- | --- |
42+
| nickname | string | 昵称 |
43+
| qid | string | QID(**可选**|
44+
| age | int32 | 年龄 |
45+
| sex | enum (string) | 性别,可能值:`male`, `female`, `unknown` |
46+
| remark | string | 备注(**可选**|
47+
| bio | string | 个性签名(**可选**|
48+
| level | int32 | QQ 等级(**可选**|
49+
| country | string | 国家或地区(**可选**|
50+
| city | string | 城市(**可选**|
51+
| school | string | 学校(**可选**|
52+
3053
## `get_friend_list` 获取好友列表
3154

3255
### 参数

src/main/kotlin/org/ntqqrev/milky/api/SystemApi.kt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,27 @@ val SystemApi = Category("system") {
4646
}
4747
}
4848

49+
api("get_user_profile") {
50+
describe("获取用户个人信息")
51+
input {
52+
field("user_id", IntType, "用户 QQ 号")
53+
}
54+
output {
55+
field("nickname", StringType, "昵称")
56+
field("qid", StringType, "QID") { optional() }
57+
field("age", IntType, "年龄")
58+
field("sex", StringType, "性别") {
59+
enum("male", "female", "unknown")
60+
}
61+
field("remark", StringType, "备注") { optional() }
62+
field("bio", StringType, "个性签名") { optional() }
63+
field("level", IntType, "QQ 等级") { optional() }
64+
field("country", StringType, "国家或地区") { optional() }
65+
field("city", StringType, "城市") { optional() }
66+
field("school", StringType, "学校") { optional() }
67+
}
68+
}
69+
4970
api("get_friend_list") {
5071
describe("获取好友列表")
5172
input(cachedApiBase)

0 commit comments

Comments
 (0)