1

I'm currently generating an image buffer and sending it to a group using

ctx.replyWithPhoto({ source: myBuffer, filename: "image.png" });

I'm wanting to reuse this photo to send later and I figured I could use Telegrams file_id for this, but I can't find a way to actually get it. Every example I find is about somone sending a photo to the bot, not the bot creating and sending the photo to the chat.

Any help or ideas on how to do this would be appreciated.

1 Answers1

0

I had the same question and I found an answer here.

message: { message_id: 68, from: [Object], chat: [Object], date: 1625421075, photo: [Array] }

From the message object you can access the photo property and you can find the file_id like message.photo[0].file_id

Michaeluuk
  • 79
  • 1
  • 7