fix(telegram): notify users on media download failures

Co-authored-by: Artale <117890364+arosstale@users.noreply.github.com>
This commit is contained in:
Peter Steinberger
2026-02-22 17:52:04 +01:00
parent d0e6763263
commit 795db98f6a
3 changed files with 51 additions and 1 deletions

View File

@@ -722,7 +722,16 @@ export const registerTelegramHandlers = ({
logger.warn({ chatId, error: String(mediaErr) }, oversizeLogMessage);
return;
}
throw mediaErr;
logger.warn({ chatId, error: String(mediaErr) }, "media fetch failed");
await withTelegramApiErrorLogging({
operation: "sendMessage",
runtime,
fn: () =>
bot.api.sendMessage(chatId, "⚠️ Failed to download media. Please try again.", {
reply_to_message_id: msg.message_id,
}),
}).catch(() => {});
return;
}
// Skip sticker-only messages where the sticker was skipped (animated/video)