🐛 fix fortune

This commit is contained in:
fumiama 2022-01-23 13:22:31 +08:00
parent 4baead3490
commit 80f49c47c6

View File

@ -144,6 +144,7 @@ func init() {
m, err := imgpool.NewImage(ctx, cachefile, cachefile) m, err := imgpool.NewImage(ctx, cachefile, cachefile)
if err != nil { if err != nil {
logrus.Debugln("[fortune]", err)
if file.IsNotExist(cachefile) { if file.IsNotExist(cachefile) {
f, err := os.Create(cachefile) f, err := os.Create(cachefile)
if err != nil { if err != nil {
@ -156,9 +157,8 @@ func init() {
ctx.SendChain(message.Text("ERROR: ", err)) ctx.SendChain(message.Text("ERROR: ", err))
return return
} }
} else {
m, err = imgpool.NewImage(ctx, cachefile, cachefile)
} }
m, err = imgpool.NewImage(ctx, cachefile, cachefile)
} }
if err != nil { if err != nil {