mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-18 20:50:12 +08:00
fix: use https logo url (fix #937)
This commit is contained in:
parent
2710074f00
commit
4ffa18c511
@ -184,7 +184,7 @@ func drawstatus(m *ctrl.Control[*zero.Ctx], uid int64, botname string, botrunsta
|
|||||||
return
|
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 {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,7 +16,7 @@ func (cc *context) prepareLogos(s ...string) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
err = file.DownloadTo("https://gchat.qpic.cn/gchatpic_new//--"+strings.ToUpper(v)+"/0", cc.headimgsdir[i])
|
err = file.DownloadTo("https://gchat.qpic.cn/gchatpic_new//--"+strings.ToUpper(v)+"/0", cc.headimgsdir[i])
|
||||||
} else {
|
} 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 {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
@ -705,12 +705,12 @@ func init() { // 插件主体
|
|||||||
|
|
||||||
// 传入 ctx 和 welcome格式string 返回cq格式string 使用方法:welcometocq(ctx,w.Msg)
|
// 传入 ctx 和 welcome格式string 返回cq格式string 使用方法:welcometocq(ctx,w.Msg)
|
||||||
func welcometocq(ctx *zero.Ctx, welcome string) string {
|
func welcometocq(ctx *zero.Ctx, welcome string) string {
|
||||||
uid := strconv.FormatInt(ctx.Event.UserID, 10) // 用户id
|
uid := strconv.FormatInt(ctx.Event.UserID, 10) // 用户id
|
||||||
nickname := ctx.CardOrNickName(ctx.Event.UserID) // 用户昵称
|
nickname := ctx.CardOrNickName(ctx.Event.UserID) // 用户昵称
|
||||||
at := "[CQ:at,qq=" + uid + "]" // at用户
|
at := "[CQ:at,qq=" + uid + "]" // at用户
|
||||||
avatar := "[CQ:image,file=" + "http://q4.qlogo.cn/g?b=qq&nk=" + uid + "&s=640]" // 用户头像
|
avatar := "[CQ:image,file=" + "https://q4.qlogo.cn/g?b=qq&nk=" + uid + "&s=640]" // 用户头像
|
||||||
gid := strconv.FormatInt(ctx.Event.GroupID, 10) // 群id
|
gid := strconv.FormatInt(ctx.Event.GroupID, 10) // 群id
|
||||||
groupname := ctx.GetThisGroupInfo(true).Name // 群名
|
groupname := ctx.GetThisGroupInfo(true).Name // 群名
|
||||||
cqstring := strings.ReplaceAll(welcome, "{at}", at)
|
cqstring := strings.ReplaceAll(welcome, "{at}", at)
|
||||||
cqstring = strings.ReplaceAll(cqstring, "{nickname}", nickname)
|
cqstring = strings.ReplaceAll(cqstring, "{nickname}", nickname)
|
||||||
cqstring = strings.ReplaceAll(cqstring, "{avatar}", avatar)
|
cqstring = strings.ReplaceAll(cqstring, "{avatar}", avatar)
|
||||||
|
|||||||
@ -128,7 +128,7 @@ func init() {
|
|||||||
ctx.SendChain(
|
ctx.SendChain(
|
||||||
message.At(uid),
|
message.At(uid),
|
||||||
message.Text("\n今天你在", userInfo.Updatetime, "娶了群友"),
|
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(
|
message.Text(
|
||||||
"\n",
|
"\n",
|
||||||
"[", userInfo.Targetname, "]",
|
"[", userInfo.Targetname, "]",
|
||||||
@ -140,7 +140,7 @@ func init() {
|
|||||||
ctx.SendChain(
|
ctx.SendChain(
|
||||||
message.At(uid),
|
message.At(uid),
|
||||||
message.Text("\n今天你在", userInfo.Updatetime, "被群友"),
|
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(
|
message.Text(
|
||||||
"\n",
|
"\n",
|
||||||
"[", userInfo.Username, "]",
|
"[", userInfo.Username, "]",
|
||||||
@ -200,7 +200,7 @@ func init() {
|
|||||||
ctx.SendChain(
|
ctx.SendChain(
|
||||||
message.At(uid),
|
message.At(uid),
|
||||||
message.Text("今天你的群老婆是"),
|
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(
|
message.Text(
|
||||||
"\n",
|
"\n",
|
||||||
"[", ctx.CardOrNickName(fiancee), "]",
|
"[", ctx.CardOrNickName(fiancee), "]",
|
||||||
|
|||||||
@ -153,7 +153,7 @@ func init() {
|
|||||||
message.Text(sendtext[0][rand.Intn(len(sendtext[0]))]),
|
message.Text(sendtext[0][rand.Intn(len(sendtext[0]))]),
|
||||||
message.At(uid),
|
message.At(uid),
|
||||||
message.Text(choicetext),
|
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(
|
message.Text(
|
||||||
"\n",
|
"\n",
|
||||||
"[", ctx.CardOrNickName(fiancee), "]",
|
"[", ctx.CardOrNickName(fiancee), "]",
|
||||||
@ -239,7 +239,7 @@ func init() {
|
|||||||
message.Text(sendtext[2][rand.Intn(len(sendtext[2]))]),
|
message.Text(sendtext[2][rand.Intn(len(sendtext[2]))]),
|
||||||
message.At(uid),
|
message.At(uid),
|
||||||
message.Text("今天你的群"+choicetext+"是"),
|
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(
|
message.Text(
|
||||||
"\n",
|
"\n",
|
||||||
"[", ctx.CardOrNickName(fiancee), "]",
|
"[", ctx.CardOrNickName(fiancee), "]",
|
||||||
@ -303,7 +303,7 @@ func init() {
|
|||||||
message.Text("恭喜你成功撮合了一对CP\n\n"),
|
message.Text("恭喜你成功撮合了一对CP\n\n"),
|
||||||
message.At(gayOne),
|
message.At(gayOne),
|
||||||
message.Text("今天你的群老婆是"),
|
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(
|
message.Text(
|
||||||
"\n",
|
"\n",
|
||||||
"[", ctx.CardOrNickName(gayZero), "]",
|
"[", ctx.CardOrNickName(gayZero), "]",
|
||||||
|
|||||||
@ -31,7 +31,7 @@ const (
|
|||||||
agreeStatus
|
agreeStatus
|
||||||
disagreeStatus
|
disagreeStatus
|
||||||
loveTag = "表白"
|
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"
|
anonymousURL = "https://gitcode.net/anto_july/avatar/-/raw/master/%v.png"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@ -325,7 +325,7 @@ func getrank(count int) int {
|
|||||||
|
|
||||||
func initPic(picFile string, uid int64) (avatar []byte, err error) {
|
func initPic(picFile string, uid int64) (avatar []byte, err error) {
|
||||||
defer process.SleepAbout1sTo2s()
|
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 {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user