mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-22 17:36:34 +03:00
Support MessageMedia in pack_bot_file_id
This commit is contained in:
parent
e23308c0f9
commit
de84bf08bf
|
@ -956,6 +956,11 @@ def pack_bot_file_id(file):
|
|||
|
||||
If an invalid parameter is given, it will ``return None``.
|
||||
"""
|
||||
if isinstance(file, types.MessageMediaDocument):
|
||||
file = file.document
|
||||
elif isinstance(file, types.MessageMediaPhoto):
|
||||
file = file.photo
|
||||
|
||||
if isinstance(file, types.Document):
|
||||
file_type = 5
|
||||
for attribute in file.attributes:
|
||||
|
|
Loading…
Reference in New Issue
Block a user