How to use the pyrogram.client.types.object.Object function in Pyrogram

To help you get started, we’ve selected a few Pyrogram examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pyrogram / pyrogram / pyrogram / client / types / messages_and_media / venue.py View on Github external
#
# 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 .

import pyrogram
from pyrogram.api import types
from .location import Location
from ..object import Object


class Venue(Object):
    """A venue.

    Parameters:
        location (:obj:`Location`):
            Venue location.

        title (``str``):
            Name of the venue.

        address (``str``):
            Address of the venue.

        foursquare_id (``str``, *optional*):
            Foursquare identifier of the venue.

        foursquare_type (``str``, *optional*):
github pyrogram / pyrogram / pyrogram / client / types / messages_and_media / poll_option.py View on Github external
# 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 .

import pyrogram
from ..object import Object


class PollOption(Object):
    """Contains information about one answer option in a poll.

    Parameters:
        text (``str``):
            Option text, 1-100 characters.

        voter_count (``int``):
            Number of users that voted for this option.
            Equals to 0 until you vote.

        data (``bytes``):
            The data this poll option is holding.
    """

    def __init__(
        self,
github pyrogram / pyrogram / pyrogram / client / types / bots_and_keyboards / game_high_score.py View on Github external
# 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 .

import pyrogram

from pyrogram.api import types
from pyrogram.client.types.object import Object
from pyrogram.client.types.user_and_chats import User


class GameHighScore(Object):
    """One row of the high scores table for a game.

    Parameters:
        user (:obj:`User`):
            User.

        score (``int``):
            Score.

        position (``position``, *optional*):
            Position in high score table for the game.
    """

    def __init__(
        self,
        *,
github pyrogram / pyrogram / pyrogram / client / types / user_and_chats / chat_members.py View on Github external
# 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 .

from typing import List

import pyrogram
from pyrogram.api import types
from .chat_member import ChatMember
from ..object import Object


class ChatMembers(Object):
    """Contains information about the members list of a chat.

    Parameters:
        total_count (``int``):
            Total number of members the chat has.

        chat_members (List of :obj:`ChatMember `):
            Requested chat members.
    """

    __slots__ = ["total_count", "chat_members"]

    def __init__(
        self,
        *,
        client: "pyrogram.BaseClient" = None,
github pyrogram / pyrogram / pyrogram / client / types / messages_and_media / profile_photos.py View on Github external
# 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 .

from typing import List

import pyrogram
from .photo import Photo
from ..object import Object


class ProfilePhotos(Object):
    """Contains a user's profile pictures.

    Parameters:
        total_count (``int``):
            Total number of profile pictures the target user has.

        profile_photos (List of :obj:`Photo`):
            Requested profile pictures.
    """

    __slots__ = ["total_count", "profile_photos"]

    def __init__(
        self,
        *,
        client: "pyrogram.BaseClient" = None,
github pyrogram / pyrogram / pyrogram / client / types / messages_and_media / message_entity.py View on Github external
# 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 .

import pyrogram

from pyrogram.api import types
from ..object import Object
from ..user_and_chats.user import User


class MessageEntity(Object):
    """One special entity in a text message.
    For example, hashtags, usernames, URLs, etc.

    Parameters:
        type (``str``):
            Type of the entity.
            Can be "mention" (@username), "hashtag", "cashtag", "bot_command", "url", "email", "phone_number", "bold"
            (bold text), "italic" (italic text), "code" (monowidth string), "pre" (monowidth block), "text_link"
            (for clickable text URLs), "text_mention" (for custom text mentions based on users' identifiers).

        offset (``int``):
            Offset in UTF-16 code units to the start of the entity.

        length (``int``):
            Length of the entity in UTF-16 code units.
github pyrogram / pyrogram / pyrogram / client / types / inline_mode / todo / inline_query_result_contact.py View on Github external
# 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 .

from pyrogram.client.types.object import Object


class InlineQueryResultContact(Object):
    """Represents a contact with a phone number. By default, this contact will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the contact.

    Attributes:
        ID: ``0xb0700009``

    Parameters:
        type (``str``):
            Type of the result, must be contact.

        id (``str``):
            Unique identifier for this result, 1-64 Bytes.

        phone_number (``str``):
            Contact's phone number.

        first_name (``str``):
github pyrogram / pyrogram / pyrogram / client / types / bots_and_keyboards / inline_keyboard_markup.py View on Github external
# 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 .

from typing import List

from pyrogram.api.types import ReplyInlineMarkup, KeyboardButtonRow
from . import InlineKeyboardButton
from ..object import Object


class InlineKeyboardMarkup(Object):
    """An inline keyboard that appears right next to the message it belongs to.

    Parameters:
        inline_keyboard (List of List of :obj:`InlineKeyboardButton`):
            List of button rows, each represented by a List of InlineKeyboardButton objects.
    """

    __slots__ = ["inline_keyboard"]

    def __init__(
        self,
        inline_keyboard: List[List[InlineKeyboardButton]]
    ):
        super().__init__()

        self.inline_keyboard = inline_keyboard
github pyrogram / pyrogram / pyrogram / client / types / messages_and_media / document.py View on Github external
# 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 .

from struct import pack
from typing import List

import pyrogram
from pyrogram.api import types
from .thumbnail import Thumbnail
from ..object import Object
from ...ext.utils import encode


class Document(Object):
    """A generic file (as opposed to photos, voice messages, audio files, ...).

    Parameters:
        file_id (``str``):
            Unique file identifier.

        file_name (``str``, *optional*):
            Original filename as defined by sender.

        mime_type (``str``, *optional*):
            MIME type of the file as defined by sender.

        file_size (``int``, *optional*):
            File size.

        date (``int``, *optional*):
github pyrogram / pyrogram / pyrogram / client / types / messages_and_media / game.py View on Github external
# 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 .

import pyrogram
from pyrogram.api import types
from .animation import Animation
from .photo import Photo
from ..object import Object


class Game(Object):
    """A game.
    Use BotFather to create and edit games, their short names will act as unique identifiers.

    Parameters:
        id (``int``):
            Unique identifier of the game.

        title (``str``):
            Title of the game.

        short_name (``str``):
            Unique short name of the game.

        description (``str``):
            Description of the game.