mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-05-05 03:23:49 +08:00
feature get_group_system_msg.
This commit is contained in:
parent
1b63a15bbe
commit
6ad0d68978
@ -666,6 +666,15 @@ func (bot *CQBot) CQGetMessage(messageId int32) MSG {
|
||||
})
|
||||
}
|
||||
|
||||
func (bot *CQBot) CQGetGroupSystemMessages() MSG {
|
||||
msg, err := bot.Client.GetGroupSystemMessages()
|
||||
if err != nil {
|
||||
log.Warnf("获取群系统消息失败: %v", err)
|
||||
return Failed(100)
|
||||
}
|
||||
return OK(msg)
|
||||
}
|
||||
|
||||
func (bot *CQBot) CQCanSendImage() MSG {
|
||||
return OK(MSG{"yes": true})
|
||||
}
|
||||
|
2
go.mod
2
go.mod
@ -3,7 +3,7 @@ module github.com/Mrs4s/go-cqhttp
|
||||
go 1.14
|
||||
|
||||
require (
|
||||
github.com/Mrs4s/MiraiGo v0.0.0-20201024092610-03d2bbf32a4d
|
||||
github.com/Mrs4s/MiraiGo v0.0.0-20201025135955-5be0ad946177
|
||||
github.com/gin-gonic/gin v1.6.3
|
||||
github.com/gorilla/websocket v1.4.2
|
||||
github.com/guonaihong/gout v0.1.3
|
||||
|
2
go.sum
2
go.sum
@ -8,6 +8,8 @@ github.com/Mrs4s/MiraiGo v0.0.0-20201017083749-517ddcd50b8d h1:f59SuqT0RVy6T9nAg
|
||||
github.com/Mrs4s/MiraiGo v0.0.0-20201017083749-517ddcd50b8d/go.mod h1:cwYPI2uq6nxNbx0nA6YuAKF1V5szSs6FPlGVLQvRUlo=
|
||||
github.com/Mrs4s/MiraiGo v0.0.0-20201024092610-03d2bbf32a4d h1:g200Tv/mkCy6oSFqfOzblMfa3D50iNhyG7IUUQWkb78=
|
||||
github.com/Mrs4s/MiraiGo v0.0.0-20201024092610-03d2bbf32a4d/go.mod h1:cwYPI2uq6nxNbx0nA6YuAKF1V5szSs6FPlGVLQvRUlo=
|
||||
github.com/Mrs4s/MiraiGo v0.0.0-20201025135955-5be0ad946177 h1:TcKqPWXKvOKW2O80rbswKYVLBB3Xas3+RvRInVMyBm8=
|
||||
github.com/Mrs4s/MiraiGo v0.0.0-20201025135955-5be0ad946177/go.mod h1:cwYPI2uq6nxNbx0nA6YuAKF1V5szSs6FPlGVLQvRUlo=
|
||||
github.com/bwmarrin/snowflake v0.3.0 h1:xm67bEhkKh6ij1790JB83OujPR5CzNe8QuQqAgISZN0=
|
||||
github.com/bwmarrin/snowflake v0.3.0/go.mod h1:NdZxfVWX+oR6y2K0o6qAYv6gIOP9rjG0/E9WsDpxqwE=
|
||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||
|
@ -318,6 +318,10 @@ func (s *httpServer) GetForwardMessage(c *gin.Context) {
|
||||
c.JSON(200, s.bot.CQGetForwardMessage(resId))
|
||||
}
|
||||
|
||||
func (s *httpServer) GetGroupSystemMessage(c *gin.Context) {
|
||||
c.JSON(200, s.bot.CQGetGroupSystemMessages())
|
||||
}
|
||||
|
||||
func (s *httpServer) DeleteMessage(c *gin.Context) {
|
||||
mid, _ := strconv.ParseInt(getParam(c, "message_id"), 10, 32)
|
||||
c.JSON(200, s.bot.CQDeleteMessage(int32(mid)))
|
||||
@ -505,6 +509,9 @@ var httpApi = map[string]func(s *httpServer, c *gin.Context){
|
||||
"get_msg": func(s *httpServer, c *gin.Context) {
|
||||
s.GetMessage(c)
|
||||
},
|
||||
"get_group_system_msg": func(s *httpServer, c *gin.Context) {
|
||||
s.GetGroupSystemMessage(c)
|
||||
},
|
||||
"get_group_honor_info": func(s *httpServer, c *gin.Context) {
|
||||
s.GetGroupHonorInfo(c)
|
||||
},
|
||||
|
@ -495,6 +495,9 @@ var wsApi = map[string]func(*coolq.CQBot, gjson.Result) coolq.MSG{
|
||||
"get_version_info": func(bot *coolq.CQBot, p gjson.Result) coolq.MSG {
|
||||
return bot.CQGetVersionInfo()
|
||||
},
|
||||
"get_group_system_msg": func(bot *coolq.CQBot, p gjson.Result) coolq.MSG {
|
||||
return bot.CQGetGroupSystemMessages()
|
||||
},
|
||||
"_get_vip_info": func(bot *coolq.CQBot, p gjson.Result) coolq.MSG {
|
||||
return bot.CQGetVipInfo(p.Get("user_id").Int())
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user