Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
158 changes: 158 additions & 0 deletions src/api/v1/bot.md
Original file line number Diff line number Diff line change
Expand Up @@ -1092,3 +1092,161 @@ POST /v1/bot/group-permission-edit
"msg": "success" // 返回状态消息
}
```

## 获取关注者列表

```http request
POST /v1/bot/follower-list
```

### 请求头

| 名称 | 必须 | 备注 |
| ----- | ---- | ---- |
| token | 是 | 无 |

### 请求体

```ProtoBuf
data {
size: 20 // 分页大小
page: 1 // 页数
}
bot_id: "123" // 机器人ID
keywords: "测试" // 搜索关键词
```

::: details ProtoBuf数据结构

```proto
message list_follower {
Data data = 2;
string bot_id = 3; // 机器人ID
string keywords = 4; // 搜索关键词

message Data {
int32 size = 1; // 分页大小
int32 page = 2; // 页数
}
}
```

:::

### 响应数据

```ProtoBuf
status {
number: 114514
code: 1
msg: "success"
}
user {
user_id: "7356666" // 用户ID
name: "Feng" // 用户名
avatar_url: "https://..." // 头像URL
is_vip: 0 // 是否为vip用户, 0-不为vip用户, 1-vip用户
}
totol: 32 // 关注该机器人的用户总数
}
// 可以有多个
// ...
```

::: details ProtoBuf数据结构

```proto
message list_follower {
Status status = 1;
repeated User user = 2;
int32 totol = 3;

message User {
string user_id = 1;
string name = 2;
string avatar_url = 4;
int32 is_vip = 6;
}
}
}
```

:::

## 获取加入群聊列表

```http request
POST /v1/bot/join-group-list
```

### 请求头

| 名称 | 必须 | 备注 |
| ----- | ---- | ---- |
| token | 是 | 无 |

### 请求体

```ProtoBuf
data {
size: 20 // 分页大小
page: 1 // 页数
}
bot_id: "123" // 机器人ID
keywords: "测试用户名" // 搜索关键词
```

::: details ProtoBuf数据结构

```proto
message list_join_group {
Data data = 2;
string bot_id = 3; // 机器人ID
string keywords = 4; // 搜索关键词

message Data {
int32 size = 1; // 分页大小
int32 page = 2; // 页数
}
}
```

:::

### 响应数据

```ProtoBuf
status {
number: 114514
code: 1
msg: "success"
}
group {
user_id: "123" // 群聊ID
name: "测试群聊名称" // 群聊名字
avatar_url: "https://..." // 头像URL
}
totol: 32 // 机器人加入的群聊总数
}
// 可以有多个
// ...
```

::: details ProtoBuf数据结构

```proto
message list_join_group {
Status status = 1;
repeated Group group = 2;
int32 total = 3;

message Group {
string id = 1;
string name = 2;
string avatarUrl = 3;
}

}
```

:::
3 changes: 2 additions & 1 deletion src/api/v1/community.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ POST /v1/community/posts/post-reward
```JSONC
{
"postId": 123, // 文章ID
"recvId": "123", // 接受用户ID
"amount": 1.0 // 打赏金币数
}
```
Expand Down Expand Up @@ -351,7 +352,7 @@ POST /v1/community/ba/following-ba-list

```JSONC
{
"typ": 2, // 类型
"typ": 2, // 类型(1-关注, 2-热门, 3-我的, 4-全部)
"size": 20, // 排序
"page": 1 // 页数
}
Expand Down
63 changes: 54 additions & 9 deletions src/api/v1/conversation.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,23 @@ POST /v1/conversation/list
| ----- | ---- | ---- |
| token | 是 | 无 |

请求体

```ProtoBuf
md5: "123123" // 上次获取对话列表的md5,如果与服务器一致则返回空列表
```

::: details ProtoBuf数据结构

```proto
// 请求标识符
message address_book_list_send {
string md5 = 2;
}
```

:::

响应体:

```ProtoBuf
Expand All @@ -53,15 +70,15 @@ status {
data {
chat_id: "7356666" // 对象ID
chat_type: 1 // 对象类型,1-用户 2-群聊 3-机器人
name: "测试" // 名称
remark: "测试" // 备注名称
chat_content: "我信(" // 会话内容
timestamp_ms: 1755566778727 // 时间戳(毫秒)
timestamp_ms: 1755566778727 // 加入对话列表时间戳(毫秒)
unread_message: 1 // 是否存在未读消息
at: 1 // 是否被@,1表示被@
avatar_id: 12345 // 头像ID
avatar_url: "https://chat-img.jwznb.com/..." // 头像URL
do_not_disturb: 1 // 免打扰,1表示开启
timestamp: 1755566778 // 时间戳(秒)
send_timestamp: 1755566778 // 消息发送时间戳(秒)
at_data {
unknown: 123456 // 似乎是名称ID
mentioned_id: "7356666" // 被@的ID
Expand All @@ -71,11 +88,12 @@ data {
mentioner_name: "测试" // 发起@的对象的名称
msg_seq: 1234 // 消息序列
}
name: "测试"; // 用户真实名称
certification_level: 1 // 认证相关,1是官方,2是地区
}
// ...
total: 8 // 会话数目
request_id: "abcdef"
md5: "abcdef" // 对话列表的md5

```

Expand All @@ -87,22 +105,22 @@ message list {
Status status = 1;
repeated Data data = 2;
uint64 total = 3; // 列表中对话的数量
string request_id = 4; // 似乎是请求ID
string md5 = 4; // 对话列表的md5

message Data {
string chat_id = 1; // 对象ID
uint64 chat_type = 2; // 对象类型
string name = 3; // 名称
string remark = 3; // 备注名称
string chat_content = 4; // 消息内容
uint64 timestamp_ms = 5; // 毫秒时间戳
uint64 timestamp_ms = 5; // 加入对话列表时间戳(毫秒)
uint64 unread_message = 6; // 1表示有未读消息
uint64 at = 7; // 是否被@
uint64 avatar_id = 8; // 头像ID
string avatar_url = 9; // 头像URL
uint64 do_not_disturb = 11; // 免打扰
uint64 timestamp = 12; // 秒级时间戳
uint64 send_timestamp = 12; // 消息发送时间戳(秒)
At_data at_data = 14; // @数据
// 15和3重了就不解析了
string name = 15; // 用户真实名称
uint64 certification_level = 16; // 认证,1是官方 2是地区

message At_data {
Expand Down Expand Up @@ -146,3 +164,30 @@ POST /v1/conversation/sort-change
"msg": "success" // 返回信息
}
```

## 删除对话

POST /v1/conversation/remove

请求头:

| 名称 | 必须 | 备注 |
| ----- | ---- | ---- |
| token | 是 | 无 |

请求体:

```JSONC
{
"chatId": "123" // 用户/机器人/群组ID
}
```

响应体:

```JSONC
{
"code": 1, // 返回状态码,1为正常
"msg": "success" // 返回信息
}
```
35 changes: 33 additions & 2 deletions src/api/v1/disk.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,37 @@ POST /v1/disk/file-list
}
```

## 获取群网盘文件总大小

POST /v1/disk/file-size

请求头:

| 名称 | 必须 | 备注 |
| ----- | ---- | ---- |
| token | 是 | 无 |

请求体:

```JSONC
{
"chatId": "群聊id",
"chatType": 2, // 会话类型
}
```

响应体:

```JSONC
{
"code": 1,
"data": {
"totalSize": 0 // 群网盘总占用大小(单位:B)
},
"msg": "success" // 返回消息
}
```

## 上传文件(需搭配[获取上传文件token](/api/v1/misc.html#%E8%8E%B7%E5%8F%96%E5%8A%9F%E8%83%BD%E8%B7%AF%E7%94%B1)使用)

POST /v1/disk/upload-file
Expand Down Expand Up @@ -129,7 +160,7 @@ POST /v1/disk/rename
```JSONC
{
"id": 123, // 文件ID
"objectType": 2, // 会话类型
"objectType": 2, // 文件类型(1-文件夹, 2-文件)
"name": "测试文件名称" // 文件名称
}
```
Expand Down Expand Up @@ -158,7 +189,7 @@ POST /v1/disk/remove
```JSONC
{
"id": 123, // 文件ID
"objectType": 2, // 会话类型
"objectType": 2, // 文件类型(1-文件夹, 2-文件)
}
```

Expand Down
Loading