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: ....
Users & Chats¶
A Telegram user or bot. |
|
A chat. |
|
A chat preview. |
|
A chat photo. |
|
Contains information about one member of a chat. |
|
Describes actions that a non-administrator user is allowed to take in a chat. |
|
An invite link for a chat. |
|
Represents a chat administrator that has created invite links in a chat. |
|
A chat event from the recent actions log (also known as admin log). |
|
Set of filters used to obtain a chat event log. |
|
Represents changes in the status of a chat member. |
|
Represents a join request sent to a chat. |
|
Contains information about a joiner member of a chat. |
|
A user's dialog. |
|
A restriction applied to bots or chats. |
|
A user emoji status. |
|
Birthday information of a user. |
|
Business information of a user. |
|
Information about intro of this user. |
|
Business recipients. |
|
Business working hours. |
|
Business weekly open hours. |
|
Describes privileged actions an administrator is able to take in a chat. |
|
Reply or profile color status. |
|
Describes result of join of a chat by the current user. |
|
A chat reactions |
|
A list of actions that are possible when interacting with this user, to be shown as suggested actions in the chat action bar. |
|
Represents a folder for user chats. |
|
Contains a chat folder invite link. |
|
Chats found by name substring and auxiliary data. |
|
Birthday information of a user. |
|
Contains information about one member of a group call. |
|
A service message about a cleared history in chat. |
|
The date and user of when someone has joined with an invite link. |
|
A service message about a phone_call ended in the chat. |
|
A service message about a phone_call started in the chat. |
|
A privacy rule. |
|
Information about the current stealth mode session. |
|
Contains information about rating of a user. |
|
Accepts gift types. |
|
Information about bot verification. |
|
Describes actions that a connected business bot is allowed to take in a chat. |
|
Contains information about an invite link to a chat folder. |
|
The join was declined by the guard bot. |
|
An approval from a guard bot through a Web App is required to join the chat. |
|
The join request was sent and have to be approved by administrators of the chat. |
|
Contains information about a joiner member of a chat. |
|
Contains information about a user that has failed to be added to a chat. |
|
A Telegram user's or chat's username. |
|
Contains information about verification status of a chat or a user. |
|
A service message about a voice chat ended in the chat. |
|
A service message about new members invited to a voice chat. |
|
A service message about a voice chat scheduled in the chat. |
|
A service message about a voice chat started in the chat. |
Messages & Media¶
A message. |
|
One special entity in a text message. |
|
A Photo. |
|
One size of a photo or a file/sticker thumbnail. |
|
An audio file to be treated as music by the Telegram clients. |
|
A generic file (as opposed to photos, voice messages, audio files, ...). |
|
An animation file (GIF or H.264/MPEG-4 AVC video without sound). |
|
A video file. |
|
A voice note. |
|
A video note. |
|
A phone contact. |
|
A point on the map. |
|
A venue. |
|
A sticker. |
|
A game. |
|
A webpage preview |
|
A Poll. |
|
Contains information about one answer option in a poll. |
|
A dice with a random value from 1 to 6 for currently supported base emoji. |
|
Contains information about a reaction. |
|
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. |
|
Contains data sent from a Web App to the bot. |
|
Contains information about a message reactions. |
|
A chat reactions |
|
Contains information about available effect. |
|
Contains information about boost. |
|
A Business message. |
|
Describes a background set for a specific chat. |
|
Contains information about one or more boosts applied by a specific user. |
|
Describes a checklist. |
|
Describes a task in a checklist. |
|
Some tasks were added to a checklist. |
|
Some tasks from a checklist were marked as done or not done. |
|
A service message that a contact has registered with Telegram. |
|
A price for direct messages was changed in the channel chat. |
|
Contains information about a topic in a channel direct messages chat administered by the current user. |
|
This object contains information about a message that is being replied to, which may come from another chat or forum topic. |
|
Represents a fact-check created by an independent fact-checker. |
|
Contains information about a text with some entities. |
|
A forum topic. |
|
A service message about a forum topic closed in the chat. |
|
A service message about a new forum topic created in the chat. |
|
A service message about a forum topic renamed in the chat. |
|
A service message about a forum topic reopened in the chat. |
|
A service message about a general topic hidden in the chat. |
|
A service message about a general topic unhidden in the chat. |
|
Describes a gift or an upgraded gift that can be transferred to another owner or transferred to the TON blockchain as an NFT. |
|
Contains information about a star gift attribute. |
|
Describes an auction on which a gift can be purchased. |
|
Represent auction state of a gift. |
|
Describes collection of gifts. |
|
Telegram Premium was gifted to the user. |
|
Telegram Stars were gifted to a user. |
|
Toncoins were gifted to a user. |
|
An giveaway. |
|
This object represents a service message about the completion of a giveaway without public winners. |
|
This object represents a service message about the creation of a scheduled giveaway. |
|
A Telegram Stars were received by the current user from a giveaway. |
|
This object represents a message about the completion of a giveaway with public winners. |
|
Describes a task in a checklist to be sent. |
|
This object contains basic information about an invoice. |
|
Describes the options used for link preview generation. |
|
A live photo. |
|
This object contains information about the bot that was created to be managed by the current bot. |
|
This object describes the position on faces where a mask should be placed by default. |
|
Describes the media area added to a story. |
|
A message content. |
|
This object describes the origin of a message. |
|
The message was originally sent to a channel chat. |
|
The message was originally sent on behalf of a chat to a group chat. |
|
The message was originally sent by an unknown user. |
|
Contains information about a message imported from a foreign chat service. |
|
The message was originally sent by a known user. |
|
Contains information about boost. |
|
Describes the paid media added to a message. |
|
The paid media isn't available before the payment. |
|
A price for paid messages was changed in the supergroup chat. |
|
Paid messages were refunded. |
|
Contains information about a user that added paid reactions. |
|
Contains information about an invoice payment form. |
|
Describes an additional payment option. |
|
Describes a service message about an option added to a poll. |
|
Describes a service message about an option deleted from a poll. |
|
A Telegram Premium gift code was created for the user. |
|
Information about a proximity alert. |
|
This object contains basic information about a refunded payment. |
|
Describes reply parameters for the message that is being sent. |
|
Restriction reason. |
|
This object represents a block in a rich formatted message. |
|
Rich formatted message. |
|
This object represents a rich formatted text. |
|
A service message that a screenshot of a message in the chat has been taken. |
|
Describes a possibly non-integer amount of Telegram Stars. |
|
A story. |
|
A story view date and reaction information. |
|
A stripped thumbnail |
|
Describes a service message about the failed approval of a suggested post. |
|
Describes a service message about the approval of a suggested post. |
|
Describes a service message about the rejection of a suggested post. |
|
Contains information about a suggested post. |
|
Describes a service message about a successful payment for a suggested post. |
|
Contains parameters of a post that is being suggested. |
|
Describes price of a suggested post. |
|
Describes a service message about a payment refund for a suggested post. |
|
Describes manually or automatically chosen quote from another message. |
|
This object contains identifier of an upgraded gift attribute to search for. |
|
Identifier of a gift backdrop. |
|
Identifier of a gift model. |
|
Identifier of a gift symbol. |
|
Describes rarity of an upgraded gift attribute. |
|
Describes the original details about the gift. |
|
An offer to purchase an upgraded gift was sent or received. |
|
Contains information about value of an upgraded gift. |
|
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. |
|
Describes a bid in an auction. |
|
Describes a round of an auction. |
|
Describes state of an auction. |
|
Contains information about an ongoing auction. |
|
Contains information about a finished auction. |
|
Chat |
|
Chat |
|
Describes a service message about an ownership change in the chat. |
|
Describes a service message about the chat owner leaving the chat. |
|
Describes a chat theme. |
|
Contains checked gift code data. |
|
Contains result of gift crafting. |
|
Craft has failed. |
|
Craft was successful. |
|
Describes the maximum number of times that a specific gift can be purchased. |
|
Describes parameters of a unique gift available for resale. |
|
Describes price of a resold gift. |
|
Describes price of a resold gift in Telegram Stars. |
|
Describes price of a resold gift in Toncoins. |
|
Contains examples of possible upgraded gifts for the given regular gift. |
|
Describes a price required to pay to upgrade a gift. |
|
Contains all possible variants of upgraded gifts for the given regular gift. |
|
Contains the result of a payment request. |
|
A block with an anchor, corresponding to the HTML tag |
|
A block with an animation, corresponding to the HTML tag |
|
A block with a music file, corresponding to the HTML tag |
|
A block quotation, corresponding to the HTML tag |
|
Caption of a rich formatted block. |
|
A collage, corresponding to the custom HTML tag |
|
An expandable block for details disclosure, corresponding to the HTML tag |
|
A divider, corresponding to the HTML tag |
|
A footer, corresponding to the HTML tag |
|
A list of blocks, corresponding to the HTML tag |
|
An item of a list. |
|
A block with a map, corresponding to the custom HTML tag |
|
A block with a mathematical expression in LaTeX format, corresponding to the custom HTML tag |
|
A text paragraph, corresponding to the HTML tag |
|
A block with a photo, corresponding to the HTML tag |
|
A preformatted text block, corresponding to the nested HTML tags |
|
A quotation with centered text, loosely corresponding to the HTML tag |
|
A section heading, corresponding to the HTML tags |
|
A slideshow, corresponding to the custom HTML tag |
|
A table, corresponding to the HTML tag |
|
Cell in a table. |
|
A block with a "Thinking..." placeholder, corresponding to the custom HTML tag |
|
A rich block unsupported yet. |
|
A block with a video, corresponding to the HTML tag |
|
A block with a voice note, corresponding to the HTML tag |
|
An anchor. |
|
A link to an anchor. |
|
A text with a bank card number. |
|
A bold text. |
|
A bot command. |
|
A cashtag. |
|
A monowidth text. |
|
A custom emoji. |
|
Formatted date and time. |
|
A text with an email address. |
|
A hashtag. |
|
A italicized text. |
|
A marked text. |
|
A mathematical expression. |
|
A mention by a username. |
|
A text with a phone number. |
|
A reference. |
|
A link to a reference. |
|
A text covered by a spoiler. |
|
A strikethrough text. |
|
A subscript text. |
|
A superscript text. |
|
A mention of a Telegram user by their identifier. |
|
A underlined text. |
|
A text with a link. |
|
Contains information about saved payment credentials. |
|
A service message about a new successful payment. |
|
Describes price of a suggested post in Telegram Stars. |
|
Describes price of a suggested post in Toncoins. |
|
The attribute is epic. |
|
The attribute is legendary. |
|
The rarity is represented as the numeric frequence of the model. |
|
The attribute is rare. |
|
The attribute is uncommon. |
|
An offer to purchase a gift was rejected or expired. |
Bot keyboards & Commands¶
A custom keyboard with reply options. |
|
One button of the reply keyboard. |
|
Object used to tell clients to remove a bot keyboard. |
|
An inline keyboard that appears right next to the message it belongs to. |
|
One button of an inline keyboard. |
|
Represents a parameter of the inline keyboard button used to automatically authorize a user. |
|
Object used to force clients to show a reply interface. |
|
An incoming callback query from a callback button in an inline keyboard. |
|
One row of the high scores table for a game. |
|
Placeholder, currently holds no information. |
|
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. |
|
A bot command with the standard slash "/" prefix. |
|
Represents the scope to which bot commands are applied. |
|
Represents the default scope of bot commands. |
|
Represents the scope of bot commands, covering all private chats. |
|
Represents the scope of bot commands, covering all group and supergroup chats. |
|
Represents the scope of bot commands, covering all group and supergroup chat administrators. |
|
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. |
|
This object describes the access settings of a bot. |
|
A channel/supergroup boost has changed (bots only). |
|
Contains information about a chat shared with a bot. |
|
Contains information about a poll type. |
|
Contains information about a chat peer type. |
|
This object defines the parameters for the creation of a managed bot. |
|
Contains information about a user peer type. |
|
This object represents a portion of the price for goods or services. |
|
This object contains information about the creation or token update of a bot that is managed by the current bot. |
|
Reactions to a message with anonymous reactions were changed. |
|
This object represents a change of a reaction on a message performed by a user. |
|
This object represents information about an order. |
|
This object contains information about an incoming pre-checkout query. |
|
This object represents information about purchased paid media. |
|
Describes an inline message sent by a guest bot. |
|
Contains information about a shipping address. |
|
This object represents one shipping option. |
|
This object contains information about an incoming shipping query. |
|
Contains information about a users shared with a bot. |
Inline Mode¶
An incoming inline query. |
|
One result of an inline query. |
|
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 an animation 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 article or web page. |
|
Link to an audio file. |
|
Contact with a phone number |
|
Link to a file. |
|
Link to an animated GIF file. |
|
A location on a map. |
|
Link to a photo. |
|
A venue. |
|
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. |
|
A result of an inline query chosen by the user and sent to their chat partner. |
Input Content¶
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 a photo to be set as a user profile or chat photo. |
|
Describes a checklist to create. |
|
Contains information about the payment method chosen by the user. |
|
Applies if a user enters new credentials using Apple Pay. |
|
Applies if a user enters new credentials using Google Pay. |
|
Applies if a user enters new credentials on a payment provider website. |
|
Applies if a user chooses some previously saved payment credentials. |
|
Describes an invoice to process. |
|
An invoice from a message or paid media purchase from paid media message. |
|
Content of an invoice message to be sent as the result of an inline query. |
|
An invoice from a link. |
|
Represents an HTTP link to be sent. |
|
Represents a live photo to be sent. |
|
Represents a location to be sent. |
|
A sticker to be attached. |
|
Represents a venue to be sent. |
|
Content of a message to be sent as a result of an inline query. |
|
Content of a media message to be sent. |
|
This object contains information about one answer option in a poll to be sent. |
|
Content of a media message to be sent. |
|
Content of a privacy rule. |
|
Allow all users. |
|
Allow bots and miniapps. |
|
Allow only participants of certain chats. |
|
Allow only close friends. |
|
Allow contacts only. |
|
Allow only users with a Premium subscription, currently only usable for |
|
Allow only participants of certain users. |
|
Disallow all users. |
|
Disallow bots and miniapps. |
|
Disallow only participants of certain chats. |
|
Disallow contacts only. |
|
Disallow only participants of certain users. |
|
Describes a checklist to create. |
|
Content of a rich message to be sent as the result of an inline query. |
|
Content of a text 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 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. |
|
An animation in H.264/MPEG-4 AVC format. |
|
A previously used profile photo of the current user. |
|
A static photo in JPEG format. |
Enums¶
This page lists all available enums from the pyrogram.enums package.
from pyrogram.enums import ParseMode, ChatAction, ...
Block list enumeration |
|
Business away enumeration used in |
|
Button style type enumeration used in |
|
Chat action enumeration used in |
|
Chat event action enumeration used in |
|
Media area type enumeration used in |
|
How the service message |
|
Chat member status enumeration used in |
|
Chat members filter enumeration used in |
|
Chat type enumeration used in |
|
Valid platforms for a |
|
Folder color enumeration used in |
|
Star gift attribute type enumeration used in |
|
Describes order in which upgraded gifts for resale will be sorted. |
|
Gift purchase offer state enumeration used in |
|
Gift type enumeration used in |
|
Mask point type enumeration used in |
|
Media area type enumeration used in |
|
Message entity type enumeration used in |
|
Message media type enumeration used in |
|
Message origin type enumeration used in |
|
Message service type enumeration used in |
|
Messages filter enumeration used in |
|
Next code type enumeration used in |
|
Reaction privacy type enumeration used in |
|
Parse mode enumeration used in various places to set a specific parse mode |
|
Describes type of payment form. |
|
Phone call discard reason enumeration used in |
|
Describes type of the request for which a code is sent to a phone number |
|
Poll type enumeration used in |
|
Privacy key enumeration used in |
|
Privacy rule type enumeration used in |
|
Profile color enumeration used in |
|
Profile tab enumeration used in |
|
Reply color enumeration used in |
|
Sent code type enumeration used in |
|
Sticker type enumeration used in |
|
Stories privacy rules type enumeration used in |
|
Suggested post refund reason enumeration used in |
|
Suggested post state enumeration used in |
|
Represents the categories of chats for which a list of frequently used chats can be retrieved. |
|
Origin from which the upgraded gift was obtained. |
|
User status enumeration used in |