1

I'm making telegram bot on nodeJs and I failed trying to find information on how to send local photo with bot. Official documentation says "upload a new photo using multipart/form-data". What does that mean ? If you now a better way of sending photos (maybe putting folder on server and make requests to it) you can answer too !

1 Answers1

0

You can use the method sendPhoto and pass the photo's url in the photo parameter. Otherwise you can send the photo to the bot, get the photo's file_id and put it in the photo parameter.

Simple request:

{
  "chat_id": 777000,
  "photo": "https://www.google.com/logo.png",
}

or

{
  "chat_id": 777000,
  "photo": "AAMCBAADGQEAAQNWw17pM7Z_kM_nftmLt5F49qkR",
}
GioIacca9
  • 406
  • 4
  • 8