title: Ruby - How download to my computer the photo sent by the user to the telegram bot?
body: <p>I am using Ruby for my telegram bot. People send some information to bot, and some times it is photo. I Need to save this photo to my computer in directory with Ruby file and then send this photo another people if he or she is needed of it.</p>
  <p>So,  How do I download a photo that was sent to my Telegram bot? I know about getFile from official site of Telegram and about this question <a href="https://stackoverflow.com/questions/31096358/how-do-i-download-a-file-or-photo-that-was-sent-to-my-telegram-bot">How do I download a file or photo that was sent to my Telegram bot?</a> but i don't understand how to use it with Ruby, because i'm start ruby only 5 months ago.
  I try to wrote different code, but all doesn't work...</p>
  <pre><code>bot.messages_handler(content_types=['photo'])
  bot.send_message(message.chat_id,bot.get_file_url(message.photo[0].file_id))
  </code></pre>
  <p>I'm hope for your help.</p>
  <p>UPDATE!
  So, now after codding and analisis all information and answer I have code which can find 'file_id' of photo from message of user and use this 'file_id' for sending this photo to another users.</p>
  <pre><code>if message.photo
    info_about_phot = message.photo.to_s #Hash all info about photo to string
    for i in ((info_about_phot.index('@file_id=&quot;')+10).. 
        (info_about_phot.index('&quot;, @file_unique_id=')-1)) #find all simbols of 'file_id' inside info about photo
        info_about_phot = info_about_phot + message.photo.to_s[i] #mabe 'file_id from all simbols'
     end
  end
  bot.api.send_photo(chat_id: message.from.id, photo: info_about_phot) #send message with only photo
  </code></pre>
  <p>may be it is not so clear as variant of @mechnicov but it works perfect and help me with my problem. But if some body can write better code - i will say &quot;Thanks!!!&quot;.</p>