2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-09-05 08:45:13 +00:00

Add the new Photo type

This commit is contained in:
Dan
2018-06-28 19:04:45 +02:00
parent be451a3bb2
commit 5f87bbc962
3 changed files with 46 additions and 5 deletions

View File

@@ -31,6 +31,7 @@ from .location import Location
from .message import Message
from .message_entity import MessageEntity
from .messages import Messages
from .photo import Photo
from .photo_size import PhotoSize
from .reply_markup import (
ForceReply, InlineKeyboardButton, InlineKeyboardMarkup,

View File

@@ -0,0 +1,41 @@
# Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2018 Dan Tès <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pyrogram is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from pyrogram.api.core import Object
class Photo(Object):
"""This object represents a Photo
Args:
id (``str``):
Unique identifier for this photo.
date (``int``):
Date the photo was sent in Unix time
sizes (List of :obj:`PhotoSize <pyrogram.PhotoSize>):
Available sizes of this photo
"""
ID = 0xb0700027
def __init__(self, id: str, date: int, sizes: list):
self.id = id
self.date = date
self.sizes = sizes