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

User

A Telegram user or bot.

Chat

A chat.

ChatPreview

A chat preview.

ChatPhoto

A chat photo.

ChatMember

Contains information about one member of a chat.

ChatPermissions

Describes actions that a non-administrator user is allowed to take in a chat.

ChatPrivileges

Describes privileged actions an administrator is able to take in a chat.

ChatInviteLink

An invite link for a chat.

ChatAdminWithInviteLinks

Represents a chat administrator that has created invite links in a chat.

ChatEvent

A chat event from the recent actions log (also known as admin log).

ChatEventFilter

Set of filters used to obtain a chat event log.

ChatMemberUpdated

Represents changes in the status of a chat member.

ChatJoinRequest

Represents a join request sent to a chat.

ChatJoiner

Contains information about a joiner member of a chat.

Dialog

A user's dialog.

Restriction

A restriction applied to bots or chats.

EmojiStatus

A user emoji status.

Birthday

Represents a user's birthday.

BotVerification

Represents bot verification information.

BotVerifierSettings

Bot verifier settings.

Messages & Media

Message

A message.

MessageEntity

One special entity in a text message.

Photo

A Photo.

Thumbnail

One size of a photo or a file/sticker thumbnail.

AlternativeVideo

Describes an alternative reencoded quality of a video file.

Audio

An audio file to be treated as music by the Telegram clients.

Document

A generic file (as opposed to photos, voice messages, audio files, ...).

Animation

An animation file (GIF or H.264/MPEG-4 AVC video without sound).

Video

A video file.

Voice

A voice note.

VideoNote

A video note.

Contact

A phone contact.

Location

A point on the map.

Venue

A venue.

Sticker

A sticker.

Game

A game.

WebPage

A webpage preview

Poll

A Poll.

PollOption

Contains information about one answer option in a poll.

Dice

A dice with a random value from 1 to 6 for currently supported base emoji.

Reaction

Contains information about a reaction.

VideoChatScheduled

A service message about a voice chat scheduled in the chat.

VideoChatStarted

A service message about a voice chat started in the chat.

VideoChatEnded

A service message about a voice chat ended in the chat.

VideoChatMembersInvited

A service message about new members invited to a voice chat.

WebAppData

Contains data sent from a Web App to the bot.

MessageReactions

Contains information about a message reactions.

ChatReactions

A chat reactions

PaidMedia

Represents a paid media.

TodoList

Represents a to-do list attached to a message.

TodoItem

Represents a single item in a to-do list.

TodoCompletion

Represents a completion entry for a to-do item.

FactCheck

Represents a fact check attached to a message.

SuggestedPost

Represents a suggested post for a channel.

MessageEffect

Represents a message effect.

PublicForward

Represents a public forward.

PublicForwards

Represents a list of public forwards.

Bot keyboards

ReplyKeyboardMarkup

A custom keyboard with reply options.

KeyboardButton

One button of the reply keyboard.

ReplyKeyboardRemove

Object used to tell clients to remove a bot keyboard.

InlineKeyboardMarkup

An inline keyboard that appears right next to the message it belongs to.

InlineKeyboardButton

One button of an inline keyboard.

LoginUrl

Represents a parameter of the inline keyboard button used to automatically authorize a user.

ForceReply

Object used to force clients to show a reply interface.

CallbackQuery

An incoming callback query from a callback button in an inline keyboard.

GameHighScore

One row of the high scores table for a game.

CallbackGame

Placeholder, currently holds no information.

WebAppInfo

Contains information about a Web App.

MenuButton

Describes the bot's menu button in a private chat.

MenuButtonCommands

A menu button, which opens the bot's list of commands.

MenuButtonWebApp

A menu button, which launches a Web App.

MenuButtonDefault

Describes that no specific value for the menu button was set.

SentWebAppMessage

Contains information about an inline message sent by a Web App on behalf of a user.

Bot commands

BotCommand

A bot command with the standard slash "/" prefix.

BotCommandScope

Represents the scope to which bot commands are applied.

BotCommandScopeDefault

Represents the default scope of bot commands.

BotCommandScopeAllPrivateChats

Represents the scope of bot commands, covering all private chats.

BotCommandScopeAllGroupChats

Represents the scope of bot commands, covering all group and supergroup chats.

BotCommandScopeAllChatAdministrators

Represents the scope of bot commands, covering all group and supergroup chat administrators.

BotCommandScopeChat

Represents the scope of bot commands, covering a specific chat.

BotCommandScopeChatAdministrators

Represents the scope of bot commands, covering all administrators of a specific group or supergroup chat.

BotCommandScopeChatMember

Represents the scope of bot commands, covering a specific member of a group or supergroup chat.

Input Media

InputMedia

Content of a media message to be sent.

InputMediaPhoto

A photo to be sent inside an album.

InputMediaVideo

A video to be sent inside an album.

InputMediaAudio

An audio to be sent inside an album.

InputMediaAnimation

An animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent inside an album.

InputMediaDocument

A generic file to be sent inside an album.

InputPhoneContact

A Phone Contact to be added in your Telegram address book.

Inline Mode

InlineQuery

An incoming inline query.

InlineQueryResult

One result of an inline query.

InlineQueryResultCachedAudio

A link to an MP3 audio file stored on the Telegram servers

InlineQueryResultCachedDocument

A link to a file stored on the Telegram servers.

InlineQueryResultCachedAnimation

A link to an animation file stored on the Telegram servers.

InlineQueryResultCachedPhoto

A link to a photo stored on the Telegram servers.

InlineQueryResultCachedSticker

A link to a sticker stored on the Telegram servers

InlineQueryResultCachedVideo

A link to a video file stored on the Telegram servers.

InlineQueryResultCachedVoice

A link to a voice message stored on the Telegram servers.

InlineQueryResultArticle

Link to an article or web page.

InlineQueryResultAudio

Link to an audio file.

InlineQueryResultContact

Contact with a phone number

InlineQueryResultDocument

Link to a file.

InlineQueryResultAnimation

Link to an animated GIF file.

InlineQueryResultLocation

A location on a map.

InlineQueryResultPhoto

Link to a photo.

InlineQueryResultVenue

A venue.

InlineQueryResultVideo

Link to a page containing an embedded video player or a video file.

InlineQueryResultVoice

Link to a voice recording in an .OGG container encoded with OPUS.

ChosenInlineResult

A result of an inline query chosen by the user and sent to their chat partner.

InputMessageContent

InputMessageContent

Content of a message to be sent as a result of an inline query.

InputTextMessageContent

Content of a text message to be sent as the result of an inline query.

Authorization

SentCode

Contains info on a sent confirmation code.

TermsOfService

Telegram's Terms of Service returned by sign_in().

Stories

StoryItem

Represents a story.

StoryViews

Aggregated view and reaction information of a story.

StoryView

Represents a story view.

StoryViewsList

Represents a list of story views.

PeerStories

Stories associated with a peer.

StoriesStealthMode

Information about the stealth mode for stories.

MediaArea

Represents a clickable rectangular area on a story.

MediaAreaCoordinates

Coordinates and size of a clickable rectangular area on top of a story.

StoryForwardHeader

Contains information about the original story that was reposted.

StoryReaction

Represents a story reaction.

StoryReactionsList

Represents a list of story reactions.

Payments

StarsAmount

Represents an amount of Telegram Stars with nano precision.

StarsTransaction

Represents a Telegram Stars transaction.

StarsTransactionPeer

Represents the peer involved in a Stars transaction.

StarsSubscription

Represents a Telegram Stars subscription.

StarsSubscriptionPricing

Represents the pricing of a Stars subscription.

StarsStatus

Represents the current Stars balance and transactions.

StarsRevenueStatus

Describes Telegram Star revenue balances.

StarsTopupOption

Telegram Stars topup option.

StarsGiftOption

Telegram Stars gift option.

PaidReactionPrivacy

Paid reaction privacy settings.

Star Gifts

StarGift

A star gift.

StarGiftUnique

A unique/collectible star gift.

StarGiftAuctionState

Represents the state of a star gift auction.

StarGiftAuctionUserState

Represents a user's state in a star gift auction.

StarGiftAuctionRound

Represents a star gift auction round.

AuctionBidLevel

Represents an auction bid level.

DisallowedGiftsSettings

Disallow the reception of specific gift types.

Business

BusinessInfo

Aggregated business information for a user.

BusinessWorkHours

Represents the work hours of a business.

BusinessWeeklyOpen

Represents a time interval during which a business is open.

BusinessLocation

Represents the location of a business.

BusinessIntro

Represents a business introduction message shown to new contacts.

BusinessGreetingMessage

Represents an automated greeting message for business accounts.

BusinessAwayMessage

Represents an automated away message for business accounts.

BusinessRecipients

Represents recipients for business automated messages.

BusinessConnection

Represents a business bot connection.

QuickReply

Represents a quick reply shortcut.

BusinessChatLink

Represents a business chat link.

BusinessBotRecipients

Represents recipients for a business bot.

Boosts

Boost

Represents a channel boost.

BoostStatus

Represents a channel's boost status.

BoostsList

List of boosts.

GiveawayResults

Represents the results of a giveaway.

PrepaidGiveaway

Represents a prepaid giveaway.

MyBoost

Represents a boost applied by the current user.

MyBoosts

Represents a list of boosts applied by the current user.

Saved Messages

SavedDialog

Represents a saved messages dialog.

SavedDialogs

Represents a list of saved messages dialogs.

SavedReactionTag

Represents a saved messages reaction tag.