1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-05 03:23:49 +08:00
This commit is contained in:
Akiba 2022-06-25 21:21:16 +08:00
parent 7e750352c4
commit a0fba6ad54
No known key found for this signature in database
GPG Key ID: 770E2536B844F0F9

View File

@ -832,7 +832,12 @@ func (bot *CQBot) uploadForwardElement(m gjson.Result, target int64, sourceType
groupID := target groupID := target
source := message.Source{SourceType: sourceType, PrimaryID: target} source := message.Source{SourceType: sourceType, PrimaryID: target}
if sourceType == message.SourcePrivate { if sourceType == message.SourcePrivate {
groupID = 0 // ios 设备的合并转发来源群号不能为 0
if len(bot.Client.GroupList) == 0 {
groupID = 1
} else {
groupID = bot.Client.GroupList[1].Uin
}
} }
builder := bot.Client.NewForwardMessageBuilder(groupID) builder := bot.Client.NewForwardMessageBuilder(groupID)
@ -875,12 +880,10 @@ func (bot *CQBot) uploadForwardElement(m gjson.Result, target int64, sourceType
i := e.Get("data.id").Int() i := e.Get("data.id").Int()
m, _ := db.GetMessageByGlobalID(int32(i)) m, _ := db.GetMessageByGlobalID(int32(i))
if m != nil { if m != nil {
mSource := func() message.SourceType { mSource := message.SourcePrivate
if m.GetType() == "group" { if m.GetType() == "group" {
return message.SourceGroup mSource = message.SourceGroup
} }
return message.SourcePrivate
}()
msgTime := m.GetAttribute().Timestamp msgTime := m.GetAttribute().Timestamp
if msgTime == 0 { if msgTime == 0 {
msgTime = ts.Unix() msgTime = ts.Unix()