telegram-bot-api icon indicating copy to clipboard operation
telegram-bot-api copied to clipboard

How to send picture of firebase storage via send photo api?

Open h0lme3 opened this issue 2 years ago • 9 comments

Hi I am going to send picture using https://api.telegram.org/bot{tg_token}/sendPhoto?chat_id=-{tg_chat_id}&photo={photo_path}&caption={message}&parse_mode=Markdown but I cant send picture of firebase storage. i.e. https://firebasestorage.googleapis.com/v0/b/parasol-finance-21.appspot.com/o/projects%2F24kn8ifJpEuGmbQP8VmkxeXgjnVi5zXvFQzusgmT3CmD%2F1SP_IDO.png?alt=media&token=fa212a61-6dd9-4c63-9231-2206232c11a0 when I send this picture, I get this error. image I guess the issue is picture path of storage.

fyi: I can send photo like this : https://parasol.finance/assets/preview/projects.png

plz help me!

h0lme3 avatar Oct 07 '22 16:10 h0lme3

https://core.telegram.org/bots/api#sendphoto:

The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20.

levlam avatar Oct 07 '22 18:10 levlam

Thanks for your reply, @levlam Yes I know it. I said I could send photo but just except of picture of storage.

h0lme3 avatar Oct 07 '22 18:10 h0lme3

The provided photo is invalid. It doesn't met the requirements.

levlam avatar Oct 07 '22 18:10 levlam

Yes, maybe. so I wanted to know how to send photo uploaded on firebase storage. I just worry about this part of photo url. image

No idea?

h0lme3 avatar Oct 07 '22 18:10 h0lme3

Photos can be sent exactly as described in https://core.telegram.org/bots/api#sendphoto. If the photo is publicly accessible by the URL and meets all other requirements, it can be sent via the URL.

levlam avatar Oct 07 '22 18:10 levlam

The provided photo is invalid. It doesn't met the requirements.

So, how can I meet with the requirements? https://firebasestorage.googleapis.com/v0/b/parasol-finance-21.appspot.com/o/projects%2F24kn8ifJpEuGmbQP8VmkxeXgjnVi5zXvFQzusgmT3CmD%2F1SP_IDO.png?alt=media&token=fa212a61-6dd9-4c63-9231-2206232c11a0 It can be accessible though right?

h0lme3 avatar Oct 10 '22 15:10 h0lme3

The photo's width and height must not exceed 10000 in total.

levlam avatar Oct 10 '22 22:10 levlam

The photo's width and height must not exceed 10000 in total.

So you mean, its width and height exceeded 10000 in total? How can I adjust it via api? Or maybe need to replace it? But fyi, I cant send all photos of storage.

h0lme3 avatar Oct 10 '22 23:10 h0lme3

This is unrelated to Bot API. The error 400 for the provided link is absolutely correct.

levlam avatar Oct 11 '22 09:10 levlam