|
| 1 | +# Pyrogram - Telegram MTProto API Client Library for Python |
| 2 | +# Copyright (C) 2017-2018 Dan Tès <https://github.com/delivrance> |
| 3 | +# |
| 4 | +# This file is part of Pyrogram. |
| 5 | +# |
| 6 | +# Pyrogram is free software: you can redistribute it and/or modify |
| 7 | +# it under the terms of the GNU Lesser General Public License as published |
| 8 | +# by the Free Software Foundation, either version 3 of the License, or |
| 9 | +# (at your option) any later version. |
| 10 | +# |
| 11 | +# Pyrogram is distributed in the hope that it will be useful, |
| 12 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | +# GNU Lesser General Public License for more details. |
| 15 | +# |
| 16 | +# You should have received a copy of the GNU Lesser General Public License |
| 17 | +# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>. |
| 18 | + |
| 19 | +from pyrogram.api.core import Object |
| 20 | + |
| 21 | + |
| 22 | +class GIF(Object): |
| 23 | + """This object represents a GIF file. |
| 24 | +
|
| 25 | + Attributes: |
| 26 | + ID: ``0xb0700025`` |
| 27 | +
|
| 28 | + Args: |
| 29 | + file_id (``str``): |
| 30 | + Unique identifier for this file. |
| 31 | +
|
| 32 | + width (``int``): |
| 33 | + GIF width as defined by sender. |
| 34 | +
|
| 35 | + height (``int``): |
| 36 | + GIF height as defined by sender. |
| 37 | +
|
| 38 | + duration (``int``): |
| 39 | + Duration of the GIF in seconds as defined by sender. |
| 40 | +
|
| 41 | + thumb (:obj:`PhotoSize <pyrogram.PhotoSize>`, *optional*): |
| 42 | + GIF thumbnail. |
| 43 | +
|
| 44 | + file_name (``str``, *optional*): |
| 45 | + GIF file name. |
| 46 | +
|
| 47 | + mime_type (``str``, *optional*): |
| 48 | + Mime type of a file as defined by sender. |
| 49 | +
|
| 50 | + file_size (``int``, *optional*): |
| 51 | + File size. |
| 52 | +
|
| 53 | + date (``int``, *optional*): |
| 54 | + Date the GIF was sent in Unix time. |
| 55 | + """ |
| 56 | + |
| 57 | + ID = 0xb0700025 |
| 58 | + |
| 59 | + def __init__( |
| 60 | + self, |
| 61 | + file_id: str, |
| 62 | + width: int, |
| 63 | + height: int, |
| 64 | + duration: int, |
| 65 | + thumb=None, |
| 66 | + file_name: str = None, |
| 67 | + mime_type: str = None, |
| 68 | + file_size: int = None, |
| 69 | + date: int = None |
| 70 | + ): |
| 71 | + self.file_id = file_id # string |
| 72 | + self.thumb = thumb # flags.0?PhotoSize |
| 73 | + self.file_name = file_name # flags.1?string |
| 74 | + self.mime_type = mime_type # flags.2?string |
| 75 | + self.file_size = file_size # flags.3?int |
| 76 | + self.date = date # flags.4?int |
| 77 | + self.width = width # int |
| 78 | + self.height = height # int |
| 79 | + self.duration = duration # int |
0 commit comments