Support MessageMedia in pack_bot_file_id

This commit is contained in:
Lonami Exo 2019-02-10 12:30:20 +01:00
parent e23308c0f9
commit de84bf08bf

View File

@ -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: