how save photo in telegram python bot?

前端 未结 1 1181
长情又很酷
长情又很酷 2021-01-05 20:46

i want to write a telegram bot that save photos . this is my code , but its not working. and i don\'t know what is my problem?

def image_handler(bot, update         


        
1条回答
  •  时光说笑
    2021-01-05 21:16

    update.message.photo is an array of photos sizes (PhotoSize objects).

    Use file = bot.getFile(update.message.photo[-1].file_id). This will get the image with biggest size available.

    0 讨论(0)
提交回复
热议问题