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¶
Accepts gift types. |
|
Birthday information of a user. |
|
Business information of a user. |
|
Information about intro of this user. |
|
Business recipients. |
|
Business weekly open hours. |
|
Business working hours. |
|
A Telegram user or bot. |
|
A Telegram user's or chat's username. |
|
Contains information about verification status of a chat or a user. |
|
A chat. |
|
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. |
|
Describes privileged actions an administrator is able 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. |
|
Contains information about a user that has failed to be added to a chat. |
|
Represents a folder for user chats. |
|
Contains information about one member of a group call. |
|
Reply or profile color status. |
|
Chats found by name substring and auxiliary data. |
|
A privacy rule. |
|
Information about the current stealth mode session. |
|
Contains information about rating of a user. |
|
Information about bot verification. |
|
Describes actions that a connected business bot is allowed to take in a chat. |
|
A list of actions that are possible when interacting with this user, to be shown as suggested actions in the chat action bar. |
|
Birthday information of a user. |
|
A service message about a cleared history in chat. |
Messages & Media¶
A Business message. |
|
A message. |
|
One special entity in a text 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. |
|
This object describes the origin of a message. |
|
A Photo. |
|
Describes a service message about an option added to a poll. |
|
Describes a service message about an option deleted from a poll. |
|
One size of a photo or a file/sticker thumbnail. |
|
A stripped thumbnail |
|
An audio file to be treated as music by the Telegram clients. |
|
Contains information about available effect. |
|
A generic file (as opposed to photos, voice messages, audio files, ...). |
|
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. |
|
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. |
|
Contains result of gift crafting. |
|
Craft was successful. |
|
Craft has failed. |
|
A point on the map. |
|
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. |
|
A venue. |
|
A sticker. |
|
A game. |
|
A webpage preview |
|
A Poll. |
|
Information about a proximity alert. |
|
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. |
|
Restriction reason. |
|
Describes a gift or an upgraded gift that can be transferred to another owner or transferred to the TON blockchain as an NFT. |
|
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 service message about a phone_call started in the chat. |
|
A service message about a phone_call ended in the chat. |
|
Contains data sent from a Web App to the bot. |
|
Contains information about a message reactions. |
|
A chat reactions |
|
A story. |
|
Contains information about boost. |
|
Contains information about boost. |
|
An giveaway. |
|
Describes a task in a checklist to be sent. |
|
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 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. |
|
This object contains basic information about an invoice. |
|
Describes the options used for link preview generation. |
|
Describes collection of gifts. |
|
A Telegram Premium gift code was created for the user. |
|
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 checked gift code data. |
|
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. |
|
Describes a checklist. |
|
This object contains basic information about a refunded payment. |
|
Describes reply parameters for the message that is being sent. |
|
A service message about a new successful payment. |
|
Contains parameters of a post that is being suggested. |
|
Contains information about a suggested post. |
|
Describes a service message about a successful payment for a suggested post. |
|
Describes price of a suggested post. |
|
Describes price of a suggested post in Telegram Stars. |
|
Describes price of a suggested post in Toncoins. |
|
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. |
|
Describes a service message about a payment refund for a suggested post. |
|
Describes manually or automatically chosen quote from another message. |
|
Describes the paid media added to a message. |
|
The paid media isn't available before the payment. |
|
Paid messages were refunded. |
|
Contains information about a user that added paid reactions. |
|
A price for paid messages was changed in the supergroup chat. |
|
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. |
|
Contains information about an invoice payment form. |
|
Describes an additional payment option. |
|
Contains information about saved payment credentials. |
|
Contains the result of a payment request. |
|
Contains information about one or more boosts applied by a specific user. |
|
Describes a service message about an ownership change in the chat. |
|
Describes a service message about the chat owner leaving the chat. |
|
Chat |
|
Chat |
|
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. |
|
Describes a possibly non-integer amount of Telegram Stars. |
|
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. |
|
Contains information about a star gift attribute. |
|
A story view date and reaction information. |
|
Telegram Premium was gifted to the user. |
|
Describes a background set for a specific chat. |
|
Describes a chat theme. |
|
Telegram Stars were gifted to a user. |
|
Toncoins were gifted to a user. |
|
Contains information about value of an upgraded gift. |
|
This object contains identifier of an upgraded gift attribute to search for. |
|
An offer to purchase an upgraded gift was sent or received. |
|
An offer to purchase a gift was rejected or expired. |
|
Identifier of a gift model. |
|
Identifier of a gift symbol. |
|
Identifier of a gift backdrop. |
|
Describes rarity of an upgraded gift attribute. |
|
The rarity is represented as the numeric frequence of the model. |
|
The attribute is uncommon. |
|
The attribute is rare. |
|
The attribute is epic. |
|
The attribute is legendary. |
|
Describes the original details about the gift. |
|
Describes a photo to be set as a user profile or chat photo. |
|
A previously used profile photo of the current user. |
|
A static photo in JPEG format. |
|
An animation in H.264/MPEG-4 AVC format. |
|
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. |
|
Represent auction state of a gift. |
|
Describes an auction on which a gift can be purchased. |
Bot keyboards¶
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. |
|
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. |
|
Contains information about a poll type. |
|
This object contains information about the creation or token update of a bot that is managed by the current bot. |
|
This object represents information about an order. |
|
This object contains information about an incoming pre-checkout query. |
|
Contains information about a shipping address. |
|
This object contains information about an incoming shipping query. |
|
This object represents a change of a reaction on a message performed by a user. |
|
Reactions to a message with anonymous reactions were changed. |
|
A channel/supergroup boost has changed (bots only). |
|
This object represents one shipping option. |
|
This object represents information about purchased paid media. |
|
Contains information about a chat shared with a bot. |
|
Contains information about a users shared with a bot. |
Bot commands¶
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. |
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. |
InputContent¶
Describes a checklist to create. |
|
Content of a contact message to be sent as the result of an inline query. |
|
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. |
|
Content of a location message to be sent as the result of an inline query. |
|
Content of a media message to be sent. |
|
An animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent inside an album. |
|
An audio to be sent inside an album. |
|
A generic file to be sent inside an album. |
|
A photo to be sent inside an album. |
|
A video to be sent inside an album. |
|
A sticker to be attached. |
|
Content of a message to be sent as a result of an inline query. |
|
A Phone Contact to be added in your Telegram address book. |
|
This object contains information about one answer option in a poll 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. |
|
Content of a text 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. |