From 5fd814d1d3eddd4973da2448c1c26a73662d93b4 Mon Sep 17 00:00:00 2001 From: Yiwen-Chan Date: Mon, 21 Jun 2021 20:14:02 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=20linux=20?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setutime/setu_geter.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/setutime/setu_geter.go b/setutime/setu_geter.go index 64af39120d..25b15b8c02 100644 --- a/setutime/setu_geter.go +++ b/setutime/setu_geter.go @@ -74,12 +74,11 @@ func init() { // 插件主体 continue } // 下载图片 - file, err := download(illust, POOL.Path) - if err != nil { + if _, err := download(illust, POOL.Path); err != nil { ctx.SendChain(message.Text("ERROR: ", err)) continue } - ctx.SendGroupMessage(POOL.Group, []message.MessageSegment{message.Image(file)}) + ctx.SendGroupMessage(POOL.Group, []message.MessageSegment{message.Image(file(illust))}) // 向缓冲池添加一张图片 POOL.Push(type_, illust) @@ -225,7 +224,7 @@ func (p *Pool) Pop(type_ string) (illust *pixiv.Illust) { func file(i *pixiv.Illust) string { filename := fmt.Sprint(i.Pid) pwd, _ := os.Getwd() - filepath := pwd + `\` + POOL.Path + filename + filepath := pwd + `/` + POOL.Path + filename if _, err := os.Stat(filepath + ".jpg"); err == nil || os.IsExist(err) { return `file:///` + filepath + ".jpg" }