Skip to content

Commit 4fd195d

Browse files
committed
fix(telegram): defaultDocumentHandler MEDIA format — remove leaked filename
The format 'MEDIA:document:path:fileName' had 3 colon-separated parts, but sendMedia only parses 2 (type:path). The fileName leaked into the path, causing os.Stat to fail. Fixed to clean 'MEDIA:document:path'. Telegram's sendDocument gets the filename from the file itself.
1 parent a13b172 commit 4fd195d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

internal/telegram/handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ func defaultDocumentHandler(bot *Bot) func(int64, int, string, string) (string,
170170
if err != nil {
171171
return "", fmt.Errorf("telegram handler: download document: %w", err)
172172
}
173-
return fmt.Sprintf("MEDIA:document:%s:%s", path, fileName), nil
173+
return fmt.Sprintf("MEDIA:document:%s", path), nil
174174
}
175175
}
176176

0 commit comments

Comments
 (0)