Available Types
This page is about Electrogram 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: ....
Authorization
Contains information about one session in a Telegram application used by the current user. |
|
Contains a list of sessions |
|
Contains info on a sent confirmation code. |
|
Telegram's Terms of Service returned by |
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. |
Bots
Contains information about a allowed bot. |
|
Contains information about a bot app. |
|
A bot business connection Information. |
|
A bot Information. |
Bot keyboards
Placeholder, currently holds no information. |
|
An incoming callback query from a callback button in an inline keyboard. |
|
Contains information about a collectible item and its last purchase. |
|
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. |
|
One button of the inline keyboard. |
|
An inline keyboard that appears right next to the message it belongs to. |
|
One button of the reply keyboard. |
|
Button style. |
|
Represents a parameter of the inline keyboard button used to automatically authorize a user. |
|
Describes the bot's menu button in a private chat. |
|
A menu button, which opens the bot's list of commands. |
|
Describes that no specific value for the menu button was set. |
|
A menu button, which launches a Web App. |
|
A custom keyboard with reply options. |
|
Object used to tell clients to remove a bot keyboard. |
|
Object used to request clients to send a channel identifier. |
|
Object used to request clients to send a chat identifier. |
|
Object used to request clients to send a user identifier. |
|
Contains information about a requested chat. |
|
Contains information about a requested chats. |
|
Contains information about a requested user. |
|
Contains information about an inline message sent by a Web App on behalf of a user. |
|
Contains information about a Web App. |
Telegram Business
A ExtendedMediaPreview. |
|
Content of a stars transaction. |
|
This object contains basic information about an invoice. |
|
A PaidMedia. |
|
The paid media isn't available before the payment. |
|
Contains information about a payment. |
|
Contains information about a refunded payment. |
|
An incoming pre-checkout query from a buy button in an inline keyboard. |
|
Contains information about a shipping address. |
|
This object represents one shipping option. |
|
This object contains information about an incoming shipping query. |
|
A stars amount. |
|
Contains information about stars status. |
|
Contains information about stars transaction. |
|
Contains information about a successful payment. |
|
A suggested post. |
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. |
|
Link to an animated GIF file. |
|
Link to an article or web page. |
|
Link to an audio file. |
|
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. |
|
Contact with a phone number |
|
Link to a 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. |
Input Media
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 Phone Contact to be added to your Telegram address book. |
Input Message Content
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. |
|
Content of a location message to be sent as the result of an inline query. |
|
Content of a message to be sent as a result of an inline query. |
|
Contains information about a target replied message. |
|
Contains information about a target replied story. |
|
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. |
Input Privacy Rule
Content of a privacy rule. |
|
Allow all users. |
|
Allow only participants of certain chats. |
|
Allow contacts only. |
|
Allow only users with a Premium subscription, currently only usable for |
|
Allow only participants of certain users. |
|
Disallow all users. |
|
Disallow only participants of certain chats. |
|
Disallow contacts only. |
|
Disallow only participants of certain users. |
Messages & Media
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. |
|
Contains information about available effect. |
|
A phone contact. |
|
A service message that a contact has registered with Telegram. |
|
A dice with a random value from 1 to 6 for currently supported base emoji. |
|
A generic file (as opposed to photos, voice messages, audio files, ...). |
|
Contains information about a message draft. |
|
Contains information about a story viewers. |
|
A fact-check. |
|
A game. |
|
Telegram Premium was gifted to the user |
|
A giveaway. |
|
A service message about a giveaway started in the channel. |
|
A giveaway result. |
|
This object represents a price for goods or services. |
|
A point on the map. |
|
A message. |
|
One special entity in a text 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 message reactor. |
|
Contains information about a forwarded story. |
|
This object contains basic information about an payment form. |
|
A Photo. |
|
A Poll. |
|
Contains information about one answer option in a poll. |
|
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 a custom emoji. |
|
The reaction is based on an emoji. |
|
The paid reaction in a channel chat. |
|
A service message that a screenshot of a message in the chat has been taken. |
|
A sticker. |
|
A stickerset. |
|
A stripped thumbnail |
|
One size of a photo or a file/sticker thumbnail. |
|
A translated text with entities. |
|
A venue. |
|
A video file. |
|
A video note. |
|
A voice note. |
|
Contains data sent from a Web App to the bot. |
|
A webpage preview |
|
A webpage preview |
|
A web page preview. |
Payments
Describes a gift that can be sent to another user. |
|
Represents a gift received by a user. |
Stories
Content of a media area to be included in story. |
|
A channel post media area. |
|
Content of a media areas in story. |
|
A channel post media area. |
|
A coordinates of media area. |
|
A story privacy. |
|
A story. |
|
A deleted story. |
|
Contains information about origin of forwarded story. |
|
A skipped story. |
|
Contains information about a story viewers. |
Users & Chats
User Date of birth. |
|
Business information of a user. |
|
Business working hours. |
|
Business recipients. |
|
Business weekly open hours. |
|
Business working hours. |
|
A chat. |
|
Represents a chat administrator that has created invite links in a chat. |
|
Reply 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. |
|
Represents a join request sent to a chat. |
|
A service message about a user join request approved in the chat. |
|
Contains information about a joiner member of 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. |
|
A chat preview. |
|
Describes privileged actions an administrator is able to take in a chat. |
|
A chat reactions |
|
A user's dialog. |
|
A user emoji status. |
|
A user's folder. |
|
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. |
|
Chats found by name substring and auxiliary data. |
|
A service message about a general topic hidden in the chat. |
|
A service message about a general topic unhidden in the chat. |
|
The date and user of when someone has joined with an invite link. |
|
A PeerChannel. |
|
A PeerUser. |
|
A privacy rule. |
|
A restriction applied to bots or chats. |
|
A Telegram user or bot. |
|
A Username. |
|
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. |