1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-05 19:43:49 +08:00
This commit is contained in:
Mrs4s 2022-06-25 17:40:15 +08:00
parent 2402bbedb0
commit f772996418
No known key found for this signature in database
GPG Key ID: 3186E98FA19CE3A7

View File

@ -873,17 +873,17 @@ func (bot *CQBot) uploadForwardElement(m gjson.Result, target int64, sourceType
} }
if e.Get("data.id").Exists() { if e.Get("data.id").Exists() {
i := e.Get("data.id").Int() i := e.Get("data.id").Int()
m, _ := db.GetGroupMessageByGlobalID(int32(i)) m, _ := db.GetMessageByGlobalID(int32(i))
if m != nil { if m != nil {
msgTime := m.Attribute.Timestamp msgTime := m.GetAttribute().Timestamp
if msgTime == 0 { if msgTime == 0 {
msgTime = ts.Unix() msgTime = ts.Unix()
} }
return &message.ForwardNode{ return &message.ForwardNode{
SenderId: m.Attribute.SenderUin, SenderId: m.GetAttribute().SenderUin,
SenderName: m.Attribute.SenderName, SenderName: m.GetAttribute().SenderName,
Time: int32(msgTime), Time: int32(msgTime),
Message: resolveElement(bot.ConvertContentMessage(m.Content, message.SourceGroup)), Message: resolveElement(bot.ConvertContentMessage(m.GetContent(), message.SourceGroup)),
} }
} }
log.Warnf("警告: 引用消息 %v 错误或数据库未开启.", e.Get("data.id").Str) log.Warnf("警告: 引用消息 %v 错误或数据库未开启.", e.Get("data.id").Str)