optimize: gif plugin for image cache (#901) (fix #900)

修改gif插件图片保存方式
This commit is contained in:
vatebur
2024-05-09 15:29:20 +08:00
committed by GitHub
parent d832f9aaea
commit 8fa928d37f
3 changed files with 8 additions and 7 deletions

View File

@@ -14,9 +14,9 @@ func (cc *context) prepareLogos(s ...string) error {
for i, v := range s {
_, err := strconv.Atoi(v)
if err != nil {
err = file.DownloadTo("https://gchat.qpic.cn/gchatpic_new//--"+strings.ToUpper(v)+"/0", cc.usrdir+strconv.Itoa(i)+".gif")
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.usrdir+strconv.Itoa(i)+".gif")
err = file.DownloadTo("http://q4.qlogo.cn/g?b=qq&nk="+v+"&s=640", cc.headimgsdir[i])
}
if err != nil {
return err