🎨 ️ pixiv 图片缓存集中到 data/pixiv

This commit is contained in:
fumiama
2022-01-27 14:32:13 +08:00
parent aa71fa7cb8
commit e245a8f124
9 changed files with 42 additions and 64 deletions

View File

@@ -164,15 +164,17 @@ func init() {
}
}
m.SetFile(file.BOTPATH + "/" + cachefile)
err = m.Push(ctxext.Send(ctx), ctxext.GetMessage(ctx))
if err != nil && err.Error() == "send image error" {
ctx.SendChain(message.Image("file:///" + file.BOTPATH + "/" + cachefile))
hassent, err := m.Push(ctxext.Send(ctx), ctxext.GetMessage(ctx))
if err != nil {
ctx.SendChain(message.Text("ERROR: ", err))
return
}
if hassent {
return
}
} else {
// 发送图片
ctx.SendChain(message.Image(m.String()))
}
// 发送图片
ctx.SendChain(message.Image(m.String()))
})
}