1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-06-19 05:55:04 +08:00

Fix image..jpg (#1198)

This commit is contained in:
Arnie97 2021-11-29 12:58:50 +08:00 committed by GitHub
parent b4bd22ea11
commit fe1bfeb948
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)