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