fix photo detection

This commit is contained in:
Tomáš Mládek 2018-01-31 13:42:16 +01:00
parent f9863d3de0
commit afdf462217

View file

@ -71,7 +71,7 @@ def handle_url(bot, update):
# noinspection PyBroadException # noinspection PyBroadException
def handle_rest(bot, update): def handle_rest(bot, update):
file = None file = None
if update.message.photo is not None: if len(update.message.photo) > 0:
photo = max(update.message.photo, key=lambda p: p.width) photo = max(update.message.photo, key=lambda p: p.width)
file = photo.file_id file = photo.file_id
elif update.message.document is not None: elif update.message.document is not None: