From fe1bfeb9489cb580b177b312bff3dc574abddc26 Mon Sep 17 00:00:00 2001 From: Arnie97 Date: Mon, 29 Nov 2021 12:58:50 +0800 Subject: [PATCH] Fix image..jpg (#1198) --- coolq/api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coolq/api.go b/coolq/api.go index 8c8e14c..687ff47 100644 --- a/coolq/api.go +++ b/coolq/api.go @@ -1384,7 +1384,7 @@ func (bot *CQBot) CQGetImage(file string) global.MSG { "filename": r.ReadString(), "url": r.ReadString(), } - local := path.Join(global.CachePath, file+"."+path.Ext(msg["filename"].(string))) + local := path.Join(global.CachePath, file+path.Ext(msg["filename"].(string))) if !global.PathExists(local) { if body, err := global.HTTPGetReadCloser(msg["url"].(string)); err == nil { f, _ := os.OpenFile(local, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0o0644)