2016-05-15 11 views

答えて

1

あなたがpyTelegramBotAPIを使用している場合は、このコードを使用することができます:

@bot.message_handler(content_types=['photo']) 
def handle_photo(message): 
    raw = message.photo[2].file_id 
    name = raw+".jpg" 
    file_info = bot.get_file(raw) 
    downloaded_file = bot.download_file(file_info.file_path) 
    with open(name,'wb') as new_file: 
     new_file.write(downloaded_file) 
関連する問題