Available Types

This page is about Pyrogram types. All types listed here are accessible through the main package directly.

from pyrogram import User, Message, ...

Note

Optional fields may not exist when irrelevant – i.e.: they will contain the value of None and aren’t shown when, for example, using print().

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

A chat default permissions and a single member permissions within a chat.

Dialog

A user’s dialog.

Restriction

A restriction applied to bots or chats.

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.

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.

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

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.

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.

InlineQueryResultArticle

Link to an article or web page.

InlineQueryResultPhoto

Link to a photo.

InlineQueryResultAnimation

Link to an animated GIF file.

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