0
votes

I would use telegram API sendphoto function to send photo message in Google App Script.

the photo is Blob file, which generated from chart.getAs('image/png'). https://developers.google.com/apps-script/reference/charts/

In Reference https://core.telegram.org/bots/api#sendphoto, it say

Post the file using multipart/form-data in the usual way that files are uploaded via the browser

Do it mean i cannot upload using the telegram api?

If can, Can i use the below google app script to upload photo?

UrlFetchApp.fetch("https://api.telegram.org/botXXXXXXX/sendPhoto?chat_id=YYYYYYYY&photo=" + blob);
1

1 Answers

1
votes

Telegram will only accept either a link to an image or file upload. Might be possible to use raw blob data to upload it directly without using any temporary file.