1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-04 11:07:40 +08:00

fix: 修复读取合并转发私聊内容报错 (#287)

This commit is contained in:
Azure 2022-07-20 20:40:26 +08:00 committed by GitHub
parent a39b3fdd96
commit 5c0e2c5773
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -163,8 +163,12 @@ func (l *forwardMsgLinker) link(name string) *message.ForwardMessage {
}
}
gid := int64(0) // 给群号一个缺省值0防止在读合并转发的私聊内容时候会报错
if m.Head.GroupInfo != nil {
gid = m.Head.GroupInfo.GroupCode.Unwrap()
}
nodes = append(nodes, &message.ForwardNode{
GroupId: m.Head.GroupInfo.GroupCode.Unwrap(),
GroupId: gid,
SenderId: m.Head.FromUin.Unwrap(),
SenderName: name,
Time: m.Head.MsgTime.Unwrap(),