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

AcceptedGiftTypes

Accepts gift types.

Birthday

Birthday information of a user.

BusinessConnection

Business information of a user.

BusinessIntro

Information about intro of this user.

BusinessRecipients

Business recipients.

BusinessWeeklyOpen

Business weekly open hours.

BusinessWorkingHours

Business working hours.

User

A Telegram user or bot.

Username

A Telegram user's or chat's username.

VerificationStatus

Contains information about verification status of a chat or a user.

Chat

A chat.

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.

ChatAdministratorRights

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.

FailedToAddMember

Contains information about a user that has failed to be added to a chat.

Folder

Represents a folder for user chats.

GroupCallMember

Contains information about one member of a group call.

ChatColor

Reply or profile color status.

FoundContacts

Chats found by name substring and auxiliary data.

PrivacyRule

A privacy rule.

StoriesStealthMode

Information about the current stealth mode session.

UserRating

Contains information about rating of a user.

BotVerification

Information about bot verification.

BusinessBotRights

Describes actions that a connected business bot is allowed to take in a chat.

ChatSettings

A list of actions that are possible when interacting with this user, to be shown as suggested actions in the chat action bar.

GlobalPrivacySettings

Birthday information of a user.

HistoryCleared

A service message about a cleared history in chat.

Messages & Media

BusinessMessage

A Business message.

Message

A message.

MessageEntity

One special entity in a text message.

MessageOriginChannel

The message was originally sent to a channel chat.

MessageOriginChat

The message was originally sent on behalf of a chat to a group chat.

MessageOriginHiddenUser

The message was originally sent by an unknown user.

MessageOriginImport

Contains information about a message imported from a foreign chat service.

MessageOriginUser

The message was originally sent by a known user.

MessageOrigin

This object describes the origin of a message.

Photo

A Photo.

PollOptionAdded

Describes a service message about an option added to a poll.

PollOptionDeleted

Describes a service message about an option deleted from a poll.

Thumbnail

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

StrippedThumbnail

A stripped thumbnail

Audio

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

AvailableEffect

Contains information about available effect.

Document

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

ExternalReplyInfo

This object contains information about a message that is being replied to, which may come from another chat or forum topic.

FactCheck

Represents a fact-check created by an independent fact-checker.

FormattedText

Contains information about a text with some entities.

ForumTopic

A forum topic.

ForumTopicClosed

A service message about a forum topic closed in the chat.

ForumTopicCreated

A service message about a new forum topic created in the chat.

ForumTopicEdited

A service message about a forum topic renamed in the chat.

ForumTopicReopened

A service message about a forum topic reopened in the chat.

GeneralForumTopicHidden

A service message about a general topic hidden in the chat.

GeneralForumTopicUnhidden

A service message about a general topic unhidden in the chat.

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.

CraftGiftResult

Contains result of gift crafting.

CraftGiftResultSuccess

Craft was successful.

CraftGiftResultFail

Craft has failed.

Location

A point on the map.

ManagedBotCreated

This object contains information about the bot that was created to be managed by the current bot.

MaskPosition

This object describes the position on faces where a mask should be placed by default.

MediaArea

Describes the media area added to a story.

MessageContent

A message content.

Venue

A venue.

Sticker

A sticker.

Game

A game.

WebPage

A webpage preview

Poll

A Poll.

ProximityAlertTriggered

Information about a proximity alert.

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.

RestrictionReason

Restriction reason.

Gift

Describes a gift or an upgraded gift that can be transferred to another owner or transferred to the TON blockchain as an NFT.

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.

PhoneCallStarted

A service message about a phone_call started in the chat.

PhoneCallEnded

A service message about a phone_call ended in the chat.

WebAppData

Contains data sent from a Web App to the bot.

MessageReactions

Contains information about a message reactions.

ChatReactions

A chat reactions

Story

A story.

MyBoost

Contains information about boost.

BoostsStatus

Contains information about boost.

Giveaway

An giveaway.

InputChecklistTask

Describes a task in a checklist to be sent.

GiveawayCreated

This object represents a service message about the creation of a scheduled giveaway.

GiveawayPrizeStars

A Telegram Stars were received by the current user from a giveaway.

GiveawayCompleted

This object represents a service message about the completion of a giveaway without public winners.

GiveawayWinners

This object represents a message about the completion of a giveaway with public winners.

Invoice

This object contains basic information about an invoice.

LinkPreviewOptions

Describes the options used for link preview generation.

GiftCollection

Describes collection of gifts.

PremiumGiftCode

A Telegram Premium gift code was created for the user.

GiftPurchaseLimit

Describes the maximum number of times that a specific gift can be purchased.

GiftResaleParameters

Describes parameters of a unique gift available for resale.

GiftResalePrice

Describes price of a resold gift.

GiftResalePriceStar

Describes price of a resold gift in Telegram Stars.

GiftResalePriceTon

Describes price of a resold gift in Toncoins.

GiftUpgradePreview

Contains examples of possible upgraded gifts for the given regular gift.

GiftUpgradePrice

Describes a price required to pay to upgrade a gift.

GiftUpgradeVariants

Contains all possible variants of upgraded gifts for the given regular gift.

CheckedGiftCode

Contains checked gift code data.

ChecklistTask

Describes a task in a checklist.

ChecklistTasksAdded

Some tasks were added to a checklist.

ChecklistTasksDone

Some tasks from a checklist were marked as done or not done.

Checklist

Describes a checklist.

RefundedPayment

This object contains basic information about a refunded payment.

ReplyParameters

Describes reply parameters for the message that is being sent.

SuccessfulPayment

A service message about a new successful payment.

SuggestedPostParameters

Contains parameters of a post that is being suggested.

SuggestedPostInfo

Contains information about a suggested post.

SuggestedPostPaid

Describes a service message about a successful payment for a suggested post.

SuggestedPostPrice

Describes price of a suggested post.

SuggestedPostPriceStar

Describes price of a suggested post in Telegram Stars.

SuggestedPostPriceTon

Describes price of a suggested post in Toncoins.

SuggestedPostApprovalFailed

Describes a service message about the failed approval of a suggested post.

SuggestedPostApproved

Describes a service message about the approval of a suggested post.

SuggestedPostDeclined

Describes a service message about the rejection of a suggested post.

SuggestedPostRefunded

Describes a service message about a payment refund for a suggested post.

TextQuote

Describes manually or automatically chosen quote from another message.

PaidMediaInfo

Describes the paid media added to a message.

PaidMediaPreview

The paid media isn't available before the payment.

PaidMessagesRefunded

Paid messages were refunded.

PaidReactor

Contains information about a user that added paid reactions.

PaidMessagesPriceChanged

A price for paid messages was changed in the supergroup chat.

DirectMessagePriceChanged

A price for direct messages was changed in the channel chat.

DirectMessagesTopic

Contains information about a topic in a channel direct messages chat administered by the current user.

PaymentForm

Contains information about an invoice payment form.

PaymentOption

Describes an additional payment option.

SavedCredentials

Contains information about saved payment credentials.

PaymentResult

Contains the result of a payment request.

ChatBoost

Contains information about one or more boosts applied by a specific user.

ChatOwnerChanged

Describes a service message about an ownership change in the chat.

ChatOwnerLeft

Describes a service message about the chat owner leaving the chat.

ChatHasProtectedContentToggled

Chat has_protected_content setting was changed or request to change it was rejected.

ChatHasProtectedContentDisableRequested

Chat has_protected_content setting was requested to be disabled.

ContactRegistered

A service message that a contact has registered with Telegram.

ScreenshotTaken

A service message that a screenshot of a message in the chat has been taken.

StarAmount

Describes a possibly non-integer amount of Telegram Stars.

WriteAccessAllowed

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.

GiftAttribute

Contains information about a star gift attribute.

StoryView

A story view date and reaction information.

GiftedPremium

Telegram Premium was gifted to the user.

ChatBackground

Describes a background set for a specific chat.

ChatTheme

Describes a chat theme.

GiftedStars

Telegram Stars were gifted to a user.

GiftedTon

Toncoins were gifted to a user.

UpgradedGiftValueInfo

Contains information about value of an upgraded gift.

UpgradedGiftAttributeId

This object contains identifier of an upgraded gift attribute to search for.

UpgradedGiftPurchaseOffer

An offer to purchase an upgraded gift was sent or received.

UpgradedGiftPurchaseOfferRejected

An offer to purchase a gift was rejected or expired.

UpgradedGiftAttributeIdModel

Identifier of a gift model.

UpgradedGiftAttributeIdSymbol

Identifier of a gift symbol.

UpgradedGiftAttributeIdBackdrop

Identifier of a gift backdrop.

UpgradedGiftAttributeRarity

Describes rarity of an upgraded gift attribute.

UpgradedGiftAttributeRarityPerMille

The rarity is represented as the numeric frequence of the model.

UpgradedGiftAttributeRarityUncommon

The attribute is uncommon.

UpgradedGiftAttributeRarityRare

The attribute is rare.

UpgradedGiftAttributeRarityEpic

The attribute is epic.

UpgradedGiftAttributeRarityLegendary

The attribute is legendary.

UpgradedGiftOriginalDetails

Describes the original details about the gift.

InputChatPhoto

Describes a photo to be set as a user profile or chat photo.

InputChatPhotoPrevious

A previously used profile photo of the current user.

InputChatPhotoStatic

A static photo in JPEG format.

InputChatPhotoAnimation

An animation in H.264/MPEG-4 AVC format.

AuctionBid

Describes a bid in an auction.

AuctionRound

Describes a round of an auction.

AuctionState

Describes state of an auction.

AuctionStateActive

Contains information about an ongoing auction.

AuctionStateFinished

Contains information about a finished auction.

GiftAuctionState

Represent auction state of a gift.

GiftAuction

Describes an auction on which a gift can be purchased.

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.

KeyboardButtonRequestChat

Contains information about a chat peer type.

KeyboardButtonRequestManagedBot

This object defines the parameters for the creation of a managed bot.

KeyboardButtonRequestUsers

Contains information about a user peer type.

KeyboardButtonPollType

Contains information about a poll type.

ManagedBotUpdated

This object contains information about the creation or token update of a bot that is managed by the current bot.

OrderInfo

This object represents information about an order.

PreCheckoutQuery

This object contains information about an incoming pre-checkout query.

ShippingAddress

Contains information about a shipping address.

ShippingQuery

This object contains information about an incoming shipping query.

MessageReactionUpdated

This object represents a change of a reaction on a message performed by a user.

MessageReactionCountUpdated

Reactions to a message with anonymous reactions were changed.

ChatBoostUpdated

A channel/supergroup boost has changed (bots only).

ShippingOption

This object represents one shipping option.

PurchasedPaidMedia

This object represents information about purchased paid media.

ChatShared

Contains information about a chat shared with a bot.

UsersShared

Contains information about a users shared with a bot.

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.

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.

Authorization

ActiveSession

Contains information about one session in a Telegram application used by the current user.

ActiveSessions

Contains a list of currently active sessions

FirebaseAuthenticationSettings

Contains settings for Firebase Authentication in the official applications.

FirebaseAuthenticationSettingsAndroid

Settings for Firebase Authentication in the official Android application.

FirebaseAuthenticationSettingsIos

Settings for Firebase Authentication in the official iOS application.

PhoneNumberAuthenticationSettings

Contains settings for the authentication of the user's phone number.

SentCode

Contains info on a sent confirmation code.

TermsOfService

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

InputContent

InputChecklist

Describes a checklist to create.

InputContactMessageContent

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

InputCredentials

Contains information about the payment method chosen by the user.

InputCredentialsApplePay

Applies if a user enters new credentials using Apple Pay.

InputCredentialsGooglePay

Applies if a user enters new credentials using Google Pay.

InputCredentialsNew

Applies if a user enters new credentials on a payment provider website.

InputCredentialsSaved

Applies if a user chooses some previously saved payment credentials.

InputInvoice

Describes an invoice to process.

InputInvoiceMessage

An invoice from a message or paid media purchase from paid media message.

InputInvoiceMessageContent

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

InputInvoiceName

An invoice from a link.

InputLocationMessageContent

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

InputMedia

Content of a media message to be sent.

InputMediaAnimation

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

InputMediaAudio

An audio to be sent inside an album.

InputMediaDocument

A generic file to be sent inside an album.

InputMediaPhoto

A photo to be sent inside an album.

InputMediaVideo

A video to be sent inside an album.

InputMediaSticker

A sticker to be attached.

InputMessageContent

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

InputPhoneContact

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

InputPollOption

This object contains information about one answer option in a poll to be sent.

InputPrivacyRule

Content of a privacy rule.

InputPrivacyRuleAllowAll

Allow all users.

InputPrivacyRuleAllowBots

Allow bots and miniapps.

InputPrivacyRuleAllowChats

Allow only participants of certain chats.

InputPrivacyRuleAllowCloseFriends

Allow only close friends.

InputPrivacyRuleAllowContacts

Allow contacts only.

InputPrivacyRuleAllowPremium

Allow only users with a Premium subscription, currently only usable for CHAT_INVITE.

InputPrivacyRuleAllowUsers

Allow only participants of certain users.

InputPrivacyRuleDisallowAll

Disallow all users.

InputPrivacyRuleDisallowBots

Disallow bots and miniapps.

InputPrivacyRuleDisallowChats

Disallow only participants of certain chats.

InputPrivacyRuleDisallowContacts

Disallow contacts only.

InputPrivacyRuleDisallowUsers

Disallow only participants of certain users.

InputTextMessageContent

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

InputVenueMessageContent

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