fix: allow custom file name for cached files in FileFromMessage function

This commit is contained in:
krau
2025-05-07 11:38:56 +08:00
parent e731cfee9e
commit c3a4702e79

View File

@@ -182,6 +182,9 @@ func FileFromMessage(ctx *ext.Context, chatID int64, messageID int, customFileNa
key := fmt.Sprintf("file:%d:%d", chatID, messageID)
cachedFile, err := common.CacheGet[*types.File](ctx, key)
if err == nil {
if customFileName != "" {
cachedFile.FileName = customFileName
}
return cachedFile, nil
}
common.Log.Debugf("Getting file: %s", key)