fix photo detection
This commit is contained in:
parent
4798507629
commit
705b662782
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