fix: логирование транскрипции + пометка голосового для Claude

Claude получает "[Голосовой вопрос]:" чтобы не путать с запросом
о голосовом распознавании.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
anor
2026-03-30 17:46:39 +10:00
co-authored by Claude Opus 4.6
parent 4b6cc5410e
commit 80788d72d4
+4
View File
@@ -356,8 +356,12 @@ async def voice_message(update: Update, context: ContextTypes.DEFAULT_TYPE):
await wait_msg.edit_text("Не удалось распознать речь.")
return
logger.info(f"Voice transcription for user {user_id}: {text[:200]}")
await wait_msg.edit_text(f"🤔 «{text[:100]}{'...' if len(text) > 100 else ''}»\nДумаю...")
# Prefix so Claude knows this is a transcribed voice question
text = f"[Голосовой вопрос пользователя]: {text}"
except Exception as e:
logger.error(f"Voice transcription error: {e}")
await wait_msg.edit_text(f"Ошибка распознавания: {e}")