fix(audio): handle voice message failures gracefully
- Send user feedback when voice/audio download fails instead of silent failure - Send graceful message when audio transcription is not configured instead of empty text which crashes API
This commit is contained in:
@@ -300,6 +300,7 @@ export class TelegramAdapter implements ChannelAdapter {
|
||||
const fileData = await this.downloadFileToBase64(voice.file_id);
|
||||
if (!fileData) {
|
||||
console.error(`Failed to download voice message ${voice.file_id}`);
|
||||
await ctx.reply('Sorry, I couldn\'t download your voice message. Please try again.', { reply_parameters: { message_id: ctx.message.message_id } });
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -337,6 +338,7 @@ export class TelegramAdapter implements ChannelAdapter {
|
||||
const fileData = await this.downloadFileToBase64(audio.file_id);
|
||||
if (!fileData) {
|
||||
console.error(`Failed to download audio message ${audio.file_id}`);
|
||||
await ctx.reply('Sorry, I couldn\'t download your audio file. Please try again.', { reply_parameters: { message_id: ctx.message.message_id } });
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user