1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-04 19:17:38 +08:00

简化URL处理逻辑 (#263)

* update image url

* %X
This commit is contained in:
lz1998 2022-03-20 01:06:05 +08:00 committed by GitHub
parent 5903226f25
commit 79f34a47b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,9 +1,7 @@
package message package message
import ( import (
"strings" "fmt"
"github.com/Mrs4s/MiraiGo/binary"
"github.com/Mrs4s/MiraiGo/client/pb/msg" "github.com/Mrs4s/MiraiGo/client/pb/msg"
"github.com/Mrs4s/MiraiGo/internal/proto" "github.com/Mrs4s/MiraiGo/internal/proto"
) )
@ -73,7 +71,7 @@ func NewGroupImage(id string, md5 []byte, fid int64, size, width, height, imageT
ImageType: imageType, ImageType: imageType,
Width: width, Width: width,
Height: height, Height: height,
Url: "https://gchat.qpic.cn/gchatpic_new/1/0-0-" + strings.ReplaceAll(binary.CalculateImageResourceId(md5)[1:37], "-", "") + "/0?term=2", Url: fmt.Sprintf("https://gchat.qpic.cn/gchatpic_new/1/0-0-%X/0?term=2", md5),
} }
} }