feat: 添加常量 TempDir 并更新文件下载逻辑以支持跳过已存在文件的选项

This commit is contained in:
lixiangwuxian
2025-04-12 21:16:58 +08:00
parent b49b780da2
commit 7ba0f74b49
7 changed files with 20 additions and 13 deletions

View File

@@ -28,7 +28,7 @@ func GenerateCongratulationImage(text string, inputFile, outputFile string, isGo
dc.DrawImage(im, 0, 0)
// 判断是否为图片
if imgUrl, ok := isImageCQ(text); ok {
filePath, err := util.DownloadFile(imgUrl, "/tmp/qqbot")
filePath, err := util.DownloadFile(imgUrl, "/tmp/qqbot", false)
if err != nil {
log.Print("无法下载图片:", err)
return