fix: flip audio default to file (backward compat)

- Default: sendAudio (file with metadata) - preserves old behavior
- Opt-in: [[audio_as_voice]] tag for voice bubble

This is non-breaking - existing integrations keep working.
This commit is contained in:
Manuel Maly
2026-01-04 22:16:39 +01:00
committed by Peter Steinberger
parent 262f8a8d45
commit 2972fce02c
2 changed files with 12 additions and 9 deletions

View File

@@ -1250,12 +1250,14 @@ async function deliverReplies(params: {
...mediaParams,
});
} else if (kind === "audio") {
const useVoice = reply.audioAsVoice === true; // default false
const useVoice = reply.audioAsVoice === true; // default false (backward compatible)
if (useVoice) {
// Voice message - displays as round playable bubble (opt-in via [[audio_as_voice]])
await bot.api.sendVoice(chatId, file, {
...mediaParams,
});
} else {
// Audio file - displays with metadata (title, duration) - DEFAULT
await bot.api.sendAudio(chatId, file, {
...mediaParams,
});