From 46519ef1eae192ffa99ac3b436f0791cff9e8b8b Mon Sep 17 00:00:00 2001 From: Max Richter Date: Fri, 9 May 2025 19:39:54 +0200 Subject: [PATCH] feat: print images in chat --- lib/telegram.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/telegram.ts b/lib/telegram.ts index c8b3875..886a58b 100644 --- a/lib/telegram.ts +++ b/lib/telegram.ts @@ -63,7 +63,9 @@ bot.command("end", async (ctx) => { task.noteName.replace(/\.md$/, "") }/photo-${photoIndex}.jpg`; - finalNote += `![image](${photoUrl})\n\n`; + finalNote += `![image](data:image/jpeg;base64,${ + btoa(String.fromCharCode(...(entry.content as Uint8Array))) + })\n\n`; photoTasks.push({ content: entry.content as Uint8Array, path: photoUrl,