feat: telegram transcript
This commit is contained in:
parent
048cd08e41
commit
635e6a30a2
1 changed files with 14 additions and 0 deletions
|
|
@ -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]"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue