mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-03-25 20:34:16 +03:00
Add missing InputPhoto/Document -> InputMedia autocast
This commit is contained in:
parent
f31ca142a3
commit
ab91bc2829
|
@ -255,8 +255,12 @@ def get_input_media(media, is_photo=False):
|
||||||
it will be treated as an :tl:`InputMediaUploadedPhoto`.
|
it will be treated as an :tl:`InputMediaUploadedPhoto`.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
if media.SUBCLASS_OF_ID == 0xfaf846f4: # crc32(b'InputMedia'):
|
if media.SUBCLASS_OF_ID == 0xfaf846f4: # crc32(b'InputMedia')
|
||||||
return media
|
return media
|
||||||
|
elif media.SUBCLASS_OF_ID == 0x846363e0: # crc32(b'InputPhoto')
|
||||||
|
return InputMediaPhoto(media)
|
||||||
|
elif media.SUBCLASS_OF_ID == 0xf33fdb68: # crc32(b'InputDocument')
|
||||||
|
return InputMediaDocument(media)
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
_raise_cast_fail(media, 'InputMedia')
|
_raise_cast_fail(media, 'InputMedia')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user