Skip to content

Commit c3a4702

Browse files
committed
fix: allow custom file name for cached files in FileFromMessage function
1 parent e731cfe commit c3a4702

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

bot/utils.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,9 @@ func FileFromMessage(ctx *ext.Context, chatID int64, messageID int, customFileNa
182182
key := fmt.Sprintf("file:%d:%d", chatID, messageID)
183183
cachedFile, err := common.CacheGet[*types.File](ctx, key)
184184
if err == nil {
185+
if customFileName != "" {
186+
cachedFile.FileName = customFileName
187+
}
185188
return cachedFile, nil
186189
}
187190
common.Log.Debugf("Getting file: %s", key)

0 commit comments

Comments
 (0)