fix photo detection
This commit is contained in:
parent
f9863d3de0
commit
afdf462217
1 changed files with 1 additions and 1 deletions
2
robot.py
2
robot.py
|
@ -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:
|
||||||
|
|
Loading…
Reference in a new issue