From c24bc8394b466e75cc6e82b9a7ce6ce4b27e3b61 Mon Sep 17 00:00:00 2001 From: Danil Nikolaev Date: Fri, 1 May 2026 05:18:39 +0300 Subject: [PATCH] fix --- src/util/utils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/utils.ts b/src/util/utils.ts index 4341a0d..d2fc987 100644 --- a/src/util/utils.ts +++ b/src/util/utils.ts @@ -2052,9 +2052,9 @@ export async function processNewMessage(msg: Message): Promise { let voiceB64: string | null = null; - const modelInfo = await commands.find(c => c instanceof OllamaGetModel).getModelCapabilities(); + const modelInfo = await commands.find(c => c instanceof OllamaGetModel)?.getModelCapabilities(); - if (msg.voice && modelInfo.audio?.supported) { + if (msg.voice && modelInfo?.audio?.supported) { const filePath = (await bot.getFile({file_id: msg.voice.file_id})).file_path; let fileBuffer = await downloadTelegramFile(filePath); const input = path.join(Environment.DATA_PATH, "input.ogg");