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. |
|
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. |
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 |
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. |
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. |
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. |
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. |
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. |