Available Types#
This page is about Pyrogram Types. All types listed here are available through the pyrogram.types
package.
Unless required as argument to a client method, most of the types don’t need to be manually instantiated because they
are only returned by other methods. You also don’t need to import them, unless you want to type-hint your variables.
from pyrogram.types import User, Message, ...
Note
Optional fields always exist inside the object, but they could be empty and contain the value of None
.
Empty fields aren’t shown when, for example, using print(message)
and this means that
hasattr(message, "photo")
always returns True
.
To tell whether a field is set or not, do a simple boolean check: if message.photo: ...
.
Messages & Media#
A message. |
|
One special entity in a text message. |
|
This object contains information about the quoted part of a message that is replied to by the given message. |
|
This object contains information about a message that is being replied to, which may come from another chat or forum topic. |
|
Describes reply parameters for the message that is being sent. |
|
This object describes the origin of a message. |
|
The message was originally sent by a known user. |
|
The message was originally sent by an unknown user. |
|
The message was originally sent on behalf of a chat to a group chat. |
|
The message was originally sent to a channel chat. |
|
Contains information about a message created with importMessages. |
|
A Photo. |
|
Describes an alternative reencoded quality of a video file. |
|
An animation file (GIF or H.264/MPEG-4 AVC video without sound). |
|
An audio file to be treated as music by the Telegram clients. |
|
A generic file (as opposed to photos, voice messages, audio files, ...). |
|
This object represents a story. |
|
A video file. |
|
A video note. |
|
A voice note. |
|
Describes the paid media added to a message. |
|
This object describes paid media. |
|
The paid media isn't available before the payment. |
|
The paid media is a photo. |
|
The paid media is a video. |
|
A phone contact. |
|
A dice with a random value from 1 to 6 for currently supported base emoji. |
|
Contains information about one answer option in a poll. |
|
This object contains information about one answer option in a poll to send. |
|
A Poll. |
|
This object represents an answer of a user in a non-anonymous poll. |
|
A point on the map. |
|
A venue. |
|
Describes a gift that can be sent to another user. |
|
Represents a gift received by a user. |
|
Describes an upgraded gift that can be gifted to another user or transferred to TON blockchain as an NFT. |
|
Contains data sent from a Web App to the bot. |
|
This object represents a service message about a change in auto-delete timer settings. |
|
This object represents a service message about a user boosting a chat. |
|
Describes a background set for a specific chat. |
|
A game. |
|
Contains gift code data. |
|
Telegram Premium was gifted to the user |
|
Telegram Stars were gifted to a user |
|
This object represents a message about a scheduled giveaway. |
|
This object represents a service message about the creation of a scheduled giveaway. |
|
This object represents a service message about the completion of a giveaway without public winners. |
|
This object represents a message about the completion of a giveaway with public winners. |
|
Contains information about an effect added to a message. |
|
Reactions to a message with anonymous reactions were changed. |
|
This object represents a change of a reaction on a message performed by a user. |
|
Contains information about a message reactions. |
|
Contains information about a reaction. |
|
Represents a reaction added to a message along with the number of times it was added. |
|
This object describes the type of a reaction. |
|
The reaction is based on an emoji. |
|
The reaction is based on a custom emoji. |
|
The paid reaction in a channel chat. |
|
One size of a photo or a file/sticker thumbnail. |
|
A translated text with entities. |
|
A stripped thumbnail |
|
Describes a sponsored message. |
|
A sticker. |
|
A webpage preview |
|
A service message that a contact has registered with Telegram. |
|
A service message that a screenshot of a message in the chat has been taken. |
|
Contains information about a message draft. |
Users & Chats#
|
|
A Telegram user or bot. |
|
A chat. |
|
Describes usernames assigned to a user, a supergroup, or a channel. |
|
This object contains information about a chat that was shared with the bot using a |
|
This object represents a service message about a user allowing a bot to write messages after adding it to the attachment menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess. |
|
This object contains information about the users whose identifiers were shared with the bot using a |
|
Represents a chat administrator that has created invite links in a chat. |
|
Accent or profile color status. |
|
A chat event from the recent actions log (also known as admin log). |
|
Set of filters used to obtain a chat event log. |
|
An invite link for a chat. |
|
Contains information about a joiner member of a chat. |
|
Represents a join request sent to a chat. |
|
Contains information about one member of a chat. |
|
Represents changes in the status of a chat member. |
|
Describes actions that a non-administrator user is allowed to take in a chat. |
|
A chat photo. |
|
Describes privileged actions an administrator is able to take in a chat. |
|
A chat reactions |
|
A service message about a voice chat scheduled in the chat. |
|
A service message about a voice chat started in the chat. |
|
A service message about a voice chat ended in the chat. |
|
A service message about new members invited to a voice chat. |
|
A user's dialog. |
|
A user emoji status. |
|
Represents a group call participant |
|
The date and user of when someone has joined with an invite link. |
|
A restriction applied to bots or chats. |
|
Represents an RTMP URL and stream key to be used in streaming software. |
Bot keyboards#
Placeholder, currently holds no information. |
|
An incoming callback query from a callback button in an inline keyboard. |
|
This object represents an inline keyboard button that copies specified text to the clipboard. |
|
Object used to force clients to show a reply interface. |
|
One row of the high scores table for a game. |
|
One button of an inline keyboard. |
|
An inline keyboard that appears right next to the message it belongs to. |
|
One button of the reply keyboard. |
|
This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed. |
|
This object defines the criteria used to request a suitable chat. |
|
This object defines the criteria used to request suitable users. |
|
A custom keyboard with reply options. |
|
Object used to tell clients to remove a bot keyboard. |
|
Represents a parameter of the inline keyboard button used to automatically authorize a user. |
|
Contains information about a Web App. |
|
Describes the bot's menu button in a private chat. |
|
A menu button, which opens the bot's list of commands. |
|
A menu button, which launches a Web App. |
|
Describes that no specific value for the menu button was set. |
|
Contains information about an inline message sent by a Web App on behalf of a user. |
|
This object represents an inline button that switches the current user to inline mode in a chosen chat, with an optional default inline query. |
Bot commands#
A bot command with the standard slash "/" prefix. |
|
Represents the scope to which bot commands are applied. |
|
Represents the scope of bot commands, covering all group and supergroup chat administrators. |
|
Represents the scope of bot commands, covering all group and supergroup chats. |
|
Represents the scope of bot commands, covering all private chats. |
|
Represents the scope of bot commands, covering a specific chat. |
|
Represents the scope of bot commands, covering all administrators of a specific group or supergroup chat. |
|
Represents the scope of bot commands, covering a specific member of a group or supergroup chat. |
|
Represents the default scope of bot commands. |
Chat Forum Topics#
This object represents a forum topic. |
|
This object represents a service message about a new forum topic created in the chat. |
|
This object represents a service message about a forum topic closed in the chat. |
|
This object represents a service message about an edited forum topic. |
|
This object represents a service message about a forum topic reopened in the chat. |
|
This object represents a service message about General forum topic hidden in the chat. |
|
This object represents a service message about General forum topic unhidden in the chat. |
Input Media#
Content of a media message to be sent. |
|
A photo to be sent inside an album. |
|
A video to be sent inside an album. |
|
An audio to be sent inside an album. |
|
An animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent inside an album. |
|
A generic file to be sent inside an album. |
|
A Phone Contact to be added in your Telegram address book. |
|
Describes the options used for link preview generation. |
Input Paid Media#
This object describes the paid media to be sent. |
|
The paid media to send is a photo. |
|
The paid media to send is a video. |
|
This object contains information about a paid media purchase. |
Inline Mode#
A result of an inline query chosen by the user and sent to their chat partner. |
|
An incoming inline query. |
|
One result of an inline query. |
|
A link to an animation file stored on the Telegram servers. |
|
A link to an MP3 audio file stored on the Telegram servers |
|
A link to a file stored on the Telegram servers. |
|
A link to a photo stored on the Telegram servers. |
|
A link to a sticker stored on the Telegram servers |
|
A link to a video file stored on the Telegram servers. |
|
A link to a voice message stored on the Telegram servers. |
|
Link to an animated GIF file. |
|
Link to an audio file. |
|
Link to a file. |
|
Link to a photo. |
|
Link to a page containing an embedded video player or a video file. |
|
Link to a voice recording in an .OGG container encoded with OPUS. |
|
Link to an article or web page. |
|
Contact with a phone number |
|
A location on a map. |
|
A venue. |
InputMessageContent#
Content of a message to be sent as a result of an inline query. |
|
Content of a text message to be sent as the result of an inline query. |
|
Content of a location message to be sent as the result of an inline query. |
|
Content of a venue message to be sent as the result of an inline query. |
|
Content of a contact message to be sent as the result of an inline query. |
|
Content of an invoice message to be sent as the result of an inline query. |
Payments#
Describes the connection of the bot with a business account. |
|
|
|
|
|
|
|
|
|
Contains information about a collectible item and its last purchase. |
|
This object represents a portion of the price for goods or services. |
|
This object contains basic information about an invoice. |
|
This object represents a shipping address. |
|
This object represents information about an order. |
|
This object represents one shipping option. |
|
This object contains basic information about an payment form. |
|
This object contains basic information about a successful payment. |
|
This object contains basic information about a refunded payment. |
|
This object contains information about an incoming shipping query. |
|
This object contains information about an incoming pre-checkout query. |
|
This object Describes a possibly non-integer amount of Telegram Stars. |