Skip to content

Commit 345be20

Browse files
Kauid323QianLin-Jiaxi
authored andcommitted
add:获取群内机器人配置和保存群内机器人配置
大脑炸了
1 parent e4bfae8 commit 345be20

1 file changed

Lines changed: 196 additions & 2 deletions

File tree

src/api/v1/bot.md

Lines changed: 196 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ POST /v1/bot/new-list
7676
}
7777
```
7878

79-
## 使用该机器人的群组(该注释含有较多不知道的字段,请谨慎使用)
79+
## 使用该机器人的群组
8080

8181
POST /v1/bot/bot-detail
8282

@@ -114,7 +114,7 @@ POST /v1/bot/bot-detail
114114
"headcount": 123, // 机器人使用人数
115115
"private": 0, // 是否私有(0为否,1为私人)
116116
"isStop": 0, // 是否停用(0为启用,1为停用)
117-
"settingJson": "", // 设置json
117+
"settingJson": "", // 机器人设置json(需转义)
118118
"del_flag": 0,
119119
"alwaysAgree": 1, // 是否总是同意添加群聊
120120
"banId": 0, // 顾名思义
@@ -659,3 +659,197 @@ POST /v1/bot/edit-subscribed-link
659659
"msg": "success" // 返回消息
660660
}
661661
```
662+
663+
## 获取群聊内机器人设置
664+
665+
POST /v1/bot/get-user-settings-json
666+
667+
请求头:
668+
669+
|名称|必须|备注|
670+
|-----|-----|-----|
671+
|token||群聊管理员token|
672+
673+
请求体:
674+
675+
```JSONC
676+
{
677+
"botId": "2468910", // 机器人id
678+
"chatId": "1234567" // 会话id(一般是群聊)
679+
}
680+
```
681+
682+
响应体: (具体settingsJson更多解释请看[这里](https://yh-api.yyyyt.top/api/v1/instruction.html#%E5%88%9B%E5%BB%BA%E6%9C%BA%E5%99%A8%E4%BA%BA%E6%8C%87%E4%BB%A4)
683+
684+
```JSONC
685+
{
686+
"code": 1,
687+
"data": {
688+
"settingsJson": [
689+
{
690+
"id": "pqkyru", // 该项的id(表单id)
691+
"key": 0, // 第几个项,这里是第一个
692+
"props": [
693+
{
694+
"name": "标签", // 该项名称
695+
"type": "label", // 类型,一个用于设置“标签”的配置项,有radio-单选框,input-输入框,switch-开关,chexkbox-多选框,textarea-多行输入框,select-选择器
696+
"value": "" // 这个类型预定的值,默认空
697+
},
698+
{
699+
"name": "选项",
700+
"placeholder": "用#分割,如:北京#上海#天津", // 带有输入框的项/类型,会有选项,然后里面有占位符,这个就是占位符文本,其实这个叫选项
701+
"type": "options", // 带placeholder的类型有,Radio 单选框,Checkbox 多选框,Select 选择器
702+
"value": ""
703+
}
704+
],
705+
"propsValue": {
706+
"label": "标签",
707+
"options": "用#分割,如:北京#上海#天津"
708+
},
709+
"title": "Radio 单选框", // 该项标题
710+
"type": "radio"
711+
},
712+
{
713+
"id": "xmmtbi",
714+
"key": 1,
715+
"props": [
716+
{
717+
"name": "标签",
718+
"type": "label",
719+
"value": ""
720+
},
721+
{
722+
"name": "默认内容",
723+
"type": "defaultValue",
724+
"value": ""
725+
},
726+
{
727+
"name": "占位文本",
728+
"type": "placeholder",
729+
"value": ""
730+
}
731+
],
732+
"propsValue": {
733+
"defaultValue": "默认内容",
734+
"label": "标签",
735+
"placeholder": "占位文本"
736+
},
737+
"title": "Input 输入框",
738+
"type": "input"
739+
},
740+
{
741+
"id": "vnafdx",
742+
"key": 2,
743+
"props": [
744+
{
745+
"name": "标签",
746+
"type": "label",
747+
"value": ""
748+
},
749+
{
750+
"name": "默认状态",
751+
"placeholder": "1:默认打开,0:默认关闭",
752+
"type": "defaultValue",
753+
"value": ""
754+
}
755+
],
756+
"propsValue": {
757+
"defaultValue": "1:默认打开,0:默认关闭",
758+
"label": "标签"
759+
},
760+
"title": "Switch 开关",
761+
"type": "switch"
762+
},
763+
{
764+
"id": "sdudlm",
765+
"key": 3,
766+
"props": [
767+
{
768+
"name": "标签",
769+
"type": "label",
770+
"value": ""
771+
},
772+
{
773+
"name": "选项",
774+
"placeholder": "用#分割,如:北京#上海#天津",
775+
"type": "options",
776+
"value": ""
777+
}
778+
],
779+
"propsValue": {
780+
"label": "标签",
781+
"options": "用#分割,如:北京#上海#天津"
782+
},
783+
"title": "Checkbox 多选框",
784+
"type": "checkbox"
785+
},
786+
{
787+
"id": "qievxs",
788+
"key": 4,
789+
"props": [
790+
{
791+
"name": "标签",
792+
"type": "label",
793+
"value": ""
794+
},
795+
{
796+
"name": "占位文本",
797+
"type": "placeholder",
798+
"value": ""
799+
}
800+
],
801+
"propsValue": {
802+
"label": "标签",
803+
"placeholder": "占位文本"
804+
},
805+
"title": "textarea 多行输入框",
806+
"type": "textarea"
807+
},
808+
{
809+
"id": "pzdslt",
810+
"key": 5,
811+
"props": [
812+
{
813+
"name": "标签",
814+
"type": "label",
815+
"value": ""
816+
},
817+
{
818+
"name": "选项",
819+
"placeholder": "用#分割,如:北京#上海#天津",
820+
"type": "options",
821+
"value": ""
822+
}
823+
],
824+
"propsValue": {
825+
"label": "标签",
826+
"options": "用#分割,如:北京#上海#天津"
827+
},
828+
"title": "Select 选择器",
829+
"type": "select"
830+
}
831+
]
832+
},
833+
"msg": "success"
834+
}
835+
```
836+
837+
## 群聊内机器人设置保存
838+
839+
POST /v1/bot/send-setting-json
840+
841+
请求头:
842+
843+
|名称|必须|备注|
844+
|-----|-----|-----|
845+
|token||群聊管理员token|
846+
847+
请求体: (具体settingJson更多解释请看[这里](https://yh-api.yyyyt.top/api/v1/instruction.html#%E5%88%9B%E5%BB%BA%E6%9C%BA%E5%99%A8%E4%BA%BA%E6%8C%87%E4%BB%A4)
848+
849+
```JSONC
850+
{
851+
"id": "12345", // 机器人id
852+
"groupId": "678910", // 群聊id
853+
"settingJson": "" // 机器人设置json数组(需转义)
854+
}
855+
```

0 commit comments

Comments
 (0)