mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-06-19 14:05:03 +08:00
Fix image..jpg (#1198)
This commit is contained in:
parent
b4bd22ea11
commit
fe1bfeb948
@ -1384,7 +1384,7 @@ func (bot *CQBot) CQGetImage(file string) global.MSG {
|
|||||||
"filename": r.ReadString(),
|
"filename": r.ReadString(),
|
||||||
"url": 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 !global.PathExists(local) {
|
||||||
if body, err := global.HTTPGetReadCloser(msg["url"].(string)); err == nil {
|
if body, err := global.HTTPGetReadCloser(msg["url"].(string)); err == nil {
|
||||||
f, _ := os.OpenFile(local, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0o0644)
|
f, _ := os.OpenFile(local, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0o0644)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user