Slightly improve documentation

This commit is contained in:
Lonami Exo 2023-02-26 10:10:19 +01:00
parent acfde7132b
commit 0563430314
3 changed files with 9 additions and 3 deletions

View File

@ -223,7 +223,8 @@ class DownloadMethods:
The output file path, directory, or stream-like object. The output file path, directory, or stream-like object.
If the path exists and is a file, it will be overwritten. If the path exists and is a file, it will be overwritten.
If file is the type `bytes`, it will be downloaded in-memory If file is the type `bytes`, it will be downloaded in-memory
as a bytestring (e.g. ``file=bytes``). and returned as a bytestring (i.e. ``file=bytes``, without
parentheses or quotes).
download_big (`bool`, optional): download_big (`bool`, optional):
Whether to use the big version of the available photos. Whether to use the big version of the available photos.
@ -333,7 +334,8 @@ class DownloadMethods:
The output file path, directory, or stream-like object. The output file path, directory, or stream-like object.
If the path exists and is a file, it will be overwritten. If the path exists and is a file, it will be overwritten.
If file is the type `bytes`, it will be downloaded in-memory If file is the type `bytes`, it will be downloaded in-memory
as a bytestring (e.g. ``file=bytes``). and returned as a bytestring (i.e. ``file=bytes``, without
parentheses or quotes).
progress_callback (`callable`, optional): progress_callback (`callable`, optional):
A callback function accepting two parameters: A callback function accepting two parameters:
@ -376,6 +378,9 @@ class DownloadMethods:
path = await message.download_media() path = await message.download_media()
await message.download_media(filename) await message.download_media(filename)
# Downloading to memory
blob = await client.download_media(message, bytes)
# Printing download progress # Printing download progress
def callback(current, total): def callback(current, total):
print('Downloaded', current, 'out of', total, print('Downloaded', current, 'out of', total,

View File

@ -427,6 +427,7 @@ STICKER_FILE_INVALID,400,Sticker file invalid
STICKER_GIF_DIMENSIONS,400,The specified video sticker has invalid dimensions STICKER_GIF_DIMENSIONS,400,The specified video sticker has invalid dimensions
STICKER_ID_INVALID,400,The provided sticker ID is invalid STICKER_ID_INVALID,400,The provided sticker ID is invalid
STICKER_INVALID,400,The provided sticker is invalid STICKER_INVALID,400,The provided sticker is invalid
STICKER_MIME_INVALID,400,Make sure to pass a valid image file for the right InputFile parameter
STICKER_PNG_DIMENSIONS,400,Sticker png dimensions invalid STICKER_PNG_DIMENSIONS,400,Sticker png dimensions invalid
STICKER_PNG_NOPNG,400,Stickers must be a png file but the used image was not a png STICKER_PNG_NOPNG,400,Stickers must be a png file but the used image was not a png
STICKER_TGS_NODOC,400,You must send the animated sticker as a document STICKER_TGS_NODOC,400,You must send the animated sticker as a document

1 name codes description
427 STICKER_GIF_DIMENSIONS 400 The specified video sticker has invalid dimensions
428 STICKER_ID_INVALID 400 The provided sticker ID is invalid
429 STICKER_INVALID 400 The provided sticker is invalid
430 STICKER_MIME_INVALID 400 Make sure to pass a valid image file for the right InputFile parameter
431 STICKER_PNG_DIMENSIONS 400 Sticker png dimensions invalid
432 STICKER_PNG_NOPNG 400 Stickers must be a png file but the used image was not a png
433 STICKER_TGS_NODOC 400 You must send the animated sticker as a document

View File

@ -332,7 +332,7 @@ phone.toggleGroupCallSettings,user,GROUPCALL_NOT_MODIFIED
photos.deletePhotos,user, photos.deletePhotos,user,
photos.getUserPhotos,both,MAX_ID_INVALID USER_ID_INVALID photos.getUserPhotos,both,MAX_ID_INVALID USER_ID_INVALID
photos.updateProfilePhoto,user,PHOTO_ID_INVALID photos.updateProfilePhoto,user,PHOTO_ID_INVALID
photos.uploadProfilePhoto,user,ALBUM_PHOTOS_TOO_MANY FILE_PARTS_INVALID IMAGE_PROCESS_FAILED PHOTO_CROP_SIZE_SMALL PHOTO_EXT_INVALID VIDEO_FILE_INVALID photos.uploadProfilePhoto,user,ALBUM_PHOTOS_TOO_MANY FILE_PARTS_INVALID IMAGE_PROCESS_FAILED PHOTO_CROP_SIZE_SMALL PHOTO_EXT_INVALID STICKER_MIME_INVALID VIDEO_FILE_INVALID
ping,both, ping,both,
reqDHParams,both, reqDHParams,both,
reqPq,both, reqPq,both,

1 method usability errors
332 photos.deletePhotos user
333 photos.getUserPhotos both MAX_ID_INVALID USER_ID_INVALID
334 photos.updateProfilePhoto user PHOTO_ID_INVALID
335 photos.uploadProfilePhoto user ALBUM_PHOTOS_TOO_MANY FILE_PARTS_INVALID IMAGE_PROCESS_FAILED PHOTO_CROP_SIZE_SMALL PHOTO_EXT_INVALID VIDEO_FILE_INVALID ALBUM_PHOTOS_TOO_MANY FILE_PARTS_INVALID IMAGE_PROCESS_FAILED PHOTO_CROP_SIZE_SMALL PHOTO_EXT_INVALID STICKER_MIME_INVALID VIDEO_FILE_INVALID
336 ping both
337 reqDHParams both
338 reqPq both