Skip to content

Commit 6e5b0c1

Browse files
committed
Update: /api/v1/msg
1 parent f9c9aea commit 6e5b0c1

1 file changed

Lines changed: 168 additions & 5 deletions

File tree

src/api/v1/msg.md

Lines changed: 168 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ msg {
191191
edit_time: 1234 // 最后编辑时间
192192
}
193193
// ...
194-
total: 23 // 获取的消息数量,貌似最大31个
194+
total: 23 // 获取的消息数量,貌似最大31个,实际获取的数量是请求中的数量+1
195195
```
196196

197197
::: details ProtoBuf数据结构
@@ -420,7 +420,170 @@ message list_message { // 其实可以和 list-message-by-seq共用的。
420420

421421
:::
422422

423-
### 获取信息历史编辑内容
423+
## 通过消息ID列出消息
424+
425+
POST /v1/msg/list-message-by-mid-seq
426+
427+
::: warning
428+
由于没有所有消息情况,因此此处响应相关内容(尤其是指令等测试群不常见部分)可能会有缺失/错误,见谅.同时建议参照proto文件理解相关内容.也欢迎来PR补充.
429+
:::
430+
431+
::: tip
432+
此接口和 list-message 的区别在于此接口获取到的消息包含请求的消息ID的消息内容. 实际获取到的消息数量是请求消息数量+1
433+
:::
434+
435+
请求头:
436+
437+
|名称|必须|备注|
438+
|-----|-----|-----|
439+
|token|||
440+
441+
请求体:
442+
443+
```ProtoBuf
444+
request_id: 123456 // 请求ID,方便debug用的,可不写
445+
chat_type: 2 // 对象类型,1-用户 2-群聊 3-机器人
446+
chat_id: "big" // 对象ID
447+
unknown: 0 // 不知道干啥的
448+
msg_count: 10 // 请求获取消息数量
449+
msg_id: abcdef // 消息ID
450+
```
451+
452+
::: details ProtoBuf 数据结构
453+
454+
```proto
455+
// 列出包含请求 msg_id 消息
456+
message list_message_by_mid_seq_send {
457+
uint64 request_id = 3; // 请求id
458+
uint64 chat_type = 4;
459+
string chat_id = 5;
460+
uint64 unknown = 6; // 不知道干啥的
461+
uint64 msg_count = 7;
462+
string msg_id = 8;
463+
}
464+
```
465+
466+
:::
467+
468+
响应体:
469+
470+
```ProtoBuf
471+
status {
472+
number: 114514
473+
code: 1
474+
msg: "success"
475+
}
476+
msg {
477+
msg_id: "abcdef" // 消息ID
478+
sender {
479+
chat_id: "7356666" // 发送者ID
480+
chat_type: 1 // 发送者类型。
481+
name: "测试" // 发送者名称
482+
avatar_url: "https://chat-img.jwznb.com/..." // 头像URL
483+
tag_old: "测试成员" // 标签(旧版显示)
484+
// ...
485+
tag {
486+
id: 114514 // 标签ID
487+
text: "测试成员" // 标签文字
488+
color: "#FFFFFFFF" // 颜色
489+
}
490+
// ...
491+
}
492+
direction: "left" // 在聊天中的位置(左边/右边)
493+
msg_type: 1 // 消息类型
494+
msg_content {
495+
text: "ok" // 消息内容
496+
// 剩下的建议看ProtoBuf序列文件,太多不写了
497+
}
498+
send_time: 123456789 // 发送时间(毫秒时间戳)
499+
cmd {
500+
name: "指令名" // 指令名
501+
type: 1 // 指令类型
502+
}
503+
msg_delete_time: 8888 // 消息撤回时间(毫秒时间戳)
504+
quote_msg_id: "abcdef" // 引用消息的ID
505+
msg_seq: 6666 // 消息序列
506+
edit_time: 1234 // 最后编辑时间
507+
}
508+
// ...
509+
total: 11 // 获取的消息数量
510+
```
511+
512+
::: details ProtoBuf数据结构
513+
514+
```proto
515+
// 标签
516+
message Tag {
517+
uint64 id = 1; // 标签ID(貌似)
518+
string text = 3;
519+
string color = 4;
520+
}
521+
522+
message Msg {
523+
string msg_id = 1; // 消息ID
524+
Sender sender = 2;
525+
string direction = 3; // 消息位置,左边/右边
526+
uint64 msg_type = 4;
527+
Msg_content msg_content = 5;
528+
uint64 send_time = 6; // 时间戳(毫秒)
529+
Cmd cmd = 7; // 指令
530+
uint64 msg_delete_time = 8; // 消息撤回时间
531+
string quote_msg_id = 9; // 引用消息ID
532+
uint64 msg_seq = 10;
533+
uint64 edit_time = 12; // 最后编辑时间
534+
535+
message Cmd {
536+
string name = 2; // 指令名
537+
uint64 type = 4; // 指令类型
538+
}
539+
// 消息
540+
message Msg_content {
541+
string text = 1; // 消息内容
542+
string buttons = 2; // 按钮
543+
string image_url = 3;
544+
string file_name = 4;
545+
string file_url = 5;
546+
string form = 7; // 表单消息
547+
string quote_msg_text = 8; // 引用消息文字
548+
string sticker_url = 9; // 表情URL
549+
string post_id = 10; // 文章ID
550+
string post_title = 11; // 文章标题
551+
string post_content = 12; // 文章内容
552+
string post_content_type = 13; // 文章类型
553+
string expression_id = 15; // 个人表情ID(不知道为啥为STR)
554+
uint64 file_size = 18; // 文件/图片大小(字节)
555+
string video_url = 19; // 视频URL
556+
string audio_url = 21; // 语音URL
557+
uint64 audio_time = 22; // 语音时长
558+
uint64 sticker_item_id = 25; // 表情ID
559+
uint64 sticker_pack_id = 26; // 表情包ID
560+
string call_text = 29; // 语音通话文字
561+
string call_status_text = 32; // 语音通话状态文字
562+
uint64 width = 33; // 图片的宽度
563+
uint64 height = 34; // 图片的高度
564+
}
565+
// 发送者信息
566+
message Sender {
567+
string chat_id = 1;
568+
uint64 chat_type = 2;
569+
string name = 3;
570+
string avatar_url = 4;
571+
repeated string tag_old = 6;
572+
repeated Tag tag = 7;
573+
}
574+
}
575+
576+
message list_message_by_mid_seq {
577+
Status status = 1;
578+
repeated Msg msg = 2;
579+
uint64 total = 3; // 消息数
580+
}
581+
582+
```
583+
584+
:::
585+
586+
## 获取信息历史编辑内容
424587

425588
POST /v1/msg/list-message-edit-record
426589

@@ -463,7 +626,7 @@ POST /v1/msg/list-message-edit-record
463626
}
464627
```
465628

466-
### 发送按钮点击事件
629+
## 发送按钮点击事件
467630

468631
POST /v1/msg/button-report
469632

@@ -520,7 +683,7 @@ message button_report {
520683

521684
:::
522685

523-
### 撤回信息
686+
## 撤回信息
524687

525688
POST /v1/msg/recall-msg
526689

@@ -572,7 +735,7 @@ message button_report {
572735

573736
:::
574737

575-
### 批量信息撤回
738+
## 批量撤回消息
576739

577740
POST /v1/msg/recall-msg-batch
578741

0 commit comments

Comments
 (0)