mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-29 21:38:04 +00:00
Rename "thumbnails" to "thumbs"
This commit is contained in:
parent
17ddb0d1b7
commit
6bebe2297e
@ -54,11 +54,11 @@ class Animation(Object):
|
||||
date (``int``, *optional*):
|
||||
Date the animation was sent in Unix time.
|
||||
|
||||
thumbnails (List of :obj:`Thumbnail`, *optional*):
|
||||
thumbs (List of :obj:`Thumbnail`, *optional*):
|
||||
Animation thumbnails.
|
||||
"""
|
||||
|
||||
__slots__ = ["file_id", "file_name", "mime_type", "file_size", "date", "width", "height", "duration", "thumbnails"]
|
||||
__slots__ = ["file_id", "file_name", "mime_type", "file_size", "date", "width", "height", "duration", "thumbs"]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
@ -72,7 +72,7 @@ class Animation(Object):
|
||||
mime_type: str = None,
|
||||
file_size: int = None,
|
||||
date: int = None,
|
||||
thumbnails: List[Thumbnail] = None,
|
||||
thumbs: List[Thumbnail] = None,
|
||||
):
|
||||
super().__init__(client)
|
||||
|
||||
@ -84,7 +84,7 @@ class Animation(Object):
|
||||
self.width = width
|
||||
self.height = height
|
||||
self.duration = duration
|
||||
self.thumbnails = thumbnails
|
||||
self.thumbs = thumbs
|
||||
|
||||
@staticmethod
|
||||
def _parse(
|
||||
@ -110,6 +110,6 @@ class Animation(Object):
|
||||
file_size=animation.size,
|
||||
file_name=file_name,
|
||||
date=animation.date,
|
||||
thumbnails=Thumbnail._parse(client, animation),
|
||||
thumbs=Thumbnail._parse(client, animation),
|
||||
client=client
|
||||
)
|
||||
|
@ -54,12 +54,12 @@ class Audio(Object):
|
||||
title (``str``, *optional*):
|
||||
Title of the audio as defined by sender or by audio tags.
|
||||
|
||||
thumbnails (List of :obj:`Thumbnail`, *optional*):
|
||||
thumbs (List of :obj:`Thumbnail`, *optional*):
|
||||
Thumbnails of the music file album cover.
|
||||
"""
|
||||
|
||||
__slots__ = [
|
||||
"file_id", "file_name", "mime_type", "file_size", "date", "duration", "performer", "title", "thumbnails"
|
||||
"file_id", "file_name", "mime_type", "file_size", "date", "duration", "performer", "title", "thumbs"
|
||||
]
|
||||
|
||||
def __init__(
|
||||
@ -74,7 +74,7 @@ class Audio(Object):
|
||||
date: int = None,
|
||||
performer: str = None,
|
||||
title: str = None,
|
||||
thumbnails: List[Thumbnail] = None,
|
||||
thumbs: List[Thumbnail] = None,
|
||||
):
|
||||
super().__init__(client)
|
||||
|
||||
@ -86,7 +86,7 @@ class Audio(Object):
|
||||
self.duration = duration
|
||||
self.performer = performer
|
||||
self.title = title
|
||||
self.thumbnails = thumbnails
|
||||
self.thumbs = thumbs
|
||||
|
||||
@staticmethod
|
||||
def _parse(
|
||||
@ -112,6 +112,6 @@ class Audio(Object):
|
||||
file_size=audio.size,
|
||||
file_name=file_name,
|
||||
date=audio.date,
|
||||
thumbnails=Thumbnail._parse(client, audio),
|
||||
thumbs=Thumbnail._parse(client, audio),
|
||||
client=client
|
||||
)
|
||||
|
@ -45,11 +45,11 @@ class Document(Object):
|
||||
date (``int``, *optional*):
|
||||
Date the document was sent in Unix time.
|
||||
|
||||
thumbnails (List of :obj:`Thumbnail`, *optional*):
|
||||
thumbs (List of :obj:`Thumbnail`, *optional*):
|
||||
Document thumbnails as defined by sender.
|
||||
"""
|
||||
|
||||
__slots__ = ["file_id", "file_name", "mime_type", "file_size", "date", "thumbnails"]
|
||||
__slots__ = ["file_id", "file_name", "mime_type", "file_size", "date", "thumbs"]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
@ -60,7 +60,7 @@ class Document(Object):
|
||||
mime_type: str = None,
|
||||
file_size: int = None,
|
||||
date: int = None,
|
||||
thumbnails: List[Thumbnail] = None,
|
||||
thumbs: List[Thumbnail] = None,
|
||||
):
|
||||
super().__init__(client)
|
||||
|
||||
@ -69,7 +69,7 @@ class Document(Object):
|
||||
self.mime_type = mime_type
|
||||
self.file_size = file_size
|
||||
self.date = date
|
||||
self.thumbnails = thumbnails
|
||||
self.thumbs = thumbs
|
||||
|
||||
@staticmethod
|
||||
def _parse(client, document: types.Document, file_name: str) -> "Document":
|
||||
@ -87,6 +87,6 @@ class Document(Object):
|
||||
mime_type=document.mime_type,
|
||||
file_size=document.size,
|
||||
date=document.date,
|
||||
thumbnails=Thumbnail._parse(client, document),
|
||||
thumbs=Thumbnail._parse(client, document),
|
||||
client=client
|
||||
)
|
||||
|
@ -45,11 +45,11 @@ class Photo(Object):
|
||||
date (``int``):
|
||||
Date the photo was sent in Unix time.
|
||||
|
||||
thumbnails (List of :obj:`Thumbnail`):
|
||||
Available sizes of this photo.
|
||||
thumbs (List of :obj:`Thumbnail`, *optional*):
|
||||
Available thumbnails of this photo.
|
||||
"""
|
||||
|
||||
__slots__ = ["file_id", "width", "height", "file_size", "date", "thumbnails"]
|
||||
__slots__ = ["file_id", "width", "height", "file_size", "date", "thumbs"]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
@ -60,7 +60,7 @@ class Photo(Object):
|
||||
height: int,
|
||||
file_size: int,
|
||||
date: int,
|
||||
thumbnails: List[Thumbnail]
|
||||
thumbs: List[Thumbnail]
|
||||
):
|
||||
super().__init__(client)
|
||||
|
||||
@ -69,7 +69,7 @@ class Photo(Object):
|
||||
self.height = height
|
||||
self.file_size = file_size
|
||||
self.date = date
|
||||
self.thumbnails = thumbnails
|
||||
self.thumbs = thumbs
|
||||
|
||||
@staticmethod
|
||||
def _parse(client, photo: types.Photo) -> "Photo":
|
||||
@ -89,6 +89,6 @@ class Photo(Object):
|
||||
height=big.h,
|
||||
file_size=big.size,
|
||||
date=photo.date,
|
||||
thumbnails=Thumbnail._parse(client, photo),
|
||||
thumbs=Thumbnail._parse(client, photo),
|
||||
client=client
|
||||
)
|
||||
|
@ -59,14 +59,14 @@ class Sticker(Object):
|
||||
set_name (``str``, *optional*):
|
||||
Name of the sticker set to which the sticker belongs.
|
||||
|
||||
thumbnails (List of :obj:`Thumbnail`, *optional*):
|
||||
thumbs (List of :obj:`Thumbnail`, *optional*):
|
||||
Sticker thumbnails in the .webp or .jpg format.
|
||||
"""
|
||||
|
||||
# TODO: Add mask position
|
||||
|
||||
__slots__ = [
|
||||
"file_id", "file_name", "mime_type", "file_size", "date", "width", "height", "emoji", "set_name", "thumbnails"
|
||||
"file_id", "file_name", "mime_type", "file_size", "date", "width", "height", "emoji", "set_name", "thumbs"
|
||||
]
|
||||
|
||||
def __init__(
|
||||
@ -82,7 +82,7 @@ class Sticker(Object):
|
||||
date: int = None,
|
||||
emoji: str = None,
|
||||
set_name: str = None,
|
||||
thumbnails: List[Thumbnail] = None
|
||||
thumbs: List[Thumbnail] = None
|
||||
):
|
||||
super().__init__(client)
|
||||
|
||||
@ -95,7 +95,7 @@ class Sticker(Object):
|
||||
self.height = height
|
||||
self.emoji = emoji
|
||||
self.set_name = set_name,
|
||||
self.thumbnails = thumbnails
|
||||
self.thumbs = thumbs
|
||||
# self.mask_position = mask_position
|
||||
|
||||
@staticmethod
|
||||
@ -143,6 +143,6 @@ class Sticker(Object):
|
||||
mime_type=sticker.mime_type,
|
||||
file_name=file_name,
|
||||
date=sticker.date,
|
||||
thumbnails=Thumbnail._parse(client, sticker),
|
||||
thumbs=Thumbnail._parse(client, sticker),
|
||||
client=client
|
||||
)
|
||||
|
@ -57,13 +57,13 @@ class Video(Object):
|
||||
date (``int``, *optional*):
|
||||
Date the video was sent in Unix time.
|
||||
|
||||
thumbnails (List of :obj:`Thumbnail`, *optional*):
|
||||
thumbs (List of :obj:`Thumbnail`, *optional*):
|
||||
Video thumbnails.
|
||||
"""
|
||||
|
||||
__slots__ = [
|
||||
"file_id", "width", "height", "duration", "file_name", "mime_type", "supports_streaming", "file_size", "date",
|
||||
"thumbnails"
|
||||
"thumbs"
|
||||
]
|
||||
|
||||
def __init__(
|
||||
@ -79,7 +79,7 @@ class Video(Object):
|
||||
supports_streaming: bool = None,
|
||||
file_size: int = None,
|
||||
date: int = None,
|
||||
thumbnails: List[Thumbnail] = None
|
||||
thumbs: List[Thumbnail] = None
|
||||
):
|
||||
super().__init__(client)
|
||||
|
||||
@ -92,7 +92,7 @@ class Video(Object):
|
||||
self.supports_streaming = supports_streaming
|
||||
self.file_size = file_size
|
||||
self.date = date
|
||||
self.thumbnails = thumbnails
|
||||
self.thumbs = thumbs
|
||||
|
||||
@staticmethod
|
||||
def _parse(
|
||||
@ -119,6 +119,6 @@ class Video(Object):
|
||||
supports_streaming=video_attributes.supports_streaming,
|
||||
file_size=video.size,
|
||||
date=video.date,
|
||||
thumbnails=Thumbnail._parse(client, video),
|
||||
thumbs=Thumbnail._parse(client, video),
|
||||
client=client
|
||||
)
|
||||
|
@ -48,11 +48,11 @@ class VideoNote(Object):
|
||||
date (``int``, *optional*):
|
||||
Date the video note was sent in Unix time.
|
||||
|
||||
thumbnails (List of :obj:`Thumbnail`, *optional*):
|
||||
thumbs (List of :obj:`Thumbnail`, *optional*):
|
||||
Video thumbnails.
|
||||
"""
|
||||
|
||||
__slots__ = ["file_id", "mime_type", "file_size", "date", "length", "duration", "thumbnails"]
|
||||
__slots__ = ["file_id", "mime_type", "file_size", "date", "length", "duration", "thumbs"]
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
@ -61,7 +61,7 @@ class VideoNote(Object):
|
||||
file_id: str,
|
||||
length: int,
|
||||
duration: int,
|
||||
thumbnails: List[Thumbnail] = None,
|
||||
thumbs: List[Thumbnail] = None,
|
||||
mime_type: str = None,
|
||||
file_size: int = None,
|
||||
date: int = None
|
||||
@ -74,7 +74,7 @@ class VideoNote(Object):
|
||||
self.date = date
|
||||
self.length = length
|
||||
self.duration = duration
|
||||
self.thumbnails = thumbnails
|
||||
self.thumbs = thumbs
|
||||
|
||||
@staticmethod
|
||||
def _parse(client, video_note: types.Document, video_attributes: types.DocumentAttributeVideo) -> "VideoNote":
|
||||
@ -93,6 +93,6 @@ class VideoNote(Object):
|
||||
file_size=video_note.size,
|
||||
mime_type=video_note.mime_type,
|
||||
date=video_note.date,
|
||||
thumbnails=Thumbnail._parse(client, video_note),
|
||||
thumbs=Thumbnail._parse(client, video_note),
|
||||
client=client
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user