diff --git a/client/client.go b/client/client.go
index 054fff25..54e27b15 100644
--- a/client/client.go
+++ b/client/client.go
@@ -13,10 +13,10 @@ import (
"math/rand"
"net"
"strconv"
+ "strings"
"sync"
"sync/atomic"
"time"
- "strings"
"github.com/golang/protobuf/proto"
@@ -180,13 +180,13 @@ func (c *QQClient) Login() (*LoginResponse, error) {
}
func (c *QQClient) GetVipInfo(target int64) (*VipInfo, error) {
- b, err := utils.HttpGetBytes(fmt.Sprintf("https://h5.vip.qq.com/p/mc/cardv2/other?platform=1&qq=%d&adtag=geren&aid=mvip.pingtai.mobileqq.androidziliaoka.fromqita",target),c.getCookiesWithDomain("h5.vip.qq.com"))
+ b, err := utils.HttpGetBytes(fmt.Sprintf("https://h5.vip.qq.com/p/mc/cardv2/other?platform=1&qq=%d&adtag=geren&aid=mvip.pingtai.mobileqq.androidziliaoka.fromqita", target), c.getCookiesWithDomain("h5.vip.qq.com"))
if err != nil {
return nil, err
}
- ret := VipInfo{Uin: target};
+ ret := VipInfo{Uin: target}
b = b[bytes.Index(b, []byte(``))+24:]
- t := b[:bytes.Index(b,[]byte(``))]
+ t := b[:bytes.Index(b, []byte(``))]
ret.Name = string(t)
b = b[bytes.Index(b, []byte(`LV`))+17:]
t = b[:bytes.Index(b, []byte(`
`))]
@@ -194,7 +194,7 @@ func (c *QQClient) GetVipInfo(target int64) (*VipInfo, error) {
b = b[bytes.Index(b, []byte(``))+35:]
b = b[bytes.Index(b, []byte(`
`))+3:]
t = b[:bytes.Index(b, []byte(`倍`))]
- ret.LevelSpeed, _ = strconv.ParseFloat(string(t),64)
+ ret.LevelSpeed, _ = strconv.ParseFloat(string(t), 64)
b = b[bytes.Index(b, []byte(``))+35:]
b = b[bytes.Index(b, []byte(`
`))+3:]
st := string(b[:bytes.Index(b, []byte(`
`))])
@@ -209,7 +209,7 @@ func (c *QQClient) GetVipInfo(target int64) (*VipInfo, error) {
b = b[bytes.Index(b, []byte(`
`))+3:]
t = b[:bytes.Index(b, []byte(`
`))]
ret.VipGrowthTotal, _ = strconv.Atoi(string(t))
- return &ret,nil
+ return &ret, nil
}
func (c *QQClient) GetGroupHonorInfo(groupCode int64, honorType HonorType) (*GroupHonorInfo, error) {
@@ -445,7 +445,7 @@ func (c *QQClient) GetForwardMessage(resId string) *message.ForwardMessage {
ret.Nodes = append(ret.Nodes, &message.ForwardNode{
SenderId: m.Head.FromUin,
SenderName: func() string {
- if m.Head.MsgType == 82 {
+ if m.Head.MsgType == 82 && m.Head.GroupInfo != nil {
return m.Head.GroupInfo.GroupCard
}
return m.Head.FromNick
diff --git a/go.mod b/go.mod
index 2006d99e..9887a232 100644
--- a/go.mod
+++ b/go.mod
@@ -4,6 +4,6 @@ go 1.14
require (
github.com/golang/protobuf v1.4.2
- github.com/tidwall/gjson v1.6.1 // indirect
+ github.com/tidwall/gjson v1.6.1
google.golang.org/protobuf v1.25.0
)
diff --git a/go.sum b/go.sum
index fef7d0b8..31ae4621 100644
--- a/go.sum
+++ b/go.sum
@@ -24,6 +24,12 @@ github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.0 h1:/QaMHBdZ26BB3SSst0Iwl10Epc+xhTquomWX0oZEB6w=
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
+github.com/tidwall/gjson v1.6.1 h1:LRbvNuNuvAiISWg6gxLEFuCe72UKy5hDqhxW/8183ws=
+github.com/tidwall/gjson v1.6.1/go.mod h1:BaHyNc5bjzYkPqgLq7mdVzeiRtULKULXLgZFKsxEHI0=
+github.com/tidwall/match v1.0.1 h1:PnKP62LPNxHKTwvHHZZzdOAOCtsJTjo6dZLCwpKm5xc=
+github.com/tidwall/match v1.0.1/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0+pL9E=
+github.com/tidwall/pretty v1.0.2 h1:Z7S3cePv9Jwm1KwS0513MRaoUe3S01WPbLNV40pwWZU=
+github.com/tidwall/pretty v1.0.2/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=