diff --git a/apps/bot/src/bot.ts b/apps/bot/src/bot.ts index 2e6f28ec..931857bb 100644 --- a/apps/bot/src/bot.ts +++ b/apps/bot/src/bot.ts @@ -626,7 +626,7 @@ export function createBot(o: BotOptions) { } /** Text of a voice note; null — it could not be heard, and the user has been told. */ - async function voiceText(m: TgMessage): Promise { + async function voiceText(user: User, m: TgMessage): Promise { const f = m.voice ?? m.audio!; const cfg = transcribeConfig(); if (!cfg) return reply(m.chat.id, tr("Голосовые сообщения пока не работают. Напишите задачу текстом."), m.message_id).then(() => null); @@ -649,7 +649,7 @@ export function createBot(o: BotOptions) { } async function onVoice(user: User, m: TgMessage) { - const text = await voiceText(m); + const text = await voiceText(user, m); if (text) await onPlainText(user, m.chat.id, text, true); } @@ -685,7 +685,7 @@ export function createBot(o: BotOptions) { if (text.startsWith("/")) return closeFeedbackMode(db, user.id).then(() => "pass" as const); let said = text || m.caption?.trim() || ""; if (!said && (m.voice || m.audio)) { - const heard = await voiceText(m); + const heard = await voiceText(user, m); if (!heard) return "done"; said = heard; }