1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-04 19:17:37 +08:00
* fix: 尝试修复 #2070 (#2071)

* Close file after uploading it to private chat

fix #2119
上传文件到私聊后,释放文件。
This commit is contained in:
Janet-Baker 2023-06-04 09:56:40 +08:00 committed by GitHub
parent bad3c86912
commit 5bf64ee743
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -617,6 +617,7 @@ func (bot *CQBot) CQUploadPrivateFile(userID int64, file, name string) global.MS
log.Warnf("上传私聊文件 %v 失败: %+v", file, err)
return Failed(100, "OPEN_FILE_ERROR", "打开文件失败")
}
defer func() { _ = fileBody.Close() }()
localFile := &client.LocalFile{
FileName: name,
Body: fileBody,