diff --git a/src/auto-reply/types.ts b/src/auto-reply/types.ts index 6726c6492..0bd7671d7 100644 --- a/src/auto-reply/types.ts +++ b/src/auto-reply/types.ts @@ -18,5 +18,7 @@ export type ReplyPayload = { mediaUrl?: string; mediaUrls?: string[]; replyToId?: string; + /** Send audio as voice message (bubble) instead of audio file. Defaults to false. */ + audioAsVoice?: boolean; isError?: boolean; }; diff --git a/src/telegram/bot.ts b/src/telegram/bot.ts index 64591a1ee..bacdabc98 100644 --- a/src/telegram/bot.ts +++ b/src/telegram/bot.ts @@ -1250,9 +1250,16 @@ async function deliverReplies(params: { ...mediaParams, }); } else if (kind === "audio") { - await bot.api.sendAudio(chatId, file, { - ...mediaParams, - }); + const useVoice = reply.audioAsVoice === true; // default false + if (useVoice) { + await bot.api.sendVoice(chatId, file, { + ...mediaParams, + }); + } else { + await bot.api.sendAudio(chatId, file, { + ...mediaParams, + }); + } } else { await bot.api.sendDocument(chatId, file, { ...mediaParams,