fix(media): harden unknown mime handling from #39199 (thanks @nicolasgrasset)

Co-authored-by: Nicolas Grasset <nicolas.grasset@gmail.com>
This commit is contained in:
Peter Steinberger
2026-03-07 23:30:32 +00:00
parent dc92f2e19d
commit 1aaca517e3
7 changed files with 23 additions and 14 deletions

View File

@@ -576,7 +576,8 @@ export async function sendMessageTelegram(
fileName: media.fileName,
});
const isVideoNote = kind === "video" && opts.asVideoNote === true;
const fileName = media.fileName ?? (isGif ? "animation.gif" : inferFilename(kind)) ?? "file";
const fileName =
media.fileName ?? (isGif ? "animation.gif" : inferFilename(kind ?? "document")) ?? "file";
const file = new InputFile(media.buffer, fileName);
let caption: string | undefined;
let followUpText: string | undefined;