How telegram bot can get file_id of uploaded file?

Arsenii Sigiller picture Arsenii Sigiller · May 12, 2016 · Viewed 13.1k times · Source

In telegram API documentation I see: "You can either pass a file_id as String to resend a photo that is already on the Telegram servers", but I can't find ways to get file_id of uploaded file. How can I get it?

Answer

Farbod Ahmadian picture Farbod Ahmadian · May 14, 2016

Its depended to your content_types ,for example:

Video:

message.video.file_id

Audio:

message.audio.file_id

Photo:

message.photo[2].file_id

For more see this link.