Saving photos in telegram bot in the best quality

When you send a photo to Telegram (I understand that you can send it as a file, but you need to send it as a photo).
We see at once an array, where there are several variations in quality
but they have the same FILE ID, but different file unique id.
And then if I download a file, and specify file id - just it is required, it is downloaded in the lowest quality.
Help, how to download in the best quality?

Welcome to the Make community!

It appears that the last photo in the array is the best quality.

Therefore, you can use the built-in function last, together with the map function to get the last ID.

e.g.:

{{ last(map(1.message.photo; "id")) }}

For more information, see the function documentation in the Help Center.

Hope this helps! Let me know if there are any further questions or issues.

β€” @samliew


P.S.: Did you know, the concepts of about 70% of questions asked on this forum are already covered in the Make Academy. Investing some effort into it will save you lots of time and frustration using Make later!

Thanks for the advice
I did as you described but it gives an error
What did I do wrong?


I see that the key parameter is lit in red - in our case it is file_id
how to write it correctly?

Thank you all very much
issue resolved

this is exactly the design to be inserted

{{last(map(1.message.photo; β€œfile_id”))}}

2 Likes

You inserted double quotes around the text file_id.

Hope this helps! Let me know if there are any further questions or issues.

β€” @samliew