feat: some more logs
This commit is contained in:
		| @@ -39,6 +39,8 @@ bot.command("end", async (ctx) => { | ||||
|   const task = activeTasks[ctx.chat.id.toString()]; | ||||
|   if (!task) return ctx.reply("No active note found."); | ||||
|  | ||||
|   console.log("Ending note", task.noteName); | ||||
|  | ||||
|   let finalNote = `# ${task.noteName}\n\n`; | ||||
|  | ||||
|   const photoTasks: { content: Uint8Array; path: string }[] = []; | ||||
| @@ -49,19 +51,20 @@ bot.command("end", async (ctx) => { | ||||
|       finalNote += entry.content + "\n\n"; | ||||
|     } else if (entry.type === "voice") { | ||||
|       try { | ||||
|         console.log("Converting OGG to MP3"); | ||||
|         const mp3Data = await convertOggToMp3(entry.content as Uint8Array); | ||||
|         console.log("Finished converting OGG to MP3, transcribing..."); | ||||
|         const transcript = await transcribe(mp3Data); | ||||
|         finalNote += `**Voice Transcript:**\n${transcript}\n\n`; | ||||
|         console.log("Finished transcribing"); | ||||
|       } catch (error) { | ||||
|         console.log(error); | ||||
|         finalNote += "**[Voice message could not be transcribed]**\n\n"; | ||||
|       } | ||||
|     } else if (entry.type === "photo") { | ||||
|       photoIndex++; | ||||
|  | ||||
|       const photoUrl = `${ | ||||
|         task.noteName.replace(/\.md$/, "") | ||||
|       }/photo-${photoIndex}.jpg`; | ||||
|       }/photo-${photoIndex++}.jpg`; | ||||
|  | ||||
|       finalNote += `**Photo**:\n ${photoUrl}\n\n`; | ||||
|       photoTasks.push({ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user