diff --git a/message/elements.go b/message/elements.go index 4c7a0fb8..5f4a59cd 100644 --- a/message/elements.go +++ b/message/elements.go @@ -102,7 +102,8 @@ type MusicShareElement struct { } type AnimatedSticker struct { - ID int32 + ID int32 + Name string } type RedBagMessageType int diff --git a/message/face.go b/message/face.go index 9740bcda..25cf4364 100644 --- a/message/face.go +++ b/message/face.go @@ -8,11 +8,11 @@ var faceMap = map[int]string{ 2: "色", 3: "发呆", 4: "得意", - 5: "流泪", 6: "害羞", 7: "闭嘴", 8: "睡", 9: "大哭", + 5: "流泪", 10: "尴尬", 11: "发怒", 12: "调皮", @@ -128,6 +128,13 @@ var faceMap = map[int]string{ 324: "吃糖", 325: "惊吓", 326: "生气", + 53: "蛋糕", + 114: "篮球", + 327: "加一", + 328: "错号", + 329: "对号", + 330: "完成", + 331: "明白", 49: "拥抱", 66: "爱心", 63: "玫瑰", @@ -226,7 +233,6 @@ var faceMap = map[int]string{ 274: "太南了", 113: "啤酒", 140: "K歌", - 53: "蛋糕", 188: "蛋", 55: "炸弹", 184: "河蟹", @@ -238,7 +244,6 @@ var faceMap = map[int]string{ 145: "祈祷", 117: "瓢虫", 168: "药", - 114: "篮球", 115: "乒乓", 57: "足球", 41: "发抖", @@ -260,6 +265,7 @@ var faceMap = map[int]string{ } var stickerMap = map[int]string{ + 5: "16", 311: "1", 312: "2", 313: "3", @@ -274,4 +280,6 @@ var stickerMap = map[int]string{ 324: "12", 325: "14", 326: "15", + 53: "17", + 114: "13", } diff --git a/message/generate.go b/message/generate.go index 7eeb6490..c41f8668 100644 --- a/message/generate.go +++ b/message/generate.go @@ -15,7 +15,7 @@ import ( "strings" ) -const faceDownloadUrl = `https://down.qq.com/qqface/config/face_config2021071501.zip?mType=Other` //? 好像是会自动更新的 +const faceDownloadUrl = `https://down.qq.com/qqface/config/face_config_json_1026_hide.zip?mType=Other` //? 好像是会自动更新的 type ani struct { QSid string @@ -66,7 +66,7 @@ func main() { faceConfig.SystemFace[i].QDes = strings.TrimPrefix(faceConfig.SystemFace[i].QDes, "/") if sysface.AniStickerId != "" { faceConfig.Stickers = append(faceConfig.Stickers, ani{ - Qsid: sysface.QSid, + QSid: sysface.QSid, StickerID: sysface.AniStickerId, }) } diff --git a/message/message.go b/message/message.go index 594fde7e..b7d311d9 100644 --- a/message/message.go +++ b/message/message.go @@ -567,6 +567,14 @@ func ParseMessageElems(elems []*msg.Elem) []IMessageElement { newSysFaceMsg := &msg.MsgElemInfoServtype33{} _ = proto.Unmarshal(elem.CommonElem.PbElem, newSysFaceMsg) res = append(res, NewFace(int32(newSysFaceMsg.GetIndex()))) + case 37: + animatedStickerMsg := &msg.MsgElemInfoServtype37{} + _ = proto.Unmarshal(elem.CommonElem.PbElem, animatedStickerMsg) + sticker := &AnimatedSticker{ + ID: int32(animatedStickerMsg.GetQsid()), + Name: strings.TrimPrefix(string(animatedStickerMsg.GetText()), "/"), + } + return []IMessageElement{sticker} // sticker 永远为单独消息 } } } diff --git a/message/pack.go b/message/pack.go index 0a696206..410be098 100644 --- a/message/pack.go +++ b/message/pack.go @@ -155,13 +155,22 @@ func (e *ShortVideoElement) Pack() (r []*msg.Elem) { } func (e *AnimatedSticker) Pack() []*msg.Elem { - name := "/" + faceMap[int(e.ID)] + if e.Name == "" { + e.Name = faceMap[int(e.ID)] + } + name := "/" + e.Name + business := int32(1) + if e.ID == 114 { + // 对篮球适配,否则篮球不会投出 + business = 2 + } + pbElem, _ := proto.Marshal(&msg.MsgElemInfoServtype37{ Packid: []byte("1"), Stickerid: []byte(stickerMap[int(e.ID)]), Qsid: proto.Uint32(uint32(e.ID)), Sourcetype: proto.Uint32(1), - Stickertype: proto.Uint32(1), + Stickertype: proto.Uint32(uint32(business)), Resultid: []byte{}, Text: []byte(name), Surpriseid: []byte{}, @@ -171,11 +180,11 @@ func (e *AnimatedSticker) Pack() []*msg.Elem { CommonElem: &msg.CommonElem{ ServiceType: proto.Int32(37), PbElem: pbElem, - BusinessType: proto.Int32(1), + BusinessType: &business, }, } - pbReverse, _ := proto.Marshal(&msg.Text{Str: proto.String(fmt.Sprintf("[%s]请使用最新版手机QQ体验新功能", faceMap[int(e.ID)]))}) + pbReverse, _ := proto.Marshal(&msg.Text{Str: proto.String(fmt.Sprintf("[%s]请使用最新版手机QQ体验新功能", e.Name))}) text := &msg.Elem{ Text: &msg.Text{ Str: &name,