package main import "context" // telegramVoiceText keeps a voice note or a fixed failure marker. Download and // decode failures do not block later updates. Only owner messages reach it. func telegramVoiceText(ctx context.Context, api *TelegramAPI, store *VoiceStore, transcriber *VoiceTranscriber, message *TelegramMessage) string { text := "(voice not downloaded)" if message.Voice.FileSize <= voiceMaxBytes { data, err := api.GetFile(ctx, message.Voice.FileID, voiceMaxBytes, errVoiceSize) if err == nil { text = transcriber.Text(ctx, store, data) } } if message.Caption != "" { text += "\n" + message.Caption } return text }