How to download photo from messagePhoto?
wahyuief opened this issue · 1 comments
wahyuief commented
I want to save photo from content type messagePhoto but it's not work
for message in response.update['messages']:
if message['content']['@type'] == 'messagePhoto':
stats_data[message['id']] = message['content']['text']['text']
photo_id = message['content']['photo']['sizes'][0]['photo']['id']
photo_data = telegram.call_method(
method_name = 'downloadFile',
params = {'file_id': photo_id}
)
photo_data.wait()
from_message_id = message['id']