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");