diff --git a/client/group_info.go b/client/group_info.go index 761ebf62..eac6a534 100644 --- a/client/group_info.go +++ b/client/group_info.go @@ -24,10 +24,12 @@ type ( MemberCount uint16 MaxMemberCount uint16 Members []*GroupMemberInfo + // 最后一条信息的SEQ,只有通过 GetGroupInfo 函数获取的 GroupInfo 才会有 + LastMsgSeq int64 - client *QQClient - lastMsgSeq int64 - lock sync.RWMutex + client *QQClient + + lock sync.RWMutex } GroupMemberInfo struct { @@ -183,7 +185,7 @@ func decodeGroupInfoResponse(c *QQClient, _ uint16, payload []byte) (interface{} MemberCount: uint16(*info.GroupInfo.GroupMemberNum), MaxMemberCount: uint16(*info.GroupInfo.GroupMemberMaxNum), Members: []*GroupMemberInfo{}, - lastMsgSeq: int64(info.GroupInfo.GetGroupCurMsgSeq()), + LastMsgSeq: int64(info.GroupInfo.GetGroupCurMsgSeq()), client: c, }, nil } diff --git a/client/group_msg.go b/client/group_msg.go index 9dc3b83f..e55c4403 100644 --- a/client/group_msg.go +++ b/client/group_msg.go @@ -142,7 +142,7 @@ func (c *QQClient) sendGroupMessage(groupCode int64, forward bool, m *message.Se return ret case <-time.After(time.Second * 5): if g, err := c.GetGroupInfo(groupCode); err == nil { - if history, err := c.GetGroupMessages(groupCode, g.lastMsgSeq-10, g.lastMsgSeq+1); err == nil { + if history, err := c.GetGroupMessages(groupCode, g.LastMsgSeq-10, g.LastMsgSeq+1); err == nil { for _, m := range history { if m.InternalId == mr { return m