feat: telegram transcript

This commit is contained in:
Mauro Trulli 2026-02-18 23:24:14 +01:00
parent 048cd08e41
commit 635e6a30a2

View file

@ -275,6 +275,20 @@ func (c *TelegramChannel) handleMessage(ctx context.Context, message *telego.Mes
logger.InfoCF("telegram", "Voice transcribed successfully", map[string]interface{}{ logger.InfoCF("telegram", "Voice transcribed successfully", map[string]interface{}{
"text": result.Text, "text": result.Text,
}) })
replyText := fmt.Sprintf("🎤 <b>Transcription: </b><i>%s</i>", escapeHTML(result.Text))
replyMsg := tu.Message(tu.ID(chatID), replyText)
replyMsg.ReplyParameters = &telego.ReplyParameters{
MessageID: message.MessageID,
}
replyMsg.ParseMode = telego.ModeHTML
if _, err := c.bot.SendMessage(ctx, replyMsg); err != nil {
logger.ErrorCF("telegram", "Failed to send transcription reply", map[string]interface{}{
"error": err.Error(),
})
}
} }
} else { } else {
transcribedText = "[voice]" transcribedText = "[voice]"