mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-05-04 19:17:37 +08:00
尝试使 get_msg 获取消息中的回复信息 (#2207)
This commit is contained in:
parent
2b1d9c21cb
commit
cffdfd8181
18
coolq/api.go
18
coolq/api.go
@ -1686,8 +1686,26 @@ func (bot *CQBot) CQGetMessage(messageID int32) global.MSG {
|
||||
switch o := msg.(type) {
|
||||
case *db.StoredGroupMessage:
|
||||
m["group_id"] = o.GroupCode
|
||||
if o.QuotedInfo != nil {
|
||||
elem := global.MSG{
|
||||
"type": "reply",
|
||||
"data": global.MSG{
|
||||
"id": strconv.FormatInt(int64(o.QuotedInfo.PrevGlobalID), 10),
|
||||
},
|
||||
}
|
||||
o.Content = append(o.Content, elem)
|
||||
}
|
||||
m["message"] = ToFormattedMessage(bot.ConvertContentMessage(o.Content, message.SourceGroup), message.Source{SourceType: message.SourceGroup, PrimaryID: o.GroupCode})
|
||||
case *db.StoredPrivateMessage:
|
||||
if o.QuotedInfo != nil {
|
||||
elem := global.MSG{
|
||||
"type": "reply",
|
||||
"data": global.MSG{
|
||||
"id": strconv.FormatInt(int64(o.QuotedInfo.PrevGlobalID), 10),
|
||||
},
|
||||
}
|
||||
o.Content = append(o.Content, elem)
|
||||
}
|
||||
m["message"] = ToFormattedMessage(bot.ConvertContentMessage(o.Content, message.SourcePrivate), message.Source{SourceType: message.SourcePrivate})
|
||||
}
|
||||
return OK(m)
|
||||
|
Loading…
x
Reference in New Issue
Block a user