Available Types

This page is about pyroblack 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

Birthday

Birthday information of a user.

BusinessInfo

Business information of a user.

BusinessMessage

Business working hours.

BusinessRecipients

Business recipients.

BusinessWeeklyOpen

Business weekly open hours.

BusinessWorkingHours

Business working hours.

User

A Telegram user or bot.

Username

A Username.

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.

ChatJoinedByRequest

A service message about a user join request approved in the chat.

ChatJoiner

Contains information about a joiner member of a chat.

Dialog

A user's dialog.

Folder

A user's folder.

Restriction

A restriction applied to bots or chats.

EmojiStatus

A user emoji status.

ForumTopic

A forum topic.

PeerUser

A PeerUser.

PeerChannel

A PeerChannel.

BotInfo

A bot Information.

GroupCallMember

Contains information about one member of a group call.

ChatColor

Reply or profile color status.

CollectibleItemInfo

Contains information about a collectible item and its last purchase. :Parameters: * purchase_date (datetime) -- Point in time (Unix timestamp) when the item was purchased * currency (str) -- Currency for the paid amount * amount (float) -- The paid amount, in the smallest units of the currency * cryptocurrency (str) -- Cryptocurrency used to pay for the item * cryptocurrency_amount (float) -- The paid amount, in the smallest units of the cryptocurrency * url (str) -- Individual URL for the item on https://fragment.com.

FoundContacts

Chats found by name substring and auxiliary data.

PrivacyRule

A privacy rule.

Messages & Media

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.

Thumbnail

One size of a photo or a file/sticker 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.

AlternativeVideo

Describes an alternative reencoded quality of a video file.

Animation

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

LabeledPrice

This object represents a price for goods or services.

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.

StickerSet

A stickerset.

Game

A game.

Giveaway

A giveaway.

GiveawayLaunched

A service message about a giveaway started in the channel.

GiveawayResult

A giveaway result.

MessageInvoice

Contains information about an Invoice.

MessageStory

Contains information about a forwarded story.

WebPage

A webpage preview

WebPageEmpty

A webpage preview

WebPagePreview

A web page preview.

TranscribedAudio

Transcribes the audio of a voice message.

TranslatedText

A translated text with entities.

TextQuote

Describes manually or automatically chosen quote from another message.

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.

MessageReactor

Contains information about a message reactor.

ChatReactions

A chat reactions

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.

ForumTopicClosed

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

ForumTopicDeleted

A deleted forum topic.

ForumTopicReopened

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

GeneralTopicHidden

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

GeneralTopicUnhidden

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

Reaction

Contains information about a reaction.

ReactionCount

Represents a reaction added to a message along with the number of times it was added.

ReactionType

Contains information about a reaction.

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.

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.

SuccessfulPayment

Contains information about a successful payment.

ExtendedMediaPreview

A ExtendedMediaPreview.

PaidMedia

A PaidMedia.

PaymentForm

This object contains basic information about an payment form.

ReadParticipant

Contains information about a read participant.

Stories

Story

A story.

StoryDeleted

A deleted story.

StoryForwardHeader

Contains information about origin of forwarded story.

StorySkipped

A skipped story.

StoriesPrivacyRules

A story privacy.

StoryViews

Contains information about a story viewers.

MediaArea

Content of a media areas in story.

MediaAreaChannelPost

A channel post media area.

MediaAreaCoordinates

A coordinates of media area.

InputMediaArea

Content of a media area to be included in story.

InputMediaAreaChannelPost

A channel post media area.

Pyromod

Identifier

A dataclass that serves as a utility for matching listeners to the data of updates.

Listener

Designed to manage and handle different types of listeners used in pyromod.

Bot

BotAllowed

Contains information about a allowed bot.

BotApp

Contains information about a bot app.

BotBusinessConnection

A bot business connection Information.

PaymentInfo

Contains information about a payment.

PaymentRefunded

Contains information about a refunded payment.

ShippingAddress

Contains information about a shipping address.

SuccessfulPayment

Contains information about a successful payment.

Bot keyboards

BotBusinessConnection

A bot business connection Information.

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.

InlineKeyboardButtonBuy

One button of the inline keyboard.

RequestPeerTypeChannel

Object used to request clients to send a channel identifier.

RequestPeerTypeChat

Object used to request clients to send a chat identifier.

RequestPeerTypeUser

Object used to request clients to send a user identifier.

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

MenuButton

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

MenuButtonCommands

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

MenuButtonWebApp

MenuButtonDefault

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

SentWebAppMessage

PaymentInfo

Contains information about a payment.

PreCheckoutQuery

An incoming pre-checkout query from a buy button in an inline keyboard.

ShippingAddress

Contains information about a shipping address.

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.

InputReplyToMessage

Contains information about a target replied message.

InputReplyToMonoforum

Contains information about a target replied monoforum.

InputReplyToStory

Contains information about a target replied story.

InputTextMessageContent

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

InputLocationMessageContent

Content of a location 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.

InputContactMessageContent

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

InputInvoiceMessageContent

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

Authorization

ActiveSession

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

ActiveSessions

Contains a list of currently active sessions

LoginToken

Contains info on a login token.

SentCode

Contains info on a sent confirmation code.

TermsOfService

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

InputPrivacyRule

InputPrivacyRuleAllowAll

Allow all users.

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.

InputPrivacyRuleAllowChats

Allow only participants of certain chats.

InputPrivacyRuleDisallowAll

Disallow all users.

InputPrivacyRuleDisallowContacts

Disallow contacts only.

InputPrivacyRuleDisallowUsers

Disallow only participants of certain users.

InputPrivacyRuleDisallowChats

Disallow only participants of certain chats.