mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-05-05 03:23:49 +08:00
fix #75.
This commit is contained in:
parent
782a3e2a39
commit
69675aa0f9
@ -229,6 +229,14 @@ func (s *httpServer) GetGroupMemberInfo(c *gin.Context) {
|
||||
}
|
||||
|
||||
func (s *httpServer) SendMessage(c *gin.Context) {
|
||||
if getParam(c, "message_type") == "private" {
|
||||
s.SendPrivateMessage(c)
|
||||
return
|
||||
}
|
||||
if getParam(c, "message_type") == "group" {
|
||||
s.SendGroupMessage(c)
|
||||
return
|
||||
}
|
||||
if getParam(c, "group_id") != "" {
|
||||
s.SendGroupMessage(c)
|
||||
return
|
||||
|
@ -331,6 +331,12 @@ var wsApi = map[string]func(*coolq.CQBot, gjson.Result) coolq.MSG{
|
||||
)
|
||||
},
|
||||
"send_msg": func(bot *coolq.CQBot, p gjson.Result) coolq.MSG {
|
||||
if p.Get("message_type").Str == "private" {
|
||||
return bot.CQSendPrivateMessage(p.Get("user_id").Int(), p.Get("message"))
|
||||
}
|
||||
if p.Get("message_type").Str == "group" {
|
||||
return bot.CQSendGroupMessage(p.Get("group_id").Int(), p.Get("message"))
|
||||
}
|
||||
if p.Get("group_id").Int() != 0 {
|
||||
return bot.CQSendGroupMessage(p.Get("group_id").Int(), p.Get("message"))
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user