Update to layer 129 and other additions/enhancements (#3074)

* Apply code corrections for the new layer types.
* Support not passing `user` to `get_permissions`.
* `download_profile_photo` now supports `MessageService`.
* `thumb` in send and edit message.
* Document new known errors.
This commit is contained in:
Anonymous
2021-06-16 02:27:32 +05:30
committed by GitHub
parent 6b53d45ce2
commit 7c5efee1de
8 changed files with 132 additions and 60 deletions

View File

@@ -518,8 +518,7 @@ def get_input_media(
if isinstance(media, (
types.MessageMediaEmpty, types.MessageMediaUnsupported,
types.ChatPhotoEmpty, types.UserProfilePhotoEmpty,
types.ChatPhoto, types.UserProfilePhoto,
types.FileLocationToBeDeprecated)):
types.ChatPhoto, types.UserProfilePhoto)):
return types.InputMediaEmpty()
if isinstance(media, types.Message):
@@ -823,9 +822,6 @@ def _get_file_info(location):
thumb_size=location.sizes[-1].type
), _photo_size_byte_count(location.sizes[-1]))
if isinstance(location, types.FileLocationToBeDeprecated):
raise TypeError('Unavailable location cannot be used as input')
_raise_cast_fail(location, 'InputFileLocation')
@@ -1217,10 +1213,6 @@ def resolve_bot_file_id(file_id):
date=None,
sizes=[types.PhotoSize(
type=photo_size,
location=types.FileLocationToBeDeprecated(
volume_id=volume_id,
local_id=local_id
),
w=0,
h=0,
size=0