fix photo detection

This commit is contained in:
Tomáš Mládek 2018-01-31 13:42:16 +01:00 committed by Tomáš Mládek
parent 4798507629
commit 705b662782

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: