This object represents one size of a photo or a file/sticker thumbnail. Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their :attr:`file_unique_id` is equal. Args: file_id (:obj:`str`): Identifier for this file, whi
| 23 | |
| 24 | |
| 25 | class PhotoSize(_BaseMedium): |
| 26 | """This object represents one size of a photo or a file/sticker thumbnail. |
| 27 | |
| 28 | Objects of this class are comparable in terms of equality. Two objects of this class are |
| 29 | considered equal, if their :attr:`file_unique_id` is equal. |
| 30 | |
| 31 | Args: |
| 32 | file_id (:obj:`str`): Identifier for this file, which can be used to download |
| 33 | or reuse the file. |
| 34 | file_unique_id (:obj:`str`): Unique identifier for this file, which |
| 35 | is supposed to be the same over time and for different bots. |
| 36 | Can't be used to download or reuse the file. |
| 37 | width (:obj:`int`): Photo width. |
| 38 | height (:obj:`int`): Photo height. |
| 39 | file_size (:obj:`int`, optional): File size in bytes. |
| 40 | |
| 41 | Attributes: |
| 42 | file_id (:obj:`str`): Identifier for this file, which can be used to download |
| 43 | or reuse the file. |
| 44 | file_unique_id (:obj:`str`): Unique identifier for this file, which |
| 45 | is supposed to be the same over time and for different bots. |
| 46 | Can't be used to download or reuse the file. |
| 47 | width (:obj:`int`): Photo width. |
| 48 | height (:obj:`int`): Photo height. |
| 49 | file_size (:obj:`int`): Optional. File size in bytes. |
| 50 | |
| 51 | |
| 52 | """ |
| 53 | |
| 54 | __slots__ = ("height", "width") |
| 55 | |
| 56 | def __init__( |
| 57 | self, |
| 58 | file_id: str, |
| 59 | file_unique_id: str, |
| 60 | width: int, |
| 61 | height: int, |
| 62 | file_size: int | None = None, |
| 63 | *, |
| 64 | api_kwargs: JSONDict | None = None, |
| 65 | ): |
| 66 | super().__init__( |
| 67 | file_id=file_id, |
| 68 | file_unique_id=file_unique_id, |
| 69 | file_size=file_size, |
| 70 | api_kwargs=api_kwargs, |
| 71 | ) |
| 72 | with self._unfrozen(): |
| 73 | # Required |
| 74 | self.width: int = width |
| 75 | self.height: int = height |
no outgoing calls
searching dependent graphs…