I am using the telegram bot API but I cant see anyway to download a filé that was sent to my bot. I get a hash of the file but dont know what to do with it. Is there any way
If you are using pyTelegramBotAPI you can download your photo using this code:
raw = message.photo[2].file_id path = raw+".jpg" file_info = bot.get_file(raw) downloaded_file = bot.download_file(file_info.file_path) with open(path,'wb') as new_file: new_file.write(downloaded_file)