From 705b6627828975c9927b05262850b3b6eeafaca0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Wed, 31 Jan 2018 13:42:16 +0100 Subject: [PATCH] fix photo detection --- robot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/robot.py b/robot.py index df4007c..38c5d33 100755 --- a/robot.py +++ b/robot.py @@ -71,7 +71,7 @@ def handle_url(bot, update): # noinspection PyBroadException def handle_rest(bot, update): 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) file = photo.file_id elif update.message.document is not None: