mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-10 19:46:36 +03:00
Add missing Photo/Document cases to get_input_media
This commit is contained in:
parent
ae2abd2ba9
commit
8d652c35a1
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user