Commit 2b00b497 authored by wdvxdr's avatar wdvxdr

fix: fit onebot

适配onebot标准
parent a77977b1
......@@ -209,7 +209,7 @@ json中的字符串需要进行转义:
| 字段 | 类型 | 说明 |
| -------- | ------ | ---- |
| group_id | int64 | 群号 |
| name | string | 新名 |
| group_name | string | 新名 |
### 获取图片信息
......
......@@ -347,7 +347,7 @@ func (s *httpServer) SetWholeBan(c *gin.Context) {
func (s *httpServer) SetGroupName(c *gin.Context) {
gid, _ := strconv.ParseInt(getParam(c, "group_id"), 10, 64)
c.JSON(200, s.bot.CQSetGroupName(gid, getParam(c, "name")))
c.JSON(200, s.bot.CQSetGroupName(gid, getParam(c, "group_name")))
}
func (s *httpServer) SetGroupLeave(c *gin.Context) {
......
......@@ -477,7 +477,7 @@ var wsApi = map[string]func(*coolq.CQBot, gjson.Result) coolq.MSG{
}())
},
"set_group_name": func(bot *coolq.CQBot, p gjson.Result) coolq.MSG {
return bot.CQSetGroupName(p.Get("group_id").Int(), p.Get("name").Str)
return bot.CQSetGroupName(p.Get("group_id").Int(), p.Get("group_name").Str)
},
"set_group_leave": func(bot *coolq.CQBot, p gjson.Result) coolq.MSG {
return bot.CQSetGroupLeave(p.Get("group_id").Int())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment