mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-06-19 05:55:04 +08:00
fix onebot protocol.
This commit is contained in:
parent
690384a9a3
commit
569b89a117
@ -352,6 +352,9 @@ func SetRestart(s *httpServer, c *gin.Context) {
|
||||
|
||||
func GetForwardMessage(s *httpServer, c *gin.Context) {
|
||||
resId := getParam(c, "message_id")
|
||||
if resId == "" {
|
||||
resId = getParam(c, "id")
|
||||
}
|
||||
c.JSON(200, s.bot.CQGetForwardMessage(resId))
|
||||
}
|
||||
|
||||
|
@ -481,7 +481,11 @@ var wsApi = map[string]func(*coolq.CQBot, gjson.Result) coolq.MSG{
|
||||
return bot.CQGetImage(p.Get("file").Str)
|
||||
},
|
||||
"get_forward_msg": func(bot *coolq.CQBot, p gjson.Result) coolq.MSG {
|
||||
return bot.CQGetForwardMessage(p.Get("message_id").Str)
|
||||
id := p.Get("message_id").Str
|
||||
if id == "" {
|
||||
id = p.Get("id").Str
|
||||
}
|
||||
return bot.CQGetForwardMessage(id)
|
||||
},
|
||||
"get_msg": func(bot *coolq.CQBot, p gjson.Result) coolq.MSG {
|
||||
return bot.CQGetMessage(int32(p.Get("message_id").Int()))
|
||||
|
Loading…
x
Reference in New Issue
Block a user