Skip to content

Commit

Permalink
fix: use https logo url (fix #937)
Browse files Browse the repository at this point in the history
  • Loading branch information
fumiama committed Aug 5, 2024
1 parent 2710074 commit 4ffa18c
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion plugin/aifalse/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func drawstatus(m *ctrl.Control[*zero.Ctx], uid int64, botname string, botrunsta
return
}

data, err = web.GetData("http://q4.qlogo.cn/g?b=qq&nk=" + strconv.FormatInt(uid, 10) + "&s=640")
data, err = web.GetData("https://q4.qlogo.cn/g?b=qq&nk=" + strconv.FormatInt(uid, 10) + "&s=640")
if err != nil {
return
}
Expand Down
2 changes: 1 addition & 1 deletion plugin/gif/logo.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func (cc *context) prepareLogos(s ...string) error {
if err != nil {
err = file.DownloadTo("https://gchat.qpic.cn/gchatpic_new//--"+strings.ToUpper(v)+"/0", cc.headimgsdir[i])
} else {
err = file.DownloadTo("http://q4.qlogo.cn/g?b=qq&nk="+v+"&s=640", cc.headimgsdir[i])
err = file.DownloadTo("https://q4.qlogo.cn/g?b=qq&nk="+v+"&s=640", cc.headimgsdir[i])
}
if err != nil {
return err
Expand Down
12 changes: 6 additions & 6 deletions plugin/manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -705,12 +705,12 @@ func init() { // 插件主体

// 传入 ctx 和 welcome格式string 返回cq格式string 使用方法:welcometocq(ctx,w.Msg)
func welcometocq(ctx *zero.Ctx, welcome string) string {
uid := strconv.FormatInt(ctx.Event.UserID, 10) // 用户id
nickname := ctx.CardOrNickName(ctx.Event.UserID) // 用户昵称
at := "[CQ:at,qq=" + uid + "]" // at用户
avatar := "[CQ:image,file=" + "http://q4.qlogo.cn/g?b=qq&nk=" + uid + "&s=640]" // 用户头像
gid := strconv.FormatInt(ctx.Event.GroupID, 10) // 群id
groupname := ctx.GetThisGroupInfo(true).Name // 群名
uid := strconv.FormatInt(ctx.Event.UserID, 10) // 用户id
nickname := ctx.CardOrNickName(ctx.Event.UserID) // 用户昵称
at := "[CQ:at,qq=" + uid + "]" // at用户
avatar := "[CQ:image,file=" + "https://q4.qlogo.cn/g?b=qq&nk=" + uid + "&s=640]" // 用户头像
gid := strconv.FormatInt(ctx.Event.GroupID, 10) // 群id
groupname := ctx.GetThisGroupInfo(true).Name // 群名
cqstring := strings.ReplaceAll(welcome, "{at}", at)
cqstring = strings.ReplaceAll(cqstring, "{nickname}", nickname)
cqstring = strings.ReplaceAll(cqstring, "{avatar}", avatar)
Expand Down
6 changes: 3 additions & 3 deletions plugin/qqwife/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func init() {
ctx.SendChain(
message.At(uid),
message.Text("\n今天你在", userInfo.Updatetime, "娶了群友"),
message.Image("http://q4.qlogo.cn/g?b=qq&nk="+strconv.FormatInt(userInfo.Target, 10)+"&s=640").Add("cache", 0),
message.Image("https://q4.qlogo.cn/g?b=qq&nk="+strconv.FormatInt(userInfo.Target, 10)+"&s=640").Add("cache", 0),
message.Text(
"\n",
"[", userInfo.Targetname, "]",
Expand All @@ -140,7 +140,7 @@ func init() {
ctx.SendChain(
message.At(uid),
message.Text("\n今天你在", userInfo.Updatetime, "被群友"),
message.Image("http://q4.qlogo.cn/g?b=qq&nk="+strconv.FormatInt(userInfo.User, 10)+"&s=640").Add("cache", 0),
message.Image("https://q4.qlogo.cn/g?b=qq&nk="+strconv.FormatInt(userInfo.User, 10)+"&s=640").Add("cache", 0),
message.Text(
"\n",
"[", userInfo.Username, "]",
Expand Down Expand Up @@ -200,7 +200,7 @@ func init() {
ctx.SendChain(
message.At(uid),
message.Text("今天你的群老婆是"),
message.Image("http://q4.qlogo.cn/g?b=qq&nk="+strconv.FormatInt(fiancee, 10)+"&s=640").Add("cache", 0),
message.Image("https://q4.qlogo.cn/g?b=qq&nk="+strconv.FormatInt(fiancee, 10)+"&s=640").Add("cache", 0),
message.Text(
"\n",
"[", ctx.CardOrNickName(fiancee), "]",
Expand Down
6 changes: 3 additions & 3 deletions plugin/qqwife/function.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func init() {
message.Text(sendtext[0][rand.Intn(len(sendtext[0]))]),
message.At(uid),
message.Text(choicetext),
message.Image("http://q4.qlogo.cn/g?b=qq&nk="+strconv.FormatInt(fiancee, 10)+"&s=640").Add("cache", 0),
message.Image("https://q4.qlogo.cn/g?b=qq&nk="+strconv.FormatInt(fiancee, 10)+"&s=640").Add("cache", 0),
message.Text(
"\n",
"[", ctx.CardOrNickName(fiancee), "]",
Expand Down Expand Up @@ -239,7 +239,7 @@ func init() {
message.Text(sendtext[2][rand.Intn(len(sendtext[2]))]),
message.At(uid),
message.Text("今天你的群"+choicetext+"是"),
message.Image("http://q4.qlogo.cn/g?b=qq&nk="+strconv.FormatInt(fiancee, 10)+"&s=640").Add("cache", 0),
message.Image("https://q4.qlogo.cn/g?b=qq&nk="+strconv.FormatInt(fiancee, 10)+"&s=640").Add("cache", 0),
message.Text(
"\n",
"[", ctx.CardOrNickName(fiancee), "]",
Expand Down Expand Up @@ -303,7 +303,7 @@ func init() {
message.Text("恭喜你成功撮合了一对CP\n\n"),
message.At(gayOne),
message.Text("今天你的群老婆是"),
message.Image("http://q4.qlogo.cn/g?b=qq&nk="+strconv.FormatInt(gayZero, 10)+"&s=640").Add("cache", 0),
message.Image("https://q4.qlogo.cn/g?b=qq&nk="+strconv.FormatInt(gayZero, 10)+"&s=640").Add("cache", 0),
message.Text(
"\n",
"[", ctx.CardOrNickName(gayZero), "]",
Expand Down
2 changes: 1 addition & 1 deletion plugin/qzone/qzone.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const (
agreeStatus
disagreeStatus
loveTag = "表白"
faceURL = "http://q4.qlogo.cn/g?b=qq&nk=%v&s=640"
faceURL = "https://q4.qlogo.cn/g?b=qq&nk=%v&s=640"
anonymousURL = "https://gitcode.net/anto_july/avatar/-/raw/master/%v.png"
)

Expand Down
2 changes: 1 addition & 1 deletion plugin/score/sign_in.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ func getrank(count int) int {

func initPic(picFile string, uid int64) (avatar []byte, err error) {
defer process.SleepAbout1sTo2s()
avatar, err = web.GetData("http://q4.qlogo.cn/g?b=qq&nk=" + strconv.FormatInt(uid, 10) + "&s=640")
avatar, err = web.GetData("https://q4.qlogo.cn/g?b=qq&nk=" + strconv.FormatInt(uid, 10) + "&s=640")
if err != nil {
return
}
Expand Down

0 comments on commit 4ffa18c

Please sign in to comment.