fix
This commit is contained in:
+2
-2
@@ -2052,9 +2052,9 @@ export async function processNewMessage(msg: Message): Promise<void> {
|
|||||||
|
|
||||||
let voiceB64: string | null = null;
|
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;
|
const filePath = (await bot.getFile({file_id: msg.voice.file_id})).file_path;
|
||||||
let fileBuffer = await downloadTelegramFile(filePath);
|
let fileBuffer = await downloadTelegramFile(filePath);
|
||||||
const input = path.join(Environment.DATA_PATH, "input.ogg");
|
const input = path.join(Environment.DATA_PATH, "input.ogg");
|
||||||
|
|||||||
Reference in New Issue
Block a user