From cffdfd8181983c57927683c3cba6050136664723 Mon Sep 17 00:00:00 2001 From: xiangxiangxiong9 <1296976552@qq.com> Date: Tue, 1 Aug 2023 11:24:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E4=BD=BF=20get=5Fmsg=20?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=B6=88=E6=81=AF=E4=B8=AD=E7=9A=84=E5=9B=9E?= =?UTF-8?q?=E5=A4=8D=E4=BF=A1=E6=81=AF=20(#2207)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- coolq/api.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/coolq/api.go b/coolq/api.go index 72b34b9..7749832 100644 --- a/coolq/api.go +++ b/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)