Add missing Photo/Document cases to get_input_media

This commit is contained in:
Lonami Exo 2018-03-27 11:22:31 +02:00
parent ae2abd2ba9
commit 8d652c35a1

View File

@ -261,12 +261,22 @@ def get_input_media(media, is_photo=False):
ttl_seconds=media.ttl_seconds
)
if isinstance(media, (Photo, photos.Photo, PhotoEmpty)):
return InputMediaPhoto(
id=get_input_photo(media)
)
if isinstance(media, MessageMediaDocument):
return InputMediaDocument(
id=get_input_document(media.document),
ttl_seconds=media.ttl_seconds
)
if isinstance(media, (Document, DocumentEmpty)):
return InputMediaDocument(
id=get_input_document(media)
)
if isinstance(media, FileLocation):
if is_photo:
return InputMediaUploadedPhoto(file=media)