peyk.platforms.telegram.types

One-file-per-type Telegram Bot API model package.

The package intentionally keeps the legacy models.py facade as the compatibility import surface while exposing every Telegram type here.

class peyk.platforms.telegram.types.AcceptedGiftTypes(unlimited_gifts: bool, limited_gifts: bool, unique_gifts: bool, premium_subscription: bool, gifts_from_channels: bool)[source]

Bases: object

This object describes the types of gifts that can be gifted to a user or a chat.

Variables:
  • unlimited_gifts (bool) – True, if unlimited regular gifts are accepted

  • limited_gifts (bool) – True, if limited regular gifts are accepted

  • unique_gifts (bool) – True, if unique gifts or gifts that can be upgraded to unique for free are accepted

  • premium_subscription (bool) – True, if a Telegram Premium subscription is accepted

  • gifts_from_channels (bool) – True, if transfers of unique gifts from channels are accepted

classmethod from_dict(data: dict | None) AcceptedGiftTypes | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

unlimited_gifts: bool
limited_gifts: bool
unique_gifts: bool
premium_subscription: bool
gifts_from_channels: bool
class peyk.platforms.telegram.types.AffiliateInfo(commission_per_mille: int = 0, amount: int = 0, nanostar_amount: int | None = None, currency: str = '')[source]

Bases: object

Contains information about the affiliate that received a commission via this transaction.

Variables:
  • commission_per_mille (int) – The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the bot from referred users

  • amount (int) – Integer amount of Telegram Stars received by the affiliate from the transaction, rounded to 0; can be negative for refunds

  • affiliate_user – The bot or the user that received an affiliate commission if it was received by a bot or a user

  • affiliate_chat – The chat that received an affiliate commission if it was received by a chat

  • nanostar_amount (int | None) – The number of 1/1000000000 shares of Telegram Stars received by the affiliate; from -999999999 to 999999999; can be negative for refunds

amount: int = 0
commission_per_mille: int = 0
currency: str = ''
classmethod from_dict(data: dict | None) AffiliateInfo | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

nanostar_amount: int | None = None
class peyk.platforms.telegram.types.Animation(file_id: str, file_unique_id: str, width: int, height: int, duration: int, thumbnail: PhotoSize | None = None, file_name: str | None = None, mime_type: str | None = None, file_size: int | None = None)[source]

Bases: object

This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).

Variables:
  • file_id (str) – Identifier for this file, which can be used to download or reuse the file

  • file_unique_id (str) – Unique identifier for this file, which is supposed to be the same over time and for different bots. Can’t be used to download or reuse the file.

  • width (int) – Video width as defined by the sender

  • height (int) – Video height as defined by the sender

  • duration (int) – Duration of the video in seconds as defined by the sender

  • thumbnail (peyk.platforms.telegram.types.photo_size.PhotoSize | None) – Animation thumbnail as defined by the sender

  • file_name (str | None) – Original animation filename as defined by the sender

  • mime_type (str | None) – MIME type of the file as defined by the sender

  • file_size (int | None) – File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.

file_name: str | None = None
file_size: int | None = None
classmethod from_dict(data: dict | None) Animation | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

mime_type: str | None = None
thumbnail: PhotoSize | None = None
file_id: str
file_unique_id: str
width: int
height: int
duration: int
class peyk.platforms.telegram.types.Audio(file_id: str, file_unique_id: str, duration: int, performer: str | None = None, title: str | None = None, file_name: str | None = None, mime_type: str | None = None, file_size: int | None = None, thumbnail: PhotoSize | None = None)[source]

Bases: object

This object represents an audio file to be treated as music by the Telegram clients.

Variables:
  • file_id (str) – Identifier for this file, which can be used to download or reuse the file

  • file_unique_id (str) – Unique identifier for this file, which is supposed to be the same over time and for different bots. Can’t be used to download or reuse the file.

  • duration (int) – Duration of the audio in seconds as defined by the sender

  • performer (str | None) – Performer of the audio as defined by the sender or by audio tags

  • title (str | None) – Title of the audio as defined by the sender or by audio tags

  • file_name (str | None) – Original filename as defined by the sender

  • mime_type (str | None) – MIME type of the file as defined by the sender

  • file_size (int | None) – File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.

  • thumbnail (peyk.platforms.telegram.types.photo_size.PhotoSize | None) – Thumbnail of the album cover to which the music file belongs

file_name: str | None = None
file_size: int | None = None
classmethod from_dict(data: dict | None) Audio | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

mime_type: str | None = None
performer: str | None = None
thumbnail: PhotoSize | None = None
title: str | None = None
file_id: str
file_unique_id: str
duration: int
class peyk.platforms.telegram.types.BackgroundFillFreeformGradient(type: str = 'freeform_gradient', colors: List[int] | None = None)[source]

Bases: object

The background is a freeform gradient that rotates after every message in the chat.

Variables:
  • type (str) – Type of the background fill, always ‘freeform_gradient’

  • colors (List[int] | None) – A list of the 3 or 4 base colors that are used to generate the freeform gradient in the RGB24 format

colors: List[int] | None = None
classmethod from_dict(data: dict | None) BackgroundFillFreeformGradient | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

type: str = 'freeform_gradient'
class peyk.platforms.telegram.types.BackgroundFillGradient(type: str = 'gradient', top_color: int = 0, bottom_color: int = 0, rotation_angle: int = 0)[source]

Bases: object

The background is a gradient fill.

Variables:
  • type (str) – Type of the background fill, always ‘gradient’

  • top_color (int) – Top color of the gradient in the RGB24 format

  • bottom_color (int) – Bottom color of the gradient in the RGB24 format

  • rotation_angle (int) – Clockwise rotation angle of the background fill in degrees; 0-359

bottom_color: int = 0
classmethod from_dict(data: dict | None) BackgroundFillGradient | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

rotation_angle: int = 0
top_color: int = 0
type: str = 'gradient'
class peyk.platforms.telegram.types.BackgroundFillSolid(type: str = 'solid', color: int = 0)[source]

Bases: object

The background is filled using the selected color.

Variables:
  • type (str) – Type of the background fill, always ‘solid’

  • color (int) – The color of the background fill in the RGB24 format

color: int = 0
classmethod from_dict(data: dict | None) BackgroundFillSolid | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

type: str = 'solid'
class peyk.platforms.telegram.types.BackgroundTypeChatTheme(type: str = 'chat_theme', theme_name: str = '')[source]

Bases: object

The background is taken directly from a built-in chat theme.

Variables:
  • type (str) – Type of the background, always ‘chat_theme’

  • theme_name (str) – Name of the chat theme, which is usually an emoji

classmethod from_dict(data: dict | None) BackgroundTypeChatTheme | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

theme_name: str = ''
type: str = 'chat_theme'
class peyk.platforms.telegram.types.BackgroundTypeFill(type: str = 'fill', fill: BackgroundFillSolid | BackgroundFillGradient | BackgroundFillFreeformGradient | None = None, dark_theme_dimming: int = 0)[source]

Bases: object

The background is automatically filled based on the selected colors.

Variables:
dark_theme_dimming: int = 0
fill: BackgroundFillSolid | BackgroundFillGradient | BackgroundFillFreeformGradient | None = None
classmethod from_dict(data: dict | None) BackgroundTypeFill | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

type: str = 'fill'
class peyk.platforms.telegram.types.BackgroundTypePattern(type: str = 'pattern', document: Document | None = None, fill: BackgroundFillSolid | BackgroundFillGradient | BackgroundFillFreeformGradient | None = None, intensity: int = 0, is_inverted: bool | None = None, is_moving: bool | None = None)[source]

Bases: object

The background is a .PNG or .TGV (gzipped subset of SVG with MIME type ‘application/x-tgwallpattern’) pattern to be combined with the background fill chosen by the user.

Variables:
document: Document | None = None
fill: BackgroundFillSolid | BackgroundFillGradient | BackgroundFillFreeformGradient | None = None
classmethod from_dict(data: dict | None) BackgroundTypePattern | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

intensity: int = 0
is_inverted: bool | None = None
is_moving: bool | None = None
type: str = 'pattern'
class peyk.platforms.telegram.types.BackgroundTypeWallpaper(type: str = 'wallpaper', document: Document | None = None, dark_theme_dimming: int = 0, is_blurred: bool | None = None, is_moving: bool | None = None)[source]

Bases: object

The background is a wallpaper in the JPEG format.

Variables:
  • type (str) – Type of the background, always ‘wallpaper’

  • document (peyk.platforms.telegram.types.document.Document | None) – Document with the wallpaper

  • dark_theme_dimming (int) – Dimming of the background in dark themes, as a percentage; 0-100

  • is_blurred (bool | None) – True, if the wallpaper is downscaled to fit in a 450x450 square and then box-blurred with radius 12

  • is_moving (bool | None) – True, if the background moves slightly when the device is tilted

dark_theme_dimming: int = 0
document: Document | None = None
classmethod from_dict(data: dict | None) BackgroundTypeWallpaper | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

is_blurred: bool | None = None
is_moving: bool | None = None
type: str = 'wallpaper'
class peyk.platforms.telegram.types.Birthdate(day: int, month: int, year: int | None = None)[source]

Bases: object

Describes the birthdate of a user.

Variables:
  • day (int) – Day of the user’s birth; 1-31

  • month (int) – Month of the user’s birth; 1-12

  • year (int | None) – Year of the user’s birth

classmethod from_dict(data: dict | None) Birthdate | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

year: int | None = None
day: int
month: int
class peyk.platforms.telegram.types.BotAccessSettings(can_send_messages: bool | None = None, can_send_audios: bool | None = None, can_send_documents: bool | None = None, can_send_photos: bool | None = None, can_send_videos: bool | None = None, can_send_video_notes: bool | None = None, can_send_voice_notes: bool | None = None, can_send_polls: bool | None = None, can_send_other_messages: bool | None = None, can_add_web_page_previews: bool | None = None, can_change_info: bool | None = None, can_invite_users: bool | None = None, can_pin_messages: bool | None = None, can_manage_topics: bool | None = None)[source]

Bases: object

This object describes the access settings of a bot.

Variables:
  • is_access_restricted – True, if only selected users can access the bot. The bot’s owner can always access it.

  • added_users – The list of other users who have access to the bot if the access is restricted

can_add_web_page_previews: bool | None = None
can_change_info: bool | None = None
can_invite_users: bool | None = None
can_manage_topics: bool | None = None
can_pin_messages: bool | None = None
can_send_audios: bool | None = None
can_send_documents: bool | None = None
can_send_messages: bool | None = None
can_send_other_messages: bool | None = None
can_send_photos: bool | None = None
can_send_polls: bool | None = None
can_send_video_notes: bool | None = None
can_send_videos: bool | None = None
can_send_voice_notes: bool | None = None
classmethod from_dict(data: dict | None) BotAccessSettings | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.BotCommand(command: str = '', description: str = '', is_ephemeral: bool | None = None)[source]

Bases: object

This object represents a bot command.

Variables:
  • command (str) – Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores.

  • description (str) – Description of the command; 1-256 characters

  • is_ephemeral (bool | None) – True, if the command sends an ephemeral message, which can be seen only by the sender of the message and the bot

command: str = ''
description: str = ''
classmethod from_dict(data: dict | None) BotCommand | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

is_ephemeral: bool | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.BotCommandScopeAllChatAdministrators(type: str = 'all_chat_administrators')[source]

Bases: object

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

Variables:

type (str) – Scope type, must be all_chat_administrators

classmethod from_dict(data: dict | None) BotCommandScopeAllChatAdministrators | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

type: str = 'all_chat_administrators'
class peyk.platforms.telegram.types.BotCommandScopeAllGroupChats(type: str = 'all_group_chats')[source]

Bases: object

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

Variables:

type (str) – Scope type, must be all_group_chats

classmethod from_dict(data: dict | None) BotCommandScopeAllGroupChats | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

type: str = 'all_group_chats'
class peyk.platforms.telegram.types.BotCommandScopeAllPrivateChats(type: str = 'all_private_chats')[source]

Bases: object

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

Variables:

type (str) – Scope type, must be all_private_chats

classmethod from_dict(data: dict | None) BotCommandScopeAllPrivateChats | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

type: str = 'all_private_chats'
class peyk.platforms.telegram.types.BotCommandScopeChat(type: str = 'chat', chat_id: int | str = 0)[source]

Bases: object

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

Variables:
  • type (str) – Scope type, must be chat

  • chat_id (int | str) – Unique identifier for the target chat or username of the target supergroup in the format @username. Channel direct messages chats and channel chats aren’t supported.

chat_id: int | str = 0
classmethod from_dict(data: dict | None) BotCommandScopeChat | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

type: str = 'chat'
class peyk.platforms.telegram.types.BotCommandScopeChatAdministrators(type: str = 'chat_administrators', chat_id: int | str = 0)[source]

Bases: object

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

Variables:
  • type (str) – Scope type, must be chat_administrators

  • chat_id (int | str) – Unique identifier for the target chat or username of the target supergroup in the format @username. Channel direct messages chats and channel chats aren’t supported.

chat_id: int | str = 0
classmethod from_dict(data: dict | None) BotCommandScopeChatAdministrators | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

type: str = 'chat_administrators'
class peyk.platforms.telegram.types.BotCommandScopeChatMember(type: str = 'chat_member', chat_id: int | str = 0, user_id: int = 0)[source]

Bases: object

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

Variables:
  • type (str) – Scope type, must be chat_member

  • chat_id (int | str) – Unique identifier for the target chat or username of the target supergroup in the format @username. Channel direct messages chats and channel chats aren’t supported.

  • user_id (int) – Unique identifier of the target user

chat_id: int | str = 0
classmethod from_dict(data: dict | None) BotCommandScopeChatMember | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

type: str = 'chat_member'
user_id: int = 0
class peyk.platforms.telegram.types.BotCommandScopeDefault(type: str = 'default')[source]

Bases: object

Represents the default scope of bot commands. Default commands are used if no commands with a narrower scope are specified for the user.

Variables:

type (str) – Scope type, must be default

classmethod from_dict(data: dict | None) BotCommandScopeDefault | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

type: str = 'default'
class peyk.platforms.telegram.types.BotDescription(description: str = '')[source]

Bases: object

This object represents the bot’s description.

Variables:

description (str) – The bot’s description

description: str = ''
classmethod from_dict(data: dict | None) BotDescription | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.BotName(name: str = '')[source]

Bases: object

This object represents the bot’s name.

Variables:

name (str) – The bot’s name

classmethod from_dict(data: dict | None) BotName | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

name: str = ''
class peyk.platforms.telegram.types.BotShortDescription(short_description: str = '')[source]

Bases: object

This object represents the bot’s short description.

Variables:

short_description (str) – The bot’s short description

classmethod from_dict(data: dict | None) BotShortDescription | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

short_description: str = ''
class peyk.platforms.telegram.types.BotSubscriptionUpdated(user: User, invoice_payload: str, state: str)[source]

Bases: object

This object contains information about changes to a user payment subscription toward the current bot.

Variables:
  • user (peyk.platforms.telegram.types.user.User) – User who subscribed for payments toward the bot

  • invoice_payload (str) – Bot-specified invoice payload

  • state (str) – The new state of the subscription. Currently, it can be one of ‘canceled’ if the user canceled the subscription, ‘active’ if the user re-enabled a previously canceled subscription, or ‘failed’ if payment for the subscription failed.

classmethod from_dict(data)
subscription = None
user: User
invoice_payload: str
state: str
class peyk.platforms.telegram.types.BusinessBotRights(can_reply: bool | None = None, can_delete_outgoing_messages: bool | None = None, can_edit_messages: bool | None = None, can_delete_all_messages: bool | None = None, can_post_stories: bool | None = None, can_edit_stories: bool | None = None, can_delete_stories: bool | None = None, can_read_messages: bool | None = None, can_change_gift_settings: bool | None = None, can_transfer_and_upgrade_gifts: bool | None = None, can_convert_gift_to_stars: bool | None = None, can_transfer_stars: bool | None = None, can_manage_connected_bots: bool | None = None)[source]

Bases: object

Represents the rights of a business bot.

Variables:
  • can_reply (bool | None) – True, if the bot can send and edit messages in the private chats that had incoming messages in the last 24 hours

  • can_read_messages (bool | None) – True, if the bot can mark incoming private messages as read

  • can_delete_sent_messages – True, if the bot can delete messages sent by the bot

  • can_delete_all_messages (bool | None) – True, if the bot can delete all private messages in managed chats

  • can_edit_name – True, if the bot can edit the first and last name of the business account

  • can_edit_bio – True, if the bot can edit the bio of the business account

  • can_edit_profile_photo – True, if the bot can edit the profile photo of the business account

  • can_edit_username – True, if the bot can edit the username of the business account

  • can_change_gift_settings (bool | None) – True, if the bot can change the privacy settings pertaining to gifts for the business account

  • can_view_gifts_and_stars – True, if the bot can view gifts and the amount of Telegram Stars owned by the business account

  • can_convert_gifts_to_stars – True, if the bot can convert regular gifts owned by the business account to Telegram Stars

  • can_transfer_and_upgrade_gifts (bool | None) – True, if the bot can transfer and upgrade gifts owned by the business account

  • can_transfer_stars (bool | None) – True, if the bot can transfer Telegram Stars received by the business account to its own account, or use them to upgrade and transfer gifts

  • can_manage_stories – True, if the bot can post, edit and delete stories on behalf of the business account

  • can_delete_outgoing_messages (bool | None) – True, if the bot can delete messages sent by the bot

can_change_gift_settings: bool | None = None
can_convert_gift_to_stars: bool | None = None
can_delete_all_messages: bool | None = None
can_delete_outgoing_messages: bool | None = None
can_delete_stories: bool | None = None
can_edit_messages: bool | None = None
can_edit_stories: bool | None = None
can_manage_connected_bots: bool | None = None
can_post_stories: bool | None = None
can_read_messages: bool | None = None
can_reply: bool | None = None
can_transfer_and_upgrade_gifts: bool | None = None
can_transfer_stars: bool | None = None
classmethod from_dict(data: dict | None) BusinessBotRights | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.BusinessConnection(id: str, user: User, user_chat_id: int, date: int, is_enabled: bool, rights: BusinessBotRights | None = None)[source]

Bases: object

Describes the connection of the bot with a business account.

Variables:
  • id (str) – Unique identifier of the business connection

  • user (peyk.platforms.telegram.types.user.User) – Business account user that created the business connection

  • user_chat_id (int) – Identifier of a private chat with the user who created the business connection. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.

  • date (int) – Date the connection was established in Unix time

  • is_enabled (bool) – True, if the connection is active

  • rights (peyk.platforms.telegram.types.business_bot_rights.BusinessBotRights | None) – Rights of the business bot

  • can_reply – True, if the bot can act on behalf of the business account in chats that were active in the last 24 hours

can_reply = None
classmethod from_dict(data)
rights: BusinessBotRights | None = None
id: str
user: User
user_chat_id: int
date: int
is_enabled: bool
class peyk.platforms.telegram.types.BusinessIntro(title: str | None = None, message: str | None = None, sticker: Sticker | None = None)[source]

Bases: object

Contains information about the start page settings of a Telegram Business account.

Variables:
classmethod from_dict(data: dict | None) BusinessIntro | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

message: str | None = None
sticker: Sticker | None = None
title: str | None = None
class peyk.platforms.telegram.types.BusinessLocation(address: str, location: Location | None = None)[source]

Bases: object

Contains information about the location of a Telegram Business account.

Variables:
classmethod from_dict(data: dict | None) BusinessLocation | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

location: Location | None = None
address: str
class peyk.platforms.telegram.types.BusinessMessagesDeleted(business_connection_id: str, chat: Chat, message_ids: List[int])[source]

Bases: object

This object is received when messages are deleted from a connected business account.

Variables:
  • business_connection_id (str) – Unique identifier of the business connection

  • chat (peyk.platforms.telegram.types.chat.Chat) – Information about a chat in the business account. The bot may not have access to the chat or the corresponding user.

  • message_ids (List[int]) – The list of identifiers of deleted messages in the chat of the business account

classmethod from_dict(data: dict | None) BusinessMessagesDeleted | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

business_connection_id: str
chat: Chat
message_ids: List[int]
class peyk.platforms.telegram.types.BusinessOpeningHours(time_zone_name: str, opening_hours: List[BusinessOpeningHoursInterval])[source]

Bases: object

Describes the opening hours of a business.

Variables:
classmethod from_dict(data: dict | None) BusinessOpeningHours | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

time_zone_name: str
opening_hours: List[BusinessOpeningHoursInterval]
class peyk.platforms.telegram.types.BusinessOpeningHoursInterval(opening_minute: int, closing_minute: int)[source]

Bases: object

Describes an interval of time during which a business is open.

Variables:
  • opening_minute (int) – The minute’s sequence number in a week, starting on Monday, marking the start of the time interval during which the business is open; 0 - 7 24 60

  • closing_minute (int) – The minute’s sequence number in a week, starting on Monday, marking the end of the time interval during which the business is open; 0 - 8 24 60

classmethod from_dict(data: dict | None) BusinessOpeningHoursInterval | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

opening_minute: int
closing_minute: int
class peyk.platforms.telegram.types.CallbackGame[source]

Bases: object

Placeholder – currently holds no information (game is set up via BotFather; full games surface is a later phase).

classmethod from_dict(data: dict | None) CallbackGame | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.CallbackQuery(id: str = '', from_: User | None = None, message: Message | InaccessibleMessage | None = None, inline_message_id: str | None = None, chat_instance: str | None = None, data: str | None = None, game_short_name: str | None = None)[source]

Bases: object

This object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present. NOTE: After the user presses a callback button, Telegram clients will display a progress bar until you call answerCallbackQuery. It is, therefore, necessary to react by calling answerCallbackQuery even if no notification to the user is needed (e.g., without specifying any of the optional parameters).

Variables:
  • id (str) – Unique identifier for this query

  • from – Sender

  • chat_instance (str | None) – Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games.

  • message (peyk.platforms.telegram.types.message.Message | peyk.platforms.telegram.types.inaccessible_message.InaccessibleMessage | None) – Message sent by the bot with the callback button that originated the query

  • inline_message_id (str | None) – Identifier of the message sent via the bot in inline mode, that originated the query

  • data (str | None) – Data associated with the callback button. Be aware that the message originated the query can contain no callback buttons with this data.

  • game_short_name (str | None) – Short name of a Game to be returned, serves as the unique identifier for the game

chat_instance: str | None = None
data: str | None = None
from_: User | None = None
classmethod from_dict(data: dict | None) CallbackQuery | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

game_short_name: str | None = None
id: str = ''
inline_message_id: str | None = None
message: Message | InaccessibleMessage | None = None
class peyk.platforms.telegram.types.Chat(id: int, type: str, title: str | None = None, username: str | None = None, first_name: str | None = None, last_name: str | None = None, is_forum: bool | None = None)[source]

Bases: object

This object represents a chat.

Variables:
  • id (int) – Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.

  • type (str) – Type of the chat, can be either ‘private’, ‘group’, ‘supergroup’ or ‘channel’

  • title (str | None) – Title, for supergroups, channels and group chats

  • username (str | None) – Username, for private chats, supergroups and channels if available

  • first_name (str | None) – First name of the other party in a private chat

  • last_name (str | None) – Last name of the other party in a private chat

  • is_forum (bool | None) – True, if the supergroup chat is a forum (has topics enabled)

  • is_direct_messages – True, if the chat is the direct messages chat of a channel

  • accent_color_id – Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details. Returned only in getChat. Always returned in getChat.

  • active_usernames – If non-empty, the list of all active chat usernames; for private chats, supergroups and channels. Returned only in getChat.

  • available_reactions – List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed. Returned only in getChat.

  • background_custom_emoji_id – Custom emoji identifier of emoji chosen by the chat for the reply header and link preview background. Returned only in getChat.

  • bio – Bio of the other party in a private chat. Returned only in getChat.

  • birthdate – For private chats, the date of birth of the user. Returned only in getChat.

  • business_intro – For private chats with business accounts, the intro of the business. Returned only in getChat.

  • business_location – For private chats with business accounts, the location of the business. Returned only in getChat.

  • business_opening_hours – For private chats with business accounts, the opening hours of the business. Returned only in getChat.

  • can_set_sticker_set – True, if the bot can change the group sticker set. Returned only in getChat.

  • custom_emoji_sticker_set_name – For supergroups, the name of the group’s custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group. Returned only in getChat.

  • description – Description, for groups, supergroups and channel chats. Returned only in getChat.

  • emoji_status_custom_emoji_id – Custom emoji identifier of the emoji status of the chat or the other party in a private chat. Returned only in getChat.

  • emoji_status_expiration_date – Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any. Returned only in getChat.

  • has_aggressive_anti_spam_enabled – True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. Returned only in getChat.

  • has_hidden_members – True, if non-administrators can only get the list of bots and administrators in the chat. Returned only in getChat.

  • has_private_forwards – True, if privacy settings of the other party in the private chat allows to use tg://user?id= links only in chats with the user. Returned only in getChat.

  • has_protected_content – True, if messages from the chat can’t be forwarded to other chats. Returned only in getChat.

  • has_restricted_voice_and_video_messages – True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in getChat.

  • has_visible_history – True, if new chat members will have access to old messages; available only to chat administrators. Returned only in getChat.

  • invite_link – Primary invite link, for groups, supergroups and channel chats. Returned only in getChat.

  • join_by_request – True, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in getChat.

  • join_to_send_messages – True, if users need to join the supergroup before they can send messages. Returned only in getChat.

  • linked_chat_id – Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. Returned only in getChat.

  • location – For supergroups, the location to which the supergroup is connected. Returned only in getChat.

  • message_auto_delete_time – The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat.

  • permissions – Default chat member permissions, for groups and supergroups. Returned only in getChat.

  • personal_chat – For private chats, the personal channel of the user. Returned only in getChat.

  • photo – Chat photo. Returned only in getChat.

  • pinned_message – The most recent pinned message (by sending date). Returned only in getChat.

  • profile_accent_color_id – Identifier of the accent color for the chat’s profile background. See profile accent colors for more details. Returned only in getChat.

  • profile_background_custom_emoji_id – Custom emoji identifier of the emoji chosen by the chat for its profile background. Returned only in getChat.

  • slow_mode_delay – For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds. Returned only in getChat.

  • sticker_set_name – For supergroups, name of group sticker set. Returned only in getChat.

  • unrestrict_boost_count – For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions. Returned only in getChat.

first_name: str | None = None
classmethod from_dict(data: dict | None) Chat | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

is_forum: bool | None = None
last_name: str | None = None
title: str | None = None
username: str | None = None
id: int
type: str
class peyk.platforms.telegram.types.ChatAdministratorRights(is_anonymous: bool | None = None, can_manage_chat: bool | None = None, can_delete_messages: bool | None = None, can_manage_video_chats: bool | None = None, can_restrict_members: bool | None = None, can_promote_members: bool | None = None, can_change_info: bool | None = None, can_invite_users: bool | None = None, can_post_stories: bool | None = None, can_edit_stories: bool | None = None, can_delete_stories: bool | None = None, can_post_messages: bool | None = None, can_edit_messages: bool | None = None, can_pin_messages: bool | None = None, can_manage_topics: bool | None = None, can_manage_direct_messages: bool | None = None, can_manage_tags: bool | None = None, can_send_welcome_messages: bool | None = None)[source]

Bases: object

Represents the rights of an administrator in a chat.

Variables:
  • is_anonymous (bool | None) – True, if the user’s presence in the chat is hidden

  • can_manage_chat (bool | None) – True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages, ignore slow mode, and send messages to the chat without paying Telegram Stars. Implied by any other administrator privilege.

  • can_delete_messages (bool | None) – True, if the administrator can delete messages of other users

  • can_manage_video_chats (bool | None) – True, if the administrator can manage video chats

  • can_restrict_members (bool | None) – True, if the administrator can restrict, ban or unban chat members, or access supergroup statistics

  • can_promote_members (bool | None) – True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user)

  • can_change_info (bool | None) – True, if the user is allowed to change the chat title, photo and other settings

  • can_invite_users (bool | None) – True, if the user is allowed to invite new users to the chat

  • can_post_stories (bool | None) – True, if the administrator can post stories to the chat

  • can_edit_stories (bool | None) – True, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat’s story archive

  • can_delete_stories (bool | None) – True, if the administrator can delete stories posted by other users

  • can_post_messages (bool | None) – True, if the administrator can post messages in the channel, approve suggested posts, or access channel statistics; for channels only

  • can_edit_messages (bool | None) – True, if the administrator can edit messages of other users and can pin messages; for channels only

  • can_pin_messages (bool | None) – True, if the user is allowed to pin messages; for groups and supergroups only

  • can_manage_topics (bool | None) – True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only

  • can_manage_direct_messages (bool | None) – True, if the administrator can manage direct messages of the channel and decline suggested posts; for channels only

  • can_manage_tags (bool | None) – True, if the administrator can edit the tags of regular members; for groups and supergroups only. If omitted, defaults to the value of can_pin_messages.

can_change_info: bool | None = None
can_delete_messages: bool | None = None
can_delete_stories: bool | None = None
can_edit_messages: bool | None = None
can_edit_stories: bool | None = None
can_invite_users: bool | None = None
can_manage_chat: bool | None = None
can_manage_direct_messages: bool | None = None
can_manage_tags: bool | None = None
can_manage_topics: bool | None = None
can_manage_video_chats: bool | None = None
can_pin_messages: bool | None = None
can_post_messages: bool | None = None
can_post_stories: bool | None = None
can_promote_members: bool | None = None
can_restrict_members: bool | None = None
can_send_welcome_messages: bool | None = None
classmethod from_dict(data: dict | None) ChatAdministratorRights | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

is_anonymous: bool | None = None
to_dict() Dict[str, object][source]

Serialize this type to the Telegram API request shape.

Returns:

A JSON-compatible mapping representing this value.

class peyk.platforms.telegram.types.ChatBackground(type: BackgroundTypeFill | BackgroundTypeWallpaper | BackgroundTypePattern | BackgroundTypeChatTheme | None = None)[source]

Bases: object

This object represents a chat background.

Variables:

type (peyk.platforms.telegram.types.background_type_fill.BackgroundTypeFill | peyk.platforms.telegram.types.background_type_wallpaper.BackgroundTypeWallpaper | peyk.platforms.telegram.types.background_type_pattern.BackgroundTypePattern | peyk.platforms.telegram.types.background_type_chat_theme.BackgroundTypeChatTheme | None) – Type of the background

classmethod from_dict(data: dict | None) ChatBackground | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

type: BackgroundTypeFill | BackgroundTypeWallpaper | BackgroundTypePattern | BackgroundTypeChatTheme | None = None
class peyk.platforms.telegram.types.ChatBoost(boost_id: str, add_date: int, expiration_date: int, source: ChatBoostSource)[source]

Bases: object

This object contains information about a chat boost.

Variables:
  • boost_id (str) – Unique identifier of the boost

  • add_date (int) – Point in time (Unix timestamp) when the chat was boosted

  • expiration_date (int) – Point in time (Unix timestamp) when the boost will automatically expire, unless the booster’s Telegram Premium subscription is prolonged

  • source (peyk.platforms.telegram.types.chat_boost_source.ChatBoostSource) – Source of the added boost

classmethod from_dict(data: dict | None) ChatBoost | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

boost_id: str
add_date: int
expiration_date: int
source: ChatBoostSource
class peyk.platforms.telegram.types.ChatBoostAdded(boost_count: int)[source]

Bases: object

This object represents a service message about a user boosting a chat.

Variables:

boost_count (int) – Number of boosts added by the user

classmethod from_dict(data: dict | None) ChatBoostAdded | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

boost_count: int
class peyk.platforms.telegram.types.ChatBoostRemoved(chat: Chat, boost_id: str, remove_date: int, source: ChatBoostSource)[source]

Bases: object

This object represents a boost removed from a chat.

Variables:
classmethod from_dict(data: dict | None) ChatBoostRemoved | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

chat: Chat
boost_id: str
remove_date: int
source: ChatBoostSource
class peyk.platforms.telegram.types.ChatBoostSource(source: str = '', user: User | None = None)[source]

Bases: object

Chat boost source (union alias).

classmethod from_dict(data: dict | None) ChatBoostSource | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

source: str = ''
user: User | None = None
class peyk.platforms.telegram.types.ChatBoostSourceGiftCode(source: str, user: User)[source]

Bases: object

The boost was obtained by the creation of Telegram Premium gift codes to boost a chat. Each such code boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription.

Variables:
classmethod from_dict(data: dict | None) ChatBoostSourceGiftCode | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

source: str
user: User
class peyk.platforms.telegram.types.ChatBoostSourceGiveaway(source: str, giveaway_message_id: int, user: User | None = None, prize_star_count: int | None = None, is_unclaimed: bool | None = None)[source]

Bases: object

The boost was obtained by the creation of a Telegram Premium or a Telegram Star giveaway. This boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription for Telegram Premium giveaways and prize_star_count / 500 times for one year for Telegram Star giveaways.

Variables:
  • source (str) – Source of the boost, always ‘giveaway’

  • giveaway_message_id (int) – Identifier of a message in the chat with the giveaway; the message could have been deleted already. May be 0 if the message isn’t sent yet.

  • user (peyk.platforms.telegram.types.user.User | None) – User that won the prize in the giveaway if any; for Telegram Premium giveaways only

  • prize_star_count (int | None) – The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only

  • is_unclaimed (bool | None) – True, if the giveaway was completed, but there was no user to win the prize

classmethod from_dict(data: dict | None) ChatBoostSourceGiveaway | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

is_unclaimed: bool | None = None
prize_star_count: int | None = None
user: User | None = None
source: str
giveaway_message_id: int
class peyk.platforms.telegram.types.ChatBoostSourcePremium(source: str, user: User)[source]

Bases: object

The boost was obtained by subscribing to Telegram Premium or by gifting a Telegram Premium subscription to another user.

Variables:
classmethod from_dict(data: dict | None) ChatBoostSourcePremium | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

source: str
user: User
class peyk.platforms.telegram.types.ChatBoostUpdated(chat: Chat, boost: ChatBoost)[source]

Bases: object

This object represents a boost added to a chat or changed.

Variables:
classmethod from_dict(data: dict | None) ChatBoostUpdated | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

chat: Chat
boost: ChatBoost
class peyk.platforms.telegram.types.ChatFullInfo(id: int, type: str, title: str | None = None, username: str | None = None, first_name: str | None = None, last_name: str | None = None, is_forum: bool | None = None, accent_color_id: int | None = None, max_reaction_count: int | None = None, photo: ChatPhoto | None = None, active_usernames: List[str] | None = None, description: str | None = None, invite_link: str | None = None, pinned_message: Message | None = None, permissions: object | None = None, slow_mode_delay: int | None = None, message_auto_delete_time: int | None = None, has_protected_content: bool | None = None, has_visible_history: bool | None = None, sticker_set_name: str | None = None, can_set_sticker_set: bool | None = None, linked_chat_id: int | None = None, location: object | None = None)[source]

Bases: object

This object contains full information about a chat.

Variables:
  • id (int) – Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.

  • type (str) – Type of the chat, can be either ‘private’, ‘group’, ‘supergroup’ or ‘channel’

  • accent_color_id (int | None) – Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details.

  • max_reaction_count (int | None) – The maximum number of reactions that can be set on a message in the chat

  • accepted_gift_types – Information about types of gifts that are accepted by the chat or by the corresponding user for private chats

  • title (str | None) – Title, for supergroups, channels and group chats

  • username (str | None) – Username, for private chats, supergroups and channels if available

  • first_name (str | None) – First name of the other party in a private chat

  • last_name (str | None) – Last name of the other party in a private chat

  • is_forum (bool | None) – True, if the supergroup chat is a forum (has topics enabled)

  • is_direct_messages – True, if the chat is the direct messages chat of a channel

  • photo (peyk.platforms.telegram.types.chat_photo.ChatPhoto | None) – Chat photo

  • active_usernames (List[str] | None) – If non-empty, the list of all active chat usernames; for private chats, supergroups and channels

  • birthdate – For private chats, the date of birth of the user

  • business_intro – For private chats with business accounts, the intro of the business

  • business_location – For private chats with business accounts, the location of the business

  • business_opening_hours – For private chats with business accounts, the opening hours of the business

  • personal_chat – For private chats, the personal channel of the user

  • parent_chat – Information about the corresponding channel chat; for direct messages chats only

  • available_reactions – List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed.

  • background_custom_emoji_id – Custom emoji identifier of the emoji chosen by the chat for the reply header and link preview background

  • profile_accent_color_id – Identifier of the accent color for the chat’s profile background. See profile accent colors for more details.

  • profile_background_custom_emoji_id – Custom emoji identifier of the emoji chosen by the chat for its profile background

  • emoji_status_custom_emoji_id – Custom emoji identifier of the emoji status of the chat or the other party in a private chat

  • emoji_status_expiration_date – Expiration date of the emoji status of the chat or the other party in a private chat, in Unix time, if any

  • bio – Bio of the other party in a private chat

  • has_private_forwards – True, if privacy settings of the other party in the private chat allows to use tg://user?id= links only in chats with the user

  • has_restricted_voice_and_video_messages – True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat

  • join_to_send_messages – True, if users need to join the supergroup before they can send messages

  • join_by_request – True, if all users directly joining the supergroup without using an invite link need to be approved by supergroup administrators

  • description (str | None) – Description, for groups, supergroups and channel chats

  • invite_link (str | None) – Primary invite link, for groups, supergroups and channel chats

  • pinned_message (peyk.platforms.telegram.types.message.Message | None) – The most recent pinned message (by sending date)

  • permissions (object | None) – Default chat member permissions, for groups and supergroups

  • can_send_paid_media – True, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats.

  • slow_mode_delay (int | None) – For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds

  • unrestrict_boost_count – For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions

  • message_auto_delete_time (int | None) – The time after which all messages sent to the chat will be automatically deleted; in seconds

  • has_aggressive_anti_spam_enabled – True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators.

  • has_hidden_members – True, if non-administrators can only get the list of bots and administrators in the chat

  • has_protected_content (bool | None) – True, if messages from the chat can’t be forwarded to other chats

  • has_visible_history (bool | None) – True, if new chat members will have access to old messages; available only to chat administrators

  • sticker_set_name (str | None) – For supergroups, name of the group sticker set

  • can_set_sticker_set (bool | None) – True, if the bot can change the group sticker set

  • custom_emoji_sticker_set_name – For supergroups, the name of the group’s custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group.

  • linked_chat_id (int | None) – Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.

  • location (object | None) – For supergroups, the location to which the supergroup is connected

  • rating – For private chats, the rating of the user if any

  • first_profile_audio – For private chats, the first audio added to the profile of the user

  • unique_gift_colors – The color scheme based on a unique gift that must be used for the chat’s name, message replies and link previews

  • paid_message_star_count – The number of Telegram Stars a general user has to pay to send a message to the chat

  • guard_bot – The bot that processes join request queries in the chat. The field is only available to chat administrators.

  • community – The Community to which the chat belongs

  • can_send_gift – True, if gifts can be sent to the chat

accent_color_id: int | None = None
active_usernames: List[str] | None = None
can_set_sticker_set: bool | None = None
community = None
description: str | None = None
first_name: str | None = None
classmethod from_dict(data)
guard_bot = None
has_protected_content: bool | None = None
has_visible_history: bool | None = None
is_forum: bool | None = None
last_name: str | None = None
linked_chat_id: int | None = None
location: object | None = None
max_reaction_count: int | None = None
message_auto_delete_time: int | None = None
permissions: object | None = None
photo: ChatPhoto | None = None
pinned_message: Message | None = None
slow_mode_delay: int | None = None
sticker_set_name: str | None = None
title: str | None = None
username: str | None = None
id: int
type: str

Bases: object

Represents an invite link for a chat.

Variables:
  • invite_link (str) – The invite link. If the link was created by another chat administrator, then the second part of the link will be replaced with ‘…’.

  • creator (peyk.platforms.telegram.types.user.User | None) – Creator of the link

  • creates_join_request (bool | None) – True, if users joining the chat via the link need to be approved by chat administrators

  • is_primary (bool | None) – True, if the link is primary

  • is_revoked (bool | None) – True, if the link is revoked

  • name (str | None) – Invite link name

  • expire_date (int | None) – Point in time (Unix timestamp) when the link will expire or has been expired

  • member_limit (int | None) – The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999

  • pending_join_request_count (int | None) – Number of pending join requests created using this link

  • subscription_period (int | None) – The number of seconds the subscription will be active for before the next payment

  • subscription_price (int | None) – The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat using the link

creates_join_request: bool | None = None
creator: User | None = None
expire_date: int | None = None
classmethod from_dict(data: dict | None) ChatInviteLink | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

is_primary: bool | None = None
is_revoked: bool | None = None
member_limit: int | None = None
name: str | None = None
pending_join_request_count: int | None = None
subscription_period: int | None = None
subscription_price: int | None = None
class peyk.platforms.telegram.types.ChatJoinRequest(chat: Chat, from_: User | None = None, user_chat_id: int | None = None, date: int | None = None, bio: str | None = None, invite_link: ChatInviteLink | None = None, query_id: str | None = None, bot: 'Bot[object]' | None = None)[source]

Bases: object

Represents a join request sent to a chat.

Variables:
  • chat (Chat) – Chat to which the request was sent

  • from – User that sent the join request

  • user_chat_id (Optional[int]) – Identifier of a private chat with the user who sent the join request. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot can use this identifier for 5 minutes to send messages until the join request is processed, assuming no other administrator contacted the user.

  • date (Optional[int]) – Date the request was sent in Unix time

  • bio (Optional[str]) – Bio of the user

  • invite_link (Optional[ChatInviteLink]) – Chat invite link that was used by the user to send the join request

  • query_id (Optional[str]) – Identifier of the join request query; for bots assigned to process join requests only. If present, then the bot must call sendChatJoinRequestWebApp or directly call answerChatJoinRequestQuery within 10 seconds.

async approve() bool[source]

Approve this join request through the injected bot.

bio: str | None = None
bot: 'Bot[object]' | None = None
date: int | None = None
async decline() bool[source]

Decline this join request through the injected bot.

from_: User | None = None
classmethod from_dict(data: dict | None) ChatJoinRequest | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

query_id: str | None = None
user_chat_id: int | None = None
chat: Chat
class peyk.platforms.telegram.types.ChatLocation(location: Location | None = None, address: str = '')[source]

Bases: object

Represents a location to which a chat is connected.

Variables:
address: str = ''
classmethod from_dict(data: dict | None) ChatLocation | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

location: Location | None = None
class peyk.platforms.telegram.types.ChatMemberAdministrator(status: str = 'administrator', user: User | None = None, can_be_edited: bool | None = None, is_anonymous: bool | None = None, can_manage_chat: bool | None = None, can_delete_messages: bool | None = None, can_manage_video_chats: bool | None = None, can_restrict_members: bool | None = None, can_promote_members: bool | None = None, can_change_info: bool | None = None, can_invite_users: bool | None = None, can_post_stories: bool | None = None, can_edit_stories: bool | None = None, can_delete_stories: bool | None = None, can_post_messages: bool | None = None, can_edit_messages: bool | None = None, can_pin_messages: bool | None = None, can_manage_topics: bool | None = None, can_manage_direct_messages: bool | None = None, can_manage_tags: bool | None = None, can_send_welcome_messages: bool | None = None, custom_title: str | None = None)[source]

Bases: object

Represents a chat member that has some additional privileges.

Variables:
  • status (str) – The member’s status in the chat, always ‘administrator’

  • user (peyk.platforms.telegram.types.user.User | None) – Information about the user

  • can_be_edited (bool | None) – True, if the bot is allowed to edit administrator privileges of that user

  • is_anonymous (bool | None) – True, if the user’s presence in the chat is hidden

  • can_manage_chat (bool | None) – True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report spam messages, ignore slow mode, and send messages to the chat without paying Telegram Stars. Implied by any other administrator privilege.

  • can_delete_messages (bool | None) – True, if the administrator can delete messages of other users

  • can_manage_video_chats (bool | None) – True, if the administrator can manage video chats

  • can_restrict_members (bool | None) – True, if the administrator can restrict, ban or unban chat members, or access supergroup statistics

  • can_promote_members (bool | None) – True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user)

  • can_change_info (bool | None) – True, if the user is allowed to change the chat title, photo and other settings

  • can_invite_users (bool | None) – True, if the user is allowed to invite new users to the chat

  • can_post_stories (bool | None) – True, if the administrator can post stories to the chat

  • can_edit_stories (bool | None) – True, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access the chat’s story archive

  • can_delete_stories (bool | None) – True, if the administrator can delete stories posted by other users

  • can_post_messages (bool | None) – True, if the administrator can post messages in the channel, approve suggested posts, or access channel statistics; for channels only

  • can_edit_messages (bool | None) – True, if the administrator can edit messages of other users and can pin messages; for channels only

  • can_pin_messages (bool | None) – True, if the user is allowed to pin messages; for groups and supergroups only

  • can_manage_topics (bool | None) – True, if the user is allowed to create, rename, close, and reopen forum topics; for supergroups only

  • can_manage_direct_messages (bool | None) – True, if the administrator can manage direct messages of the channel and decline suggested posts; for channels only

  • can_manage_tags (bool | None) – True, if the administrator can edit the tags of regular members; for groups and supergroups only. If omitted, defaults to the value of can_pin_messages.

  • custom_title (str | None) – Custom title for this user

can_be_edited: bool | None = None
can_change_info: bool | None = None
can_delete_messages: bool | None = None
can_delete_stories: bool | None = None
can_edit_messages: bool | None = None
can_edit_stories: bool | None = None
can_invite_users: bool | None = None
can_manage_chat: bool | None = None
can_manage_direct_messages: bool | None = None
can_manage_tags: bool | None = None
can_manage_topics: bool | None = None
can_manage_video_chats: bool | None = None
can_pin_messages: bool | None = None
can_post_messages: bool | None = None
can_post_stories: bool | None = None
can_promote_members: bool | None = None
can_restrict_members: bool | None = None
can_send_welcome_messages: bool | None = None
custom_title: str | None = None
classmethod from_dict(data: dict | None) ChatMemberAdministrator | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

is_anonymous: bool | None = None
status: str = 'administrator'
user: User | None = None
class peyk.platforms.telegram.types.ChatMemberBanned(status: str = 'kicked', user: User | None = None, until_date: int | None = None)[source]

Bases: object

Represents a chat member that was banned in the chat and can’t return to the chat or view chat messages.

Variables:
  • status (str) – The member’s status in the chat, always ‘kicked’

  • user (peyk.platforms.telegram.types.user.User | None) – Information about the user

  • until_date (int | None) – Date when restrictions will be lifted for this user; Unix time. If 0, then the user is banned forever.

classmethod from_dict(data: dict | None) ChatMemberBanned | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

status: str = 'kicked'
until_date: int | None = None
user: User | None = None
class peyk.platforms.telegram.types.ChatMemberLeft(status: str = 'left', user: User | None = None)[source]

Bases: object

Represents a chat member that isn’t currently a member of the chat, but may join it themselves.

Variables:
classmethod from_dict(data: dict | None) ChatMemberLeft | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

status: str = 'left'
user: User | None = None
class peyk.platforms.telegram.types.ChatMemberMember(status: str = 'member', user: User | None = None, tag: str | None = None, until_date: int | None = None)[source]

Bases: object

Represents a chat member that has no additional privileges or restrictions.

Variables:
  • status (str) – The member’s status in the chat, always ‘member’

  • user (peyk.platforms.telegram.types.user.User | None) – Information about the user

  • tag (str | None) – Tag of the member

  • until_date (int | None) – Date when the user’s subscription will expire; Unix time

classmethod from_dict(data: dict | None) ChatMemberMember | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

status: str = 'member'
tag: str | None = None
until_date: int | None = None
user: User | None = None
class peyk.platforms.telegram.types.ChatMemberOwner(status: str = 'creator', user: User | None = None, is_anonymous: bool | None = None, custom_title: str | None = None)[source]

Bases: object

Represents a chat member that owns the chat and has all administrator privileges.

Variables:
  • status (str) – The member’s status in the chat, always ‘creator’

  • user (peyk.platforms.telegram.types.user.User | None) – Information about the user

  • is_anonymous (bool | None) – True, if the user’s presence in the chat is hidden

  • custom_title (str | None) – Custom title for this user

custom_title: str | None = None
classmethod from_dict(data: dict | None) ChatMemberOwner | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

is_anonymous: bool | None = None
status: str = 'creator'
user: User | None = None
class peyk.platforms.telegram.types.ChatMemberRestricted(status: str = 'restricted', user: User | None = None, tag: str | None = None, is_member: bool | None = None, can_send_messages: bool | None = None, can_send_audios: bool | None = None, can_send_documents: bool | None = None, can_send_photos: bool | None = None, can_send_videos: bool | None = None, can_send_video_notes: bool | None = None, can_send_voice_notes: bool | None = None, can_send_polls: bool | None = None, can_send_other_messages: bool | None = None, can_add_web_page_previews: bool | None = None, can_react_to_messages: bool | None = None, can_edit_tag: bool | None = None, can_change_info: bool | None = None, can_invite_users: bool | None = None, can_pin_messages: bool | None = None, can_manage_topics: bool | None = None, until_date: int | None = None)[source]

Bases: object

Represents a chat member that is under certain restrictions in the chat. Supergroups only.

Variables:
  • status (str) – The member’s status in the chat, always ‘restricted’

  • user (peyk.platforms.telegram.types.user.User | None) – Information about the user

  • is_member (bool | None) – True, if the user is a member of the chat at the moment of the request

  • can_send_messages (bool | None) – True, if the user is allowed to send text messages, rich messages, contacts, giveaways, giveaway winners, invoices, locations and venues

  • can_send_audios (bool | None) – True, if the user is allowed to send audios

  • can_send_documents (bool | None) – True, if the user is allowed to send documents

  • can_send_photos (bool | None) – True, if the user is allowed to send photos

  • can_send_videos (bool | None) – True, if the user is allowed to send videos

  • can_send_video_notes (bool | None) – True, if the user is allowed to send video notes

  • can_send_voice_notes (bool | None) – True, if the user is allowed to send voice notes

  • can_send_polls (bool | None) – True, if the user is allowed to send polls and checklists

  • can_send_other_messages (bool | None) – True, if the user is allowed to send animations, games, stickers and use inline bots

  • can_add_web_page_previews (bool | None) – True, if the user is allowed to add web page previews to their messages

  • can_react_to_messages (bool | None) – True, if the user is allowed to react to messages

  • can_edit_tag (bool | None) – True, if the user is allowed to edit their own tag

  • can_change_info (bool | None) – True, if the user is allowed to change the chat title, photo and other settings

  • can_invite_users (bool | None) – True, if the user is allowed to invite new users to the chat

  • can_pin_messages (bool | None) – True, if the user is allowed to pin messages

  • can_manage_topics (bool | None) – True, if the user is allowed to create forum topics

  • until_date (int | None) – Date when restrictions will be lifted for this user; Unix time. If 0, then the user is restricted forever.

  • tag (str | None) – Tag of the member

can_add_web_page_previews: bool | None = None
can_change_info: bool | None = None
can_edit_tag: bool | None = None
can_invite_users: bool | None = None
can_manage_topics: bool | None = None
can_pin_messages: bool | None = None
can_react_to_messages: bool | None = None
can_send_audios: bool | None = None
can_send_documents: bool | None = None
can_send_messages: bool | None = None
can_send_other_messages: bool | None = None
can_send_photos: bool | None = None
can_send_polls: bool | None = None
can_send_video_notes: bool | None = None
can_send_videos: bool | None = None
can_send_voice_notes: bool | None = None
classmethod from_dict(data: dict | None) ChatMemberRestricted | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

is_member: bool | None = None
status: str = 'restricted'
tag: str | None = None
until_date: int | None = None
user: User | None = None
class peyk.platforms.telegram.types.ChatMemberUpdated(chat: Chat, from_: User | None = None, date: int | None = None, old_chat_member: ChatMemberOwner | ChatMemberAdministrator | ChatMemberMember | ChatMemberRestricted | ChatMemberLeft | ChatMemberBanned | None = None, new_chat_member: ChatMemberOwner | ChatMemberAdministrator | ChatMemberMember | ChatMemberRestricted | ChatMemberLeft | ChatMemberBanned | None = None, invite_link: ChatInviteLink | None = None, via_join_request: bool | None = None, via_chat_folder_invite_link: bool | None = None)[source]

Bases: object

This object represents changes in the status of a chat member.

Variables:
date: int | None = None
from_: User | None = None
classmethod from_dict(data: dict | None) ChatMemberUpdated | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

new_chat_member: ChatMemberOwner | ChatMemberAdministrator | ChatMemberMember | ChatMemberRestricted | ChatMemberLeft | ChatMemberBanned | None = None
old_chat_member: ChatMemberOwner | ChatMemberAdministrator | ChatMemberMember | ChatMemberRestricted | ChatMemberLeft | ChatMemberBanned | None = None
via_join_request: bool | None = None
chat: Chat
class peyk.platforms.telegram.types.ChatOwnerChanged(from_user: User | None = None, to_user: User | None = None)[source]

Bases: object

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

Variables:

new_owner – The new owner of the chat

classmethod from_dict(data: dict | None) ChatOwnerChanged | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

from_user: User | None = None
to_user: User | None = None
class peyk.platforms.telegram.types.ChatOwnerLeft(user: User | None = None)[source]

Bases: object

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

Variables:

new_owner – The user who will become the new owner of the chat if the previous owner does not return to the chat

classmethod from_dict(data: dict | None) ChatOwnerLeft | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

user: User | None = None
class peyk.platforms.telegram.types.ChatPermissions(can_send_messages: bool | None = None, can_send_audios: bool | None = None, can_send_documents: bool | None = None, can_send_photos: bool | None = None, can_send_videos: bool | None = None, can_send_video_notes: bool | None = None, can_send_voice_notes: bool | None = None, can_send_polls: bool | None = None, can_send_other_messages: bool | None = None, can_add_web_page_previews: bool | None = None, can_react_to_messages: bool | None = None, can_edit_tag: bool | None = None, can_change_info: bool | None = None, can_invite_users: bool | None = None, can_pin_messages: bool | None = None, can_manage_topics: bool | None = None)[source]

Bases: object

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

Variables:
  • can_send_messages (bool | None) – True, if the user is allowed to send text messages, rich messages, contacts, giveaways, giveaway winners, invoices, locations and venues

  • can_send_audios (bool | None) – True, if the user is allowed to send audios

  • can_send_documents (bool | None) – True, if the user is allowed to send documents

  • can_send_photos (bool | None) – True, if the user is allowed to send photos

  • can_send_videos (bool | None) – True, if the user is allowed to send videos

  • can_send_video_notes (bool | None) – True, if the user is allowed to send video notes

  • can_send_voice_notes (bool | None) – True, if the user is allowed to send voice notes

  • can_send_polls (bool | None) – True, if the user is allowed to send polls and checklists

  • can_send_other_messages (bool | None) – True, if the user is allowed to send animations, games, stickers and use inline bots

  • can_add_web_page_previews (bool | None) – True, if the user is allowed to add web page previews to their messages

  • can_react_to_messages (bool | None) – True, if the user is allowed to react to messages. If omitted, defaults to the value of can_send_messages.

  • can_edit_tag (bool | None) – True, if the user is allowed to edit their own tag. If omitted, defaults to the value of can_pin_messages.

  • can_change_info (bool | None) – True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups.

  • can_invite_users (bool | None) – True, if the user is allowed to invite new users to the chat

  • can_pin_messages (bool | None) – True, if the user is allowed to pin messages. Ignored in public supergroups.

  • can_manage_topics (bool | None) – True, if the user is allowed to create forum topics. If omitted, defaults to the value of can_pin_messages.

can_add_web_page_previews: bool | None = None
can_change_info: bool | None = None
can_edit_tag: bool | None = None
can_invite_users: bool | None = None
can_manage_topics: bool | None = None
can_pin_messages: bool | None = None
can_react_to_messages: bool | None = None
can_send_audios: bool | None = None
can_send_documents: bool | None = None
can_send_messages: bool | None = None
can_send_other_messages: bool | None = None
can_send_photos: bool | None = None
can_send_polls: bool | None = None
can_send_video_notes: bool | None = None
can_send_videos: bool | None = None
can_send_voice_notes: bool | None = None
classmethod from_dict(data: dict | None) ChatPermissions | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

to_dict() Dict[str, object][source]

Serialize this type to the Telegram API request shape.

Returns:

A JSON-compatible mapping representing this value.

class peyk.platforms.telegram.types.ChatPhoto(small_file_id: str, small_file_unique_id: str, big_file_id: str, big_file_unique_id: str)[source]

Bases: object

This object represents a chat photo.

Variables:
  • small_file_id (str) – File identifier of small (160x160) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed.

  • small_file_unique_id (str) – Unique file identifier of small (160x160) chat photo, which is supposed to be the same over time and for different bots. Can’t be used to download or reuse the file.

  • big_file_id (str) – File identifier of big (640x640) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed.

  • big_file_unique_id (str) – Unique file identifier of big (640x640) chat photo, which is supposed to be the same over time and for different bots. Can’t be used to download or reuse the file.

classmethod from_dict(data: dict | None) ChatPhoto | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

small_file_id: str
small_file_unique_id: str
big_file_id: str
big_file_unique_id: str
class peyk.platforms.telegram.types.ChatShared(request_id: int = 0, chat_id: int = 0, title: str | None = None, username: str | None = None, photo: List[PhotoSize] | None = None)[source]

Bases: object

This object contains information about a chat that was shared with the bot using a KeyboardButtonRequestChat button.

Variables:
  • request_id (int) – Identifier of the request

  • chat_id (int) – Identifier of the shared chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot may not have access to the chat and could be unable to use this identifier, unless the chat is already known to the bot by some other means.

  • title (str | None) – Title of the chat, if the title was requested by the bot

  • username (str | None) – Username of the chat, if the username was requested by the bot and available

  • photo (List[peyk.platforms.telegram.types.photo_size.PhotoSize] | None) – Available sizes of the chat photo, if the photo was requested by the bot

chat_id: int = 0
classmethod from_dict(data: dict | None) ChatShared | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

photo: List[PhotoSize] | None = None
request_id: int = 0
title: str | None = None
username: str | None = None
class peyk.platforms.telegram.types.Checklist(title: str = '', tasks: List[ChecklistTask] | None = None, others_can_add_tasks: bool | None = None, others_can_mark_tasks_as_done: bool | None = None)[source]

Bases: object

Describes a checklist.

Variables:
  • title (str) – Title of the checklist

  • tasks (List[peyk.platforms.telegram.types.checklist_task.ChecklistTask] | None) – List of tasks in the checklist

  • title_entities – Special entities that appear in the checklist title

  • others_can_add_tasks (bool | None) – True, if users other than the creator of the list can add tasks to the list

  • others_can_mark_tasks_as_done (bool | None) – True, if users other than the creator of the list can mark tasks as done or not done

classmethod from_dict(data: dict | None) Checklist | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

others_can_add_tasks: bool | None = None
others_can_mark_tasks_as_done: bool | None = None
tasks: List[ChecklistTask] | None = None
title: str = ''
class peyk.platforms.telegram.types.ChecklistTask(id: int = 0, text: str = '', text_entities: List[MessageEntity] | None = None, completed_by_user: User | None = None, completion_date: int | None = None)[source]

Bases: object

Describes a task in a checklist.

Variables:
  • id (int) – Unique identifier of the task

  • text (str) – Text of the task

  • text_entities (List[peyk.platforms.telegram.types.message_entity.MessageEntity] | None) – Special entities that appear in the task text

  • completed_by_user (peyk.platforms.telegram.types.user.User | None) – User that completed the task; omitted if the task wasn’t completed by a user

  • completed_by_chat – Chat that completed the task; omitted if the task wasn’t completed by a chat

  • completion_date (int | None) – Point in time (Unix timestamp) when the task was completed; 0 if the task wasn’t completed

completed_by_user: User | None = None
completion_date: int | None = None
classmethod from_dict(data: dict | None) ChecklistTask | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

id: int = 0
text: str = ''
text_entities: List[MessageEntity] | None = None
class peyk.platforms.telegram.types.ChecklistTasksAdded(checklist_message: Message | None = None, tasks: List[ChecklistTask] | None = None)[source]

Bases: object

Describes a service message about tasks added to a checklist.

Variables:
checklist_message: Message | None = None
classmethod from_dict(data: dict | None) ChecklistTasksAdded | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

tasks: List[ChecklistTask] | None = None
class peyk.platforms.telegram.types.ChecklistTasksDone(checklist_message: Message | None = None, tasks: List[ChecklistTask] | None = None, completed_tasks: List[ChecklistTask] | None = None)[source]

Bases: object

Describes a service message about checklist tasks marked as done or not done.

Variables:
  • checklist_message (peyk.platforms.telegram.types.message.Message | None) – Message containing the checklist whose tasks were marked as done or not done. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply.

  • marked_as_done_task_ids – Identifiers of the tasks that were marked as done

  • marked_as_not_done_task_ids – Identifiers of the tasks that were marked as not done

checklist_message: Message | None = None
completed_tasks: List[ChecklistTask] | None = None
classmethod from_dict(data: dict | None) ChecklistTasksDone | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

tasks: List[ChecklistTask] | None = None
class peyk.platforms.telegram.types.ChosenInlineResult(result_id: str, from_: User | None = None, location: Location | None = None, inline_message_id: str | None = None, query: str = '')[source]

Bases: object

Represents a result of an inline query that was chosen by the user and sent to their chat partner. Note: It is necessary to enable inline feedback via @BotFather in order to receive these objects in updates.

Variables:
  • result_id (str) – The unique identifier for the result that was chosen

  • from – The user that chose the result

  • query (str) – The query that was used to obtain the result

  • location (peyk.platforms.telegram.types.location.Location | None) – Sender location, only for bots that require user location

  • inline_message_id (str | None) – Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. Will be also received in callback queries and can be used to edit the message.

from_: User | None = None
classmethod from_dict(data: dict | None) ChosenInlineResult | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

inline_message_id: str | None = None
location: Location | None = None
query: str = ''
result_id: str
class peyk.platforms.telegram.types.Community(id: int = 0, title: str = '', bot: User | None = None, name: str | None = None)[source]

Bases: object

Represents a community (a group of chats).

Variables:
  • id (int) – Unique identifier for this community. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.

  • name (str | None) – Name of the community

bot: User | None = None
classmethod from_dict(data: dict | None) Community | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

id: int = 0
name: str | None = None
title: str = ''
class peyk.platforms.telegram.types.CommunityChatAdded(chat_id: int = 0, community: Community | None = None)[source]

Bases: object

Describes a service message about a chat being added to a community.

Variables:

community (peyk.platforms.telegram.types.community.Community | None) – The new community to which the chat belongs

chat_id: int = 0
community: Community | None = None
classmethod from_dict(data: dict | None) CommunityChatAdded | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.CommunityChatJoined(chat_id: int = 0, community: Community | None = None)[source]

Bases: object

CommunityChatJoined Telegram Bot API type.

chat_id: int = 0
community: Community | None = None
classmethod from_dict(data: dict | None) CommunityChatJoined | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.CommunityChatRemoved(chat_id: int = 0)[source]

Bases: object

CommunityChatRemoved Telegram Bot API type.

chat_id: int = 0
classmethod from_dict(data: dict | None) CommunityChatRemoved | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.Contact(phone_number: str, first_name: str, last_name: str | None = None, user_id: int | None = None, vcard: str | None = None)[source]

Bases: object

This object represents a phone contact.

Variables:
  • phone_number (str) – Contact’s phone number

  • first_name (str) – Contact’s first name

  • last_name (str | None) – Contact’s last name

  • user_id (int | None) – Contact’s user identifier in Telegram. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.

  • vcard (str | None) – Additional data about the contact in the form of a vCard

classmethod from_dict(data: dict | None) Contact | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

last_name: str | None = None
user_id: int | None = None
vcard: str | None = None
phone_number: str
first_name: str
class peyk.platforms.telegram.types.CopyTextButton(text: str = '')[source]

Bases: object

This object represents an inline keyboard button that copies specified text to the clipboard.

Variables:

text (str) – The text to be copied to the clipboard; 1-256 characters

classmethod from_dict(data: dict | None) CopyTextButton | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

text: str = ''
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.Dice(emoji: str, value: int)[source]

Bases: object

This object represents an animated emoji that displays a random value.

Variables:
  • emoji (str) – Emoji on which the dice throw animation is based

  • value (int) – Value of the dice, 1-6 for ‘’, ‘’ and ‘’ base emoji, 1-5 for ‘’ and ‘’ base emoji, 1-64 for ‘’ base emoji

classmethod from_dict(data: dict | None) Dice | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

emoji: str
value: int
class peyk.platforms.telegram.types.DirectMessagePriceChanged(is_paid_direct_messages: bool | None = None)[source]

Bases: object

Describes a service message about a change in the price of direct messages sent to a channel chat.

Variables:
  • are_direct_messages_enabled – True, if direct messages are enabled for the channel chat; False otherwise

  • direct_message_star_count – The new number of Telegram Stars that must be paid by users for each direct message sent to the channel. Does not apply to users who have been exempted by administrators. Defaults to 0.

classmethod from_dict(data: dict | None) DirectMessagePriceChanged | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

is_paid_direct_messages: bool | None = None
class peyk.platforms.telegram.types.DirectMessagesTopic(topic_id: int | None = None, user: User | None = None)[source]

Bases: object

Describes a topic of a direct messages chat.

Variables:
  • topic_id (int | None) – Unique identifier of the topic. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.

  • user (peyk.platforms.telegram.types.user.User | None) – Information about the user that created the topic. Currently, it is always present.

classmethod from_dict(data: dict | None) DirectMessagesTopic | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

topic_id: int | None = None
user: User | None = None
class peyk.platforms.telegram.types.DisabledButton[source]

Bases: object

Newer addition – marks an inline button disabled (does nothing). Currently holds no information.

classmethod from_dict(data: dict | None) DisabledButton | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.Document(file_id: str, file_unique_id: str, thumbnail: PhotoSize | None = None, file_name: str | None = None, mime_type: str | None = None, file_size: int | None = None)[source]

Bases: object

This object represents a general file (as opposed to photos, voice messages and audio files).

Variables:
  • file_id (str) – Identifier for this file, which can be used to download or reuse the file

  • file_unique_id (str) – Unique identifier for this file, which is supposed to be the same over time and for different bots. Can’t be used to download or reuse the file.

  • thumbnail (peyk.platforms.telegram.types.photo_size.PhotoSize | None) – Document thumbnail as defined by the sender

  • file_name (str | None) – Original filename as defined by the sender

  • mime_type (str | None) – MIME type of the file as defined by the sender

  • file_size (int | None) – File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.

file_name: str | None = None
file_size: int | None = None
classmethod from_dict(data: dict | None) Document | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

mime_type: str | None = None
thumbnail: PhotoSize | None = None
file_id: str
file_unique_id: str
class peyk.platforms.telegram.types.EncryptedCredentials(data: str, hash: str, secret: str)[source]

Bases: object

Describes data required for decrypting and authenticating EncryptedPassportElement. See the Telegram Passport Documentation for a complete description of the data decryption and authentication processes.

Variables:
  • data (str) – Base64-encoded encrypted JSON-serialized data with unique user’s payload, data hashes and secrets required for EncryptedPassportElement decryption and authentication

  • hash (str) – Base64-encoded data hash for data authentication

  • secret (str) – Base64-encoded secret, encrypted with the bot’s public RSA key, required for data decryption

classmethod from_dict(data: dict | None) EncryptedCredentials | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

data: str
hash: str
secret: str
class peyk.platforms.telegram.types.EncryptedPassportElement(type: str, hash: str, data: str | None = None, phone_number: str | None = None, email: str | None = None, files: List[PassportFile] | None = None, front_side: PassportFile | None = None, reverse_side: PassportFile | None = None, selfie: PassportFile | None = None, translation: List[PassportFile] | None = None)[source]

Bases: object

Describes documents or other Telegram Passport elements shared with the bot by the user.

Variables:
  • type (str) – Element type. One of ‘personal_details’, ‘passport’, ‘driver_license’, ‘identity_card’, ‘internal_passport’, ‘address’, ‘utility_bill’, ‘bank_statement’, ‘rental_agreement’, ‘passport_registration’, ‘temporary_registration’, ‘phone_number’, ‘email’.

  • hash (str) – Base64-encoded element hash for using in PassportElementErrorUnspecified

  • data (str | None) – Base64-encoded encrypted Telegram Passport element data provided by the user; available only for ‘personal_details’, ‘passport’, ‘driver_license’, ‘identity_card’, ‘internal_passport’ and ‘address’ types. Can be decrypted and verified using the accompanying EncryptedCredentials.

  • phone_number (str | None) – User’s verified phone number; available only for ‘phone_number’ type

  • email (str | None) – User’s verified email address; available only for ‘email’ type

  • files (List[peyk.platforms.telegram.types.passport_file.PassportFile] | None) – Array of encrypted files with documents provided by the user; available only for ‘utility_bill’, ‘bank_statement’, ‘rental_agreement’, ‘passport_registration’ and ‘temporary_registration’ types. Files can be decrypted and verified using the accompanying EncryptedCredentials.

  • front_side (peyk.platforms.telegram.types.passport_file.PassportFile | None) – Encrypted file with the front side of the document, provided by the user; available only for ‘passport’, ‘driver_license’, ‘identity_card’ and ‘internal_passport’. The file can be decrypted and verified using the accompanying EncryptedCredentials.

  • reverse_side (peyk.platforms.telegram.types.passport_file.PassportFile | None) – Encrypted file with the reverse side of the document, provided by the user; available only for ‘driver_license’ and ‘identity_card’. The file can be decrypted and verified using the accompanying EncryptedCredentials.

  • selfie (peyk.platforms.telegram.types.passport_file.PassportFile | None) – Encrypted file with the selfie of the user holding a document, provided by the user; available if requested for ‘passport’, ‘driver_license’, ‘identity_card’ and ‘internal_passport’. The file can be decrypted and verified using the accompanying EncryptedCredentials.

  • translation (List[peyk.platforms.telegram.types.passport_file.PassportFile] | None) – Array of encrypted files with translated versions of documents provided by the user; available if requested for ‘passport’, ‘driver_license’, ‘identity_card’, ‘internal_passport’, ‘utility_bill’, ‘bank_statement’, ‘rental_agreement’, ‘passport_registration’ and ‘temporary_registration’ types. Files can be decrypted and verified using the accompanying EncryptedCredentials.

data: str | None = None
email: str | None = None
files: List[PassportFile] | None = None
classmethod from_dict(data: dict | None) EncryptedPassportElement | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

front_side: PassportFile | None = None
phone_number: str | None = None
reverse_side: PassportFile | None = None
selfie: PassportFile | None = None
translation: List[PassportFile] | None = None
type: str
hash: str
class peyk.platforms.telegram.types.EphemeralMessageParameters(receiver_user_id: int | None = None, callback_query_id: str | None = None, replace_callback_query_message: bool | None = None)[source]

Bases: object

Ephemeral message parameters.

callback_query_id: str | None = None
classmethod from_dict(data: dict | None) EphemeralMessageParameters | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

receiver_user_id: int | None = None
replace_callback_query_message: bool | None = None
class peyk.platforms.telegram.types.ExternalReplyInfo(origin: object | None = None, chat: Chat | None = None, message_id: int | None = None, link_preview_options: object | None = None, animation: object | None = None, audio: object | None = None, document: object | None = None, photo: object | None = None, sticker: object | None = None, story: object | None = None, video: object | None = None, video_note: object | None = None, voice: object | None = None, live_photo: object | None = None, has_media_spoiler: bool | None = None, contact: object | None = None, dice: object | None = None, game: object | None = None, giveaway: object | None = None, giveaway_winners: object | None = None, invoice: object | None = None, location: object | None = None, poll: object | None = None, venue: object | None = None, quote: TextQuote | None = None)[source]

Bases: object

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

Variables:
  • origin (object | None) – Origin of the message replied to by the given message

  • chat (peyk.platforms.telegram.types.chat.Chat | None) – Chat the original message belongs to. Available only if the chat is a supergroup or a channel.

  • message_id (int | None) – Unique message identifier inside the original chat. Available only if the original chat is a supergroup or a channel.

  • link_preview_options (object | None) – Options used for link preview generation for the original message, if it is a text message

  • animation (object | None) – Message is an animation, information about the animation

  • audio (object | None) – Message is an audio file, information about the file

  • document (object | None) – Message is a general file, information about the file

  • live_photo (object | None) – Message is a live photo, information about the live photo

  • paid_media – Message contains paid media; information about the paid media

  • photo (object | None) – Message is a photo, available sizes of the photo

  • sticker (object | None) – Message is a sticker, information about the sticker

  • story (object | None) – Message is a forwarded story

  • video (object | None) – Message is a video, information about the video

  • video_note (object | None) – Message is a video note, information about the video message

  • voice (object | None) – Message is a voice message, information about the file

  • has_media_spoiler (bool | None) – True, if the message media is covered by a spoiler animation

  • checklist – Message is a checklist

  • contact (object | None) – Message is a shared contact, information about the contact

  • dice (object | None) – Message is a dice with random value

  • game (object | None) – Message is a game, information about the game.

  • giveaway (object | None) – Message is a scheduled giveaway, information about the giveaway

  • giveaway_winners (object | None) – A giveaway with public winners was completed

  • invoice (object | None) – Message is an invoice for a payment, information about the invoice.

  • location (object | None) – Message is a shared location, information about the location

  • poll (object | None) – Message is a native poll, information about the poll

  • venue (object | None) – Message is a venue, information about the venue

animation: object | None = None
audio: object | None = None
chat: Chat | None = None
contact: object | None = None
dice: object | None = None
document: object | None = None
classmethod from_dict(data: dict | None) ExternalReplyInfo | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

game: object | None = None
giveaway: object | None = None
giveaway_winners: object | None = None
has_media_spoiler: bool | None = None
invoice: object | None = None
live_photo: object | None = None
location: object | None = None
message_id: int | None = None
origin: object | None = None
photo: object | None = None
poll: object | None = None
quote: TextQuote | None = None
sticker: object | None = None
story: object | None = None
venue: object | None = None
video: object | None = None
video_note: object | None = None
voice: object | None = None
class peyk.platforms.telegram.types.File(file_id: str, file_unique_id: str, file_size: int | None = None, file_path: str | None = None)[source]

Bases: object

This object represents a file ready to be downloaded. The file can be downloaded via the link https://api.telegram.org/file/bot/. It is guaranteed that the link will be valid for at least 1 hour. When the link expires, a new one can be requested by calling getFile. The maximum file size to download is 20 MB

Variables:
  • file_id (str) – Identifier for this file, which can be used to download or reuse the file

  • file_unique_id (str) – Unique identifier for this file, which is supposed to be the same over time and for different bots. Can’t be used to download or reuse the file.

  • file_size (int | None) – File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.

  • file_path (str | None) – File path. Use https://api.telegram.org/file/bot/ to get the file.

file_path: str | None = None
file_size: int | None = None
classmethod from_dict(data: dict | None) File | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

file_id: str
file_unique_id: str
class peyk.platforms.telegram.types.ForceReply(force_reply: bool = True, input_field_placeholder: str | None = None, selective: bool | None = None)[source]

Bases: object

Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot’s message and tapped ‘Reply’). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode. Not supported in channels and for messages sent on behalf of a user account. Example: A poll bot for groups runs in privacy mode (only receives commands, replies to its messages and mentions). There could be two ways to create a new poll:

Explain the user how to send a command with parameters (e.g. /newpoll question answer1 answer2). May be appealing for hardcore users but lacks modern day polish. Guide the user through a step-by-step process. ‘Please send me your question’, ‘Cool, now let’s add the first answer option’, ‘Great. Keep adding answer options, then send /done when you’re ready’. The last option is definitely more attractive. And if you use ForceReply in your bot’s questions, it will receive the user’s answers even if it only receives replies, commands and mentions - without any extra work for the user.

Variables:
  • force_reply (bool) – Shows reply interface to the user, as if they manually selected the bot’s message and tapped ‘Reply’

  • input_field_placeholder (str | None) – The placeholder to be shown in the input field when the reply is active; 1-64 characters

  • selective (bool | None) – Use this parameter if you want to force reply from specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot’s message is a reply to a message in the same chat and forum topic, sender of the original message.

force_reply: bool = True
classmethod from_dict(data: dict | None) ForceReply | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

input_field_placeholder: str | None = None
selective: bool | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.ForumTopic(message_thread_id: int, name: str, icon_color: int | None = None, icon_custom_emoji_id: str | None = None, is_name_implicit: bool | None = None)[source]

Bases: object

This object represents a forum topic.

Variables:
  • message_thread_id (int) – Unique identifier of the forum topic

  • name (str) – Name of the topic

  • icon_color (int | None) – Color of the topic icon in RGB format

  • icon_custom_emoji_id (str | None) – Unique identifier of the custom emoji shown as the topic icon

  • is_name_implicit (bool | None) – True, if the name of the topic wasn’t specified explicitly by its creator and likely needs to be changed by the bot

classmethod from_dict(data: dict | None) ForumTopic | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

icon_color: int | None = None
icon_custom_emoji_id: str | None = None
is_name_implicit: bool | None = None
message_thread_id: int
name: str
class peyk.platforms.telegram.types.ForumTopicClosed[source]

Bases: object

ForumTopicClosed Telegram Bot API type.

classmethod from_dict(data: dict | None) ForumTopicClosed | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.ForumTopicCreated(name: str = '', icon_color: int | None = None, icon_custom_emoji_id: str | None = None, is_name_implicit: bool | None = None)[source]

Bases: object

This object represents a service message about a new forum topic created in the chat.

Variables:
  • name (str) – Name of the topic

  • icon_color (int | None) – Color of the topic icon in RGB format

  • icon_custom_emoji_id (str | None) – Unique identifier of the custom emoji shown as the topic icon

  • is_name_implicit (bool | None) – True, if the name of the topic wasn’t specified explicitly by its creator and likely needs to be changed by the bot

classmethod from_dict(data: dict | None) ForumTopicCreated | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

icon_color: int | None = None
icon_custom_emoji_id: str | None = None
is_name_implicit: bool | None = None
name: str = ''
class peyk.platforms.telegram.types.ForumTopicEdited(name: str | None = None, icon_custom_emoji_id: str | None = None)[source]

Bases: object

This object represents a service message about an edited forum topic.

Variables:
  • name (str | None) – New name of the topic, if it was edited

  • icon_custom_emoji_id (str | None) – New identifier of the custom emoji shown as the topic icon, if it was edited; an empty string if the icon was removed

classmethod from_dict(data: dict | None) ForumTopicEdited | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

icon_custom_emoji_id: str | None = None
name: str | None = None
class peyk.platforms.telegram.types.ForumTopicReopened[source]

Bases: object

ForumTopicReopened Telegram Bot API type.

classmethod from_dict(data: dict | None) ForumTopicReopened | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.Game(title: str, description: str, photo: List[PhotoSize], text: str | None = None, text_entities: List[MessageEntity] | None = None, animation: Animation | None = None)[source]

Bases: object

This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers.

Variables:
  • title (str) – Title of the game

  • description (str) – Description of the game

  • photo (List[peyk.platforms.telegram.types.photo_size.PhotoSize]) – Photo that will be displayed in the game message in chats

  • text (str | None) – Brief description of the game or high scores included in the game message. Can be automatically edited to include current high scores for the game when the bot calls setGameScore, or manually edited using editMessageText. 0-4096 characters.

  • text_entities (List[peyk.platforms.telegram.types.message_entity.MessageEntity] | None) – Special entities that appear in text, such as usernames, URLs, bot commands, etc.

  • animation (peyk.platforms.telegram.types.animation.Animation | None) – Animation that will be displayed in the game message in chats. Upload via BotFather.

animation: Animation | None = None
classmethod from_dict(data: dict | None) Game | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

text: str | None = None
text_entities: List[MessageEntity] | None = None
title: str
description: str
photo: List[PhotoSize]
class peyk.platforms.telegram.types.GameHighScore(position: int, user: User, score: int)[source]

Bases: object

This object represents one row of the high scores table for a game. And that’s about all we’ve got for now. If you’ve got any questions, please check out our Bot FAQ

Variables:
classmethod from_dict(data: dict | None) GameHighScore | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

position: int
user: User
score: int
class peyk.platforms.telegram.types.GeneralForumTopicHidden[source]

Bases: object

GeneralForumTopicHidden Telegram Bot API type.

classmethod from_dict(data: dict | None) GeneralForumTopicHidden | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.GeneralForumTopicUnhidden[source]

Bases: object

GeneralForumTopicUnhidden Telegram Bot API type.

classmethod from_dict(data: dict | None) GeneralForumTopicUnhidden | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.Gift(id: str, sticker: Sticker, star_count: int, upgrade_star_count: int | None = None, is_premium: bool | None = None, has_colors: bool | None = None, total_count: int | None = None, remaining_count: int | None = None, personal_total_count: int | None = None, personal_remaining_count: int | None = None, background: GiftBackground | None = None, unique_gift_variant_count: int | None = None, publisher_chat: Chat | None = None)[source]

Bases: object

This object represents a gift that can be sent by the bot.

Variables:
  • id (str) – Unique identifier of the gift

  • sticker (peyk.platforms.telegram.types.sticker.Sticker) – The sticker that represents the gift

  • star_count (int) – The number of Telegram Stars that must be paid to send the sticker

  • upgrade_star_count (int | None) – The number of Telegram Stars that must be paid to upgrade the gift to a unique one

  • is_premium (bool | None) – True, if the gift can only be purchased by Telegram Premium subscribers

  • has_colors (bool | None) – True, if the gift can be used (after being upgraded) to customize a user’s appearance

  • total_count (int | None) – The total number of gifts of this type that can be sent by all users; for limited gifts only

  • remaining_count (int | None) – The number of remaining gifts of this type that can be sent by all users; for limited gifts only

  • personal_total_count (int | None) – The total number of gifts of this type that can be sent by the bot; for limited gifts only

  • personal_remaining_count (int | None) – The number of remaining gifts of this type that can be sent by the bot; for limited gifts only

  • background (peyk.platforms.telegram.types.gift_background.GiftBackground | None) – Background of the gift

  • unique_gift_variant_count (int | None) – The total number of different unique gifts that can be obtained by upgrading the gift

  • publisher_chat (peyk.platforms.telegram.types.chat.Chat | None) – Information about the chat that published the gift

background: GiftBackground | None = None
classmethod from_dict(data: dict | None) Gift | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

has_colors: bool | None = None
is_premium: bool | None = None
personal_remaining_count: int | None = None
personal_total_count: int | None = None
publisher_chat: Chat | None = None
remaining_count: int | None = None
total_count: int | None = None
unique_gift_variant_count: int | None = None
upgrade_star_count: int | None = None
id: str
sticker: Sticker
star_count: int
class peyk.platforms.telegram.types.GiftBackground(name: str = '', center_color: int = 0, edge_color: int = 0, symbol_color: int = 0, text_color: int = 0)[source]

Bases: object

This object describes the background of a gift.

Variables:
  • center_color (int) – Center color of the background in RGB format

  • edge_color (int) – Edge color of the background in RGB format

  • text_color (int) – Text color of the background in RGB format

center_color: int = 0
edge_color: int = 0
classmethod from_dict(data: dict | None) GiftBackground | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

name: str = ''
symbol_color: int = 0
text_color: int = 0
class peyk.platforms.telegram.types.GiftInfo(gift: Gift | None = None, owned_gift_id: str | None = None, convert_star_count: int | None = None, upgrade_star_count: int | None = None, can_be_upgraded: bool | None = None, is_saved: bool | None = None, is_pinned: bool | None = None, is_private: bool | None = None, is_saved_in_chat: bool | None = None, can_be_refunded: bool | None = None, upgraded_gift: object | None = None, date: int | None = None, send_date: int | None = None, last_reservation_date: int | None = None)[source]

Bases: object

Describes a service message about a regular gift that was sent or received.

Variables:
  • gift (peyk.platforms.telegram.types.gift.Gift | None) – Information about the gift

  • owned_gift_id (str | None) – Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts

  • convert_star_count (int | None) – Number of Telegram Stars that can be claimed by the receiver by converting the gift; omitted if conversion to Telegram Stars is impossible

  • prepaid_upgrade_star_count – Number of Telegram Stars that were prepaid for the ability to upgrade the gift

  • is_upgrade_separate – True, if the gift’s upgrade was purchased after the gift was sent

  • can_be_upgraded (bool | None) – True, if the gift can be upgraded to a unique gift

  • text – Text of the message that was added to the gift

  • entities – Special entities that appear in the text

  • is_private (bool | None) – True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them

  • unique_gift_number – Unique number reserved for this gift when upgraded. See the number field in UniqueGift.

can_be_refunded: bool | None = None
can_be_upgraded: bool | None = None
convert_star_count: int | None = None
date: int | None = None
classmethod from_dict(data: dict | None) GiftInfo | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

gift: Gift | None = None
is_pinned: bool | None = None
is_private: bool | None = None
is_saved: bool | None = None
is_saved_in_chat: bool | None = None
last_reservation_date: int | None = None
owned_gift_id: str | None = None
send_date: int | None = None
upgrade_star_count: int | None = None
upgraded_gift: object | None = None
class peyk.platforms.telegram.types.Gifts(gifts: List[Gift])[source]

Bases: object

This object represent a list of gifts.

Variables:

gifts (List[peyk.platforms.telegram.types.gift.Gift]) – The list of gifts

classmethod from_dict(data: dict | None) Gifts | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

gifts: List[Gift]
class peyk.platforms.telegram.types.Giveaway(chats: List[Chat], winners_selection_date: int, winner_count: int, only_new_members: bool | None = None, has_public_winners: bool | None = None, prize_description: str | None = None, country_codes: List[str] | None = None, prize_star_count: int | None = None, premium_subscription_month_count: int | None = None)[source]

Bases: object

This object represents a message about a scheduled giveaway.

Variables:
  • chats (List[peyk.platforms.telegram.types.chat.Chat]) – The list of chats which the user must join to participate in the giveaway

  • winners_selection_date (int) – Point in time (Unix timestamp) when winners of the giveaway will be selected

  • winner_count (int) – The number of users which are supposed to be selected as winners of the giveaway

  • only_new_members (bool | None) – True, if only users who join the chats after the giveaway started should be eligible to win

  • has_public_winners (bool | None) – True, if the list of giveaway winners will be visible to everyone

  • prize_description (str | None) – Description of additional giveaway prize

  • country_codes (List[str] | None) – A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which eligible users for the giveaway must come. If empty, then all users can participate in the giveaway. Users with a phone number that was bought on Fragment can always participate in giveaways.

  • prize_star_count (int | None) – The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only

  • premium_subscription_month_count (int | None) – The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only

country_codes: List[str] | None = None
classmethod from_dict(data: dict | None) Giveaway | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

has_public_winners: bool | None = None
only_new_members: bool | None = None
premium_subscription_month_count: int | None = None
prize_description: str | None = None
prize_star_count: int | None = None
chats: List[Chat]
winners_selection_date: int
winner_count: int
class peyk.platforms.telegram.types.GiveawayCompleted(winner_count: int, unclaimed_prize_count: int | None = None, giveaway_message: Message | None = None, is_star_giveaway: bool | None = None)[source]

Bases: object

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

Variables:
  • winner_count (int) – Number of winners in the giveaway

  • unclaimed_prize_count (int | None) – Number of undistributed prizes

  • giveaway_message (peyk.platforms.telegram.types.message.Message | None) – Message with the giveaway that was completed, if it wasn’t deleted

  • is_star_giveaway (bool | None) – True, if the giveaway is a Telegram Star giveaway. Otherwise, currently, the giveaway is a Telegram Premium giveaway.

classmethod from_dict(data)
giveaway_message: Message | None = None
giveaway_message_id = None
is_star_giveaway: bool | None = None
unclaimed_prize_count: int | None = None
winner_count: int
class peyk.platforms.telegram.types.GiveawayCreated(prize_star_count: int | None = None)[source]

Bases: object

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

Variables:

prize_star_count (int | None) – The number of Telegram Stars to be split between giveaway winners; for Telegram Star giveaways only

classmethod from_dict(data: dict | None) GiveawayCreated | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

prize_star_count: int | None = None
class peyk.platforms.telegram.types.GiveawayWinners(chat: Chat, giveaway_message_id: int, winners_selection_date: int, winner_count: int, winners: List[User], additional_chat_count: int | None = None, prize_star_count: int | None = None, premium_subscription_month_count: int | None = None, unclaimed_prize_count: int | None = None, only_new_members: bool | None = None, was_refunded: bool | None = None, prize_description: str | None = None)[source]

Bases: object

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

Variables:
  • chat (peyk.platforms.telegram.types.chat.Chat) – The chat that created the giveaway

  • giveaway_message_id (int) – Identifier of the message with the giveaway in the chat

  • winners_selection_date (int) – Point in time (Unix timestamp) when winners of the giveaway were selected

  • winner_count (int) – Total number of winners in the giveaway

  • winners (List[peyk.platforms.telegram.types.user.User]) – List of up to 100 winners of the giveaway

  • additional_chat_count (int | None) – The number of other chats the user had to join in order to be eligible for the giveaway

  • prize_star_count (int | None) – The number of Telegram Stars that were split between giveaway winners; for Telegram Star giveaways only

  • premium_subscription_month_count (int | None) – The number of months the Telegram Premium subscription won from the giveaway will be active for; for Telegram Premium giveaways only

  • unclaimed_prize_count (int | None) – Number of undistributed prizes

  • only_new_members (bool | None) – True, if only users who had joined the chats after the giveaway started were eligible to win

  • was_refunded (bool | None) – True, if the giveaway was canceled because the payment for it was refunded

  • prize_description (str | None) – Description of additional giveaway prize

additional_chat_count: int | None = None
classmethod from_dict(data: dict | None) GiveawayWinners | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

only_new_members: bool | None = None
premium_subscription_month_count: int | None = None
prize_description: str | None = None
prize_star_count: int | None = None
unclaimed_prize_count: int | None = None
was_refunded: bool | None = None
chat: Chat
giveaway_message_id: int
winners_selection_date: int
winner_count: int
winners: List[User]
class peyk.platforms.telegram.types.InaccessibleMessage(chat: Chat, message_id: int, date: int = 0)[source]

Bases: object

This object describes a message that was deleted or is otherwise inaccessible to the bot.

Variables:
  • chat (peyk.platforms.telegram.types.chat.Chat) – Chat the message belonged to

  • message_id (int) – Unique message identifier inside the chat

  • date (int) – Always 0. The field can be used to differentiate regular and inaccessible messages.

date: int = 0
classmethod from_dict(data: dict | None) InaccessibleMessage | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

chat: Chat
message_id: int
class peyk.platforms.telegram.types.InlineKeyboardButton(text: str = '', icon_custom_emoji_id: str | None = None, style: str | None = None, url: str | None = None, callback_data: str | None = None, web_app: WebAppInfo | None = None, login_url: LoginUrl | None = None, switch_inline_query: str | None = None, switch_inline_query_current_chat: str | None = None, switch_inline_query_chosen_chat: SwitchInlineQueryChosenChat | None = None, copy_text: CopyTextButton | None = None, callback_game: CallbackGame | None = None, pay: bool | None = None, disabled: DisabledButton | None = None)[source]

Bases: object

This object represents one button of an inline keyboard. Exactly one of the fields other than text, icon_custom_emoji_id, and style must be used to specify the type of the button.

Variables:
  • text (str) – Label text on the button

  • icon_custom_emoji_id (str | None) – Unique identifier of the custom emoji shown before the text of the button. Can only be used by bots that purchased additional usernames on Fragment or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription.

  • style (str | None) – Style of the button. Must be one of ‘danger’ (red), ‘success’ (green) or ‘primary’ (blue). If omitted, then an app-specific style is used.

  • url (str | None) – HTTP or tg:// URL to be opened when the button is pressed. Links tg://user?id= can be used to mention a user by their identifier without using a username, if this is allowed by their privacy settings.

  • callback_data (str | None) – Data to be sent in a callback query to the bot when the button is pressed, 1-64 bytes

  • web_app (peyk.platforms.telegram.types.web_app_info.WebAppInfo | None) – Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot. Not supported for messages sent on behalf of a business account.

  • login_url (peyk.platforms.telegram.types.login_url.LoginUrl | None) – An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget.

  • switch_inline_query (str | None) – If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot’s username and the specified inline query in the input field. May be empty, in which case just the bot’s username will be inserted. Not supported for messages sent in channel direct messages chats and on behalf of a business account.

  • switch_inline_query_current_chat (str | None) – If set, pressing the button will insert the bot’s username and the specified inline query in the current chat’s input field. May be empty, in which case only the bot’s username will be inserted.

This offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting something from multiple options. Not supported in channels and for messages sent in channel direct messages chats and on behalf of a business account.

switch_inline_query_chosen_chat: If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot’s username and the specified inline query in the input field. Not supported for messages sent in channel direct messages chats and on behalf of a business account. copy_text: Description of the button that copies the specified text to the clipboard callback_game: Description of the game that will be launched when the user presses the button.

NOTE: This type of button must always be the first button in the first row.

pay: Specify True, to send a Pay button. Substrings ‘’ and ‘XTR’ in the buttons’s text will be replaced with a Telegram Star icon.

NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages.

callback_data: str | None = None
callback_game: CallbackGame | None = None
copy_text: CopyTextButton | None = None
disabled: DisabledButton | None = None
classmethod from_dict(data: dict | None) InlineKeyboardButton | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

icon_custom_emoji_id: str | None = None
login_url: LoginUrl | None = None
pay: bool | None = None
style: str | None = None
switch_inline_query: str | None = None
switch_inline_query_chosen_chat: SwitchInlineQueryChosenChat | None = None
switch_inline_query_current_chat: str | None = None
text: str = ''
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

url: str | None = None
web_app: WebAppInfo | None = None
class peyk.platforms.telegram.types.InlineKeyboardMarkup(inline_keyboard: ~typing.List[~typing.List[~peyk.platforms.telegram.types.inline_keyboard_button.InlineKeyboardButton]] = <factory>)[source]

Bases: object

This object represents an inline keyboard that appears right next to the message it belongs to.

Variables:

inline_keyboard (List[List[peyk.platforms.telegram.types.inline_keyboard_button.InlineKeyboardButton]]) – Array of button rows, each represented by an Array of InlineKeyboardButton objects

classmethod from_dict(data: dict | None) InlineKeyboardMarkup | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

inline_keyboard: List[List[InlineKeyboardButton]]
class peyk.platforms.telegram.types.InlineQuery(id: str, from_: User | None = None, query: str = '', offset: str = '', chat_type: str | None = None, location: Location | None = None, bot: 'Bot[object]' | None = None)[source]

Bases: object

This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results.

Variables:
  • id (str) – Unique identifier for this query

  • from – Sender

  • query (str) – Text of the query (up to 256 characters)

  • offset (str) – Offset of the results to be returned, can be controlled by the bot

  • chat_type (Optional[str]) – Type of the chat from which the inline query was sent. Can be either ‘sender’ for a private chat with the inline query sender, ‘private’, ‘group’, ‘supergroup’, or ‘channel’. The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat.

  • location (Optional[Location]) – Sender location, only for bots that request user location

async answer(results: Sequence[InlineQueryResultArticle | InlineQueryResultPhoto | InlineQueryResultGif | InlineQueryResultMpeg4Gif | InlineQueryResultVideo | InlineQueryResultAudio | InlineQueryResultVoice | InlineQueryResultDocument | InlineQueryResultLocation | InlineQueryResultVenue | InlineQueryResultContact | InlineQueryResultGame | InlineQueryResultCachedPhoto | InlineQueryResultCachedGif | InlineQueryResultCachedMpeg4Gif | InlineQueryResultCachedSticker | InlineQueryResultCachedDocument | InlineQueryResultCachedVideo | InlineQueryResultCachedVoice | InlineQueryResultCachedAudio | Mapping[str, object]], *, cache_time: int | None = None, is_personal: bool | None = None, next_offset: str | None = None, button: object | None = None) bool[source]

Answer this inline query through the bot injected by the dispatcher.

bot: 'Bot[object]' | None = None
chat_type: str | None = None
from_: User | None = None
classmethod from_dict(data: dict | None) InlineQuery | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

location: Location | None = None
offset: str = ''
query: str = ''
id: str
class peyk.platforms.telegram.types.InlineQueryResultArticle(id: str, title: str, input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object], type: str = 'article', reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None, url: str | None = None, description: str | None = None, thumbnail_url: str | None = None, thumbnail_width: int | None = None, thumbnail_height: int | None = None)[source]

Bases: object

Represents a link to an article or web page.

Variables:
description: str | None = None
reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None
thumbnail_height: int | None = None
thumbnail_url: str | None = None
thumbnail_width: int | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

type: str = 'article'
url: str | None = None
id: str
title: str
input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object]
class peyk.platforms.telegram.types.InlineQueryResultAudio(id: str, audio_url: str, title: str, type: str = 'audio', caption: str | None = None, parse_mode: str | None = None, caption_entities: Sequence[MessageEntity | Mapping[str, object]] | None = None, performer: str | None = None, audio_duration: int | None = None, reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None, input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object] | None = None)[source]

Bases: object

Represents a link to an MP3 audio file. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio.

Variables:
audio_duration: int | None = None
caption: str | None = None
caption_entities: Sequence[MessageEntity | Mapping[str, object]] | None = None
input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object] | None = None
parse_mode: str | None = None
performer: str | None = None
reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

type: str = 'audio'
id: str
audio_url: str
title: str
class peyk.platforms.telegram.types.InlineQueryResultCachedAudio(id: str, audio_file_id: str, type: str = 'audio', caption: str | None = None, parse_mode: str | None = None, caption_entities: Sequence[MessageEntity | Mapping[str, object]] | None = None, reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None, input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object] | None = None)[source]

Bases: object

Represents a link to an MP3 audio file stored on the Telegram servers. By default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the audio.

Variables:
caption: str | None = None
caption_entities: Sequence[MessageEntity | Mapping[str, object]] | None = None
input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object] | None = None
parse_mode: str | None = None
reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

type: str = 'audio'
id: str
audio_file_id: str
class peyk.platforms.telegram.types.InlineQueryResultCachedDocument(id: str, title: str, document_file_id: str, type: str = 'document', description: str | None = None, caption: str | None = None, parse_mode: str | None = None, caption_entities: Sequence[MessageEntity | Mapping[str, object]] | None = None, reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None, input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object] | None = None)[source]

Bases: object

Represents a link to a file stored on the Telegram servers. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file.

Variables:
caption: str | None = None
caption_entities: Sequence[MessageEntity | Mapping[str, object]] | None = None
description: str | None = None
input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object] | None = None
parse_mode: str | None = None
reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

type: str = 'document'
id: str
title: str
document_file_id: str
class peyk.platforms.telegram.types.InlineQueryResultCachedGif(id: str, gif_file_id: str, type: str = 'gif', title: str | None = None, caption: str | None = None, parse_mode: str | None = None, caption_entities: Sequence[MessageEntity | Mapping[str, object]] | None = None, show_caption_above_media: bool | None = None, reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None, input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object] | None = None)[source]

Bases: object

Represents a link to an animated GIF file stored on the Telegram servers. By default, this animated GIF file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with specified content instead of the animation.

Variables:
caption: str | None = None
caption_entities: Sequence[MessageEntity | Mapping[str, object]] | None = None
input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object] | None = None
parse_mode: str | None = None
reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None
show_caption_above_media: bool | None = None
title: str | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

type: str = 'gif'
id: str
gif_file_id: str
class peyk.platforms.telegram.types.InlineQueryResultCachedMpeg4Gif(id: str, mpeg4_file_id: str, type: str = 'mpeg4_gif', title: str | None = None, caption: str | None = None, parse_mode: str | None = None, caption_entities: Sequence[MessageEntity | Mapping[str, object]] | None = None, show_caption_above_media: bool | None = None, reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None, input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object] | None = None)[source]

Bases: object

Represents a link to a video animation (H.264/MPEG-4 AVC video without sound) stored on the Telegram servers. By default, this animated MPEG-4 file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.

Variables:
caption: str | None = None
caption_entities: Sequence[MessageEntity | Mapping[str, object]] | None = None
input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object] | None = None
parse_mode: str | None = None
reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None
show_caption_above_media: bool | None = None
title: str | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

type: str = 'mpeg4_gif'
id: str
mpeg4_file_id: str
class peyk.platforms.telegram.types.InlineQueryResultCachedPhoto(id: str, photo_file_id: str, type: str = 'photo', title: str | None = None, description: str | None = None, caption: str | None = None, parse_mode: str | None = None, caption_entities: Sequence[MessageEntity | Mapping[str, object]] | None = None, show_caption_above_media: bool | None = None, reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None, input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object] | None = None)[source]

Bases: object

Represents a link to a photo stored on the Telegram servers. By default, this photo will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo.

Variables:
caption: str | None = None
caption_entities: Sequence[MessageEntity | Mapping[str, object]] | None = None
description: str | None = None
input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object] | None = None
parse_mode: str | None = None
reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None
show_caption_above_media: bool | None = None
title: str | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

type: str = 'photo'
id: str
photo_file_id: str
class peyk.platforms.telegram.types.InlineQueryResultCachedSticker(id: str, sticker_file_id: str, type: str = 'sticker', reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None, input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object] | None = None)[source]

Bases: object

Represents a link to a sticker stored on the Telegram servers. By default, this sticker will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the sticker.

Variables:
input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object] | None = None
reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

type: str = 'sticker'
id: str
sticker_file_id: str
class peyk.platforms.telegram.types.InlineQueryResultCachedVideo(id: str, video_file_id: str, title: str, type: str = 'video', description: str | None = None, caption: str | None = None, parse_mode: str | None = None, caption_entities: Sequence[MessageEntity | Mapping[str, object]] | None = None, show_caption_above_media: bool | None = None, reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None, input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object] | None = None)[source]

Bases: object

Represents a link to a video file stored on the Telegram servers. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video.

Variables:
caption: str | None = None
caption_entities: Sequence[MessageEntity | Mapping[str, object]] | None = None
description: str | None = None
input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object] | None = None
parse_mode: str | None = None
reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None
show_caption_above_media: bool | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

type: str = 'video'
id: str
video_file_id: str
title: str
class peyk.platforms.telegram.types.InlineQueryResultCachedVoice(id: str, voice_file_id: str, title: str, type: str = 'voice', caption: str | None = None, parse_mode: str | None = None, caption_entities: Sequence[MessageEntity | Mapping[str, object]] | None = None, reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None, input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object] | None = None)[source]

Bases: object

Represents a link to a voice message stored on the Telegram servers. By default, this voice message will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the voice message.

Variables:
caption: str | None = None
caption_entities: Sequence[MessageEntity | Mapping[str, object]] | None = None
input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object] | None = None
parse_mode: str | None = None
reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

type: str = 'voice'
id: str
voice_file_id: str
title: str
class peyk.platforms.telegram.types.InlineQueryResultContact(id: str, phone_number: str, first_name: str, type: str = 'contact', last_name: str | None = None, vcard: str | None = None, reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None, input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object] | None = None, thumbnail_url: str | None = None, thumbnail_width: int | None = None, thumbnail_height: int | None = None)[source]

Bases: object

Represents a contact with a phone number. By default, this contact will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the contact.

Variables:
input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object] | None = None
last_name: str | None = None
reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None
thumbnail_height: int | None = None
thumbnail_url: str | None = None
thumbnail_width: int | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

type: str = 'contact'
vcard: str | None = None
id: str
phone_number: str
first_name: str
class peyk.platforms.telegram.types.InlineQueryResultDocument(id: str, title: str, document_url: str, mime_type: str, type: str = 'document', caption: str | None = None, parse_mode: str | None = None, caption_entities: Sequence[MessageEntity | Mapping[str, object]] | None = None, description: str | None = None, reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None, input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object] | None = None, thumbnail_url: str | None = None, thumbnail_width: int | None = None, thumbnail_height: int | None = None)[source]

Bases: object

Represents a link to a file. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file. Currently, only .PDF and .ZIP files can be sent using this method.

Variables:
caption: str | None = None
caption_entities: Sequence[MessageEntity | Mapping[str, object]] | None = None
description: str | None = None
input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object] | None = None
parse_mode: str | None = None
reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None
thumbnail_height: int | None = None
thumbnail_url: str | None = None
thumbnail_width: int | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

type: str = 'document'
id: str
title: str
document_url: str
mime_type: str
class peyk.platforms.telegram.types.InlineQueryResultGame(id: str, game_short_name: str, type: str = 'game', reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None)[source]

Bases: object

Represents a Game.

Variables:
reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

type: str = 'game'
id: str
game_short_name: str
class peyk.platforms.telegram.types.InlineQueryResultGif(id: str, gif_url: str, thumbnail_url: str, type: str = 'gif', gif_width: int | None = None, gif_height: int | None = None, gif_duration: int | None = None, thumbnail_mime_type: str | None = None, title: str | None = None, caption: str | None = None, parse_mode: str | None = None, caption_entities: Sequence[MessageEntity | Mapping[str, object]] | None = None, show_caption_above_media: bool | None = None, reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None, input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object] | None = None)[source]

Bases: object

Represents a link to an animated GIF file. By default, this animated GIF file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.

Variables:
caption: str | None = None
caption_entities: Sequence[MessageEntity | Mapping[str, object]] | None = None
gif_duration: int | None = None
gif_height: int | None = None
gif_width: int | None = None
input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object] | None = None
parse_mode: str | None = None
reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None
show_caption_above_media: bool | None = None
thumbnail_mime_type: str | None = None
title: str | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

type: str = 'gif'
id: str
gif_url: str
thumbnail_url: str
class peyk.platforms.telegram.types.InlineQueryResultLocation(id: str, latitude: float, longitude: float, title: str, type: str = 'location', horizontal_accuracy: float | None = None, live_period: int | None = None, heading: int | None = None, proximity_alert_radius: int | None = None, reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None, input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object] | None = None, thumbnail_url: str | None = None, thumbnail_width: int | None = None, thumbnail_height: int | None = None)[source]

Bases: object

Represents a location on a map. By default, the location will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the location.

Variables:
heading: int | None = None
horizontal_accuracy: float | None = None
input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object] | None = None
live_period: int | None = None
proximity_alert_radius: int | None = None
reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None
thumbnail_height: int | None = None
thumbnail_url: str | None = None
thumbnail_width: int | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

type: str = 'location'
id: str
latitude: float
longitude: float
title: str
class peyk.platforms.telegram.types.InlineQueryResultMpeg4Gif(id: str, mpeg4_url: str, thumbnail_url: str, type: str = 'mpeg4_gif', mpeg4_width: int | None = None, mpeg4_height: int | None = None, mpeg4_duration: int | None = None, thumbnail_mime_type: str | None = None, title: str | None = None, caption: str | None = None, parse_mode: str | None = None, caption_entities: Sequence[MessageEntity | Mapping[str, object]] | None = None, show_caption_above_media: bool | None = None, reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None, input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object] | None = None)[source]

Bases: object

Represents a link to a video animation (H.264/MPEG-4 AVC video without sound). By default, this animated MPEG-4 file will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the animation.

Variables:
caption: str | None = None
caption_entities: Sequence[MessageEntity | Mapping[str, object]] | None = None
input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object] | None = None
mpeg4_duration: int | None = None
mpeg4_height: int | None = None
mpeg4_width: int | None = None
parse_mode: str | None = None
reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None
show_caption_above_media: bool | None = None
thumbnail_mime_type: str | None = None
title: str | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

type: str = 'mpeg4_gif'
id: str
mpeg4_url: str
thumbnail_url: str
class peyk.platforms.telegram.types.InlineQueryResultPhoto(id: str, photo_url: str, thumbnail_url: str, type: str = 'photo', photo_width: int | None = None, photo_height: int | None = None, title: str | None = None, description: str | None = None, caption: str | None = None, parse_mode: str | None = None, caption_entities: Sequence[MessageEntity | Mapping[str, object]] | None = None, show_caption_above_media: bool | None = None, reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None, input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object] | None = None)[source]

Bases: object

Represents a link to a photo. By default, this photo will be sent by the user with optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the photo.

Variables:
caption: str | None = None
caption_entities: Sequence[MessageEntity | Mapping[str, object]] | None = None
description: str | None = None
input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object] | None = None
parse_mode: str | None = None
photo_height: int | None = None
photo_width: int | None = None
reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None
show_caption_above_media: bool | None = None
title: str | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

type: str = 'photo'
id: str
photo_url: str
thumbnail_url: str
class peyk.platforms.telegram.types.InlineQueryResultVenue(id: str, latitude: float, longitude: float, title: str, address: str, type: str = 'venue', foursquare_id: str | None = None, foursquare_type: str | None = None, google_place_id: str | None = None, google_place_type: str | None = None, reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None, input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object] | None = None, thumbnail_url: str | None = None, thumbnail_width: int | None = None, thumbnail_height: int | None = None)[source]

Bases: object

Represents a venue. By default, the venue will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the venue.

Variables:
foursquare_id: str | None = None
foursquare_type: str | None = None
google_place_id: str | None = None
google_place_type: str | None = None
input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object] | None = None
reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None
thumbnail_height: int | None = None
thumbnail_url: str | None = None
thumbnail_width: int | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

type: str = 'venue'
id: str
latitude: float
longitude: float
title: str
address: str
class peyk.platforms.telegram.types.InlineQueryResultVideo(id: str, video_url: str, mime_type: str, thumbnail_url: str, title: str, type: str = 'video', caption: str | None = None, parse_mode: str | None = None, caption_entities: Sequence[MessageEntity | Mapping[str, object]] | None = None, show_caption_above_media: bool | None = None, video_width: int | None = None, video_height: int | None = None, video_duration: int | None = None, description: str | None = None, reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None, input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object] | None = None)[source]

Bases: object

Represents a link to a page containing an embedded video player or a video file. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video. If an InlineQueryResultVideo message contains an embedded video (e.g., YouTube), you must replace its content using input_message_content.

Variables:
caption: str | None = None
caption_entities: Sequence[MessageEntity | Mapping[str, object]] | None = None
description: str | None = None
input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object] | None = None
parse_mode: str | None = None
reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None
show_caption_above_media: bool | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

type: str = 'video'
video_duration: int | None = None
video_height: int | None = None
video_width: int | None = None
id: str
video_url: str
mime_type: str
thumbnail_url: str
title: str
class peyk.platforms.telegram.types.InlineQueryResultVoice(id: str, voice_url: str, title: str, type: str = 'voice', caption: str | None = None, parse_mode: str | None = None, caption_entities: Sequence[MessageEntity | Mapping[str, object]] | None = None, voice_duration: int | None = None, reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None, input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object] | None = None)[source]

Bases: object

Represents a link to a voice recording in an .OGG container encoded with OPUS. By default, this voice recording will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the the voice message.

Variables:
caption: str | None = None
caption_entities: Sequence[MessageEntity | Mapping[str, object]] | None = None
input_message_content: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object] | None = None
parse_mode: str | None = None
reply_markup: InlineKeyboardMarkup | Mapping[str, object] | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

type: str = 'voice'
voice_duration: int | None = None
id: str
voice_url: str
title: str
class peyk.platforms.telegram.types.InlineQueryResultsButton(text: str, web_app: WebAppInfo | Mapping[str, object] | None = None, start_parameter: str | None = None)[source]

Bases: object

This object represents a button to be shown above inline query results. You must use exactly one of the optional fields.

Variables:
  • text (str) – Label text on the button

  • web_app (peyk.platforms.telegram.types.web_app_info.WebAppInfo | Mapping[str, object] | None) – Description of the Web App that will be launched when the user presses the button. The Web App will be able to switch back to the inline mode using the method switchInlineQuery inside the Web App.

  • start_parameter (str | None) – Deep-linking parameter for the /start message sent to the bot when a user presses the button. 1-64 characters, only A-Z, a-z, 0-9, _ and - are allowed.

Example: An inline bot that sends YouTube videos can ask the user to connect the bot to their YouTube account to adapt search results accordingly. To do this, it displays a ‘Connect your YouTube account’ button above the results, or even before showing any. The user presses the button, switches to a private chat with the bot and, in doing so, passes a start parameter that instructs the bot to return an OAuth link. Once done, the bot can offer a switch_inline button so that the user can easily return to the chat where they wanted to use the bot’s inline capabilities.

classmethod from_dict(data: dict | None) InlineQueryResultsButton | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

start_parameter: str | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

web_app: WebAppInfo | Mapping[str, object] | None = None
text: str
class peyk.platforms.telegram.types.InputChecklist(title: str, tasks: List[InputChecklistTask], others_can_add_tasks: bool | None = None, others_can_mark_tasks_as_done: bool | None = None)[source]

Bases: object

Describes a checklist to create.

Variables:
  • title (str) – Title of the checklist; 1-255 characters after entities parsing

  • tasks (List[peyk.platforms.telegram.types.input_checklist_task.InputChecklistTask]) – List of 1-30 tasks in the checklist

  • parse_mode – Mode for parsing entities in the title. See formatting options for more details.

  • title_entities – List of special entities that appear in the title, which can be specified instead of parse_mode. Currently, only bold, italic, underline, strikethrough, spoiler, custom_emoji, and date_time entities are allowed.

  • others_can_add_tasks (bool | None) – Pass True if other users can add tasks to the checklist

  • others_can_mark_tasks_as_done (bool | None) – Pass True if other users can mark tasks as done or not done in the checklist

others_can_add_tasks: bool | None = None
others_can_mark_tasks_as_done: bool | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

title: str
tasks: List[InputChecklistTask]
class peyk.platforms.telegram.types.InputChecklistTask(text: str, parse_mode: str | None = None, text_entities: List[MessageEntity] | None = None)[source]

Bases: object

Describes a task to add to a checklist.

Variables:
  • id – Unique identifier of the task; must be positive and unique among all task identifiers currently present in the checklist

  • text (str) – Text of the task; 1-100 characters after entities parsing

  • parse_mode (str | None) – Mode for parsing entities in the text. See formatting options for more details.

  • text_entities (List[peyk.platforms.telegram.types.message_entity.MessageEntity] | None) – List of special entities that appear in the text, which can be specified instead of parse_mode. Currently, only bold, italic, underline, strikethrough, spoiler, custom_emoji, and date_time entities are allowed.

parse_mode: str | None = None
text_entities: List[MessageEntity] | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

text: str
class peyk.platforms.telegram.types.InputContactMessageContent(phone_number: str, first_name: str, last_name: str | None = None, vcard: str | None = None)[source]

Bases: object

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

Variables:
  • phone_number (str) – Contact’s phone number

  • first_name (str) – Contact’s first name

  • last_name (str | None) – Contact’s last name

  • vcard (str | None) – Additional data about the contact in the form of a vCard, 0-2048 bytes

last_name: str | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

vcard: str | None = None
phone_number: str
first_name: str
class peyk.platforms.telegram.types.InputFile(file_id: str = '')[source]

Bases: object

Input file (placeholder).

file_id: str = ''
classmethod from_dict(data: dict | None) InputFile | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.InputInvoiceMessageContent(title: str, description: str, payload: str, currency: str, prices: ~typing.Sequence[~peyk.platforms.telegram.types.labeled_price.LabeledPrice | ~typing.Mapping[str, object]] = <factory>, provider_token: str | None = None, max_tip_amount: int | None = None, suggested_tip_amounts: ~typing.List[int] | None = None, provider_data: str | None = None, photo_url: str | None = None, photo_size: int | None = None, photo_width: int | None = None, photo_height: int | None = None, need_name: bool | None = None, need_phone_number: bool | None = None, need_email: bool | None = None, need_shipping_address: bool | None = None, send_phone_number_to_provider: bool | None = None, send_email_to_provider: bool | None = None, is_flexible: bool | None = None)[source]

Bases: object

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

Variables:
  • title (str) – Product name, 1-32 characters

  • description (str) – Product description, 1-255 characters

  • payload (str) – Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use it for your internal processes.

  • currency (str) – Three-letter ISO 4217 currency code, see more on currencies. Pass ‘XTR’ for payments in Telegram Stars.

  • prices (Sequence[peyk.platforms.telegram.types.labeled_price.LabeledPrice | Mapping[str, object]]) – Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars.

  • provider_token (str | None) – Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.

  • max_tip_amount (int | None) – The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars.

  • suggested_tip_amounts (List[int] | None) – A JSON-serialized Array of suggested amounts of tip in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount.

  • provider_data (str | None) – A JSON-serialized object for data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider.

  • photo_url (str | None) – URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service.

  • photo_size (int | None) – Photo size in bytes

  • photo_width (int | None) – Photo width

  • photo_height (int | None) – Photo height

  • need_name (bool | None) – Pass True if you require the user’s full name to complete the order. Ignored for payments in Telegram Stars.

  • need_phone_number (bool | None) – Pass True if you require the user’s phone number to complete the order. Ignored for payments in Telegram Stars.

  • need_email (bool | None) – Pass True if you require the user’s email address to complete the order. Ignored for payments in Telegram Stars.

  • need_shipping_address (bool | None) – Pass True if you require the user’s shipping address to complete the order. Ignored for payments in Telegram Stars.

  • send_phone_number_to_provider (bool | None) – Pass True if the user’s phone number should be sent to the provider. Ignored for payments in Telegram Stars.

  • send_email_to_provider (bool | None) – Pass True if the user’s email address should be sent to the provider. Ignored for payments in Telegram Stars.

  • is_flexible (bool | None) – Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars.

is_flexible: bool | None = None
max_tip_amount: int | None = None
need_email: bool | None = None
need_name: bool | None = None
need_phone_number: bool | None = None
need_shipping_address: bool | None = None
photo_height: int | None = None
photo_size: int | None = None
photo_url: str | None = None
photo_width: int | None = None
provider_data: str | None = None
provider_token: str | None = None
send_email_to_provider: bool | None = None
send_phone_number_to_provider: bool | None = None
suggested_tip_amounts: List[int] | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

title: str
description: str
payload: str
currency: str
prices: Sequence[LabeledPrice | Mapping[str, object]]
class peyk.platforms.telegram.types.InputLocationMessageContent(latitude: float, longitude: float, horizontal_accuracy: float | None = None, live_period: int | None = None, heading: int | None = None, proximity_alert_radius: int | None = None)[source]

Bases: object

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

Variables:
  • latitude (float) – Latitude of the location in degrees

  • longitude (float) – Longitude of the location in degrees

  • horizontal_accuracy (float | None) – The radius of uncertainty for the location, measured in meters; 0-1500

  • live_period (int | None) – Period in seconds during which the location can be updated, must be between 60 and 86400, or 0x7FFFFFFF for live locations that can be edited indefinitely

  • heading (int | None) – For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.

  • proximity_alert_radius (int | None) – For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.

heading: int | None = None
horizontal_accuracy: float | None = None
live_period: int | None = None
proximity_alert_radius: int | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

latitude: float
longitude: float
class peyk.platforms.telegram.types.InputMediaAnimation(media: object, thumbnail: object | None = None, caption: str | None = None, parse_mode: str | None = None, caption_entities: List[MessageEntity] | None = None, show_caption_above_media: bool | None = None, width: int | None = None, height: int | None = None, duration: int | None = None, has_spoiler: bool | None = None)[source]

Bases: object

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

Variables:
  • type – Type of the media, must be animation

  • media (object) – File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass ‘attach://’ to upload a new one using multipart/form-data under name. More information on Sending Files

  • thumbnail (object | None) – Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail’s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass ‘attach://’ if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files

  • caption (str | None) – Caption of the animation to be sent, 0-1024 characters after entities parsing

  • parse_mode (str | None) – Mode for parsing entities in the animation caption. See formatting options for more details.

  • caption_entities (List[peyk.platforms.telegram.types.message_entity.MessageEntity] | None) – List of special entities that appear in the caption, which can be specified instead of parse_mode

  • show_caption_above_media (bool | None) – Pass True if the caption must be shown above the message media

  • width (int | None) – Animation width

  • height (int | None) – Animation height

  • duration (int | None) – Animation duration in seconds

  • has_spoiler (bool | None) – Pass True if the animation needs to be covered with a spoiler animation

caption: str | None = None
caption_entities: List[MessageEntity] | None = None
duration: int | None = None
has_spoiler: bool | None = None
height: int | None = None
parse_mode: str | None = None
show_caption_above_media: bool | None = None
thumbnail: object | None = None
to_dict(media: str, thumbnail: str | None = None) Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Parameters:
  • media – Value used by this operation.

  • thumbnail – Value used by this operation.

Returns:

Result produced by the operation.

width: int | None = None
media: object
class peyk.platforms.telegram.types.InputMediaAudio(media: object, thumbnail: object | None = None, caption: str | None = None, parse_mode: str | None = None, caption_entities: List[MessageEntity] | None = None, duration: int | None = None, performer: str | None = None, title: str | None = None)[source]

Bases: object

Represents an audio file to be treated as music to be sent.

Variables:
  • type – Type of the media, must be audio

  • media (object) – File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass ‘attach://’ to upload a new one using multipart/form-data under name. More information on Sending Files

  • thumbnail (object | None) – Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail’s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass ‘attach://’ if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files

  • caption (str | None) – Caption of the audio to be sent, 0-1024 characters after entities parsing

  • parse_mode (str | None) – Mode for parsing entities in the audio caption. See formatting options for more details.

  • caption_entities (List[peyk.platforms.telegram.types.message_entity.MessageEntity] | None) – List of special entities that appear in the caption, which can be specified instead of parse_mode

  • duration (int | None) – Duration of the audio in seconds

  • performer (str | None) – Performer of the audio

  • title (str | None) – Title of the audio

caption: str | None = None
caption_entities: List[MessageEntity] | None = None
duration: int | None = None
parse_mode: str | None = None
performer: str | None = None
thumbnail: object | None = None
title: str | None = None
to_dict(media: str, thumbnail: str | None = None) Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Parameters:
  • media – Value used by this operation.

  • thumbnail – Value used by this operation.

Returns:

Result produced by the operation.

media: object
class peyk.platforms.telegram.types.InputMediaDocument(media: object, thumbnail: object | None = None, caption: str | None = None, parse_mode: str | None = None, caption_entities: List[MessageEntity] | None = None, disable_content_type_detection: bool | None = None)[source]

Bases: object

Represents a general file to be sent.

Variables:
  • type – Type of the media, must be document

  • media (object) – File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass ‘attach://’ to upload a new one using multipart/form-data under name. More information on Sending Files

  • thumbnail (object | None) – Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail’s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass ‘attach://’ if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files

  • caption (str | None) – Caption of the document to be sent, 0-1024 characters after entities parsing

  • parse_mode (str | None) – Mode for parsing entities in the document caption. See formatting options for more details.

  • caption_entities (List[peyk.platforms.telegram.types.message_entity.MessageEntity] | None) – List of special entities that appear in the caption, which can be specified instead of parse_mode

  • disable_content_type_detection (bool | None) – Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always True, if the document is sent as part of an album.

caption: str | None = None
caption_entities: List[MessageEntity] | None = None
disable_content_type_detection: bool | None = None
parse_mode: str | None = None
thumbnail: object | None = None
to_dict(media: str, thumbnail: str | None = None) Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Parameters:
  • media – Value used by this operation.

  • thumbnail – Value used by this operation.

Returns:

Result produced by the operation.

media: object

Bases: object

Represents an HTTP link to be sent.

Variables:
  • type – Type of the media, must be link

  • url (str) – HTTP URL of the link

to_dict() Dict[str, object][source]

Serialize this type to the Telegram API request shape.

Returns:

A JSON-compatible mapping representing this value.

url: str
class peyk.platforms.telegram.types.InputMediaLivePhoto(media: object, photo: object, caption: str | None = None, parse_mode: str | None = None, caption_entities: List[MessageEntity] | None = None, show_caption_above_media: bool | None = None, has_spoiler: bool | None = None)[source]

Bases: object

Represents a live photo to be sent.

Variables:
  • type – Type of the media, must be live_photo

  • media (object) – Video of the live photo to send. Pass a file_id to send a file that exists on the Telegram servers (recommended) or pass ‘attach://’ to upload a new one using multipart/form-data under name. More information on Sending Files. Sending live photos by a URL is currently unsupported.

  • photo (object) – The static photo to send. Pass a file_id to send a file that exists on the Telegram servers (recommended) or pass ‘attach://’ to upload a new one using multipart/form-data under name. More information on Sending Files. Sending live photos by a URL is currently unsupported.

  • caption (str | None) – Caption of the live photo to be sent, 0-1024 characters after entities parsing

  • parse_mode (str | None) – Mode for parsing entities in the live photo caption. See formatting options for more details.

  • caption_entities (List[peyk.platforms.telegram.types.message_entity.MessageEntity] | None) – List of special entities that appear in the caption, which can be specified instead of parse_mode

  • show_caption_above_media (bool | None) – Pass True if the caption must be shown above the message media

  • has_spoiler (bool | None) – Pass True if the live photo needs to be covered with a spoiler animation

caption: str | None = None
caption_entities: List[MessageEntity] | None = None
has_spoiler: bool | None = None
parse_mode: str | None = None
show_caption_above_media: bool | None = None
to_dict(media: str, photo: str) Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Parameters:
  • media – Value used by this operation.

  • photo – Value used by this operation.

Returns:

Result produced by the operation.

media: object
photo: object
class peyk.platforms.telegram.types.InputMediaLocation(latitude: float, longitude: float, horizontal_accuracy: float | None = None)[source]

Bases: object

Represents a location to be sent.

Variables:
  • type – Type of the media, must be location

  • latitude (float) – Latitude of the location

  • longitude (float) – Longitude of the location

  • horizontal_accuracy (float | None) – The radius of uncertainty for the location, measured in meters; 0-1500

horizontal_accuracy: float | None = None
to_dict() Dict[str, object][source]

Serialize this type to the Telegram API request shape.

Returns:

A JSON-compatible mapping representing this value.

latitude: float
longitude: float
class peyk.platforms.telegram.types.InputMediaPhoto(media: object, caption: str | None = None, parse_mode: str | None = None, caption_entities: List[MessageEntity] | None = None, show_caption_above_media: bool | None = None, has_spoiler: bool | None = None)[source]

Bases: object

Represents a photo to be sent.

Variables:
  • type – Type of the media, must be photo

  • media (object) – File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass ‘attach://’ to upload a new one using multipart/form-data under name. More information on Sending Files

  • caption (str | None) – Caption of the photo to be sent, 0-1024 characters after entities parsing

  • parse_mode (str | None) – Mode for parsing entities in the photo caption. See formatting options for more details.

  • caption_entities (List[peyk.platforms.telegram.types.message_entity.MessageEntity] | None) – List of special entities that appear in the caption, which can be specified instead of parse_mode

  • show_caption_above_media (bool | None) – Pass True if the caption must be shown above the message media

  • has_spoiler (bool | None) – Pass True if the photo needs to be covered with a spoiler animation

caption: str | None = None
caption_entities: List[MessageEntity] | None = None
has_spoiler: bool | None = None
parse_mode: str | None = None
show_caption_above_media: bool | None = None
to_dict(media: str) Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Parameters:

media – Value used by this operation.

Returns:

Result produced by the operation.

media: object
class peyk.platforms.telegram.types.InputMediaSticker(media: object, type: str = 'sticker', emoji: str | None = None, mask_position: object | None = None)[source]

Bases: object

Represents a sticker file to be sent.

Variables:
  • type (str) – Type of the media, must be sticker

  • media (object) – File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a .WEBP sticker from the Internet, or pass ‘attach://’ to upload a new .WEBP, .TGS, or .WEBM sticker using multipart/form-data under name. More information on Sending Files

  • emoji (str | None) – Emoji associated with the sticker; only for just uploaded stickers

emoji: str | None = None
mask_position: object | None = None
to_dict(media_ref: str) Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Parameters:

media_ref – Value used by this operation.

Returns:

Result produced by the operation.

type: str = 'sticker'
media: object
class peyk.platforms.telegram.types.InputMediaVenue(latitude: float, longitude: float, title: str, address: str, foursquare_id: str | None = None, foursquare_type: str | None = None, google_place_id: str | None = None, google_place_type: str | None = None)[source]

Bases: object

Represents a venue to be sent.

Variables:
  • type – Type of the media, must be venue

  • latitude (float) – Latitude of the location

  • longitude (float) – Longitude of the location

  • title (str) – Name of the venue

  • address (str) – Address of the venue

  • foursquare_id (str | None) – Foursquare identifier of the venue

  • foursquare_type (str | None) – Foursquare type of the venue, if known. (For example, ‘arts_entertainment/default’, ‘arts_entertainment/aquarium’ or ‘food/icecream’.)

  • google_place_id (str | None) – Google Places identifier of the venue

  • google_place_type (str | None) – Google Places type of the venue. (See supported types.)

foursquare_id: str | None = None
foursquare_type: str | None = None
google_place_id: str | None = None
google_place_type: str | None = None
to_dict() Dict[str, object][source]

Serialize this type to the Telegram API request shape.

Returns:

A JSON-compatible mapping representing this value.

latitude: float
longitude: float
title: str
address: str
class peyk.platforms.telegram.types.InputMediaVideo(media: object, thumbnail: object | None = None, cover: object | None = None, caption: str | None = None, parse_mode: str | None = None, caption_entities: List[MessageEntity] | None = None, show_caption_above_media: bool | None = None, width: int | None = None, height: int | None = None, duration: int | None = None, supports_streaming: bool | None = None, has_spoiler: bool | None = None, start_timestamp: int | None = None)[source]

Bases: object

Represents a video to be sent.

Variables:
  • type – Type of the media, must be video

  • media (object) – File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass ‘attach://’ to upload a new one using multipart/form-data under name. More information on Sending Files

  • thumbnail (object | None) – Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail’s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass ‘attach://’ if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files

  • cover (object | None) – Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass ‘attach://’ to upload a new one using multipart/form-data under name. More information on Sending Files

  • start_timestamp (int | None) – Start timestamp for the video in the message

  • caption (str | None) – Caption of the video to be sent, 0-1024 characters after entities parsing

  • parse_mode (str | None) – Mode for parsing entities in the video caption. See formatting options for more details.

  • caption_entities (List[peyk.platforms.telegram.types.message_entity.MessageEntity] | None) – List of special entities that appear in the caption, which can be specified instead of parse_mode

  • show_caption_above_media (bool | None) – Pass True if the caption must be shown above the message media

  • width (int | None) – Video width

  • height (int | None) – Video height

  • duration (int | None) – Video duration in seconds

  • supports_streaming (bool | None) – Pass True if the uploaded video is suitable for streaming

  • has_spoiler (bool | None) – Pass True if the video needs to be covered with a spoiler animation

caption: str | None = None
caption_entities: List[MessageEntity] | None = None
cover: object | None = None
duration: int | None = None
has_spoiler: bool | None = None
height: int | None = None
parse_mode: str | None = None
show_caption_above_media: bool | None = None
start_timestamp: int | None = None
supports_streaming: bool | None = None
thumbnail: object | None = None
to_dict(media: str, thumbnail: str | None = None, cover: str | None = None) Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Parameters:
  • media – Value used by this operation.

  • thumbnail – Value used by this operation.

  • cover – Value used by this operation.

Returns:

Result produced by the operation.

width: int | None = None
media: object
class peyk.platforms.telegram.types.InputMediaVoiceNote(media: object, type: str = 'voice_note', duration: int | None = None, waveform: str | None = None)[source]

Bases: object

Represents a voice message file to be sent.

Variables:
  • type (str) – Type of the media, must be voice_note

  • media (object) – File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://” to upload a new one using multipart/form-data under name. More information on Sending Files

  • caption – Caption of the voice message to be sent, 0-1024 characters after entities parsing

  • parse_mode – Mode for parsing entities in the voice message caption. See formatting options for more details.

  • caption_entities – List of special entities that appear in the caption, which can be specified instead of parse_mode

  • duration (int | None) – Duration of the voice message in seconds

duration: int | None = None
to_dict(media_ref: str) Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Parameters:

media_ref – Value used by this operation.

Returns:

Result produced by the operation.

type: str = 'voice_note'
waveform: str | None = None
media: object
class peyk.platforms.telegram.types.InputPaidMediaLivePhoto(media: object, photo: object, type: str = 'live_photo', caption: str | None = None, parse_mode: str | None = None, caption_entities: List[MessageEntity] | None = None, show_caption_above_media: bool | None = None, has_spoiler: bool | None = None)[source]

Bases: object

The paid media to send is a live photo.

Variables:
  • type (str) – Type of the media, must be live_photo

  • media (object) – Video of the live photo to send. Pass a file_id to send a file that exists on the Telegram servers (recommended) or pass ‘attach://’ to upload a new one using multipart/form-data under name. More information on Sending Files. Sending live photos by a URL is currently unsupported.

  • photo (object) – The static photo to send. Pass a file_id to send a file that exists on the Telegram servers (recommended) or pass ‘attach://’ to upload a new one using multipart/form-data under name. More information on Sending Files. Sending live photos by a URL is currently unsupported.

caption: str | None = None
caption_entities: List[MessageEntity] | None = None
has_spoiler: bool | None = None
parse_mode: str | None = None
show_caption_above_media: bool | None = None
to_dict(media_ref: str, photo_ref: str) Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Parameters:
  • media_ref – Value used by this operation.

  • photo_ref – Value used by this operation.

Returns:

Result produced by the operation.

type: str = 'live_photo'
media: object
photo: object
class peyk.platforms.telegram.types.InputPaidMediaPhoto(media: str, type: str = 'photo')[source]

Bases: object

The paid media to send is a photo.

Variables:
  • type (str) – Type of the media, must be photo

  • media (str) – File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass ‘attach://’ to upload a new one using multipart/form-data under name. More information on Sending Files

classmethod from_dict(data: dict | None) InputPaidMediaPhoto | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

type: str = 'photo'
media: str
class peyk.platforms.telegram.types.InputPaidMediaVideo(media: str, type: str = 'video', thumbnail: str | None = None, cover: str | None = None, start_timestamp: int | None = None, width: int | None = None, height: int | None = None, duration: int | None = None, supports_streaming: bool | None = None)[source]

Bases: object

The paid media to send is a video.

Variables:
  • type (str) – Type of the media, must be video

  • media (str) – File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass ‘attach://’ to upload a new one using multipart/form-data under name. More information on Sending Files

  • thumbnail (str | None) – Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail’s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass ‘attach://’ if the thumbnail was uploaded using multipart/form-data under . More information on Sending Files

  • cover (str | None) – Cover for the video in the message. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass ‘attach://’ to upload a new one using multipart/form-data under name. More information on Sending Files

  • start_timestamp (int | None) – Start timestamp for the video in the message

  • width (int | None) – Video width

  • height (int | None) – Video height

  • duration (int | None) – Video duration in seconds

  • supports_streaming (bool | None) – Pass True if the uploaded video is suitable for streaming

cover: str | None = None
duration: int | None = None
classmethod from_dict(data: dict | None) InputPaidMediaVideo | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

height: int | None = None
start_timestamp: int | None = None
supports_streaming: bool | None = None
thumbnail: str | None = None
type: str = 'video'
width: int | None = None
media: str
class peyk.platforms.telegram.types.InputPollOption(text: str, text_parse_mode: str | None = None, text_entities: List[MessageEntity] | None = None, media: InputMediaPhoto | InputMediaVideo | InputMediaAnimation | InputMediaLink | InputMediaLivePhoto | InputMediaLocation | InputMediaVenue | None = None)[source]

Bases: object

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

Variables:
media: InputMediaPhoto | InputMediaVideo | InputMediaAnimation | InputMediaLink | InputMediaLivePhoto | InputMediaLocation | InputMediaVenue | None = None
text_entities: List[MessageEntity] | None = None
text_parse_mode: str | None = None
to_dict() Dict[str, object][source]

Serialize this type to the Telegram API request shape.

Returns:

A JSON-compatible mapping representing this value.

Raises:

ValueError – Raised when the operation cannot complete.

text: str
class peyk.platforms.telegram.types.InputProfilePhotoAnimated(photo: object, type: str = 'animated', main_frame_timestamp: float | None = None)[source]

Bases: object

An animated profile photo in the MPEG4 format.

Variables:
  • type (str) – Type of the profile photo, must be animated

  • animation – The animated profile photo. Profile photos can’t be reused and can only be uploaded as a new file, so you can pass ‘attach://’ if the photo was uploaded using multipart/form-data under . More information on Sending Files

  • main_frame_timestamp (float | None) – Timestamp in seconds of the frame that will be used as the static profile photo. Defaults to 0.0.

main_frame_timestamp: float | None = None
to_dict(photo_ref: str) Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Parameters:

photo_ref – Value used by this operation.

Returns:

Result produced by the operation.

type: str = 'animated'
photo: object
class peyk.platforms.telegram.types.InputProfilePhotoStatic(photo: object, type: str = 'static')[source]

Bases: object

A static profile photo in the .JPG format.

Variables:
  • type (str) – Type of the profile photo, must be static

  • photo (object) – The static profile photo. Profile photos can’t be reused and can only be uploaded as a new file, so you can pass ‘attach://’ if the photo was uploaded using multipart/form-data under . More information on Sending Files

to_dict(photo_ref: str) Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Parameters:

photo_ref – Value used by this operation.

Returns:

Result produced by the operation.

type: str = 'static'
photo: object
class peyk.platforms.telegram.types.InputRichBlockAnchor(name: str = '', text: str = '')[source]

Bases: object

A block with an anchor, corresponding to the HTML tag with the attribute name.

Variables:
  • type – Type of the block, always ‘anchor’

  • name (str) – The name of the anchor

name: str = ''
text: str = ''
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.InputRichBlockAnimation(animation: object = None, caption: str | None = None)[source]

Bases: object

A block with an animation, corresponding to the HTML tag .

Variables:
  • type – Type of the block, always ‘animation’

  • animation (object) – The animation. Caption is ignored.

  • caption (str | None) – Caption of the block

animation: object = None
caption: str | None = None
to_dict(media_ref: str) Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Parameters:

media_ref – Value used by this operation.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.InputRichBlockAudio(audio: object = None, caption: str | None = None)[source]

Bases: object

A block with a music file, corresponding to the HTML tag .

Variables:
  • type – Type of the block, always ‘audio’

  • audio (object) – The audio. Caption is ignored.

  • caption (str | None) – Caption of the block

audio: object = None
caption: str | None = None
to_dict(media_ref: str) Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Parameters:

media_ref – Value used by this operation.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.InputRichBlockBlockQuotation(text: str = '')[source]

Bases: object

A block quotation, corresponding to the HTML tag .

Variables:
  • type – Type of the block, always ‘blockquote’

  • blocks – Content of the block

  • credit – Credit of the block

text: str = ''
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.InputRichBlockButtons(buttons: List[object] | None = None)[source]

Bases: object

InputRichBlockButtons Telegram Bot API type.

buttons: List[object] | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.InputRichBlockCollage(items: List[object] | None = None)[source]

Bases: object

A collage, corresponding to the custom HTML tag .

Variables:
  • type – Type of the block, always ‘collage’

  • blocks – Elements of the collage

  • caption – Caption of the block

items: List[object] | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.InputRichBlockDetails(title: str = '', text: str = '')[source]

Bases: object

An expandable block for details disclosure, corresponding to the HTML tag .

Variables:
  • type – Type of the block, always ‘details’

  • summary – Always shown summary of the block

  • blocks – Content of the block

  • is_open – Pass True if the content of the block is visible by default

text: str = ''
title: str = ''
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.InputRichBlockDivider[source]

Bases: object

A divider, corresponding to the HTML tag .

Variables:

type – Type of the block, always ‘divider’

to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.InputRichBlockDocument(document: object = None, caption: str | None = None)[source]

Bases: object

InputRichBlockDocument Telegram Bot API type.

caption: str | None = None
document: object = None
to_dict(media_ref: str) Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Parameters:

media_ref – Value used by this operation.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.InputRichBlockExpandableBlockQuotation(text: str = '')[source]

Bases: object

InputRichBlockExpandableBlockQuotation Telegram Bot API type.

text: str = ''
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.InputRichBlockFooter(text: str = '')[source]

Bases: object

A footer, corresponding to the HTML tag .

Variables:
  • type – Type of the block, always ‘footer’

  • text (str) – Text of the block

text: str = ''
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.InputRichBlockList(items: List[object] | None = None)[source]

Bases: object

A list of blocks, corresponding to the HTML tag or with multiple nested tags .

Variables:
  • type – Type of the block, always ‘list’

  • items (List[object] | None) – Items of the list

items: List[object] | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.InputRichBlockListItem(text: str = '', parse_mode: str | None = None, text_entities: List[MessageEntity] | None = None)[source]

Bases: object

An item of a list to be sent.

Variables:
  • blocks – The content of the item

  • has_checkbox – Pass True if the item has a checkbox

  • is_checked – Pass True if the item has a checked checkbox

  • value – For ordered lists, the numeric value of the item label

  • type – For ordered lists, the type of the item label; must be one of ‘a’ for lowercase letters, ‘A’ for uppercase letters, ‘i’ for lowercase Roman numerals, ‘I’ for uppercase Roman numerals, or ‘1’ for decimal numbers

parse_mode: str | None = None
text: str = ''
text_entities: List[MessageEntity] | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.InputRichBlockMap(latitude: float = 0.0, longitude: float = 0.0)[source]

Bases: object

A block with a map, corresponding to the custom HTML tag . The map’s width and height must not exceed 10000 in total. The width and height ratio must be at most 20.

Variables:
  • type – Type of the block, always ‘map’

  • location – Location of the center of the map

  • zoom – Map zoom level; 0-24

  • width – Map width; 0-10000

  • height – Map height; 0-10000

  • caption – Caption of the block

latitude: float = 0.0
longitude: float = 0.0
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.InputRichBlockMathematicalExpression(expression: str = '')[source]

Bases: object

A block with a mathematical expression in LaTeX format, corresponding to the custom HTML tag .

Variables:
  • type – Type of the block, always ‘mathematical_expression’

  • expression (str) – The mathematical expression in LaTeX format

expression: str = ''
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.InputRichBlockParagraph(text: str = '')[source]

Bases: object

A text paragraph, corresponding to the HTML tag .

Variables:
  • type – Type of the block, always ‘paragraph’

  • text (str) – Text of the block

text: str = ''
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.InputRichBlockPhoto(photo: object = None, caption: str | None = None)[source]

Bases: object

A block with a photo, corresponding to the HTML tag .

Variables:
  • type – Type of the block, always ‘photo’

  • photo (object) – The photo. Caption is ignored.

  • caption (str | None) – Caption of the block

caption: str | None = None
photo: object = None
to_dict(media_ref: str) Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Parameters:

media_ref – Value used by this operation.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.InputRichBlockPreformatted(text: str = '', language: str = '')[source]

Bases: object

A preformatted text block, corresponding to the nested HTML tags and .

Variables:
  • type – Type of the block, always ‘pre’

  • text (str) – Text of the block

  • language (str) – The programming language of the text

language: str = ''
text: str = ''
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.InputRichBlockPullQuotation(text: str = '')[source]

Bases: object

A quotation with centered text, loosely corresponding to the HTML tag .

Variables:
  • type – Type of the block, always ‘pullquote’

  • text (str) – Text of the block

  • credit – Credit of the block

text: str = ''
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.InputRichBlockSectionHeading(text: str = '')[source]

Bases: object

A section heading, corresponding to the HTML tags , , , , , or .

Variables:
  • type – Type of the block, always ‘heading’

  • text (str) – Text of the block

  • size – Relative size of the text font; 1-6, 1 is the largest, 6 is the smallest

text: str = ''
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.InputRichBlockSlideshow(items: List[object] | None = None)[source]

Bases: object

A slideshow, corresponding to the custom HTML tag .

Variables:
  • type – Type of the block, always ‘slideshow’

  • blocks – Elements of the slideshow

  • caption – Caption of the block

items: List[object] | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.InputRichBlockTable(cells: List[object] | None = None, is_compact: bool | None = None)[source]

Bases: object

A table, corresponding to the HTML tag .

Variables:
  • type – Type of the block, always ‘table’

  • cells (List[object] | None) – Cells of the table

  • is_bordered – Pass True if the table has borders

  • is_striped – Pass True if the table is striped

  • caption – Caption of the table

cells: List[object] | None = None
is_compact: bool | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.InputRichBlockThinking(text: str = '')[source]

Bases: object

A block with a ‘Thinking…’ placeholder, corresponding to the custom HTML tag . The block may be used only in sendRichMessageDraft, therefore it can’t be received in messages. See https://t.me/addemoji/AIActions for examples of custom emoji that are recommended for usage in the block.

Variables:
  • type – Type of the block, always ‘thinking’

  • text (str) – Text of the block. See https://t.me/addemoji/AIActions for examples of custom emoji that are recommended for usage in the block.

text: str = ''
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.InputRichBlockVideo(video: object = None, caption: str | None = None)[source]

Bases: object

A block with a video, corresponding to the HTML tag .

Variables:
  • type – Type of the block, always ‘video’

  • video (object) – The video. Caption is ignored.

  • caption (str | None) – Caption of the block

caption: str | None = None
to_dict(media_ref: str) Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Parameters:

media_ref – Value used by this operation.

Returns:

Result produced by the operation.

video: object = None
class peyk.platforms.telegram.types.InputRichBlockVoiceNote(voice: object = None, caption: str | None = None)[source]

Bases: object

A block with a voice note, corresponding to the HTML tag .

Variables:
  • type – Type of the block, always ‘voice_note’

  • voice_note – The voice note. Caption is ignored.

  • caption (str | None) – Caption of the block

caption: str | None = None
to_dict(media_ref: str) Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Parameters:

media_ref – Value used by this operation.

Returns:

Result produced by the operation.

voice: object = None
class peyk.platforms.telegram.types.InputRichMessage(text: str | None = None, parse_mode: str | None = None, blocks: object | None = None, media: object | None = None, is_rtl: bool | None = None, skip_entity_detection: bool | None = None)[source]

Bases: object

Describes a rich message to be sent. Exactly one of the fields html, markdown, or blocks must be used.

Variables:
  • html – Content of the rich message to send described using HTML formatting. See rich message formatting options for more details. Use media field to specify the media used in the message.

  • markdown – Content of the rich message to send described using Markdown formatting. See rich message formatting options for more details. Use media field to specify the media used in the message.

  • is_rtl (bool | None) – Pass True if the rich message must be shown right-to-left

  • skip_entity_detection (bool | None) – Pass True to skip automatic detection of entities (e.g., URLs, email addresses, username mentions, hashtags, cashtags, bot commands, or phone numbers) in the text

  • blocks (object | None) – Content of the rich message to send described as a list of blocks

  • media (object | None) – List of media that are specified in the markdown or html fields using tg://photo?id=, tg://video?id=, and tg://audio?id= links

blocks: object | None = None
classmethod from_dict(data: dict | None) InputRichMessage | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

is_rtl: bool | None = None
media: object | None = None
parse_mode: str | None = None
skip_entity_detection: bool | None = None
text: str | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.InputRichMessageContent(rich_message: InputRichMessage | None = None)[source]

Bases: object

Represents the content of a rich message to be sent as the result of an inline query.

Variables:

rich_message (peyk.platforms.telegram.types.input_rich_message.InputRichMessage | None) – The message to be sent

classmethod from_dict(data: dict | None) InputRichMessageContent | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

rich_message: InputRichMessage | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.InputRichMessageMedia(media: object = None, type: str | None = None)[source]

Bases: object

Describes a media element embedded in an outgoing rich message.

Variables:
  • id – Unique identifier of the media used in a tg://photo?id=, tg://video?id=, or tg://audio?id= link. 1-64 characters, only A-Z, a-z, 0-9, _ and - are allowed.

  • media (object) – The media to be sent. Everything except the media itself and its properties is ignored.

media: object = None
to_dict(media_ref: str) Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Parameters:

media_ref – Value used by this operation.

Returns:

Result produced by the operation.

type: str | None = None
class peyk.platforms.telegram.types.InputSticker(sticker: object, format: str, emoji_list: List[str], mask_position: MaskPosition | None = None, keywords: List[str] | None = None)[source]

Bases: object

This object describes a sticker to be added to a sticker set.

Variables:
  • sticker (object) – The added sticker. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or pass ‘attach://’ to upload a new file using multipart/form-data under name. Animated and video stickers can’t be uploaded via HTTP URL. More information on Sending Files

  • format (str) – Format of the added sticker, must be one of ‘static’ for a .WEBP or .PNG image, ‘animated’ for a .TGS animation, ‘video’ for a .WEBM video

  • emoji_list (List[str]) – List of 1-20 emoji associated with the sticker

  • mask_position (peyk.platforms.telegram.types.mask_position.MaskPosition | None) – Position where the mask should be placed on faces. For ‘mask’ stickers only.

  • keywords (List[str] | None) – List of 0-20 search keywords for the sticker with total length of up to 64 characters. For ‘regular’ and ‘custom_emoji’ stickers only.

keywords: List[str] | None = None
mask_position: MaskPosition | None = None
to_dict(sticker_ref: str) Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Parameters:

sticker_ref – Value used by this operation.

Returns:

Result produced by the operation.

sticker: object
format: str
emoji_list: List[str]
class peyk.platforms.telegram.types.InputStoryContentPhoto(media: object = None, photo: object = None, type: str = 'photo', caption: str | None = None, parse_mode: str | None = None, caption_entities: List[MessageEntity] | None = None)[source]

Bases: object

Describes a photo to post as a story.

Variables:
  • type (str) – Type of the content, must be photo

  • photo (object) – The photo to post as a story. The photo must be of the size 1080x1920 and must not exceed 10 MB. The photo can’t be reused and can only be uploaded as a new file, so you can pass ‘attach://’ if the photo was uploaded using multipart/form-data under . More information on Sending Files

caption: str | None = None
caption_entities: List[MessageEntity] | None = None
classmethod from_dict(data: dict | None) InputStoryContentPhoto | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

media: object = None
parse_mode: str | None = None
photo: object = None
to_dict(media_ref: str | None = None) Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Parameters:

media_ref – Value used by this operation.

Returns:

Result produced by the operation.

type: str = 'photo'
class peyk.platforms.telegram.types.InputStoryContentVideo(video: str, type: str = 'video', duration: float | None = None, cover_frame_timestamp: float | None = None, is_animation: bool | None = None)[source]

Bases: object

Describes a video to post as a story.

Variables:
  • type (str) – Type of the content, must be video

  • video (str) – The video to post as a story. The video must be of the size 720x1280, streamable, encoded with H.265 codec, with key frames added each second in the MPEG4 format, and must not exceed 30 MB. The video can’t be reused and can only be uploaded as a new file, so you can pass ‘attach://’ if the video was uploaded using multipart/form-data under . More information on Sending Files

  • duration (float | None) – Precise duration of the video in seconds; 0-60

  • cover_frame_timestamp (float | None) – Timestamp in seconds of the frame that will be used as the static cover for the story. Defaults to 0.0.

  • is_animation (bool | None) – Pass True if the video has no sound

cover_frame_timestamp: float | None = None
duration: float | None = None
classmethod from_dict(data: dict | None) InputStoryContentVideo | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

is_animation: bool | None = None
type: str = 'video'
video: str
class peyk.platforms.telegram.types.InputTextMessageContent(message_text: str, parse_mode: str | None = None, entities: Sequence[MessageEntity | Mapping[str, object]] | None = None, link_preview_options: LinkPreviewOptions | Mapping[str, object] | None = None)[source]

Bases: object

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

Variables:
  • message_text (str) – Text of the message to be sent, 1-4096 characters

  • parse_mode (str | None) – Mode for parsing entities in the message text. See formatting options for more details.

  • entities (Sequence[peyk.platforms.telegram.types.message_entity.MessageEntity | Mapping[str, object]] | None) – List of special entities that appear in message text, which can be specified instead of parse_mode

  • link_preview_options (peyk.platforms.telegram.types.link_preview_options.LinkPreviewOptions | Mapping[str, object] | None) – Link preview generation options for the message

  • disable_web_page_preview – Disables link previews for links in the sent message

entities: Sequence[MessageEntity | Mapping[str, object]] | None = None
parse_mode: str | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

message_text: str
class peyk.platforms.telegram.types.InputVenueMessageContent(latitude: float, longitude: float, title: str, address: str, foursquare_id: str | None = None, foursquare_type: str | None = None, google_place_id: str | None = None, google_place_type: str | None = None)[source]

Bases: object

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

Variables:
  • latitude (float) – Latitude of the venue in degrees

  • longitude (float) – Longitude of the venue in degrees

  • title (str) – Name of the venue

  • address (str) – Address of the venue

  • foursquare_id (str | None) – Foursquare identifier of the venue, if known

  • foursquare_type (str | None) – Foursquare type of the venue, if known. (For example, ‘arts_entertainment/default’, ‘arts_entertainment/aquarium’ or ‘food/icecream’.)

  • google_place_id (str | None) – Google Places identifier of the venue

  • google_place_type (str | None) – Google Places type of the venue. (See supported types.)

foursquare_id: str | None = None
foursquare_type: str | None = None
google_place_id: str | None = None
google_place_type: str | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

latitude: float
longitude: float
title: str
address: str
class peyk.platforms.telegram.types.Invoice(title: str, description: str, start_parameter: str, currency: str, total_amount: int)[source]

Bases: object

This object contains basic information about an invoice.

Variables:
  • title (str) – Product name

  • description (str) – Product description

  • start_parameter (str) – Unique bot deep-linking parameter that can be used to generate this invoice

  • currency (str) – Three-letter ISO 4217 currency code, or ‘XTR’ for payments in Telegram Stars

  • total_amount (int) – Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).

classmethod from_dict(data: dict | None) Invoice | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

title: str
description: str
start_parameter: str
currency: str
total_amount: int
class peyk.platforms.telegram.types.KeyboardButton(text: str = '', icon_custom_emoji_id: str | None = None, style: str | None = None, request_users: KeyboardButtonRequestUsers | None = None, request_chat: KeyboardButtonRequestChat | None = None, request_managed_bot: KeyboardButtonRequestManagedBot | None = None, request_contact: bool | None = None, request_location: bool | None = None, request_poll: KeyboardButtonPollType | None = None, web_app: WebAppInfo | None = None)[source]

Bases: object

This object represents one button of the reply keyboard. At most one of the fields other than text, icon_custom_emoji_id, and style must be used to specify the type of the button. For simple text buttons, String can be used instead of this object to specify the button text.

Variables:
  • text (str) – Text of the button. If none of the fields other than text, icon_custom_emoji_id, and style are used, it will be sent as a message when the button is pressed.

  • icon_custom_emoji_id (str | None) – Unique identifier of the custom emoji shown before the text of the button. Can only be used by bots that purchased additional usernames on Fragment or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription.

  • style (str | None) – Style of the button. Must be one of ‘danger’ (red), ‘success’ (green) or ‘primary’ (blue). If omitted, then an app-specific style is used.

  • request_users (peyk.platforms.telegram.types.keyboard_button_request_users.KeyboardButtonRequestUsers | None) – If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a ‘users_shared’ service message. Available in private chats only.

  • request_chat (peyk.platforms.telegram.types.keyboard_button_request_chat.KeyboardButtonRequestChat | None) – If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a ‘chat_shared’ service message. Available in private chats only.

  • request_managed_bot (peyk.platforms.telegram.types.keyboard_button_request_managed_bot.KeyboardButtonRequestManagedBot | None) – If specified, pressing the button will ask the user to create and share a bot that will be managed by the current bot. Available for bots that enabled management of other bots in the @BotFather Mini App. Available in private chats only.

  • request_contact (bool | None) – If True, the user’s phone number will be sent as a contact when the button is pressed. Available in private chats only.

  • request_location (bool | None) – If True, the user’s current location will be sent when the button is pressed. Available in private chats only.

  • request_poll (peyk.platforms.telegram.types.keyboard_button_poll_type.KeyboardButtonPollType | None) – If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. Available in private chats only.

  • web_app (peyk.platforms.telegram.types.web_app_info.WebAppInfo | None) – If specified, the described Web App will be launched when the button is pressed. The Web App will be able to send a ‘web_app_data’ service message. Available in private chats only.

  • request_user – If specified, pressing the button will open a list of suitable users. Tapping on any user will send their identifier to the bot in a ‘user_shared’ service message. Available in private chats only.

classmethod from_dict(data: dict | None) KeyboardButton | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

icon_custom_emoji_id: str | None = None
request_chat: KeyboardButtonRequestChat | None = None
request_contact: bool | None = None
request_location: bool | None = None
request_managed_bot: KeyboardButtonRequestManagedBot | None = None
request_poll: KeyboardButtonPollType | None = None
request_users: KeyboardButtonRequestUsers | None = None
style: str | None = None
text: str = ''
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

web_app: WebAppInfo | None = None
class peyk.platforms.telegram.types.KeyboardButtonPollType(type: str | None = None)[source]

Bases: object

This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed.

Variables:

type (str | None) – If quiz is passed, the user will be allowed to create only polls in the quiz mode. If regular is passed, only regular polls will be allowed. Otherwise, the user will be allowed to create a poll of any type.

classmethod from_dict(data: dict | None) KeyboardButtonPollType | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

type: str | None = None
class peyk.platforms.telegram.types.KeyboardButtonRequestChat(request_id: int = 0, chat_is_channel: bool = False, chat_is_forum: bool | None = None, chat_has_username: bool | None = None, chat_is_created: bool | None = None, user_administrator_rights: ChatAdministratorRights | None = None, bot_administrator_rights: ChatAdministratorRights | None = None, bot_is_member: bool | None = None, request_title: bool | None = None, request_username: bool | None = None, request_photo: bool | None = None)[source]

Bases: object

This object defines the criteria used to request a suitable chat. Information about the selected chat will be shared with the bot when the corresponding button is pressed. The bot will be granted requested rights in the chat if appropriate..

Variables:
  • request_id (int) – Signed 32-bit identifier of the request, which will be received back in the ChatShared object. Must be unique within the message.

  • chat_is_channel (bool) – Pass True to request a channel chat, pass False to request a group or a supergroup chat

  • chat_is_forum (bool | None) – Pass True to request a forum supergroup, pass False to request a non-forum chat. If not specified, no additional restrictions are applied.

  • chat_has_username (bool | None) – Pass True to request a supergroup or a channel with a username, pass False to request a chat without a username. If not specified, no additional restrictions are applied.

  • chat_is_created (bool | None) – Pass True to request a chat owned by the user. Otherwise, no additional restrictions are applied.

  • user_administrator_rights (peyk.platforms.telegram.types.chat_administrator_rights.ChatAdministratorRights | None) – A JSON-serialized object listing the required administrator rights of the user in the chat. The rights must be a superset of bot_administrator_rights. If not specified, no additional restrictions are applied.

  • bot_administrator_rights (peyk.platforms.telegram.types.chat_administrator_rights.ChatAdministratorRights | None) – A JSON-serialized object listing the required administrator rights of the bot in the chat. The rights must be a subset of user_administrator_rights. If not specified, no additional restrictions are applied.

  • bot_is_member (bool | None) – Pass True to request a chat with the bot as a member. Otherwise, no additional restrictions are applied.

  • request_title (bool | None) – Pass True to request the chat’s title

  • request_username (bool | None) – Pass True to request the chat’s username

  • request_photo (bool | None) – Pass True to request the chat’s photo

bot_administrator_rights: ChatAdministratorRights | None = None
bot_is_member: bool | None = None
chat_has_username: bool | None = None
chat_is_channel: bool = False
chat_is_created: bool | None = None
chat_is_forum: bool | None = None
classmethod from_dict(data: dict | None) KeyboardButtonRequestChat | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

request_id: int = 0
request_photo: bool | None = None
request_title: bool | None = None
request_username: bool | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

user_administrator_rights: ChatAdministratorRights | None = None
class peyk.platforms.telegram.types.KeyboardButtonRequestManagedBot(request_id: int = 0, suggested_name: str | None = None, suggested_username: str | None = None)[source]

Bases: object

This object defines the parameters for the creation of a managed bot. Information about the created bot will be shared with the bot using the update managed_bot and a Message with the field managed_bot_created.

Variables:
  • request_id (int) – Signed 32-bit identifier of the request. Must be unique within the message.

  • suggested_name (str | None) – Suggested name for the bot

  • suggested_username (str | None) – Suggested username for the bot

classmethod from_dict(data: dict | None) KeyboardButtonRequestManagedBot | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

request_id: int = 0
suggested_name: str | None = None
suggested_username: str | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.KeyboardButtonRequestUsers(request_id: int = 0, user_is_bot: bool | None = None, user_is_premium: bool | None = None, max_quantity: int | None = None, request_name: bool | None = None, request_username: bool | None = None, request_photo: bool | None = None)[source]

Bases: object

This object defines the criteria used to request suitable users. Information about the selected users will be shared with the bot when the corresponding button is pressed.

Variables:
  • request_id (int) – Signed 32-bit identifier of the request that will be received back in the UsersShared object. Must be unique within the message.

  • user_is_bot (bool | None) – Pass True to request bots, pass False to request regular users. If not specified, no additional restrictions are applied.

  • user_is_premium (bool | None) – Pass True to request premium users, pass False to request non-premium users. If not specified, no additional restrictions are applied.

  • max_quantity (int | None) – The maximum number of users to be selected; 1-10. Defaults to 1.

  • request_name (bool | None) – Pass True to request the users’ first and last names

  • request_username (bool | None) – Pass True to request the users’ usernames

  • request_photo (bool | None) – Pass True to request the users’ photos

classmethod from_dict(data: dict | None) KeyboardButtonRequestUsers | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

max_quantity: int | None = None
request_id: int = 0
request_name: bool | None = None
request_photo: bool | None = None
request_username: bool | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

user_is_bot: bool | None = None
user_is_premium: bool | None = None
class peyk.platforms.telegram.types.LabeledPrice(label: str, amount: int)[source]

Bases: object

This object represents a portion of the price for goods or services.

Variables:
  • label (str) – Portion label

  • amount (int) – Price of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).

classmethod from_dict(data: dict | None) LabeledPrice | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

label: str
amount: int

Bases: object

Represents an HTTP link.

Variables:

url (str) – URL of the link

classmethod from_dict(data: dict | None) Link | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

url: str
class peyk.platforms.telegram.types.LinkPreviewOptions(is_disabled: bool | None = None, url: str | None = None, prefer_small_media: bool | None = None, prefer_large_media: bool | None = None, show_above_text: bool | None = None)[source]

Bases: object

Describes the options used for link preview generation.

Variables:
  • is_disabled (bool | None) – True, if the link preview is disabled

  • url (str | None) – URL to use for the link preview. If empty, then the first URL found in the message text will be used.

  • prefer_small_media (bool | None) – True, if the media in the link preview is supposed to be shrunk; ignored if the URL isn’t explicitly specified or media size change isn’t supported for the preview

  • prefer_large_media (bool | None) – True, if the media in the link preview is supposed to be enlarged; ignored if the URL isn’t explicitly specified or media size change isn’t supported for the preview

  • show_above_text (bool | None) – True, if the link preview must be shown above the message text; otherwise, the link preview will be shown below the message text

classmethod from_dict(data: dict | None) LinkPreviewOptions | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

is_disabled: bool | None = None
prefer_large_media: bool | None = None
prefer_small_media: bool | None = None
show_above_text: bool | None = None
to_dict() Dict[str, object][source]

Serialize this type to the Telegram API request shape.

Returns:

A JSON-compatible mapping representing this value.

url: str | None = None
class peyk.platforms.telegram.types.LivePhoto(file_id: str, file_unique_id: str, width: int, height: int, duration: int, photo: List[PhotoSize] | None = None, mime_type: str | None = None, file_size: int | None = None)[source]

Bases: object

This object represents a live photo.

Variables:
  • file_id (str) – Identifier for the video file which can be used to download or reuse the file

  • file_unique_id (str) – Unique identifier for the video file which is supposed to be the same over time and for different bots. Can’t be used to download or reuse the file.

  • width (int) – Video width as defined by the sender

  • height (int) – Video height as defined by the sender

  • duration (int) – Duration of the video in seconds as defined by the sender

  • photo (List[peyk.platforms.telegram.types.photo_size.PhotoSize] | None) – Available sizes of the corresponding static photo

  • mime_type (str | None) – MIME type of the file as defined by the sender

  • file_size (int | None) – File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.

file_size: int | None = None
classmethod from_dict(data: dict | None) LivePhoto | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

mime_type: str | None = None
photo: List[PhotoSize] | None = None
file_id: str
file_unique_id: str
width: int
height: int
duration: int
class peyk.platforms.telegram.types.Location(latitude: float, longitude: float, horizontal_accuracy: float | None = None, live_period: int | None = None, heading: int | None = None, proximity_alert_radius: int | None = None)[source]

Bases: object

This object represents a point on the map.

Variables:
  • latitude (float) – Latitude as defined by the sender

  • longitude (float) – Longitude as defined by the sender

  • horizontal_accuracy (float | None) – The radius of uncertainty for the location, measured in meters; 0-1500

  • live_period (int | None) – Time relative to the message sending date, during which the location can be updated; in seconds. For active live locations only.

  • heading (int | None) – The direction in which user is moving, in degrees; 1-360. For active live locations only.

  • proximity_alert_radius (int | None) – The maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only.

classmethod from_dict(data: dict | None) Location | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

heading: int | None = None
horizontal_accuracy: float | None = None
live_period: int | None = None
proximity_alert_radius: int | None = None
latitude: float
longitude: float
class peyk.platforms.telegram.types.LocationAddress(country_code: str, state: str | None = None, city: str | None = None, street_line1: str | None = None, street_line2: str | None = None, post_code: str | None = None)[source]

Bases: object

Describes the physical address of a location.

Variables:
  • country_code (str) – The two-letter ISO 3166-1 alpha-2 country code of the country where the location is located

  • state (str | None) – State of the location

  • city (str | None) – City of the location

  • street – Street address of the location

city: str | None = None
classmethod from_dict(data: dict | None) LocationAddress | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

post_code: str | None = None
state: str | None = None
street_line1: str | None = None
street_line2: str | None = None
country_code: str
class peyk.platforms.telegram.types.LoginUrl(url: str = '', forward_text: str | None = None, bot_username: str | None = None, request_write_access: bool | None = None)[source]

Bases: object

This object represents a parameter of the inline keyboard button used to automatically authorize a user. Serves as a great replacement for the Telegram Login Widget when the user is coming from Telegram. All the user needs to do is tap/click a button and confirm that they want to log in: Telegram apps support these buttons as of version 5.7. Sample bot: @discussbot

Variables:

url (str) – An HTTPS URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in Receiving authorization data.

NOTE: You must always check the hash of the received data to verify the authentication and the integrity of the data as described in Checking authorization.

forward_text: New text of the button in forwarded messages bot_username: Username of a bot, which will be used for user authorization. See Setting up a bot for more details. If not specified, the current bot’s username will be assumed. The url’s domain must be the same as the domain linked with the bot. See Linking your domain to the bot for more details. request_write_access: Pass True to request the permission for your bot to send messages to the user

bot_username: str | None = None
forward_text: str | None = None
classmethod from_dict(data: dict | None) LoginUrl | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

request_write_access: bool | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

url: str = ''
class peyk.platforms.telegram.types.ManagedBotCreated(id: str = '', user: User | None = None)[source]

Bases: object

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

Variables:

bot – Information about the bot. The bot’s token can be fetched using the method getManagedBotToken.

classmethod from_dict(data: dict | None) ManagedBotCreated | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

id: str = ''
user: User | None = None
class peyk.platforms.telegram.types.ManagedBotUpdated(id: str = '', user: User | None = None, token: str | None = None)[source]

Bases: object

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

Variables:
classmethod from_dict(data: dict | None) ManagedBotUpdated | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

id: str = ''
token: str | None = None
user: User | None = None
class peyk.platforms.telegram.types.MaskPosition(point: str, x_shift: float, y_shift: float, scale: float)[source]

Bases: object

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

Variables:
  • point (str) – The part of the face relative to which the mask should be placed. One of ‘forehead’, ‘eyes’, ‘mouth’, or ‘chin’.

  • x_shift (float) – Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place mask just to the left of the default mask position.

  • y_shift (float) – Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. For example, 1.0 will place the mask just below the default mask position.

  • scale (float) – Mask scaling coefficient. For example, 2.0 means double size.

classmethod from_dict(data: dict | None) MaskPosition | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

point: str
x_shift: float
y_shift: float
scale: float
class peyk.platforms.telegram.types.MenuButtonCommands(type: str = 'commands')[source]

Bases: object

Represents a menu button, which opens the bot’s list of commands.

Variables:

type (str) – Type of the button, must be commands

classmethod from_dict(data: dict | None) MenuButtonCommands | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

type: str = 'commands'
class peyk.platforms.telegram.types.MenuButtonDefault(type: str = 'default')[source]

Bases: object

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

Variables:

type (str) – Type of the button, must be default

classmethod from_dict(data: dict | None) MenuButtonDefault | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

type: str = 'default'
class peyk.platforms.telegram.types.MenuButtonWebApp(type: str = 'web_app', text: str = '', web_app: WebAppInfo | None = None)[source]

Bases: object

Represents a menu button, which launches a Web App.

Variables:
  • type (str) – Type of the button, must be web_app

  • text (str) – Text on the button

  • web_app (peyk.platforms.telegram.types.web_app_info.WebAppInfo | None) – Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Alternatively, a t.me link to a Web App of the bot can be specified in the object instead of the Web App’s URL, in which case the Web App will be opened as if the user pressed the link.

classmethod from_dict(data: dict | None) MenuButtonWebApp | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

text: str = ''
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

type: str = 'web_app'
web_app: WebAppInfo | None = None
class peyk.platforms.telegram.types.Message(message_id: int, date: int, chat: Chat, message_thread_id: int | None = None, from_: User | None = None, sender_chat: Chat | None = None, sender_boost_count: int | None = None, sender_business_bot: User | None = None, business_connection_id: str | None = None, forward_origin: object | None = None, is_topic_message: bool | None = None, is_automatic_forward: bool | None = None, reply_to_message: Message | None = None, external_reply: ExternalReplyInfo | None = None, quote: TextQuote | None = None, reply_to_story: object | None = None, via_bot: User | None = None, author_signature: str | None = None, text: str | None = None, entities: List[MessageEntity] | None = None, link_preview_options: object | None = None, effect_id: str | None = None, animation: Animation | None = None, audio: Audio | None = None, document: Document | None = None, paid_media: object | None = None, photo: List[PhotoSize] | None = None, sticker: object | None = None, story: object | None = None, video: Video | None = None, video_note: VideoNote | None = None, voice: Voice | None = None, live_photo: LivePhoto | None = None, caption: str | None = None, caption_entities: List[MessageEntity] | None = None, show_caption_above_media: bool | None = None, has_media_spoiler: bool | None = None, contact: Contact | None = None, dice: Dice | None = None, game: object | None = None, poll: Poll | None = None, venue: Venue | None = None, location: Location | None = None, new_chat_members: List[User] | None = None, left_chat_member: User | None = None, new_chat_title: str | None = None, new_chat_photo: object | None = None, delete_chat_photo: bool | None = None, group_chat_created: bool | None = None, supergroup_chat_created: bool | None = None, channel_chat_created: bool | None = None, message_auto_delete_timer_changed: object | None = None, migrate_to_chat_id: int | None = None, migrate_from_chat_id: int | None = None, pinned_message: Message | None = None, invoice: object | None = None, successful_payment: object | None = None, users_shared: object | None = None, chat_shared: object | None = None, connected_website: str | None = None, write_access_allowed: object | None = None, passport_data: object | None = None, proximity_alert_triggered: object | None = None, boost_added: object | None = None, chat_background_set: object | None = None, forum_topic_created: ForumTopicCreated | None = None, forum_topic_edited: ForumTopicEdited | None = None, forum_topic_closed: ForumTopicClosed | None = None, forum_topic_reopened: ForumTopicReopened | None = None, general_forum_topic_hidden: GeneralForumTopicHidden | None = None, general_forum_topic_unhidden: GeneralForumTopicUnhidden | None = None, giveaway_created: object | None = None, giveaway: object | None = None, giveaway_winners: object | None = None, giveaway_completed: object | None = None, paid_message_price_changed: object | None = None, video_chat_scheduled: object | None = None, video_chat_started: object | None = None, video_chat_ended: object | None = None, video_chat_participants_invited: object | None = None, web_app_data: object | None = None, reply_markup: InlineKeyboardMarkup | None = None)[source]

Bases: object

This object represents a message.

Variables:
  • message_id (int) – Unique message identifier inside this chat; 0 for ephemeral messages. In specific instances (e.g., a message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent.

  • date (int) – Date the message was sent in Unix time. It is always a positive number, representing a valid date.

  • chat (peyk.platforms.telegram.types.chat.Chat) – Chat the message belongs to

  • message_thread_id (int | None) – Unique identifier of a message thread or forum topic to which the message belongs; for supergroups and private chats only

  • direct_messages_topic – Information about the direct messages chat topic that contains the message

  • from – Sender of the message; may be empty for messages sent to channels. For backward compatibility, if the message was sent on behalf of a chat, the field contains a fake sender user in non-channel chats.

  • sender_chat (peyk.platforms.telegram.types.chat.Chat | None) – Sender of the message when sent on behalf of a chat. For example, the supergroup itself for messages sent by its anonymous administrators or a linked channel for messages automatically forwarded to the channel’s discussion group. For backward compatibility, if the message was sent on behalf of a chat, the field from contains a fake sender user in non-channel chats.

  • sender_boost_count (int | None) – If the sender of the message boosted the chat, the number of boosts added by the user

  • sender_business_bot (peyk.platforms.telegram.types.user.User | None) – The bot that actually sent the message on behalf of the business account. Available only for outgoing messages sent on behalf of the connected business account.

  • sender_tag – Tag or custom title of the sender of the message; for supergroups only

  • guest_query_id – The unique identifier for the guest query. Use this identifier with the method answerGuestQuery to send a response message. If non-empty, the message belongs to the chat where the guest bot was summoned, which may not coincide with other existing bot chats sharing the same identifier.

  • business_connection_id (str | None) – Unique identifier of the business connection from which the message was received. If non-empty, the message belongs to a chat of the corresponding business account that is independent from any potential bot chat which might share the same identifier.

  • forward_origin (object | None) – Information about the original message for forwarded messages

  • is_topic_message (bool | None) – True, if the message is sent to a topic in a forum supergroup or a private chat with the bot

  • is_automatic_forward (bool | None) – True, if the message is a channel post that was automatically forwarded to the connected discussion group

  • reply_to_message (peyk.platforms.telegram.types.message.Message | None) – For replies in the same chat and message thread, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply. If the message is a reply to an ephemeral message, then this field may be omitted.

  • external_reply (peyk.platforms.telegram.types.external_reply_info.ExternalReplyInfo | None) – Information about the message that is being replied to, which may come from another chat or forum topic

  • quote (peyk.platforms.telegram.types.text_quote.TextQuote | None) – For replies that quote part of the original message, the quoted part of the message

  • reply_to_story (object | None) – For replies to a story, the original story

  • reply_to_checklist_task_id – Identifier of the specific checklist task that is being replied to

  • reply_to_poll_option_id – Persistent identifier of the specific poll option that is being replied to

  • via_bot (peyk.platforms.telegram.types.user.User | None) – Bot through which the message was sent

  • guest_bot_caller_user – For a message sent by a guest bot, this is the user whose original message triggered the bot’s response

  • guest_bot_caller_chat – For a message sent by a guest bot, this is the chat whose original message triggered the bot’s response

  • edit_date – Date the message was last edited in Unix time

  • has_protected_content – True, if the message can’t be forwarded

  • is_from_offline – True, if the message was sent by an implicit action, for example, as an away or a greeting business message, or as a scheduled message

  • is_paid_post – True, if the message is a paid post. Note that such posts must not be deleted for 24 hours to receive the payment and can’t be edited.

  • media_group_id – The unique identifier inside this chat of a media message group this message belongs to

  • author_signature (str | None) – Signature of the post author for messages in channels, or the custom title of an anonymous group administrator

  • paid_star_count – The number of Telegram Stars that were paid by the sender of the message to send it

  • text (str | None) – For text messages, the actual UTF-8 text of the message

  • entities (List[peyk.platforms.telegram.types.message_entity.MessageEntity] | None) – For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text

  • link_preview_options (object | None) – Options used for link preview generation for the message, if it is a text message and link preview options were changed

  • suggested_post_info – Information about suggested post parameters if the message is a suggested post in a channel direct messages chat. If the message is an approved or declined suggested post, then it can’t be edited.

  • effect_id (str | None) – Unique identifier of the message effect added to the message

  • animation (peyk.platforms.telegram.types.animation.Animation | None) – Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set.

  • audio (peyk.platforms.telegram.types.audio.Audio | None) – Message is an audio file, information about the file

  • document (peyk.platforms.telegram.types.document.Document | None) – Message is a general file, information about the file

  • live_photo (peyk.platforms.telegram.types.live_photo.LivePhoto | None) – Message is a live photo, information about the live photo. For backward compatibility, when this field is set, the photo field will also be set.

  • paid_media (object | None) – Message contains paid media; information about the paid media

  • photo (List[peyk.platforms.telegram.types.photo_size.PhotoSize] | None) – Message is a photo, available sizes of the photo

  • sticker (object | None) – Message is a sticker, information about the sticker

  • story (object | None) – Message is a forwarded story

  • video (peyk.platforms.telegram.types.video.Video | None) – Message is a video, information about the video

  • video_note (peyk.platforms.telegram.types.video_note.VideoNote | None) – Message is a video note, information about the video message

  • voice (peyk.platforms.telegram.types.voice.Voice | None) – Message is a voice message, information about the file

  • caption (str | None) – Caption for the animation, audio, document, paid media, photo, video or voice

  • caption_entities (List[peyk.platforms.telegram.types.message_entity.MessageEntity] | None) – For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption

  • show_caption_above_media (bool | None) – True, if the caption must be shown above the message media

  • has_media_spoiler (bool | None) – True, if the message media is covered by a spoiler animation

  • checklist – Message is a checklist

  • contact (peyk.platforms.telegram.types.contact.Contact | None) – Message is a shared contact, information about the contact

  • dice (peyk.platforms.telegram.types.dice.Dice | None) – Message is a dice with random value

  • game (object | None) – Message is a game, information about the game.

  • poll (peyk.platforms.telegram.types.poll.Poll | None) – Message is a native poll, information about the poll

  • venue (peyk.platforms.telegram.types.venue.Venue | None) – Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set.

  • location (peyk.platforms.telegram.types.location.Location | None) – Message is a shared location, information about the location

  • new_chat_members (List[peyk.platforms.telegram.types.user.User] | None) – New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)

  • left_chat_member (peyk.platforms.telegram.types.user.User | None) – A member was removed from the group, information about them (this member may be the bot itself)

  • chat_owner_left – Service message: chat owner has left

  • chat_owner_changed – Service message: chat owner has changed

  • new_chat_title (str | None) – A chat title was changed to this value

  • new_chat_photo (object | None) – A chat photo was change to this value

  • delete_chat_photo (bool | None) – Service message: the chat photo was deleted

  • group_chat_created (bool | None) – Service message: the group has been created

  • supergroup_chat_created (bool | None) – Service message: the supergroup has been created. This field can’t be received in a message coming through updates, because bot can’t be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup.

  • channel_chat_created (bool | None) – Service message: the channel has been created. This field can’t be received in a message coming through updates, because bot can’t be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel.

  • message_auto_delete_timer_changed (object | None) – Service message: auto-delete timer settings changed in the chat

  • migrate_to_chat_id (int | None) – The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.

  • migrate_from_chat_id (int | None) – The supergroup has been migrated from a group with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.

  • pinned_message (peyk.platforms.telegram.types.message.Message | None) – Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.

  • invoice (object | None) – Message is an invoice for a payment, information about the invoice.

  • successful_payment (object | None) – Message is a service message about a successful payment, information about the payment.

  • refunded_payment – Message is a service message about a refunded payment, information about the payment.

  • users_shared (object | None) – Service message: users were shared with the bot

  • chat_shared (object | None) – Service message: a chat was shared with the bot

  • gift – Service message: a regular gift was sent or received

  • unique_gift – Service message: a unique gift was sent or received

  • gift_upgrade_sent – Service message: upgrade of a gift was purchased after the gift was sent

  • connected_website (str | None) – The domain name of the website on which the user has logged in.

  • write_access_allowed (object | None) – Service message: the user allowed the bot to write messages after adding it to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess

  • passport_data (object | None) – Telegram Passport data

  • proximity_alert_triggered (object | None) – Service message. A user in the chat triggered another user’s proximity alert while sharing Live Location.

  • boost_added (object | None) – Service message: user boosted the chat

  • chat_background_set (object | None) – Service message: chat background set

  • checklist_tasks_done – Service message: some tasks in a checklist were marked as done or not done

  • checklist_tasks_added – Service message: tasks were added to a checklist

  • direct_message_price_changed – Service message: the price for paid messages in the corresponding direct messages chat of a channel has changed

  • forum_topic_created (peyk.platforms.telegram.types.forum_topic_created.ForumTopicCreated | None) – Service message: forum topic created

  • forum_topic_edited (peyk.platforms.telegram.types.forum_topic_edited.ForumTopicEdited | None) – Service message: forum topic edited

  • forum_topic_closed (peyk.platforms.telegram.types.forum_topic_closed.ForumTopicClosed | None) – Service message: forum topic closed

  • forum_topic_reopened (peyk.platforms.telegram.types.forum_topic_reopened.ForumTopicReopened | None) – Service message: forum topic reopened

  • general_forum_topic_hidden (peyk.platforms.telegram.types.general_forum_topic_hidden.GeneralForumTopicHidden | None) – Service message: the ‘General’ forum topic hidden

  • general_forum_topic_unhidden (peyk.platforms.telegram.types.general_forum_topic_unhidden.GeneralForumTopicUnhidden | None) – Service message: the ‘General’ forum topic unhidden

  • giveaway_created (object | None) – Service message: a scheduled giveaway was created

  • giveaway (object | None) – The message is a scheduled giveaway message

  • giveaway_winners (object | None) – A giveaway with public winners was completed

  • giveaway_completed (object | None) – Service message: a giveaway without public winners was completed

  • managed_bot_created – Service message: user created a bot that will be managed by the current bot

  • paid_message_price_changed (object | None) – Service message: the price for paid messages has changed in the chat

  • poll_option_added – Service message: answer option was added to a poll

  • poll_option_deleted – Service message: answer option was deleted from a poll

  • suggested_post_approved – Service message: a suggested post was approved

  • suggested_post_approval_failed – Service message: approval of a suggested post has failed

  • suggested_post_declined – Service message: a suggested post was declined

  • suggested_post_paid – Service message: payment for a suggested post was received

  • suggested_post_refunded – Service message: payment for a suggested post was refunded

  • video_chat_scheduled (object | None) – Service message: video chat scheduled

  • video_chat_started (object | None) – Service message: video chat started

  • video_chat_ended (object | None) – Service message: video chat ended

  • video_chat_participants_invited (object | None) – Service message: new participants invited to a video chat

  • web_app_data (object | None) – Service message: data sent by a Web App

  • reply_markup (peyk.platforms.telegram.types.inline_keyboard_markup.InlineKeyboardMarkup | None) – Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons.

  • rich_message – Message is a rich formatted message

  • receiver_user – For ephemeral messages, the user who received the message

  • ephemeral_message_id – For ephemeral messages, identifier of the ephemeral message inside this chat. The identifier may be reused for another ephemeral message after the message is deleted or expires.

  • community_chat_added – Service message: chat added to a Community

  • community_chat_removed – Service message: chat removed from a Community

  • forward_date – For forwarded messages, date the original message was sent in Unix time

  • forward_from – For forwarded messages, sender of the original message

  • forward_from_chat – For messages forwarded from channels or from anonymous administrators, information about the original sender chat

  • forward_from_message_id – For messages forwarded from channels, identifier of the original message in the channel

  • forward_sender_name – Sender’s name for messages forwarded from users who disallow adding a link to their account in forwarded messages

  • forward_signature – For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present

  • user_shared – Service message: a user was shared with the bot

animation: Animation | None = None
audio: Audio | None = None
author_signature: str | None = None
boost_added: object | None = None
business_connection_id: str | None = None
caption: str | None = None
caption_entities: List[MessageEntity] | None = None
channel_chat_created: bool | None = None
chat_background_set: object | None = None
chat_boost = None
chat_owner_changed = None
chat_owner_left = None
chat_shared: object | None = None
checklist = None
community_chat_added = None
community_chat_joined = None
community_chat_removed = None
connected_website: str | None = None
contact: Contact | None = None
delete_chat_photo: bool | None = None
dice: Dice | None = None
direct_messages_topic = None
document: Document | None = None
edit_date = None
effect_id: str | None = None
entities: List[MessageEntity] | None = None
ephemeral_message_id = None
external_reply: ExternalReplyInfo | None = None
forum_topic_closed: ForumTopicClosed | None = None
forum_topic_created: ForumTopicCreated | None = None
forum_topic_edited: ForumTopicEdited | None = None
forum_topic_reopened: ForumTopicReopened | None = None
forward_origin: object | None = None
from_: User | None = None
classmethod from_dict(data)
game: object | None = None
general_forum_topic_hidden: GeneralForumTopicHidden | None = None
general_forum_topic_unhidden: GeneralForumTopicUnhidden | None = None
giveaway: object | None = None
giveaway_completed: object | None = None
giveaway_created: object | None = None
giveaway_winners: object | None = None
group_chat_created: bool | None = None
guest_bot_caller_chat = None
guest_bot_caller_user = None
guest_query_id = None
has_media_spoiler: bool | None = None
has_protected_content = None
invoice: object | None = None
is_automatic_forward: bool | None = None
is_from_offline = None
is_paid_post = None
is_topic_message: bool | None = None
left_chat_member: User | None = None
classmethod list_from_result(data: List[dict] | None) List[Message][source]

Parse a Telegram API result list into this type.

Parameters:

data – Raw result list, or None.

Returns:

Parsed type instances.

live_photo: LivePhoto | None = None
location: Location | None = None
media_group_id = None
message_auto_delete_timer_changed: object | None = None
message_thread_id: int | None = None
migrate_from_chat_id: int | None = None
migrate_to_chat_id: int | None = None
new_chat_members: List[User] | None = None
new_chat_photo: object | None = None
new_chat_title: str | None = None
paid_media: object | None = None
paid_message_price_changed: object | None = None
paid_star_count = None
passport_data: object | None = None
photo: List[PhotoSize] | None = None
pinned_message: Message | None = None
poll: Poll | None = None
proximity_alert_triggered: object | None = None
quote: TextQuote | None = None
receiver_user = None
refunded_payment = None
removed_chat_boost = None
reply_markup: InlineKeyboardMarkup | None = None
reply_to_message: Message | None = None
reply_to_story: object | None = None
rich_message = None
sender_boost_count: int | None = None
sender_business_bot: User | None = None
sender_chat: Chat | None = None
sender_tag = None
show_caption_above_media: bool | None = None
sticker: object | None = None
story: object | None = None
successful_payment: object | None = None
suggested_post_info = None
supergroup_chat_created: bool | None = None
text: str | None = None
users_shared: object | None = None
venue: Venue | None = None
via_bot: User | None = None
video: Video | None = None
video_chat_ended: object | None = None
video_chat_participants_invited: object | None = None
video_chat_scheduled: object | None = None
video_chat_started: object | None = None
video_note: VideoNote | None = None
voice: Voice | None = None
web_app_data: object | None = None
write_access_allowed: object | None = None
message_id: int
date: int
chat: Chat
class peyk.platforms.telegram.types.MessageAutoDeleteTimerChanged(message_auto_delete_time: int = 0)[source]

Bases: object

This object represents a service message about a change in auto-delete timer settings.

Variables:

message_auto_delete_time (int) – New auto-delete time for messages in the chat; in seconds

classmethod from_dict(data: dict | None) MessageAutoDeleteTimerChanged | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

message_auto_delete_time: int = 0
class peyk.platforms.telegram.types.MessageEntity(type: str, offset: int, length: int, url: str | None = None, user: User | None = None, language: str | None = None, custom_emoji_id: str | None = None)[source]

Bases: object

This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.

Variables:
  • type (str) – Type of the entity. Currently, can be ‘mention’ (@username), ‘hashtag’ (#hashtag or #hashtag@chatusername), ‘cashtag’ ($USD or $USD@chatusername), ‘bot_command’ (/start@jobs_bot), ‘url’ (https://telegram.org), ‘email’ (do-not-reply@telegram.org), ‘phone_number’ (+1-212-555-0123), ‘bold’ (bold text), ‘italic’ (italic text), ‘underline’ (underlined text), ‘strikethrough’ (strikethrough text), ‘spoiler’ (spoiler message), ‘blockquote’ (block quotation), ‘expandable_blockquote’ (collapsed-by-default block quotation), ‘code’ (monowidth string), ‘pre’ (monowidth block), ‘text_link’ (for clickable text URLs), ‘text_mention’ (for users without usernames), ‘custom_emoji’ (for inline custom emoji stickers), or ‘date_time’ (for formatted date and time).

  • offset (int) – Offset in UTF-16 code units to the start of the entity

  • length (int) – Length of the entity in UTF-16 code units

  • url (str | None) – For ‘text_link’ only, URL that will be opened after user taps on the text

  • user (peyk.platforms.telegram.types.user.User | None) – For ‘text_mention’ only, the mentioned user

  • language (str | None) – For ‘pre’ only, the programming language of the entity text

  • custom_emoji_id (str | None) – For ‘custom_emoji’ only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker.

  • unix_time – For ‘date_time’ only, the Unix time associated with the entity

  • date_time_format – For ‘date_time’ only, the string that defines the formatting of the date and time. See date-time entity formatting for more details.

custom_emoji_id: str | None = None
classmethod from_dict(data: dict | None) MessageEntity | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

language: str | None = None
classmethod list_from(data: List[dict] | None) List[MessageEntity] | None[source]

Parse a Telegram API result list into this type.

Parameters:

data – Raw result list, or None.

Returns:

Parsed type instances.

to_dict() Dict[str, object][source]

Serialize for outgoing request bodies (T2: send/edit params).

Returns:

The operation result (Dict[str, object]).

url: str | None = None
user: User | None = None
type: str
offset: int
length: int
class peyk.platforms.telegram.types.MessageGenerationStopped(chat_id: int = 0, message_id: int | None = None, message_thread_id: int | None = None, draft_id: int | None = None)[source]

Bases: object

MessageGenerationStopped Telegram Bot API type.

chat_id: int = 0
draft_id: int | None = None
classmethod from_dict(data: dict | None) MessageGenerationStopped | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

message_id: int | None = None
message_thread_id: int | None = None
class peyk.platforms.telegram.types.MessageId(message_id: int)[source]

Bases: object

This object represents a unique message identifier.

Variables:

message_id (int) – Unique message identifier. In specific instances (e.g., message containing a video sent to a big chat), the server might automatically schedule a message instead of sending it immediately. In such cases, this field will be 0 and the relevant message will be unusable until it is actually sent.

classmethod from_dict(data: dict | None) MessageId | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

message_id: int
class peyk.platforms.telegram.types.MessageOriginChannel(type: str = 'channel', date: int = 0, chat: Chat | None = None, message_id: int | None = None, author_signature: str | None = None)[source]

Bases: object

The message was originally sent to a channel chat.

Variables:
  • type (str) – Type of the message origin, always ‘channel’

  • date (int) – Date the message was sent originally in Unix time

  • chat (peyk.platforms.telegram.types.chat.Chat | None) – Channel chat to which the message was originally sent

  • message_id (int | None) – Unique message identifier inside the chat

  • author_signature (str | None) – Signature of the original post author

author_signature: str | None = None
chat: Chat | None = None
date: int = 0
classmethod from_dict(data: dict | None) MessageOriginChannel | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

message_id: int | None = None
type: str = 'channel'
class peyk.platforms.telegram.types.MessageOriginChat(type: str = 'chat', date: int = 0, sender_chat: Chat | None = None, author_signature: str | None = None)[source]

Bases: object

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

Variables:
  • type (str) – Type of the message origin, always ‘chat’

  • date (int) – Date the message was sent originally in Unix time

  • sender_chat (peyk.platforms.telegram.types.chat.Chat | None) – Chat that sent the message originally

  • author_signature (str | None) – For messages originally sent by an anonymous chat administrator, original message author signature

author_signature: str | None = None
date: int = 0
classmethod from_dict(data: dict | None) MessageOriginChat | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

sender_chat: Chat | None = None
type: str = 'chat'
class peyk.platforms.telegram.types.MessageOriginHiddenUser(type: str = 'hidden_user', date: int = 0, sender_user_name: str = '')[source]

Bases: object

The message was originally sent by an unknown user.

Variables:
  • type (str) – Type of the message origin, always ‘hidden_user’

  • date (int) – Date the message was sent originally in Unix time

  • sender_user_name (str) – Name of the user that sent the message originally

date: int = 0
classmethod from_dict(data: dict | None) MessageOriginHiddenUser | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

sender_user_name: str = ''
type: str = 'hidden_user'
class peyk.platforms.telegram.types.MessageOriginUser(type: str = 'user', date: int = 0, sender_user: User | None = None)[source]

Bases: object

The message was originally sent by a known user.

Variables:
  • type (str) – Type of the message origin, always ‘user’

  • date (int) – Date the message was sent originally in Unix time

  • sender_user (peyk.platforms.telegram.types.user.User | None) – User that sent the message originally

date: int = 0
classmethod from_dict(data: dict | None) MessageOriginUser | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

sender_user: User | None = None
type: str = 'user'
class peyk.platforms.telegram.types.MessageReactionCountUpdated(chat: Chat, message_id: int, date: int, reactions: List[ReactionCount] | None = None)[source]

Bases: object

This object represents reaction changes on a message with anonymous reactions.

Variables:
classmethod from_dict(data: dict | None) MessageReactionCountUpdated | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

reactions: List[ReactionCount] | None = None
chat: Chat
message_id: int
date: int
class peyk.platforms.telegram.types.MessageReactionUpdated(chat: Chat, message_id: int, date: int, old_reaction: List[ReactionTypeEmoji | ReactionTypeCustomEmoji | ReactionTypePaid] | None = None, new_reaction: List[ReactionTypeEmoji | ReactionTypeCustomEmoji | ReactionTypePaid] | None = None, user: User | None = None, actor_chat: Chat | None = None)[source]

Bases: object

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

Variables:
actor_chat: Chat | None = None
classmethod from_dict(data: dict | None) MessageReactionUpdated | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

new_reaction: List[ReactionTypeEmoji | ReactionTypeCustomEmoji | ReactionTypePaid] | None = None
old_reaction: List[ReactionTypeEmoji | ReactionTypeCustomEmoji | ReactionTypePaid] | None = None
user: User | None = None
chat: Chat
message_id: int
date: int
class peyk.platforms.telegram.types.OrderInfo(name: str | None = None, phone_number: str | None = None, email: str | None = None, shipping_address: ShippingAddress | None = None)[source]

Bases: object

This object represents information about an order.

Variables:
email: str | None = None
classmethod from_dict(data: dict | None) OrderInfo | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

name: str | None = None
phone_number: str | None = None
shipping_address: ShippingAddress | None = None
class peyk.platforms.telegram.types.OwnedGiftRegular(gift: Gift, send_date: int, type: str = 'regular', owned_gift_id: str | None = None, sender_user: User | None = None, text: str | None = None, entities: List[MessageEntity] | None = None, is_private: bool | None = None, is_saved: bool | None = None, can_be_upgraded: bool | None = None, was_refunded: bool | None = None, convert_star_count: int | None = None, prepaid_upgrade_star_count: int | None = None, is_upgrade_separate: bool | None = None, unique_gift_number: int | None = None)[source]

Bases: object

Describes a regular gift owned by a user or a chat.

Variables:
  • type (str) – Type of the gift, always ‘regular’

  • gift (peyk.platforms.telegram.types.gift.Gift) – Information about the regular gift

  • send_date (int) – Date the gift was sent in Unix time

  • owned_gift_id (str | None) – Unique identifier of the gift for the bot; for gifts received on behalf of business accounts only

  • sender_user (peyk.platforms.telegram.types.user.User | None) – Sender of the gift if it is a known user

  • text (str | None) – Text of the message that was added to the gift

  • entities (List[peyk.platforms.telegram.types.message_entity.MessageEntity] | None) – Special entities that appear in the text

  • is_private (bool | None) – True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them

  • is_saved (bool | None) – True, if the gift is displayed on the account’s profile page; for gifts received on behalf of business accounts only

  • can_be_upgraded (bool | None) – True, if the gift can be upgraded to a unique gift; for gifts received on behalf of business accounts only

  • was_refunded (bool | None) – True, if the gift was refunded and isn’t available anymore

  • convert_star_count (int | None) – Number of Telegram Stars that can be claimed by the receiver instead of the gift; omitted if the gift cannot be converted to Telegram Stars; for gifts received on behalf of business accounts only

  • prepaid_upgrade_star_count (int | None) – Number of Telegram Stars that were paid for the ability to upgrade the gift

  • is_upgrade_separate (bool | None) – True, if the gift’s upgrade was purchased after the gift was sent; for gifts received on behalf of business accounts only

  • unique_gift_number (int | None) – Unique number reserved for this gift when upgraded. See the number field in UniqueGift.

can_be_upgraded: bool | None = None
convert_star_count: int | None = None
date = None
entities: List[MessageEntity] | None = None
classmethod from_dict(data)
is_private: bool | None = None
is_saved: bool | None = None
is_upgrade_separate: bool | None = None
owned_gift_id: str | None = None
prepaid_upgrade_star_count: int | None = None
sender_user: User | None = None
text: str | None = None
type: str = 'regular'
unique_gift_number: int | None = None
was_refunded: bool | None = None
gift: Gift
send_date: int
class peyk.platforms.telegram.types.OwnedGiftUnique(gift: UniqueGift, send_date: int, type: str = 'unique', owned_gift_id: str | None = None, sender_user: User | None = None, is_saved: bool | None = None, can_be_transferred: bool | None = None, transfer_star_count: int | None = None, next_transfer_date: int | None = None)[source]

Bases: object

Describes a unique gift received and owned by a user or a chat.

Variables:
  • type (str) – Type of the gift, always ‘unique’

  • gift (peyk.platforms.telegram.types.unique_gift.UniqueGift) – Information about the unique gift

  • send_date (int) – Date the gift was sent in Unix time

  • owned_gift_id (str | None) – Unique identifier of the received gift for the bot; for gifts received on behalf of business accounts only

  • sender_user (peyk.platforms.telegram.types.user.User | None) – Sender of the gift if it is a known user

  • is_saved (bool | None) – True, if the gift is displayed on the account’s profile page; for gifts received on behalf of business accounts only

  • can_be_transferred (bool | None) – True, if the gift can be transferred to another owner; for gifts received on behalf of business accounts only

  • transfer_star_count (int | None) – Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift

  • next_transfer_date (int | None) – Point in time (Unix timestamp) when the gift can be transferred. If it is in the past, then the gift can be transferred now.

can_be_transferred: bool | None = None
date = None
classmethod from_dict(data)
is_saved: bool | None = None
next_transfer_date: int | None = None
owned_gift_id: str | None = None
sender_user: User | None = None
transfer_star_count: int | None = None
type: str = 'unique'
gift: UniqueGift
send_date: int
class peyk.platforms.telegram.types.OwnedGifts(total_count: int, gifts: List[OwnedGiftRegular | OwnedGiftUnique], next_offset: str | None = None)[source]

Bases: object

Contains the list of gifts received and owned by a user or a chat.

Variables:
classmethod from_dict(data: dict | None) OwnedGifts | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

next_offset: str | None = None
total_count: int
gifts: List[OwnedGiftRegular | OwnedGiftUnique]
class peyk.platforms.telegram.types.PaidMediaInfo(star_count: int, paid_media: List[PaidMediaLivePhoto | PaidMediaPhoto | PaidMediaPreview | PaidMediaVideo])[source]

Bases: object

Describes the paid media added to a message.

Variables:
classmethod from_dict(data: dict | None) PaidMediaInfo | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

star_count: int
paid_media: List[PaidMediaLivePhoto | PaidMediaPhoto | PaidMediaPreview | PaidMediaVideo]
class peyk.platforms.telegram.types.PaidMediaLivePhoto(type: str = 'live_photo', live_photo: LivePhoto | None = None)[source]

Bases: object

The paid media is a live photo.

Variables:
classmethod from_dict(data: dict | None) PaidMediaLivePhoto | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

live_photo: LivePhoto | None = None
type: str = 'live_photo'
class peyk.platforms.telegram.types.PaidMediaPhoto(photo: List[PhotoSize], type: str = 'photo')[source]

Bases: object

The paid media is a photo.

Variables:
classmethod from_dict(data: dict | None) PaidMediaPhoto | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

type: str = 'photo'
photo: List[PhotoSize]
class peyk.platforms.telegram.types.PaidMediaPreview(type: str = 'preview', width: int | None = None, height: int | None = None, duration: int | None = None)[source]

Bases: object

The paid media isn’t available before the payment.

Variables:
  • type (str) – Type of the paid media, always ‘preview’

  • width (int | None) – Media width as defined by the sender

  • height (int | None) – Media height as defined by the sender

  • duration (int | None) – Duration of the media in seconds as defined by the sender

duration: int | None = None
classmethod from_dict(data: dict | None) PaidMediaPreview | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

height: int | None = None
type: str = 'preview'
width: int | None = None
class peyk.platforms.telegram.types.PaidMediaPurchased(user: User | None = None, paid_media_payload: str = '')[source]

Bases: object

This object contains information about a paid media purchase.

Variables:
  • from – User who purchased the media

  • paid_media_payload (str) – Bot-specified paid media payload

classmethod from_dict(data: dict | None) PaidMediaPurchased | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

paid_media_payload: str = ''
user: User | None = None
class peyk.platforms.telegram.types.PaidMediaVideo(video: Video, type: str = 'video')[source]

Bases: object

The paid media is a video.

Variables:
classmethod from_dict(data: dict | None) PaidMediaVideo | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

type: str = 'video'
video: Video
class peyk.platforms.telegram.types.PaidMessagePriceChanged(paid_message_star_count: int | None = None)[source]

Bases: object

Describes a service message about a change in the price of paid messages within a chat.

Variables:

paid_message_star_count (int | None) – The new number of Telegram Stars that must be paid by non-administrator users of the supergroup chat for each sent message

classmethod from_dict(data: dict | None) PaidMessagePriceChanged | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

paid_message_star_count: int | None = None
class peyk.platforms.telegram.types.PassportData(data: List[EncryptedPassportElement], credentials: EncryptedCredentials)[source]

Bases: object

Describes Telegram Passport data shared with the bot by the user.

Variables:
classmethod from_dict(data: dict | None) PassportData | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

data: List[EncryptedPassportElement]
credentials: EncryptedCredentials
class peyk.platforms.telegram.types.PassportElementErrorDataField(type: str, field_name: str, data_hash: str, message: str, source: str = 'data')

Bases: object

PassportElementErrorDataField Telegram Bot API type.

classmethod from_dict(data)

Executes the from_dict operation.

Parameters:

data – Value of the declared parameter type.

Returns:

The operation result (Any).

classmethod list_from(data)

Executes the list_from operation.

Parameters:

data – Value of the declared parameter type.

Returns:

The operation result (Any).

source: str = 'data'
to_dict()

Executes the to_dict operation.

Returns:

The operation result (Any).

type: str
field_name: str
data_hash: str
message: str
class peyk.platforms.telegram.types.PassportElementErrorFile(type: str, file_hash: str, message: str, source: str = 'file')

Bases: object

PassportElementErrorFile Telegram Bot API type.

classmethod from_dict(data)

Executes the from_dict operation.

Parameters:

data – Value of the declared parameter type.

Returns:

The operation result (Any).

classmethod list_from(data)

Executes the list_from operation.

Parameters:

data – Value of the declared parameter type.

Returns:

The operation result (Any).

source: str = 'file'
to_dict()

Executes the to_dict operation.

Returns:

The operation result (Any).

type: str
file_hash: str
message: str
class peyk.platforms.telegram.types.PassportElementErrorFiles(type: str, file_hashes: List[str], message: str, source: str = 'files')

Bases: object

PassportElementErrorFiles Telegram Bot API type.

classmethod from_dict(data)

Executes the from_dict operation.

Parameters:

data – Value of the declared parameter type.

Returns:

The operation result (Any).

classmethod list_from(data)

Executes the list_from operation.

Parameters:

data – Value of the declared parameter type.

Returns:

The operation result (Any).

source: str = 'files'
to_dict()

Executes the to_dict operation.

Returns:

The operation result (Any).

type: str
file_hashes: List[str]
message: str
class peyk.platforms.telegram.types.PassportElementErrorFrontSide(type: str, file_hash: str, message: str, source: str = 'front_side')

Bases: object

PassportElementErrorFrontSide Telegram Bot API type.

classmethod from_dict(data)

Executes the from_dict operation.

Parameters:

data – Value of the declared parameter type.

Returns:

The operation result (Any).

classmethod list_from(data)

Executes the list_from operation.

Parameters:

data – Value of the declared parameter type.

Returns:

The operation result (Any).

source: str = 'front_side'
to_dict()

Executes the to_dict operation.

Returns:

The operation result (Any).

type: str
file_hash: str
message: str
class peyk.platforms.telegram.types.PassportElementErrorReverseSide(type: str, file_hash: str, message: str, source: str = 'reverse_side')

Bases: object

PassportElementErrorReverseSide Telegram Bot API type.

classmethod from_dict(data)

Executes the from_dict operation.

Parameters:

data – Value of the declared parameter type.

Returns:

The operation result (Any).

classmethod list_from(data)

Executes the list_from operation.

Parameters:

data – Value of the declared parameter type.

Returns:

The operation result (Any).

source: str = 'reverse_side'
to_dict()

Executes the to_dict operation.

Returns:

The operation result (Any).

type: str
file_hash: str
message: str
class peyk.platforms.telegram.types.PassportElementErrorSelfie(type: str, file_hash: str, message: str, source: str = 'selfie')

Bases: object

PassportElementErrorSelfie Telegram Bot API type.

classmethod from_dict(data)

Executes the from_dict operation.

Parameters:

data – Value of the declared parameter type.

Returns:

The operation result (Any).

classmethod list_from(data)

Executes the list_from operation.

Parameters:

data – Value of the declared parameter type.

Returns:

The operation result (Any).

source: str = 'selfie'
to_dict()

Executes the to_dict operation.

Returns:

The operation result (Any).

type: str
file_hash: str
message: str
class peyk.platforms.telegram.types.PassportElementErrorTranslationFile(type: str, file_hash: str, message: str, source: str = 'translation_file')

Bases: object

PassportElementErrorTranslationFile Telegram Bot API type.

classmethod from_dict(data)

Executes the from_dict operation.

Parameters:

data – Value of the declared parameter type.

Returns:

The operation result (Any).

classmethod list_from(data)

Executes the list_from operation.

Parameters:

data – Value of the declared parameter type.

Returns:

The operation result (Any).

source: str = 'translation_file'
to_dict()

Executes the to_dict operation.

Returns:

The operation result (Any).

type: str
file_hash: str
message: str
class peyk.platforms.telegram.types.PassportElementErrorTranslationFiles(type: str, file_hashes: List[str], message: str, source: str = 'translation_files')

Bases: object

PassportElementErrorTranslationFiles Telegram Bot API type.

classmethod from_dict(data)

Executes the from_dict operation.

Parameters:

data – Value of the declared parameter type.

Returns:

The operation result (Any).

classmethod list_from(data)

Executes the list_from operation.

Parameters:

data – Value of the declared parameter type.

Returns:

The operation result (Any).

source: str = 'translation_files'
to_dict()

Executes the to_dict operation.

Returns:

The operation result (Any).

type: str
file_hashes: List[str]
message: str
class peyk.platforms.telegram.types.PassportElementErrorUnspecified(type: str, element_hash: str, message: str, source: str = 'unspecified')

Bases: object

PassportElementErrorUnspecified Telegram Bot API type.

classmethod from_dict(data)

Executes the from_dict operation.

Parameters:

data – Value of the declared parameter type.

Returns:

The operation result (Any).

classmethod list_from(data)

Executes the list_from operation.

Parameters:

data – Value of the declared parameter type.

Returns:

The operation result (Any).

source: str = 'unspecified'
to_dict()

Executes the to_dict operation.

Returns:

The operation result (Any).

type: str
element_hash: str
message: str
class peyk.platforms.telegram.types.PassportFile(file_id: str, file_unique_id: str, file_size: int, file_date: int)[source]

Bases: object

This object represents a file uploaded to Telegram Passport. Currently all Telegram Passport files are in JPEG format when decrypted and don’t exceed 10MB.

Variables:
  • file_id (str) – Identifier for this file, which can be used to download or reuse the file

  • file_unique_id (str) – Unique identifier for this file, which is supposed to be the same over time and for different bots. Can’t be used to download or reuse the file.

  • file_size (int) – File size in bytes

  • file_date (int) – Unix time when the file was uploaded

classmethod from_dict(data: dict | None) PassportFile | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

file_id: str
file_unique_id: str
file_size: int
file_date: int
class peyk.platforms.telegram.types.PhotoSize(file_id: str, file_unique_id: str, width: int, height: int, file_size: int | None = None)[source]

Bases: object

This object represents one size of a photo or a file / sticker thumbnail.

Variables:
  • file_id (str) – Identifier for this file, which can be used to download or reuse the file

  • file_unique_id (str) – Unique identifier for this file, which is supposed to be the same over time and for different bots. Can’t be used to download or reuse the file.

  • width (int) – Photo width

  • height (int) – Photo height

  • file_size (int | None) – File size in bytes

file_size: int | None = None
classmethod from_dict(data: dict | None) PhotoSize | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

classmethod list_from(data: List[dict] | None) List[PhotoSize] | None[source]

Parse a Telegram API result list into this type.

Parameters:

data – Raw result list, or None.

Returns:

Parsed type instances.

file_id: str
file_unique_id: str
width: int
height: int
class peyk.platforms.telegram.types.Poll(id: str, question: str, options: List[PollOption], total_voter_count: int = 0, is_closed: bool = False, is_anonymous: bool = True, type: str = 'regular', allows_multiple_answers: bool = False, allows_revoting: bool = False, members_only: bool | None = None, country_codes: List[str] | None = None, question_entities: List[MessageEntity] | None = None, correct_option_ids: List[int] | None = None, explanation: str | None = None, explanation_entities: List[MessageEntity] | None = None, explanation_media: PollMedia | None = None, open_period: int | None = None, close_date: int | None = None, description: str | None = None, description_entities: List[MessageEntity] | None = None, media: PollMedia | None = None)[source]

Bases: object

This object contains information about a poll.

Variables:
  • id (str) – Unique poll identifier

  • question (str) – Poll question, 1-300 characters

  • options (List[peyk.platforms.telegram.types.poll_option.PollOption]) – List of poll options

  • total_voter_count (int) – Total number of users that voted in the poll

  • is_closed (bool) – True, if the poll is closed

  • is_anonymous (bool) – True, if the poll is anonymous

  • type (str) – Poll type, currently can be ‘regular’ or ‘quiz’

  • allows_multiple_answers (bool) – True, if the poll allows multiple answers

  • allows_revoting (bool) – True, if the poll allows to change the chosen answer options

  • members_only (bool | None) – True if voting is limited to users who have been members of the chat where the poll was originally sent for more than 24 hours

  • question_entities (List[peyk.platforms.telegram.types.message_entity.MessageEntity] | None) – Special entities that appear in the question. Currently, only custom emoji entities are allowed in poll questions

  • country_codes (List[str] | None) – A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries from which users can vote in the poll. The country code ‘FT’ is used for users with anonymous numbers. If omitted, then users from any country can participate in the poll.

  • correct_option_ids (List[int] | None) – Array of 0-based identifiers of the correct answer options. Available only for polls in quiz mode which are closed or were sent (not forwarded) by the bot or to the private chat with the bot.

  • explanation (str | None) – Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters

  • explanation_entities (List[peyk.platforms.telegram.types.message_entity.MessageEntity] | None) – Special entities like usernames, URLs, bot commands, etc. that appear in the explanation

  • explanation_media (peyk.platforms.telegram.types.poll_media.PollMedia | None) – Media added to the quiz explanation

  • open_period (int | None) – Amount of time in seconds the poll will be active after creation

  • close_date (int | None) – Point in time (Unix timestamp) when the poll will be automatically closed

  • description (str | None) – Description of the poll; for polls inside the Message object only

  • description_entities (List[peyk.platforms.telegram.types.message_entity.MessageEntity] | None) – Special entities like usernames, URLs, bot commands, etc. that appear in the description

  • media (peyk.platforms.telegram.types.poll_media.PollMedia | None) – Media added to the poll description; for polls inside the Message object only

  • correct_option_id – 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot.

allows_multiple_answers: bool = False
allows_revoting: bool = False
close_date: int | None = None
correct_option_ids: List[int] | None = None
country_codes: List[str] | None = None
description: str | None = None
description_entities: List[MessageEntity] | None = None
explanation: str | None = None
explanation_entities: List[MessageEntity] | None = None
explanation_media: PollMedia | None = None
classmethod from_dict(data: dict | None) Poll | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

is_anonymous: bool = True
is_closed: bool = False
media: PollMedia | None = None
members_only: bool | None = None
open_period: int | None = None
question_entities: List[MessageEntity] | None = None
total_voter_count: int = 0
type: str = 'regular'
id: str
question: str
options: List[PollOption]
class peyk.platforms.telegram.types.PollAnswer(poll_id: str, voter_chat: Chat | None = None, user: User | None = None, option_ids: List[int] | None = None, option_persistent_ids: List[str] | None = None)[source]

Bases: object

This object represents an answer of a user in a non-anonymous poll.

Variables:
  • poll_id (str) – Unique poll identifier

  • option_ids (List[int] | None) – 0-based identifiers of chosen answer options. May be empty if the vote was retracted.

  • option_persistent_ids (List[str] | None) – Persistent identifiers of the chosen answer options. May be empty if the vote was retracted.

  • voter_chat (peyk.platforms.telegram.types.chat.Chat | None) – The chat that changed the answer to the poll, if the voter is anonymous

  • user (peyk.platforms.telegram.types.user.User | None) – The user that changed the answer to the poll, if the voter isn’t anonymous

classmethod from_dict(data: dict | None) PollAnswer | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

option_ids: List[int] | None = None
option_persistent_ids: List[str] | None = None
user: User | None = None
voter_chat: Chat | None = None
poll_id: str
class peyk.platforms.telegram.types.PollMedia(animation: Animation | None = None, audio: Audio | None = None, document: Document | None = None, link: Link | None = None, live_photo: LivePhoto | None = None, location: Location | None = None, photo: List[PhotoSize] | None = None, sticker: object | None = None, venue: Venue | None = None, video: Video | None = None)[source]

Bases: object

At most one of the optional fields can be present in any given object.

Variables:
animation: Animation | None = None
audio: Audio | None = None
document: Document | None = None
classmethod from_dict(data: dict | None) PollMedia | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

live_photo: LivePhoto | None = None
location: Location | None = None
photo: List[PhotoSize] | None = None
sticker: object | None = None
venue: Venue | None = None
video: Video | None = None
class peyk.platforms.telegram.types.PollOption(persistent_id: str | None = None, text: str = '', text_entities: List[MessageEntity] | None = None, media: PollMedia | None = None, voter_count: int = 0, added_by_user: User | None = None, added_by_chat: Chat | None = None, addition_date: int | None = None)[source]

Bases: object

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

Variables:
  • persistent_id (str | None) – Unique identifier of the option, persistent on option addition and deletion

  • text (str) – Option text, 1-100 characters

  • voter_count (int) – Number of users who voted for this option; may be 0 if unknown

  • text_entities (List[peyk.platforms.telegram.types.message_entity.MessageEntity] | None) – Special entities that appear in the option text. Currently, only custom emoji entities are allowed in poll option texts

  • media (peyk.platforms.telegram.types.poll_media.PollMedia | None) – Media added to the poll option

  • added_by_user (peyk.platforms.telegram.types.user.User | None) – User who added the option; omitted if the option wasn’t added by a user after poll creation

  • added_by_chat (peyk.platforms.telegram.types.chat.Chat | None) – Chat that added the option; omitted if the option wasn’t added by a chat after poll creation

  • addition_date (int | None) – Point in time (Unix timestamp) when the option was added; omitted if the option existed in the original poll

added_by_chat: Chat | None = None
added_by_user: User | None = None
addition_date: int | None = None
classmethod from_dict(data: dict | None) PollOption | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

media: PollMedia | None = None
persistent_id: str | None = None
text: str = ''
text_entities: List[MessageEntity] | None = None
voter_count: int = 0
class peyk.platforms.telegram.types.PollOptionAdded(option: PollOption | None = None, voter_count: int = 0)[source]

Bases: object

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

Variables:
  • option_persistent_id – Unique identifier of the added option

  • option_text – Option text

  • poll_message – Message containing the poll to which the option was added, if known. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply.

  • option_text_entities – Special entities that appear in the option_text

classmethod from_dict(data: dict | None) PollOptionAdded | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

option: PollOption | None = None
voter_count: int = 0
class peyk.platforms.telegram.types.PollOptionDeleted(option: PollOption | None = None)[source]

Bases: object

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

Variables:
  • option_persistent_id – Unique identifier of the deleted option

  • option_text – Option text

  • poll_message – Message containing the poll from which the option was deleted, if known. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply.

  • option_text_entities – Special entities that appear in the option_text

classmethod from_dict(data: dict | None) PollOptionDeleted | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

option: PollOption | None = None
class peyk.platforms.telegram.types.PreCheckoutQuery(id: str, from_: User, currency: str, total_amount: int, invoice_payload: str, shipping_option_id: str | None = None, order_info: OrderInfo | None = None)[source]

Bases: object

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

Variables:
  • id (str) – Unique query identifier

  • from – User who sent the query

  • currency (str) – Three-letter ISO 4217 currency code, or ‘XTR’ for payments in Telegram Stars

  • total_amount (int) – Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).

  • invoice_payload (str) – Bot-specified invoice payload

  • shipping_option_id (str | None) – Identifier of the shipping option chosen by the user

  • order_info (peyk.platforms.telegram.types.order_info.OrderInfo | None) – Order information provided by the user

classmethod from_dict(data: dict | None) PreCheckoutQuery | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

order_info: OrderInfo | None = None
shipping_option_id: str | None = None
id: str
from_: User
currency: str
total_amount: int
invoice_payload: str
class peyk.platforms.telegram.types.PreparedInlineMessage(id: str = '', expiration_date: int = 0)[source]

Bases: object

Describes an inline message to be sent by a user of a Mini App.

Variables:
  • id (str) – Unique identifier of the prepared message

  • expiration_date (int) – Expiration date of the prepared message, in Unix time. Expired prepared messages can no longer be used.

expiration_date: int = 0
classmethod from_dict(data: dict | None) PreparedInlineMessage | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

id: str = ''
class peyk.platforms.telegram.types.PreparedKeyboardButton(text: str = '')[source]

Bases: object

Describes a keyboard button to be used by a user of a Mini App.

Variables:

id – Unique identifier of the keyboard button

classmethod from_dict(data: dict | None) PreparedKeyboardButton | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

text: str = ''
class peyk.platforms.telegram.types.ProximityAlertTriggered(traveler: User | None = None, watcher: User | None = None, distance: int = 0)[source]

Bases: object

This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user.

Variables:
distance: int = 0
classmethod from_dict(data: dict | None) ProximityAlertTriggered | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

traveler: User | None = None
watcher: User | None = None
class peyk.platforms.telegram.types.ReactionCount(type: ReactionTypeEmoji | ReactionTypeCustomEmoji | ReactionTypePaid, total_count: int = 0)[source]

Bases: object

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

Variables:
classmethod from_dict(data: dict | None) ReactionCount | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

total_count: int = 0
type: ReactionTypeEmoji | ReactionTypeCustomEmoji | ReactionTypePaid
class peyk.platforms.telegram.types.ReactionTypeCustomEmoji(type: str = 'custom_emoji', custom_emoji_id: str = '')[source]

Bases: object

The reaction is based on a custom emoji.

Variables:
  • type (str) – Type of the reaction, always ‘custom_emoji’

  • custom_emoji_id (str) – Custom emoji identifier

custom_emoji_id: str = ''
classmethod from_dict(data: dict | None) ReactionTypeCustomEmoji | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

type: str = 'custom_emoji'
class peyk.platforms.telegram.types.ReactionTypeEmoji(type: str = 'emoji', emoji: str = '')[source]

Bases: object

The reaction is based on an emoji.

Variables:
  • type (str) – Type of the reaction, always ‘emoji’

  • emoji (str) – Reaction emoji. Currently, it can be one of “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”, “”.

emoji: str = ''
classmethod from_dict(data: dict | None) ReactionTypeEmoji | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

type: str = 'emoji'
class peyk.platforms.telegram.types.ReactionTypePaid(type: str = 'paid')[source]

Bases: object

The reaction is paid.

Variables:

type (str) – Type of the reaction, always ‘paid’

classmethod from_dict(data: dict | None) ReactionTypePaid | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

type: str = 'paid'
class peyk.platforms.telegram.types.RefundedPayment(currency: str, total_amount: int, invoice_payload: str, telegram_payment_charge_id: str, provider_payment_charge_id: str | None = None)[source]

Bases: object

This object contains basic information about a refunded payment.

Variables:
  • currency (str) – Three-letter ISO 4217 currency code, or ‘XTR’ for payments in Telegram Stars. Currently, always ‘XTR’.

  • total_amount (int) – Total refunded price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45, total_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).

  • invoice_payload (str) – Bot-specified invoice payload

  • telegram_payment_charge_id (str) – Telegram payment identifier

  • provider_payment_charge_id (str | None) – Provider payment identifier

classmethod from_dict(data: dict | None) RefundedPayment | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

provider_payment_charge_id: str | None = None
currency: str
total_amount: int
invoice_payload: str
telegram_payment_charge_id: str
class peyk.platforms.telegram.types.ReplyKeyboardMarkup(keyboard: ~typing.List[~typing.List[~peyk.platforms.telegram.types.keyboard_button.KeyboardButton | ~typing.Mapping[str, object] | str]] = <factory>, is_persistent: bool | None = None, resize_keyboard: bool | None = None, one_time_keyboard: bool | None = None, input_field_placeholder: str | None = None, selective: bool | None = None)[source]

Bases: object

This object represents a custom keyboard with reply options (see Introduction to bots for details and examples). Not supported in channels and for messages sent on behalf of a business account.

Variables:
  • keyboard (List[List[peyk.platforms.telegram.types.keyboard_button.KeyboardButton | Mapping[str, object] | str]]) – Array of button rows, each represented by an Array of KeyboardButton objects

  • is_persistent (bool | None) – Requests clients to always show the keyboard when the regular keyboard is hidden. Defaults to False, in which case the custom keyboard can be hidden and opened with a keyboard icon.

  • resize_keyboard (bool | None) – Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to False, in which case the custom keyboard is always of the same height as the app’s standard keyboard.

  • one_time_keyboard (bool | None) – Requests clients to hide the keyboard as soon as it’s been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat - the user can press a special button in the input field to see the custom keyboard again. Defaults to False.

  • input_field_placeholder (str | None) – The placeholder to be shown in the input field when the keyboard is active; 1-64 characters

  • selective (bool | None) – Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot’s message is a reply to a message in the same chat and forum topic, sender of the original message.

Example: A user requests to change the bot’s language, bot replies to the request with a keyboard to select the new language. Other users in the group don’t see the keyboard.

classmethod from_dict(data: dict | None) ReplyKeyboardMarkup | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

input_field_placeholder: str | None = None
is_persistent: bool | None = None
one_time_keyboard: bool | None = None
resize_keyboard: bool | None = None
selective: bool | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

keyboard: List[List[KeyboardButton | Mapping[str, object] | str]]
class peyk.platforms.telegram.types.ReplyKeyboardRemove(remove_keyboard: bool = True, selective: bool | None = None)[source]

Bases: object

Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see ReplyKeyboardMarkup). Not supported in channels and for messages sent on behalf of a business account.

Variables:
  • remove_keyboard (bool) – Requests clients to remove the custom keyboard (user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use one_time_keyboard in ReplyKeyboardMarkup)

  • selective (bool | None) – Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot’s message is a reply to a message in the same chat and forum topic, sender of the original message.

Example: A user votes in a poll, bot returns confirmation message in reply to the vote and removes the keyboard for that user, while still showing the keyboard with poll options to users who haven’t voted yet.

classmethod from_dict(data: dict | None) ReplyKeyboardRemove | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

remove_keyboard: bool = True
selective: bool | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.ReplyParameters(message_id: int | None = None, chat_id: object | None = None, quote: str | None = None, quote_parse_mode: str | None = None, quote_entities: List[MessageEntity] | None = None, quote_position: int | None = None, checklist_task_id: int | None = None, allow_sending_without_reply: bool | None = None, ephemeral_message_id: int | None = None)[source]

Bases: object

Describes reply parameters for the message that is being sent.

Variables:
  • message_id (int | None) – Identifier of the message that will be replied to in the current chat, or in the chat chat_id if it is specified. Required if ephemeral_message_id isn’t specified.

  • chat_id (object | None) – If the message to be replied to is from a different chat, unique identifier for the chat or username of the bot, supergroup or channel in the format @username. Not supported for messages sent on behalf of a business account, messages from channel direct messages chats and ephemeral messages.

  • allow_sending_without_reply (bool | None) – Pass True if the message should be sent even if the specified message to be replied to is not found. Always False for replies in another chat or forum topic, and sent ephemeral messages. Always True for messages sent on behalf of a business account.

  • quote (str | None) – Quoted part of the message to be replied to; 0-1024 characters after entities parsing. The quote must be an exact substring of the message to be replied to, including bold, italic, underline, strikethrough, spoiler, custom_emoji, and date_time entities. The message will fail to send if the quote isn’t found in the original message. Ignored for ephemeral messages.

  • quote_parse_mode (str | None) – Mode for parsing entities in the quote. See formatting options for more details.

  • quote_entities (List[peyk.platforms.telegram.types.message_entity.MessageEntity] | None) – A JSON-serialized list of special entities that appear in the quote. It can be specified instead of quote_parse_mode.

  • quote_position (int | None) – Position of the quote in the original message in UTF-16 code units

  • checklist_task_id (int | None) – Identifier of the specific checklist task to be replied to

  • poll_option_id – Persistent identifier of the specific poll option to be replied to

  • ephemeral_message_id (int | None) – Identifier of the incoming ephemeral message that will be replied to in the current chat. A reply to an ephemeral message must itself be an ephemeral message. An ephemeral message may only be replied to within 15 seconds of being sent. Required if message_id isn’t specified.

allow_sending_without_reply: bool | None = None
chat_id: object | None = None
checklist_task_id: int | None = None
ephemeral_message_id: int | None = None
classmethod from_dict(data: dict | None) ReplyParameters | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

message_id: int | None = None
quote: str | None = None
quote_entities: List[MessageEntity] | None = None
quote_parse_mode: str | None = None
quote_position: int | None = None
to_dict() Dict[str, object][source]

Serialize this type to the Telegram API request shape.

Returns:

A JSON-compatible mapping representing this value.

class peyk.platforms.telegram.types.ResponseParameters(migrate_to_chat_id: int | None = None, retry_after: int | None = None)[source]

Bases: object

Describes why a request was unsuccessful.

Variables:
  • migrate_to_chat_id (int | None) – The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.

  • retry_after (int | None) – In case of exceeding flood control, the number of seconds left to wait before the request can be repeated

classmethod from_dict(data: dict | None) ResponseParameters | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

migrate_to_chat_id: int | None = None
retry_after: int | None = None
class peyk.platforms.telegram.types.RevenueWithdrawalStateFailed(type: str = 'failed')[source]

Bases: object

The withdrawal failed and the transaction was refunded.

Variables:

type (str) – Type of the state, always ‘failed’

classmethod from_dict(data: dict | None) RevenueWithdrawalStateFailed | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

type: str = 'failed'
class peyk.platforms.telegram.types.RevenueWithdrawalStatePending(type: str = 'pending')[source]

Bases: object

The withdrawal is in progress.

Variables:

type (str) – Type of the state, always ‘pending’

classmethod from_dict(data: dict | None) RevenueWithdrawalStatePending | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

type: str = 'pending'
class peyk.platforms.telegram.types.RevenueWithdrawalStateSucceeded(type: str = 'succeeded', date: int = 0, url: str = '')[source]

Bases: object

The withdrawal succeeded.

Variables:
  • type (str) – Type of the state, always ‘succeeded’

  • date (int) – Date the withdrawal was completed in Unix time

  • url (str) – An HTTPS URL that can be used to see transaction details

date: int = 0
classmethod from_dict(data: dict | None) RevenueWithdrawalStateSucceeded | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

type: str = 'succeeded'
url: str = ''
class peyk.platforms.telegram.types.RichBlockAnchor(name: str = '', text: str = '')[source]

Bases: object

A block with an anchor, corresponding to the HTML tag with the attribute name.

Variables:
  • type – Type of the block, always ‘anchor’

  • name (str) – The name of the anchor

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

name: str = ''
text: str = ''
class peyk.platforms.telegram.types.RichBlockAnimation(animation: Animation | None = None)[source]

Bases: object

A block with an animation, corresponding to the HTML tag .

Variables:
  • type – Type of the block, always ‘animation’

  • animation (peyk.platforms.telegram.types.animation.Animation | None) – The animation

  • has_spoiler – True, if the media preview is covered by a spoiler animation

  • caption – Caption of the block

animation: Animation | None = None
classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

class peyk.platforms.telegram.types.RichBlockAudio(audio: Audio | None = None)[source]

Bases: object

A block with a music file, corresponding to the HTML tag .

Variables:
audio: Audio | None = None
classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

class peyk.platforms.telegram.types.RichBlockBlockQuotation(text: str = '')[source]

Bases: object

A block quotation, corresponding to the HTML tag .

Variables:
  • type – Type of the block, always ‘blockquote’

  • blocks – Content of the block

  • credit – Credit of the block

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

text: str = ''
class peyk.platforms.telegram.types.RichBlockButtons(buttons: List[object] | None = None)[source]

Bases: object

RichBlockButtons Telegram Bot API type.

buttons: List[object] | None = None
classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

class peyk.platforms.telegram.types.RichBlockCaption(text: str = '')[source]

Bases: object

Caption of a rich formatted block.

Variables:
  • text (str) – Block caption

  • credit – Block credit which corresponds to the HTML tag

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

text: str = ''
class peyk.platforms.telegram.types.RichBlockCollage(items: List[object] | None = None)[source]

Bases: object

A collage, corresponding to the custom HTML tag .

Variables:
  • type – Type of the block, always ‘collage’

  • blocks – Elements of the collage

  • caption – Caption of the block

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

items: List[object] | None = None
class peyk.platforms.telegram.types.RichBlockDetails(title: str = '', text: str = '')[source]

Bases: object

An expandable block for details disclosure, corresponding to the HTML tag .

Variables:
  • type – Type of the block, always ‘details’

  • summary – Always shown summary of the block

  • blocks – Content of the block

  • is_open – True, if the content of the block is visible by default

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

text: str = ''
title: str = ''
class peyk.platforms.telegram.types.RichBlockDivider[source]

Bases: object

A divider, corresponding to the HTML tag .

Variables:

type – Type of the block, always ‘divider’

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

class peyk.platforms.telegram.types.RichBlockDocument(document: Document | None = None)[source]

Bases: object

RichBlockDocument Telegram Bot API type.

document: Document | None = None
classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

class peyk.platforms.telegram.types.RichBlockExpandableBlockQuotation(text: str = '')[source]

Bases: object

RichBlockExpandableBlockQuotation Telegram Bot API type.

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

text: str = ''
class peyk.platforms.telegram.types.RichBlockFooter(text: str = '')[source]

Bases: object

A footer, corresponding to the HTML tag .

Variables:
  • type – Type of the block, always ‘footer’

  • text (str) – Text of the block

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

text: str = ''
class peyk.platforms.telegram.types.RichBlockList(items: List[object] | None = None)[source]

Bases: object

A list of blocks, corresponding to the HTML tag or with multiple nested tags .

Variables:
  • type – Type of the block, always ‘list’

  • items (List[object] | None) – Items of the list

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

items: List[object] | None = None
class peyk.platforms.telegram.types.RichBlockListItem(text: str = '')[source]

Bases: object

An item of a list.

Variables:
  • label – Label of the item

  • blocks – The content of the item

  • has_checkbox – True, if the item has a checkbox

  • is_checked – True, if the item has a checked checkbox

  • value – For ordered lists, the numeric value of the item label

  • type – For ordered lists, the type of the item label; must be one of ‘a’ for lowercase letters, ‘A’ for uppercase letters, ‘i’ for lowercase Roman numerals, ‘I’ for uppercase Roman numerals, or ‘1’ for decimal numbers

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

text: str = ''
class peyk.platforms.telegram.types.RichBlockMap(latitude: float = 0.0, longitude: float = 0.0)[source]

Bases: object

A block with a map, corresponding to the custom HTML tag .

Variables:
  • type – Type of the block, always ‘map’

  • location – Location of the center of the map

  • zoom – Map zoom level; 13-20

  • width – Expected width of the map

  • height – Expected height of the map

  • caption – Caption of the block

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

latitude: float = 0.0
longitude: float = 0.0
class peyk.platforms.telegram.types.RichBlockMathematicalExpression(expression: str = '')[source]

Bases: object

A block with a mathematical expression in LaTeX format, corresponding to the custom HTML tag .

Variables:
  • type – Type of the block, always ‘mathematical_expression’

  • expression (str) – The mathematical expression in LaTeX format

expression: str = ''
classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

class peyk.platforms.telegram.types.RichBlockParagraph(text: str = '')[source]

Bases: object

A text paragraph, corresponding to the HTML tag .

Variables:
  • type – Type of the block, always ‘paragraph’

  • text (str) – Text of the block

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

text: str = ''
class peyk.platforms.telegram.types.RichBlockPhoto(photo: List[PhotoSize] | None = None)[source]

Bases: object

A block with a photo, corresponding to the HTML tag .

Variables:
  • type – Type of the block, always ‘photo’

  • photo (List[peyk.platforms.telegram.types.photo_size.PhotoSize] | None) – Available sizes of the photo

  • has_spoiler – True, if the media preview is covered by a spoiler animation

  • caption – Caption of the block

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

photo: List[PhotoSize] | None = None
class peyk.platforms.telegram.types.RichBlockPreformatted(text: str = '', language: str = '')[source]

Bases: object

A preformatted text block, corresponding to the nested HTML tags and .

Variables:
  • type – Type of the block, always ‘pre’

  • text (str) – Text of the block

  • language (str) – The programming language of the text

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

language: str = ''
text: str = ''
class peyk.platforms.telegram.types.RichBlockPullQuotation(text: str = '')[source]

Bases: object

A quotation with centered text, loosely corresponding to the HTML tag .

Variables:
  • type – Type of the block, always ‘pullquote’

  • text (str) – Text of the block

  • credit – Credit of the block

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

text: str = ''
class peyk.platforms.telegram.types.RichBlockSectionHeading(text: str = '')[source]

Bases: object

A section heading, corresponding to the HTML tags , , , , , or .

Variables:
  • type – Type of the block, always ‘heading’

  • text (str) – Text of the block

  • size – Relative size of the text font; 1-6, 1 is the largest, 6 is the smallest

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

text: str = ''
class peyk.platforms.telegram.types.RichBlockSlideshow(items: List[object] | None = None)[source]

Bases: object

A slideshow, corresponding to the custom HTML tag .

Variables:
  • type – Type of the block, always ‘slideshow’

  • blocks – Elements of the slideshow

  • caption – Caption of the block

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

items: List[object] | None = None
class peyk.platforms.telegram.types.RichBlockTable(cells: List[object] | None = None, is_compact: bool | None = None)[source]

Bases: object

A table, corresponding to the HTML tag .

Variables:
  • type – Type of the block, always ‘table’

  • cells (List[object] | None) – Cells of the table

  • is_bordered – True, if the table has borders

  • is_striped – True, if the table is striped

  • caption – Caption of the table

cells: List[object] | None = None
classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

is_compact: bool | None = None
class peyk.platforms.telegram.types.RichBlockTableCell(text: str = '')[source]

Bases: object

Cell in a table.

Variables:
  • align – Horizontal cell content alignment. Currently, must be one of ‘left’, ‘center’, or ‘right’.

  • valign – Vertical cell content alignment. Currently, must be one of ‘top’, ‘middle’, or ‘bottom’.

  • text (str) – Text in the cell. If omitted, then the cell is invisible.

  • is_header – True, if the cell is a header cell

  • colspan – The number of columns the cell spans if it is bigger than 1

  • rowspan – The number of rows the cell spans if it is bigger than 1

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

text: str = ''
class peyk.platforms.telegram.types.RichBlockThinking(text: str = '')[source]

Bases: object

A block with a ‘Thinking…’ placeholder, corresponding to the custom HTML tag . The block may be used only in sendRichMessageDraft, therefore it can’t be received in messages. See https://t.me/addemoji/AIActions for examples of custom emoji that are recommended for usage in the block.

Variables:
  • type – Type of the block, always ‘thinking’

  • text (str) – Text of the block. See https://t.me/addemoji/AIActions for examples of custom emoji that are recommended for usage in the block.

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

text: str = ''
class peyk.platforms.telegram.types.RichBlockVideo(video: Video | None = None)[source]

Bases: object

A block with a video, corresponding to the HTML tag .

Variables:
  • type – Type of the block, always ‘video’

  • video (peyk.platforms.telegram.types.video.Video | None) – The video

  • has_spoiler – True, if the media preview is covered by a spoiler animation

  • caption – Caption of the block

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

video: Video | None = None
class peyk.platforms.telegram.types.RichBlockVoiceNote(voice: Voice | None = None)[source]

Bases: object

A block with a voice note, corresponding to the HTML tag .

Variables:
  • type – Type of the block, always ‘voice_note’

  • voice_note – The voice note

  • caption – Caption of the block

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

voice: Voice | None = None
class peyk.platforms.telegram.types.RichMessage(text: str = '', blocks: object | None = None, is_rtl: bool | None = None)[source]

Bases: object

Rich formatted message.

Variables:
  • blocks (object | None) – Content of the message

  • is_rtl (bool | None) – True, if the rich message must be shown right-to-left

blocks: object | None = None
classmethod from_dict(data: dict | None) RichMessage | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

is_rtl: bool | None = None
text: str = ''
class peyk.platforms.telegram.types.RichMessageButton(text: str = '', type: str = 'button')[source]

Bases: object

Rich message button.

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

text: str = ''
type: str = 'button'
class peyk.platforms.telegram.types.RichTextAnchor(text: str = '', name: str = '', type: str = 'anchor')[source]

Bases: object

An anchor.

Variables:
  • type (str) – Type of the rich text, always ‘anchor’

  • name (str) – The name of the anchor

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

name: str = ''
text: str = ''
type: str = 'anchor'

Bases: object

A link to an anchor.

Variables:
  • type (str) – Type of the rich text, always ‘anchor_link’

  • text (str) – The link text

  • anchor_name (str) – The name of the anchor. If the name is empty, then the link brings back to the top of the message.

anchor_name: str = ''
classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

text: str = ''
type: str = 'anchor_link'
class peyk.platforms.telegram.types.RichTextBankCardNumber(text: str = '', bank_card_number: str = '', type: str = 'bank_card_number')[source]

Bases: object

A text with a bank card number.

Variables:
  • type (str) – Type of the rich text, always ‘bank_card_number’

  • text (str) – The text

  • bank_card_number (str) – The bank card number

bank_card_number: str = ''
classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

text: str = ''
type: str = 'bank_card_number'
class peyk.platforms.telegram.types.RichTextBold(text: str = '', type: str = 'bold')[source]

Bases: object

A bold text.

Variables:
  • type (str) – Type of the rich text, always ‘bold’

  • text (str) – The text

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

text: str = ''
type: str = 'bold'
class peyk.platforms.telegram.types.RichTextBotCommand(text: str = '', type: str = 'bot_command')[source]

Bases: object

A bot command.

Variables:
  • type (str) – Type of the rich text, always ‘bot_command’

  • text (str) – The text

  • bot_command – The bot command

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

text: str = ''
type: str = 'bot_command'
class peyk.platforms.telegram.types.RichTextButton(text: str = '', type: str = 'button')[source]

Bases: object

Rich text button.

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

text: str = ''
type: str = 'button'
class peyk.platforms.telegram.types.RichTextCashtag(text: str = '', type: str = 'cashtag')[source]

Bases: object

A cashtag.

Variables:
  • type (str) – Type of the rich text, always ‘cashtag’

  • text (str) – The text

  • cashtag – The cashtag

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

text: str = ''
type: str = 'cashtag'
class peyk.platforms.telegram.types.RichTextCode(text: str = '', type: str = 'code')[source]

Bases: object

A monowidth text.

Variables:
  • type (str) – Type of the rich text, always ‘code’

  • text (str) – The text

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

text: str = ''
type: str = 'code'
class peyk.platforms.telegram.types.RichTextCustomEmoji(text: str = '', document_id: str = '', type: str = 'custom_emoji')[source]

Bases: object

A custom emoji.

Variables:
  • type (str) – Type of the rich text, always ‘custom_emoji’

  • custom_emoji_id – Unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker.

  • alternative_text – Alternative emoji for the custom emoji

document_id: str = ''
classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

text: str = ''
type: str = 'custom_emoji'
class peyk.platforms.telegram.types.RichTextDateTime(text: str = '', type: str = 'date_time')[source]

Bases: object

Formatted date and time.

Variables:
  • type (str) – Type of the rich text, always ‘date_time’

  • text (str) – The text

  • unix_time – The Unix time associated with the entity

  • date_time_format – The string that defines the formatting of the date and time. See date-time entity formatting for more details.

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

text: str = ''
type: str = 'date_time'
class peyk.platforms.telegram.types.RichTextEmailAddress(text: str = '', email: str = '', type: str = 'email_address')[source]

Bases: object

A text with an email address.

Variables:
  • type (str) – Type of the rich text, always ‘email_address’

  • text (str) – The text

  • email_address – The email address

email: str = ''
classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

text: str = ''
type: str = 'email_address'
class peyk.platforms.telegram.types.RichTextHashtag(text: str = '', type: str = 'hashtag')[source]

Bases: object

A hashtag.

Variables:
  • type (str) – Type of the rich text, always ‘hashtag’

  • text (str) – The text

  • hashtag – The hashtag

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

text: str = ''
type: str = 'hashtag'
class peyk.platforms.telegram.types.RichTextItalic(text: str = '', type: str = 'italic')[source]

Bases: object

An italicized text.

Variables:
  • type (str) – Type of the rich text, always ‘italic’

  • text (str) – The text

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

text: str = ''
type: str = 'italic'
class peyk.platforms.telegram.types.RichTextMarked(text: str = '', type: str = 'marked')[source]

Bases: object

A marked text.

Variables:
  • type (str) – Type of the rich text, always ‘marked’

  • text (str) – The text

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

text: str = ''
type: str = 'marked'
class peyk.platforms.telegram.types.RichTextMathematicalExpression(text: str = '', type: str = 'mathematical_expression')[source]

Bases: object

A mathematical expression.

Variables:
  • type (str) – Type of the rich text, always ‘mathematical_expression’

  • expression – The expression in LaTeX format

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

text: str = ''
type: str = 'mathematical_expression'
class peyk.platforms.telegram.types.RichTextMention(text: str = '', user_id: int = 0, type: str = 'mention')[source]

Bases: object

A mention by a username.

Variables:
  • type (str) – Type of the rich text, always ‘mention’

  • text (str) – The text

  • username – The username

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

text: str = ''
type: str = 'mention'
user_id: int = 0
class peyk.platforms.telegram.types.RichTextPhoneNumber(text: str = '', phone_number: str = '', type: str = 'phone_number')[source]

Bases: object

A text with a phone number.

Variables:
  • type (str) – Type of the rich text, always ‘phone_number’

  • text (str) – The text

  • phone_number (str) – The phone number

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

phone_number: str = ''
text: str = ''
type: str = 'phone_number'
class peyk.platforms.telegram.types.RichTextReference(text: str = '', type: str = 'reference')[source]

Bases: object

A reference.

Variables:
  • type (str) – Type of the rich text, always ‘reference’

  • text (str) – Text of the reference

  • name – The name of the reference

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

text: str = ''
type: str = 'reference'

Bases: object

A link to a reference.

Variables:
  • type (str) – Type of the rich text, always ‘reference_link’

  • text (str) – The link text

  • reference_name (str) – The name of the reference

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

reference_name: str = ''
text: str = ''
type: str = 'reference_link'
class peyk.platforms.telegram.types.RichTextSpoiler(text: str = '', type: str = 'spoiler')[source]

Bases: object

A text covered by a spoiler.

Variables:
  • type (str) – Type of the rich text, always ‘spoiler’

  • text (str) – The text

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

text: str = ''
type: str = 'spoiler'
class peyk.platforms.telegram.types.RichTextStrikethrough(text: str = '', type: str = 'strikethrough')[source]

Bases: object

A strikethrough text.

Variables:
  • type (str) – Type of the rich text, always ‘strikethrough’

  • text (str) – The text

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

text: str = ''
type: str = 'strikethrough'
class peyk.platforms.telegram.types.RichTextSubscript(text: str = '', type: str = 'subscript')[source]

Bases: object

A subscript text.

Variables:
  • type (str) – Type of the rich text, always ‘subscript’

  • text (str) – The text

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

text: str = ''
type: str = 'subscript'
class peyk.platforms.telegram.types.RichTextSuperscript(text: str = '', type: str = 'superscript')[source]

Bases: object

A superscript text.

Variables:
  • type (str) – Type of the rich text, always ‘superscript’

  • text (str) – The text

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

text: str = ''
type: str = 'superscript'
class peyk.platforms.telegram.types.RichTextTextMention(text: str = '', user: User | None = None, type: str = 'text_mention')[source]

Bases: object

A mention of a Telegram user by their identifier.

Variables:
classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

text: str = ''
type: str = 'text_mention'
user: User | None = None
class peyk.platforms.telegram.types.RichTextUnderline(text: str = '', type: str = 'underline')[source]

Bases: object

An underlined text.

Variables:
  • type (str) – Type of the rich text, always ‘underline’

  • text (str) – The text

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

text: str = ''
type: str = 'underline'
class peyk.platforms.telegram.types.RichTextUrl(text: str = '', url: str = '', type: str = 'url')[source]

Bases: object

A text with a link.

Variables:
  • type (str) – Type of the rich text, always ‘url’

  • text (str) – The text

  • url (str) – URL of the link

classmethod from_dict(data)[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

text: str = ''
type: str = 'url'
url: str = ''
class peyk.platforms.telegram.types.SentGuestMessage(chat_id: int = 0, message_id: int | None = None, inline_message_id: str | None = None)[source]

Bases: object

Describes an inline message sent by a guest bot.

Variables:

inline_message_id (str | None) – Identifier of the sent inline message

chat_id: int = 0
classmethod from_dict(data: dict | None) SentGuestMessage | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

inline_message_id: str | None = None
message_id: int | None = None
class peyk.platforms.telegram.types.SentWebAppMessage(inline_message_id: str | None = None)[source]

Bases: object

Describes an inline message sent by a Web App on behalf of a user.

Variables:

inline_message_id (str | None) – Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message.

classmethod from_dict(data: dict | None) SentWebAppMessage | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

inline_message_id: str | None = None
class peyk.platforms.telegram.types.SharedUser(user_id: int = 0, first_name: str | None = None, last_name: str | None = None, username: str | None = None, photo: List[PhotoSize] | None = None)[source]

Bases: object

This object contains information about a user that was shared with the bot using a KeyboardButtonRequestUsers button.

Variables:
  • user_id (int) – Identifier of the shared user. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so 64-bit integers or double-precision float types are safe for storing these identifiers. The bot may not have access to the user and could be unable to use this identifier, unless the user is already known to the bot by some other means.

  • first_name (str | None) – First name of the user, if the name was requested by the bot

  • last_name (str | None) – Last name of the user, if the name was requested by the bot

  • username (str | None) – Username of the user, if the username was requested by the bot

  • photo (List[peyk.platforms.telegram.types.photo_size.PhotoSize] | None) – Available sizes of the chat photo, if the photo was requested by the bot

first_name: str | None = None
classmethod from_dict(data: dict | None) SharedUser | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

last_name: str | None = None
photo: List[PhotoSize] | None = None
user_id: int = 0
username: str | None = None
class peyk.platforms.telegram.types.ShippingAddress(country_code: str, state: str, city: str, street_line1: str, street_line2: str, post_code: str)[source]

Bases: object

This object represents a shipping address.

Variables:
  • country_code (str) – Two-letter ISO 3166-1 alpha-2 country code

  • state (str) – State, if applicable

  • city (str) – City

  • street_line1 (str) – First line for the address

  • street_line2 (str) – Second line for the address

  • post_code (str) – Address post code

classmethod from_dict(data: dict | None) ShippingAddress | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

country_code: str
state: str
city: str
street_line1: str
street_line2: str
post_code: str
class peyk.platforms.telegram.types.ShippingOption(id: str, title: str, prices: List[LabeledPrice])[source]

Bases: object

This object represents one shipping option.

Variables:
classmethod from_dict(data: dict | None) ShippingOption | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

to_dict()

_shipping_option_to_dict Telegram model helper.

id: str
title: str
prices: List[LabeledPrice]
class peyk.platforms.telegram.types.ShippingQuery(id: str, from_: User, invoice_payload: str, shipping_address: ShippingAddress)[source]

Bases: object

This object contains information about an incoming shipping query.

Variables:
classmethod from_dict(data: dict | None) ShippingQuery | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

id: str
from_: User
invoice_payload: str
shipping_address: ShippingAddress
class peyk.platforms.telegram.types.StarAmount(amount: int, nanostar_amount: int | None = None)[source]

Bases: object

Describes an amount of Telegram Stars.

Variables:
  • amount (int) – Integer amount of Telegram Stars, rounded to 0; can be negative

  • nanostar_amount (int | None) – The number of 1/1000000000 shares of Telegram Stars; from -999999999 to 999999999; can be negative if and only if amount is non-positive

classmethod from_dict(data: dict | None) StarAmount | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

nanostar_amount: int | None = None
amount: int
class peyk.platforms.telegram.types.StarTransaction(id: str, amount: int, date: int, nanostar_amount: int | None = None, source: TransactionPartnerUser | TransactionPartnerFragment | TransactionPartnerTelegramAds | TransactionPartnerOther | TransactionPartnerAffiliateProgram | TransactionPartnerChat | TransactionPartnerTelegramApi | None = None, receiver: TransactionPartnerUser | TransactionPartnerFragment | TransactionPartnerTelegramAds | TransactionPartnerOther | TransactionPartnerAffiliateProgram | TransactionPartnerChat | TransactionPartnerTelegramApi | None = None)[source]

Bases: object

Describes a Telegram Star transaction. Note that if the buyer initiates a chargeback with the payment provider from whom they acquired Stars (e.g., Apple, Google) following this transaction, the refunded Stars will be deducted from the bot’s balance. This is outside of Telegram’s control.

Variables:
classmethod from_dict(data: dict | None) StarTransaction | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

nanostar_amount: int | None = None
receiver: TransactionPartnerUser | TransactionPartnerFragment | TransactionPartnerTelegramAds | TransactionPartnerOther | TransactionPartnerAffiliateProgram | TransactionPartnerChat | TransactionPartnerTelegramApi | None = None
source: TransactionPartnerUser | TransactionPartnerFragment | TransactionPartnerTelegramAds | TransactionPartnerOther | TransactionPartnerAffiliateProgram | TransactionPartnerChat | TransactionPartnerTelegramApi | None = None
id: str
amount: int
date: int
class peyk.platforms.telegram.types.StarTransactions(transactions: List[StarTransaction])[source]

Bases: object

Contains a list of Telegram Star transactions.

Variables:

transactions (List[peyk.platforms.telegram.types.star_transaction.StarTransaction]) – The list of transactions

classmethod from_dict(data: dict | None) StarTransactions | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

transactions: List[StarTransaction]
class peyk.platforms.telegram.types.Sticker(file_id: str, file_unique_id: str, type: str, width: int, height: int, is_animated: bool = False, is_video: bool = False, thumbnail: PhotoSize | None = None, emoji: str | None = None, set_name: str | None = None, premium_animation: File | None = None, mask_position: MaskPosition | None = None, custom_emoji_id: str | None = None, needs_repainting: bool | None = None, file_size: int | None = None)[source]

Bases: object

This object represents a sticker.

Variables:
  • file_id (str) – Identifier for this file, which can be used to download or reuse the file

  • file_unique_id (str) – Unique identifier for this file, which is supposed to be the same over time and for different bots. Can’t be used to download or reuse the file.

  • type (str) – Type of the sticker, currently one of ‘regular’, ‘mask’, ‘custom_emoji’. The type of the sticker is independent from its format, which is determined by the fields is_animated and is_video.

  • width (int) – Sticker width

  • height (int) – Sticker height

  • is_animated (bool) – True, if the sticker is animated

  • is_video (bool) – True, if the sticker is a video sticker

  • thumbnail (peyk.platforms.telegram.types.photo_size.PhotoSize | None) – Sticker thumbnail in the .WEBP or .JPG format

  • emoji (str | None) – Emoji associated with the sticker

  • set_name (str | None) – Name of the sticker set to which the sticker belongs

  • premium_animation (peyk.platforms.telegram.types.file.File | None) – For premium regular stickers, premium animation for the sticker

  • mask_position (peyk.platforms.telegram.types.mask_position.MaskPosition | None) – For mask stickers, the position where the mask should be placed

  • custom_emoji_id (str | None) – For custom emoji stickers, unique identifier of the custom emoji

  • needs_repainting (bool | None) – True, if the sticker must be repainted to a text color in messages, the color of the Telegram Premium badge in emoji status, white color on chat photos, or another appropriate color in other places

  • file_size (int | None) – File size in bytes

custom_emoji_id: str | None = None
emoji: str | None = None
file_size: int | None = None
classmethod from_dict(data: dict | None) Sticker | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

is_animated: bool = False
is_video: bool = False
classmethod list_from(data: List[dict] | None) List[Sticker] | None[source]

Provides the list from operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

mask_position: MaskPosition | None = None
needs_repainting: bool | None = None
premium_animation: File | None = None
set_name: str | None = None
thumbnail: PhotoSize | None = None
file_id: str
file_unique_id: str
type: str
width: int
height: int
class peyk.platforms.telegram.types.StickerSet(name: str, title: str, sticker_type: str, stickers: List[Sticker], is_animated: bool = False, is_video: bool = False, thumbnail: PhotoSize | None = None)[source]

Bases: object

This object represents a sticker set.

Variables:
  • name (str) – Sticker set name

  • title (str) – Sticker set title

  • sticker_type (str) – Type of stickers in the set, currently one of ‘regular’, ‘mask’, ‘custom_emoji’

  • stickers (List[peyk.platforms.telegram.types.sticker.Sticker]) – List of all set stickers

  • thumbnail (peyk.platforms.telegram.types.photo_size.PhotoSize | None) – Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format

  • is_animated (bool) – True, if the sticker set contains animated stickers

  • is_video (bool) – True, if the sticker set contains video stickers

classmethod from_dict(data: dict | None) StickerSet | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

is_animated: bool = False
is_video: bool = False
thumbnail: PhotoSize | None = None
name: str
title: str
sticker_type: str
stickers: List[Sticker]
class peyk.platforms.telegram.types.Story(chat: Chat | None = None, id: int | None = None)[source]

Bases: object

This object represents a story.

Variables:
chat: Chat | None = None
classmethod from_dict(data: dict | None) Story | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

id: int | None = None
class peyk.platforms.telegram.types.StoryArea(position: StoryAreaPosition | None = None, type: StoryAreaTypeLocation | StoryAreaTypeSuggestedReaction | StoryAreaTypeLink | StoryAreaTypeWeather | StoryAreaTypeUniqueGift | None = None)[source]

Bases: object

Describes a clickable area on a story media.

Variables:
classmethod from_dict(data: dict | None) StoryArea | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

position: StoryAreaPosition | None = None
type: StoryAreaTypeLocation | StoryAreaTypeSuggestedReaction | StoryAreaTypeLink | StoryAreaTypeWeather | StoryAreaTypeUniqueGift | None = None
class peyk.platforms.telegram.types.StoryAreaPosition(x_percentage: float = 0.0, y_percentage: float = 0.0, width_percentage: float = 0.0, height_percentage: float = 0.0, rotation_angle: float = 0.0, radius_percentage: float | None = None)[source]

Bases: object

Describes the position of a clickable area within a story.

Variables:
  • x_percentage (float) – The abscissa of the area’s center, as a percentage of the media width

  • y_percentage (float) – The ordinate of the area’s center, as a percentage of the media height

  • width_percentage (float) – The width of the area’s rectangle, as a percentage of the media width

  • height_percentage (float) – The height of the area’s rectangle, as a percentage of the media height

  • rotation_angle (float) – The clockwise rotation angle of the rectangle, in degrees; 0-360

  • corner_radius_percentage – The radius of the rectangle corner rounding, as a percentage of the media width

classmethod from_dict(data: dict | None) StoryAreaPosition | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

height_percentage: float = 0.0
radius_percentage: float | None = None
rotation_angle: float = 0.0
width_percentage: float = 0.0
x_percentage: float = 0.0
y_percentage: float = 0.0

Bases: object

Describes a story area pointing to an HTTP or tg:// link. Currently, a story can have up to 3 link areas.

Variables:
  • type (str) – Type of the area, always ‘link’

  • url (str) – HTTP or tg:// URL to be opened when the area is clicked

classmethod from_dict(data: dict | None) StoryAreaTypeLink | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

type: str = 'link'
url: str
class peyk.platforms.telegram.types.StoryAreaTypeLocation(latitude: float, longitude: float, type: str = 'location', address: LocationAddress | None = None)[source]

Bases: object

Describes a story area pointing to a location. Currently, a story can have up to 10 location areas.

Variables:
address: LocationAddress | None = None
classmethod from_dict(data: dict | None) StoryAreaTypeLocation | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

type: str = 'location'
latitude: float
longitude: float
class peyk.platforms.telegram.types.StoryAreaTypeSuggestedReaction(reaction_type: ReactionTypeEmoji | ReactionTypeCustomEmoji | ReactionTypePaid, type: str = 'suggested_reaction', is_dark: bool | None = None, is_flipped: bool | None = None)[source]

Bases: object

Describes a story area pointing to a suggested reaction. Currently, a story can have up to 5 suggested reaction areas.

Variables:
classmethod from_dict(data: dict | None) StoryAreaTypeSuggestedReaction | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

is_dark: bool | None = None
is_flipped: bool | None = None
type: str = 'suggested_reaction'
reaction_type: ReactionTypeEmoji | ReactionTypeCustomEmoji | ReactionTypePaid
class peyk.platforms.telegram.types.StoryAreaTypeUniqueGift(type: str = 'unique_gift', name: str = '')[source]

Bases: object

Describes a story area pointing to a unique gift. Currently, a story can have at most 1 unique gift area.

Variables:
  • type (str) – Type of the area, always ‘unique_gift’

  • name (str) – Unique name of the gift

classmethod from_dict(data: dict | None) StoryAreaTypeUniqueGift | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

name: str = ''
type: str = 'unique_gift'
class peyk.platforms.telegram.types.StoryAreaTypeWeather(temperature: float, emoji: str, background_color: int, type: str = 'weather')[source]

Bases: object

Describes a story area containing weather information. Currently, a story can have up to 3 weather areas.

Variables:
  • type (str) – Type of the area, always ‘weather’

  • temperature (float) – Temperature, in degree Celsius

  • emoji (str) – Emoji representing the weather

  • background_color (int) – A color of the area background in the ARGB format

classmethod from_dict(data: dict | None) StoryAreaTypeWeather | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

type: str = 'weather'
temperature: float
emoji: str
background_color: int
class peyk.platforms.telegram.types.SuccessfulPayment(currency: str, total_amount: int, invoice_payload: str, telegram_payment_charge_id: str, provider_payment_charge_id: str, subscription_expiration_date: int | None = None, is_recurring: bool | None = None, is_first_recurring: bool | None = None, shipping_option_id: str | None = None, order_info: OrderInfo | None = None)[source]

Bases: object

This object contains basic information about a successful payment. Note that if the buyer initiates a chargeback with the relevant payment provider following this transaction, the funds may be debited from your balance. This is outside of Telegram’s control.

Variables:
  • currency (str) – Three-letter ISO 4217 currency code, or ‘XTR’ for payments in Telegram Stars

  • total_amount (int) – Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).

  • invoice_payload (str) – Bot-specified invoice payload

  • telegram_payment_charge_id (str) – Telegram payment identifier

  • provider_payment_charge_id (str) – Provider payment identifier

  • subscription_expiration_date (int | None) – Expiration date of the subscription, in Unix time; for recurring payments only

  • is_recurring (bool | None) – True, if the payment is a recurring payment for a subscription

  • is_first_recurring (bool | None) – True, if the payment is the first payment for a subscription

  • shipping_option_id (str | None) – Identifier of the shipping option chosen by the user

  • order_info (peyk.platforms.telegram.types.order_info.OrderInfo | None) – Order information provided by the user

classmethod from_dict(data: dict | None) SuccessfulPayment | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

is_first_recurring: bool | None = None
is_recurring: bool | None = None
order_info: OrderInfo | None = None
shipping_option_id: str | None = None
subscription_expiration_date: int | None = None
currency: str
total_amount: int
invoice_payload: str
telegram_payment_charge_id: str
provider_payment_charge_id: str
class peyk.platforms.telegram.types.SuggestedPostApprovalFailed(suggested_post_message: Message | None = None, price: object | None = None)[source]

Bases: object

Describes a service message about the failed approval of a suggested post. Currently, only caused by insufficient user funds at the time of approval.

Variables:
  • price (object | None) – Expected price of the post

  • suggested_post_message (peyk.platforms.telegram.types.message.Message | None) – Message containing the suggested post whose approval has failed. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply.

classmethod from_dict(data: dict | None) SuggestedPostApprovalFailed | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

price: object | None = None
suggested_post_message: Message | None = None
class peyk.platforms.telegram.types.SuggestedPostApproved(suggested_post_message: Message | None = None, price: object | None = None)[source]

Bases: object

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

Variables:
  • send_date – Date when the post will be published

  • suggested_post_message (peyk.platforms.telegram.types.message.Message | None) – Message containing the suggested post. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply.

  • price (object | None) – Amount paid for the post

classmethod from_dict(data: dict | None) SuggestedPostApproved | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

price: object | None = None
suggested_post_message: Message | None = None
class peyk.platforms.telegram.types.SuggestedPostDeclined(suggested_post_message: Message | None = None, comment: str | None = None)[source]

Bases: object

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

Variables:
  • suggested_post_message (peyk.platforms.telegram.types.message.Message | None) – Message containing the suggested post. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply.

  • comment (str | None) – Comment with which the post was declined

comment: str | None = None
classmethod from_dict(data: dict | None) SuggestedPostDeclined | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

suggested_post_message: Message | None = None
class peyk.platforms.telegram.types.SuggestedPostInfo(price: object | None = None, send_date: int | None = None, is_approved: bool | None = None, is_declined: bool | None = None, decline_comment: str | None = None, refund_reason: str | None = None)[source]

Bases: object

Contains information about a suggested post.

Variables:
  • state – State of the suggested post. Currently, it can be one of ‘pending’, ‘approved’, ‘declined’.

  • price (object | None) – Proposed price of the post. If the field is omitted, then the post is unpaid.

  • send_date (int | None) – Proposed send date of the post. If the field is omitted, then the post can be published at any time within 30 days at the sole discretion of the user or administrator who approves it.

decline_comment: str | None = None
classmethod from_dict(data: dict | None) SuggestedPostInfo | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

is_approved: bool | None = None
is_declined: bool | None = None
price: object | None = None
refund_reason: str | None = None
send_date: int | None = None
class peyk.platforms.telegram.types.SuggestedPostPaid(suggested_post_message: Message | None = None, price: object | None = None)[source]

Bases: object

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

Variables:
  • currency – Currency in which the payment was made. Currently, one of ‘XTR’ for Telegram Stars or ‘TON’ for TON grams.

  • suggested_post_message (peyk.platforms.telegram.types.message.Message | None) – Message containing the suggested post. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply.

  • amount – The amount of the currency that was received by the channel in nanograms; for payments in TON grams only

  • star_amount – The amount of Telegram Stars that was received by the channel; for payments in Telegram Stars only

classmethod from_dict(data: dict | None) SuggestedPostPaid | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

price: object | None = None
suggested_post_message: Message | None = None
class peyk.platforms.telegram.types.SuggestedPostParameters(price: object | None = None, send_date: int | None = None)[source]

Bases: object

Contains parameters of a post that is being suggested by the bot.

Variables:
  • price (object | None) – Proposed price for the post. If the field is omitted, then the post is unpaid.

  • send_date (int | None) – Proposed send date of the post. If specified, then the date must be between 300 second and 2678400 seconds (30 days) in the future. If the field is omitted, then the post can be published at any time within 30 days at the sole discretion of the user who approves it.

price: object | None = None
send_date: int | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.SuggestedPostPrice(label: str = '', amount: int = 0)[source]

Bases: object

Describes the price of a suggested post.

Variables:
  • currency – Currency in which the post will be paid. Currently, must be one of ‘XTR’ for Telegram Stars or ‘TON’ for TON grams.

  • amount (int) – The amount of the currency that will be paid for the post in the smallest units of the currency, i.e. Telegram Stars or nanograms. Currently, price in Telegram Stars must be between 5 and 100000, and price in nanograms must be between 10000000 and 10000000000000.

amount: int = 0
classmethod from_dict(data: dict | None) SuggestedPostPrice | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

label: str = ''
class peyk.platforms.telegram.types.SuggestedPostRefunded(suggested_post_message: Message | None = None, price: object | None = None, reason: str | None = None)[source]

Bases: object

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

Variables:
  • reason (str | None) – Reason for the refund. Currently, one of ‘post_deleted’ if the post was deleted within 24 hours of being posted or removed from scheduled messages without being posted, or ‘payment_refunded’ if the payer refunded their payment.

  • suggested_post_message (peyk.platforms.telegram.types.message.Message | None) – Message containing the suggested post. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply.

classmethod from_dict(data: dict | None) SuggestedPostRefunded | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

price: object | None = None
reason: str | None = None
suggested_post_message: Message | None = None
class peyk.platforms.telegram.types.SwitchInlineQueryChosenChat(query: str | None = None, allow_user_chats: bool | None = None, allow_bot_chats: bool | None = None, allow_group_chats: bool | None = None, allow_channel_chats: bool | None = None)[source]

Bases: object

This object represents an inline button that switches the current user to inline mode in a chosen chat, with an optional default inline query.

Variables:
  • query (str | None) – The default inline query to be inserted in the input field. If left empty, only the bot’s username will be inserted.

  • allow_user_chats (bool | None) – True, if private chats with users can be chosen

  • allow_bot_chats (bool | None) – True, if private chats with bots can be chosen

  • allow_group_chats (bool | None) – True, if group and supergroup chats can be chosen

  • allow_channel_chats (bool | None) – True, if channel chats can be chosen

allow_bot_chats: bool | None = None
allow_channel_chats: bool | None = None
allow_group_chats: bool | None = None
allow_user_chats: bool | None = None
classmethod from_dict(data: dict | None) SwitchInlineQueryChosenChat | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

query: str | None = None
to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.TextQuote(text: str, entities: List[MessageEntity] | None = None, position: int | None = None, is_manual: bool | None = None)[source]

Bases: object

This object contains information about the quoted part of a message that is replied to by the given message.

Variables:
  • text (str) – Text of the quoted part of a message that is replied to by the given message

  • position (int | None) – Approximate quote position in the original message in UTF-16 code units as specified by the sender

  • entities (List[peyk.platforms.telegram.types.message_entity.MessageEntity] | None) – Special entities that appear in the quote. Currently, only bold, italic, underline, strikethrough, spoiler, custom_emoji, and date_time entities are kept in quotes.

  • is_manual (bool | None) – True, if the quote was chosen manually by the message sender. Otherwise, the quote was added automatically by the server.

entities: List[MessageEntity] | None = None
classmethod from_dict(data: dict | None) TextQuote | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

is_manual: bool | None = None
position: int | None = None
text: str
class peyk.platforms.telegram.types.TransactionPartnerAffiliateProgram(type: str = 'affiliate_program', commission_per_mille: int = 0)[source]

Bases: object

Describes the affiliate program that issued the affiliate commission received via this transaction.

Variables:
  • type (str) – Type of the transaction partner, always ‘affiliate_program’

  • commission_per_mille (int) – The number of Telegram Stars received by the bot for each 1000 Telegram Stars received by the affiliate program sponsor from referred users

  • sponsor_user – Information about the bot that sponsored the affiliate program

commission_per_mille: int = 0
classmethod from_dict(data: dict | None) TransactionPartnerAffiliateProgram | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

type: str = 'affiliate_program'
class peyk.platforms.telegram.types.TransactionPartnerChat(type: str = 'chat', chat: Chat | None = None)[source]

Bases: object

Describes a transaction with a chat.

Variables:
  • type (str) – Type of the transaction partner, always ‘chat’

  • chat (peyk.platforms.telegram.types.chat.Chat | None) – Information about the chat

  • gift – The gift sent to the chat by the bot

chat: Chat | None = None
classmethod from_dict(data: dict | None) TransactionPartnerChat | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

type: str = 'chat'
class peyk.platforms.telegram.types.TransactionPartnerFragment(type: str = 'fragment', withdrawal_state: RevenueWithdrawalStatePending | RevenueWithdrawalStateSucceeded | RevenueWithdrawalStateFailed | None = None)[source]

Bases: object

Describes a withdrawal transaction with Fragment.

Variables:
classmethod from_dict(data: dict | None) TransactionPartnerFragment | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

type: str = 'fragment'
withdrawal_state: RevenueWithdrawalStatePending | RevenueWithdrawalStateSucceeded | RevenueWithdrawalStateFailed | None = None
class peyk.platforms.telegram.types.TransactionPartnerOther(type: str = 'other')[source]

Bases: object

Describes a transaction with an unknown source or recipient.

Variables:

type (str) – Type of the transaction partner, always ‘other’

classmethod from_dict(data: dict | None) TransactionPartnerOther | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

type: str = 'other'
class peyk.platforms.telegram.types.TransactionPartnerTelegramAds(type: str = 'telegram_ads')[source]

Bases: object

Describes a withdrawal transaction to the Telegram Ads platform.

Variables:

type (str) – Type of the transaction partner, always ‘telegram_ads’

classmethod from_dict(data: dict | None) TransactionPartnerTelegramAds | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

type: str = 'telegram_ads'
class peyk.platforms.telegram.types.TransactionPartnerTelegramApi(type: str = 'telegram_api', request_count: int = 0)[source]

Bases: object

Describes a transaction with payment for paid broadcasting.

Variables:
  • type (str) – Type of the transaction partner, always ‘telegram_api’

  • request_count (int) – The number of successful requests that exceeded regular limits and were therefore billed

classmethod from_dict(data: dict | None) TransactionPartnerTelegramApi | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

request_count: int = 0
type: str = 'telegram_api'
class peyk.platforms.telegram.types.TransactionPartnerUser(transaction_type: str, user: User, type: str = 'user', affiliate: AffiliateInfo | None = None, invoice_payload: str | None = None, subscription_period: int | None = None, paid_media: List[PaidMediaLivePhoto | PaidMediaPhoto | PaidMediaPreview | PaidMediaVideo] | None = None, paid_media_payload: str | None = None, gift: Gift | None = None, premium_subscription_duration: int | None = None)[source]

Bases: object

Describes a transaction with a user.

Variables:
affiliate: AffiliateInfo | None = None
classmethod from_dict(data: dict | None) TransactionPartnerUser | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

gift: Gift | None = None
invoice_payload: str | None = None
paid_media: List[PaidMediaLivePhoto | PaidMediaPhoto | PaidMediaPreview | PaidMediaVideo] | None = None
paid_media_payload: str | None = None
premium_subscription_duration: int | None = None
subscription_period: int | None = None
type: str = 'user'
transaction_type: str
user: User
class peyk.platforms.telegram.types.UniqueGift(gift_id: str, base_name: str, name: str, number: int, model: UniqueGiftModel, symbol: UniqueGiftSymbol, backdrop: UniqueGiftBackdrop, is_premium: bool | None = None, is_burned: bool | None = None, is_from_blockchain: bool | None = None, colors: UniqueGiftColors | None = None, publisher_chat: Chat | None = None)[source]

Bases: object

This object describes a unique gift that was upgraded from a regular gift.

Variables:
colors: UniqueGiftColors | None = None
classmethod from_dict(data)
id = None
is_burned: bool | None = None
is_from_blockchain: bool | None = None
is_premium: bool | None = None
publisher_chat: Chat | None = None
title = None
gift_id: str
base_name: str
name: str
number: int
model: UniqueGiftModel
symbol: UniqueGiftSymbol
backdrop: UniqueGiftBackdrop
class peyk.platforms.telegram.types.UniqueGiftBackdrop(name: str = '', colors: UniqueGiftBackdropColors | None = None, rarity_per_milles: int = 0)[source]

Bases: object

This object describes the backdrop of a unique gift.

Variables:
colors: UniqueGiftBackdropColors | None = None
classmethod from_dict(data: dict | None) UniqueGiftBackdrop | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

name: str = ''
rarity_per_milles: int = 0
class peyk.platforms.telegram.types.UniqueGiftBackdropColors(center_color: int = 0, edge_color: int = 0, symbol_color: int = 0, text_color: int = 0)[source]

Bases: object

This object describes the colors of the backdrop of a unique gift.

Variables:
  • center_color (int) – The color in the center of the backdrop in RGB format

  • edge_color (int) – The color on the edges of the backdrop in RGB format

  • symbol_color (int) – The color to be applied to the symbol in RGB format

  • text_color (int) – The color for the text on the backdrop in RGB format

center_color: int = 0
edge_color: int = 0
classmethod from_dict(data: dict | None) UniqueGiftBackdropColors | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

symbol_color: int = 0
text_color: int = 0
class peyk.platforms.telegram.types.UniqueGiftColors(center_color: int = 0, edge_color: int = 0, symbol_color: int = 0, text_color: int = 0)[source]

Bases: object

This object contains information about the color scheme for a user’s name, message replies and link previews based on a unique gift.

Variables:
  • model_custom_emoji_id – Custom emoji identifier of the unique gift’s model

  • symbol_custom_emoji_id – Custom emoji identifier of the unique gift’s symbol

  • light_theme_main_color – Main color used in light themes; RGB format

  • light_theme_other_colors – List of 1-3 additional colors used in light themes; RGB format

  • dark_theme_main_color – Main color used in dark themes; RGB format

  • dark_theme_other_colors – List of 1-3 additional colors used in dark themes; RGB format

center_color: int = 0
edge_color: int = 0
classmethod from_dict(data: dict | None) UniqueGiftColors | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

symbol_color: int = 0
text_color: int = 0
class peyk.platforms.telegram.types.UniqueGiftInfo(gift: UniqueGift, origin: str, text: str | None = None, entities: List[MessageEntity] | None = None, is_private: bool | None = None, last_resale_currency: str | None = None, last_resale_amount: int | None = None, owned_gift_id: str | None = None, transfer_star_count: int | None = None, next_transfer_date: int | None = None)[source]

Bases: object

Describes a service message about a unique gift that was sent or received.

Variables:
  • gift (peyk.platforms.telegram.types.unique_gift.UniqueGift) – Information about the gift

  • origin (str) – Origin of the gift. Currently, either ‘upgrade’ for gifts upgraded from regular gifts, ‘transfer’ for gifts transferred from other users or channels, ‘resale’ for gifts bought from other users, ‘gifted_upgrade’ for upgrades purchased after the gift was sent, or ‘offer’ for gifts bought or sold through gift purchase offers.

  • last_resale_currency (str | None) – For gifts bought from other users, the currency in which the payment for the gift was done. Currently, one of ‘XTR’ for Telegram Stars or ‘TON’ for TON grams.

  • last_resale_amount (int | None) – For gifts bought from other users, the price paid for the gift in either Telegram Stars or nanograms

  • owned_gift_id (str | None) – Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts

  • transfer_star_count (int | None) – Number of Telegram Stars that must be paid to transfer the gift; omitted if the bot cannot transfer the gift

  • next_transfer_date (int | None) – Point in time (Unix timestamp) when the gift can be transferred. If it is in the past, then the gift can be transferred now.

  • last_resale_star_count – For gifts bought from other users, the price paid for the gift

entities: List[MessageEntity] | None = None
classmethod from_dict(data: dict | None) UniqueGiftInfo | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

is_private: bool | None = None
last_resale_amount: int | None = None
last_resale_currency: str | None = None
next_transfer_date: int | None = None
owned_gift_id: str | None = None
text: str | None = None
transfer_star_count: int | None = None
gift: UniqueGift
origin: str
class peyk.platforms.telegram.types.UniqueGiftModel(name: str = '', rarity_per_milles: int = 0, star_count: int = 0)[source]

Bases: object

This object describes the model of a unique gift.

Variables:
  • name (str) – Name of the model

  • sticker – The sticker that represents the unique gift

  • rarity_per_mille – The number of unique gifts that receive this model for every 1000 gift upgrades. Always 0 for crafted gifts.

  • rarity – Rarity of the model if it is a crafted model. Currently, can be ‘uncommon’, ‘rare’, ‘epic’, or ‘legendary’.

classmethod from_dict(data: dict | None) UniqueGiftModel | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

name: str = ''
rarity_per_milles: int = 0
star_count: int = 0
class peyk.platforms.telegram.types.UniqueGiftSymbol(name: str = '', rarity_per_milles: int = 0, star_count: int = 0)[source]

Bases: object

This object describes the symbol shown on the pattern of a unique gift.

Variables:
  • name (str) – Name of the symbol

  • sticker – The sticker that represents the unique gift

  • rarity_per_mille – The number of unique gifts that receive this model for every 1000 gifts upgraded

classmethod from_dict(data: dict | None) UniqueGiftSymbol | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

name: str = ''
rarity_per_milles: int = 0
star_count: int = 0
class peyk.platforms.telegram.types.Update(update_id: int, message: Message | None = None, edited_message: Message | None = None, channel_post: Message | None = None, edited_channel_post: Message | None = None, business_connection: object | None = None, business_message: Message | None = None, edited_business_message: Message | None = None, deleted_business_messages: object | None = None, message_reaction: object | None = None, message_reaction_count: object | None = None, inline_query: InlineQuery | None = None, chosen_inline_result: ChosenInlineResult | None = None, callback_query: CallbackQuery | None = None, shipping_query: object | None = None, pre_checkout_query: object | None = None, purchased_paid_media: object | None = None, poll: object | None = None, poll_answer: object | None = None, my_chat_member: ChatMemberUpdated | None = None, chat_member: ChatMemberUpdated | None = None, chat_join_request: ChatJoinRequest | None = None, chat_boost: object | None = None, removed_chat_boost: object | None = None)[source]

Bases: object

This object represents an incoming update. At most one of the optional fields can be present in any given update.

Variables:
  • update_id (int) – The update’s unique identifier. Update identifiers start from a certain positive number and increase sequentially. This identifier becomes especially handy if you’re using webhooks, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially.

  • message (peyk.platforms.telegram.types.message.Message | None) – New incoming message of any kind - text, photo, sticker, etc.

  • edited_message (peyk.platforms.telegram.types.message.Message | None) – New version of a message that is known to the bot and was edited. This update may at times be triggered by changes to message fields that are either unavailable or not actively used by your bot.

  • channel_post (peyk.platforms.telegram.types.message.Message | None) – New incoming channel post of any kind - text, photo, sticker, etc.

  • edited_channel_post (peyk.platforms.telegram.types.message.Message | None) – New version of a channel post that is known to the bot and was edited. This update may at times be triggered by changes to message fields that are either unavailable or not actively used by your bot.

  • business_connection (object | None) – The bot was connected to or disconnected from a business account, or a user edited an existing connection with the bot

  • business_message (peyk.platforms.telegram.types.message.Message | None) – New message from a connected business account

  • edited_business_message (peyk.platforms.telegram.types.message.Message | None) – New version of a message from a connected business account

  • deleted_business_messages (object | None) – Messages were deleted from a connected business account

  • guest_message – New guest message. The bot can use the field Message.guest_query_id and the method answerGuestQuery to send a message in response.

  • message_reaction (object | None) – A reaction to a message was changed by a user. The bot must be an administrator in the chat and must explicitly specify “message_reaction” in the list of allowed_updates to receive these updates. The update isn’t received for reactions set by bots.

  • message_reaction_count (object | None) – Reactions to a message with anonymous reactions were changed. The bot must be an administrator in the chat and must explicitly specify “message_reaction_count” in the list of allowed_updates to receive these updates. The updates are grouped and can be sent with delay up to a few minutes.

  • inline_query (peyk.platforms.telegram.types.inline_query.InlineQuery | None) – New incoming inline query

  • chosen_inline_result (peyk.platforms.telegram.types.chosen_inline_result.ChosenInlineResult | None) – The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot.

  • callback_query (peyk.platforms.telegram.types.callback_query.CallbackQuery | None) – New incoming callback query

  • shipping_query (object | None) – New incoming shipping query. Only for invoices with flexible price.

  • pre_checkout_query (object | None) – New incoming pre-checkout query. Contains full information about checkout.

  • purchased_paid_media (object | None) – A user purchased paid media with a non-empty payload sent by the bot in a non-channel chat

  • poll (object | None) – New poll state. Bots receive only updates about manually stopped polls and polls, which are sent by the bot.

  • poll_answer (object | None) – A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself.

  • my_chat_member (peyk.platforms.telegram.types.chat_member_updated.ChatMemberUpdated | None) – The bot’s chat member status was updated in a chat. For private chats, this update is received only when the bot is blocked or unblocked by the user.

  • chat_member (peyk.platforms.telegram.types.chat_member_updated.ChatMemberUpdated | None) – A chat member’s status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify “chat_member” in the list of allowed_updates to receive these updates.

  • chat_join_request (peyk.platforms.telegram.types.chat_join_request.ChatJoinRequest | None) – A request to join the chat has been sent. The bot must have the can_invite_users administrator right in the chat to receive these updates.

  • chat_boost (object | None) – A chat boost was added or changed. The bot must be an administrator in the chat to receive these updates.

  • removed_chat_boost (object | None) – A boost was removed from a chat. The bot must be an administrator in the chat to receive these updates.

  • managed_bot – A new bot was created to be managed by the bot, or token or owner of a managed bot was changed

  • subscription – User payment subscription has changed

business_connection: object | None = None
business_message: Message | None = None
callback_query: CallbackQuery | None = None
channel_post: Message | None = None
chat_boost: object | None = None
chat_join_request: ChatJoinRequest | None = None
chat_member: ChatMemberUpdated | None = None
chosen_inline_result: ChosenInlineResult | None = None
deleted_business_messages: object | None = None
edited_business_message: Message | None = None
edited_channel_post: Message | None = None
edited_message: Message | None = None
classmethod from_dict(data)
guest_message = None
inline_query: InlineQuery | None = None
classmethod list_from_result(data: List[dict] | None) List[Update][source]

Provides the list from result operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

managed_bot = None
message: Message | None = None
message_reaction: object | None = None
message_reaction_count: object | None = None
my_chat_member: ChatMemberUpdated | None = None
poll: object | None = None
poll_answer: object | None = None
pre_checkout_query: object | None = None
purchased_paid_media: object | None = None
removed_chat_boost: object | None = None
shipping_query: object | None = None
stopped_message_generation = None
subscription = None
update_id: int
class peyk.platforms.telegram.types.User(id: int, is_bot: bool, first_name: str, last_name: str | None = None, username: str | None = None, language_code: str | None = None, is_premium: bool | None = None, added_to_attachment_menu: bool | None = None, can_join_groups: bool | None = None, can_read_all_group_messages: bool | None = None, supports_inline_queries: bool | None = None, can_connect_to_business: bool | None = None, has_main_web_app: bool | None = None)[source]

Bases: object

This object represents a Telegram user or bot.

Variables:
  • id (int) – Unique identifier for this user or bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.

  • is_bot (bool) – True, if this user is a bot

  • first_name (str) – User’s or bot’s first name

  • last_name (str | None) – User’s or bot’s last name

  • username (str | None) – User’s or bot’s username

  • language_code (str | None) – IETF language tag of the user’s language

  • is_premium (bool | None) – True, if this user is a Telegram Premium user

  • added_to_attachment_menu (bool | None) – True, if this user added the bot to the attachment menu

  • can_join_groups (bool | None) – True, if the bot can be invited to groups. Returned only in getMe.

  • can_read_all_group_messages (bool | None) – True, if privacy mode is disabled for the bot. Returned only in getMe.

  • supports_guest_queries – True, if the bot supports guest queries from chats it is not a member of. Returned only in getMe.

  • supports_inline_queries (bool | None) – True, if the bot supports inline queries. Returned only in getMe.

  • can_connect_to_business (bool | None) – True, if the bot can be connected to a user account to manage it. Returned only in getMe.

  • has_main_web_app (bool | None) – True, if the bot has a main Web App. Returned only in getMe.

  • has_topics_enabled – True, if the bot has forum topic mode enabled in private chats. Returned only in getMe.

  • allows_users_to_create_topics – True, if the bot allows users to create and delete topics in private chats. Returned only in getMe.

  • can_manage_bots – True, if other bots can be created to be controlled by the bot. Returned only in getMe.

  • supports_join_request_queries – True, if the bot supports join request queries and can be assigned to process them. Returned only in getMe.

added_to_attachment_menu: bool | None = None
can_connect_to_business: bool | None = None
can_join_groups: bool | None = None
can_read_all_group_messages: bool | None = None
classmethod from_dict(data)
has_main_web_app: bool | None = None
is_premium: bool | None = None
language_code: str | None = None
last_name: str | None = None
supports_guest_queries = None
supports_inline_queries: bool | None = None
supports_join_request_queries = None
username: str | None = None
id: int
is_bot: bool
first_name: str
class peyk.platforms.telegram.types.UserChatBoosts(boosts: List[ChatBoost])[source]

Bases: object

This object represents a list of boosts added to a chat by a user.

Variables:

boosts (List[peyk.platforms.telegram.types.chat_boost.ChatBoost]) – The list of boosts added to the chat by the user

classmethod from_dict(data: dict | None) UserChatBoosts | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

boosts: List[ChatBoost]
class peyk.platforms.telegram.types.UserProfileAudios(total_count: int = 0, audios: List[Audio] | None = None)[source]

Bases: object

This object represents the audios displayed on a user’s profile.

Variables:
audios: List[Audio] | None = None
classmethod from_dict(data: dict | None) UserProfileAudios | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

total_count: int = 0
class peyk.platforms.telegram.types.UserProfilePhotos(total_count: int = 0, photos: List[List[PhotoSize]] | None = None)[source]

Bases: object

This object represent a user’s profile pictures.

Variables:
classmethod from_dict(data: dict | None) UserProfilePhotos | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

photos: List[List[PhotoSize]] | None = None
total_count: int = 0
class peyk.platforms.telegram.types.UserRating(rating: int = 0)[source]

Bases: object

This object describes the rating of a user based on their Telegram Star spendings.

Variables:
  • level – Current level of the user, indicating their reliability when purchasing digital goods and services. A higher level suggests a more trustworthy customer; a negative level is likely reason for concern.

  • rating (int) – Numerical value of the user’s rating; the higher the rating, the better

  • current_level_rating – The rating value required to get the current level

  • next_level_rating – The rating value required to get to the next level; omitted if the maximum level was reached

classmethod from_dict(data: dict | None) UserRating | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

rating: int = 0
class peyk.platforms.telegram.types.UsersShared(request_id: int = 0, users: List[SharedUser] | None = None)[source]

Bases: object

This object contains information about the users whose identifiers were shared with the bot using a KeyboardButtonRequestUsers button.

Variables:
  • request_id (int) – Identifier of the request

  • users (List[peyk.platforms.telegram.types.shared_user.SharedUser] | None) – Information about users shared with the bot

  • user_ids – Identifiers of the shared users. These numbers may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting them. But they have at most 52 significant bits, so 64-bit integers or double-precision float types are safe for storing these identifiers. The bot may not have access to the users and could be unable to use these identifiers, unless the users are already known to the bot by some other means.

classmethod from_dict(data: dict | None) UsersShared | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

request_id: int = 0
users: List[SharedUser] | None = None
class peyk.platforms.telegram.types.Venue(location: Location, title: str, address: str, foursquare_id: str | None = None, foursquare_type: str | None = None, google_place_id: str | None = None, google_place_type: str | None = None)[source]

Bases: object

This object represents a venue.

Variables:
  • location (peyk.platforms.telegram.types.location.Location) – Venue location. Can’t be a live location.

  • title (str) – Name of the venue

  • address (str) – Address of the venue

  • foursquare_id (str | None) – Foursquare identifier of the venue

  • foursquare_type (str | None) – Foursquare type of the venue. (For example, ‘arts_entertainment/default’, ‘arts_entertainment/aquarium’ or ‘food/icecream’.)

  • google_place_id (str | None) – Google Places identifier of the venue

  • google_place_type (str | None) – Google Places type of the venue. (See supported types.)

foursquare_id: str | None = None
foursquare_type: str | None = None
classmethod from_dict(data: dict | None) Venue | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

google_place_id: str | None = None
google_place_type: str | None = None
location: Location
title: str
address: str
class peyk.platforms.telegram.types.Video(file_id: str, file_unique_id: str, width: int, height: int, duration: int, thumbnail: PhotoSize | None = None, cover: List[PhotoSize] | None = None, start_timestamp: int | None = None, qualities: object | None = None, file_name: str | None = None, mime_type: str | None = None, file_size: int | None = None)[source]

Bases: object

This object represents a video file.

Variables:
  • file_id (str) – Identifier for this file, which can be used to download or reuse the file

  • file_unique_id (str) – Unique identifier for this file, which is supposed to be the same over time and for different bots. Can’t be used to download or reuse the file.

  • width (int) – Video width as defined by the sender

  • height (int) – Video height as defined by the sender

  • duration (int) – Duration of the video in seconds as defined by the sender

  • thumbnail (peyk.platforms.telegram.types.photo_size.PhotoSize | None) – Video thumbnail

  • cover (List[peyk.platforms.telegram.types.photo_size.PhotoSize] | None) – Available sizes of the cover of the video in the message

  • start_timestamp (int | None) – Timestamp in seconds from which the video will play in the message

  • qualities (object | None) – List of available qualities of the video

  • file_name (str | None) – Original filename as defined by the sender

  • mime_type (str | None) – MIME type of the file as defined by the sender

  • file_size (int | None) – File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.

cover: List[PhotoSize] | None = None
file_name: str | None = None
file_size: int | None = None
classmethod from_dict(data: dict | None) Video | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

mime_type: str | None = None
qualities: object | None = None
start_timestamp: int | None = None
thumbnail: PhotoSize | None = None
file_id: str
file_unique_id: str
width: int
height: int
duration: int
class peyk.platforms.telegram.types.VideoChatEnded(duration: int = 0)[source]

Bases: object

This object represents a service message about a video chat ended in the chat.

Variables:

duration (int) – Video chat duration in seconds

duration: int = 0
classmethod from_dict(data: dict | None) VideoChatEnded | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.VideoChatParticipantsInvited(users: List[User] | None = None)[source]

Bases: object

This object represents a service message about new members invited to a video chat.

Variables:

users (List[peyk.platforms.telegram.types.user.User] | None) – New members that were invited to the video chat

classmethod from_dict(data: dict | None) VideoChatParticipantsInvited | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

users: List[User] | None = None
class peyk.platforms.telegram.types.VideoChatScheduled(start_date: int = 0)[source]

Bases: object

This object represents a service message about a video chat scheduled in the chat.

Variables:

start_date (int) – Point in time (Unix timestamp) when the video chat is supposed to be started by a chat administrator

classmethod from_dict(data: dict | None) VideoChatScheduled | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

start_date: int = 0
class peyk.platforms.telegram.types.VideoChatStarted[source]

Bases: object

Video chat started.

classmethod from_dict(data: dict | None) VideoChatStarted | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

class peyk.platforms.telegram.types.VideoNote(file_id: str, file_unique_id: str, length: int, duration: int, thumbnail: PhotoSize | None = None, file_size: int | None = None)[source]

Bases: object

This object represents a video message (available in Telegram apps as of v.4.0).

Variables:
  • file_id (str) – Identifier for this file, which can be used to download or reuse the file

  • file_unique_id (str) – Unique identifier for this file, which is supposed to be the same over time and for different bots. Can’t be used to download or reuse the file.

  • length (int) – Video width and height (diameter of the video message) as defined by the sender

  • duration (int) – Duration of the video in seconds as defined by the sender

  • thumbnail (peyk.platforms.telegram.types.photo_size.PhotoSize | None) – Video thumbnail

  • file_size (int | None) – File size in bytes

file_size: int | None = None
classmethod from_dict(data: dict | None) VideoNote | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

thumbnail: PhotoSize | None = None
file_id: str
file_unique_id: str
length: int
duration: int
class peyk.platforms.telegram.types.VideoQuality(type: str, width: int | None = None, height: int | None = None, duration: int | None = None)[source]

Bases: object

This object represents a video file of a specific quality.

Variables:
  • file_id – Identifier for this file, which can be used to download or reuse the file

  • file_unique_id – Unique identifier for this file, which is supposed to be the same over time and for different bots. Can’t be used to download or reuse the file.

  • width (int | None) – Video width

  • height (int | None) – Video height

  • codec – Codec that was used to encode the video, for example, ‘h264’, ‘h265’, or ‘av01’

  • file_size – File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.

duration: int | None = None
classmethod from_dict(data: dict | None) VideoQuality | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

height: int | None = None
width: int | None = None
type: str
class peyk.platforms.telegram.types.Voice(file_id: str, file_unique_id: str, duration: int, mime_type: str | None = None, file_size: int | None = None)[source]

Bases: object

This object represents a voice note.

Variables:
  • file_id (str) – Identifier for this file, which can be used to download or reuse the file

  • file_unique_id (str) – Unique identifier for this file, which is supposed to be the same over time and for different bots. Can’t be used to download or reuse the file.

  • duration (int) – Duration of the audio in seconds as defined by the sender

  • mime_type (str | None) – MIME type of the file as defined by the sender

  • file_size (int | None) – File size in bytes. It can be bigger than 2^31 and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this value.

file_size: int | None = None
classmethod from_dict(data: dict | None) Voice | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

mime_type: str | None = None
file_id: str
file_unique_id: str
duration: int
class peyk.platforms.telegram.types.WebAppData(data: str, button_text: str)[source]

Bases: object

Describes data sent from a Web App to the bot.

Variables:
  • data (str) – The data. Be aware that a bad client can send arbitrary data in this field.

  • button_text (str) – Text of the web_app keyboard button from which the Web App was opened. Be aware that a bad client can send arbitrary data in this field.

classmethod from_dict(data)
data: str
button_text: str
class peyk.platforms.telegram.types.WebAppInfo(url: str = '')[source]

Bases: object

Describes a Web App.

Variables:

url (str) – An HTTPS URL of a Web App to be opened with additional data as specified in Initializing Web Apps

classmethod from_dict(data: dict | None) WebAppInfo | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

to_dict() Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Returns:

Result produced by the operation.

url: str = ''
class peyk.platforms.telegram.types.WebhookInfo(url: str, has_custom_certificate: bool | None = None, pending_update_count: int | None = None, ip_address: str | None = None, last_error_date: int | None = None, last_error_message: str | None = None, last_synchronization_error_date: int | None = None, max_connections: int | None = None, allowed_updates: List[str] | None = None)[source]

Bases: object

Describes the current status of a webhook.

Variables:
  • url (str) – Webhook URL, may be empty if webhook is not set up

  • has_custom_certificate (bool | None) – True, if a custom certificate was provided for webhook certificate checks

  • pending_update_count (int | None) – Number of updates awaiting delivery

  • ip_address (str | None) – Currently used webhook IP address

  • last_error_date (int | None) – Unix time for the most recent error that happened when trying to deliver an update via webhook

  • last_error_message (str | None) – Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook

  • last_synchronization_error_date (int | None) – Unix time of the most recent error that happened when trying to synchronize available updates with Telegram datacenters

  • max_connections (int | None) – The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery

  • allowed_updates (List[str] | None) – A list of update types the bot is subscribed to. Defaults to all update types except chat_member, message_reaction, and message_reaction_count.

allowed_updates: List[str] | None = None
classmethod from_dict(data: dict | None) WebhookInfo | None[source]

Parse a Telegram API mapping into this type.

Parameters:

data – Raw Telegram API mapping, or None.

Returns:

Parsed type instance, or None when data is None.

has_custom_certificate: bool | None = None
ip_address: str | None = None
last_error_date: int | None = None
last_error_message: str | None = None
last_synchronization_error_date: int | None = None
max_connections: int | None = None
pending_update_count: int | None = None
url: str
class peyk.platforms.telegram.types.WriteAccessAllowed(from_request: bool | None = None, web_app_name: str | None = None, from_attachment_menu: bool | None = None)[source]

Bases: object

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.

Variables:
  • from_request (bool | None) – True, if the access was granted after the user accepted an explicit request from a Web App sent by the method requestWriteAccess

  • web_app_name (str | None) – Name of the Web App, if the access was granted when the Web App was launched from a link

  • from_attachment_menu (bool | None) – True, if the access was granted when the bot was added to the attachment or side menu

from_attachment_menu: bool | None = None
classmethod from_dict(data: dict | None) WriteAccessAllowed | None[source]

Provides the from dict operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

from_request: bool | None = None
web_app_name: str | None = None
peyk.platforms.telegram.types.parse_background_fill(data: dict | None) BackgroundFillSolid | BackgroundFillGradient | BackgroundFillFreeformGradient | None[source]

Provides the parse background fill operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

peyk.platforms.telegram.types.parse_background_type(data: dict | None) BackgroundTypeFill | BackgroundTypeWallpaper | BackgroundTypePattern | BackgroundTypeChatTheme | None[source]

Provides the parse background type operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

peyk.platforms.telegram.types.parse_bot_command_scope(data: dict | None) BotCommandScopeDefault | BotCommandScopeAllPrivateChats | BotCommandScopeAllGroupChats | BotCommandScopeAllChatAdministrators | BotCommandScopeChat | BotCommandScopeChatAdministrators | BotCommandScopeChatMember | None[source]

Provides the parse bot command scope operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

peyk.platforms.telegram.types.parse_chat_boost_source(data: dict | None) ChatBoostSource | None[source]

Provides the parse chat boost source operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

peyk.platforms.telegram.types.parse_chat_member(data: dict | None) ChatMemberOwner | ChatMemberAdministrator | ChatMemberMember | ChatMemberRestricted | ChatMemberLeft | ChatMemberBanned | None[source]

Provides the parse chat member operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

peyk.platforms.telegram.types.parse_input_media(data: dict | None) InputMediaAnimation | InputMediaAudio | InputMediaDocument | InputMediaLivePhoto | InputMediaPhoto | InputMediaVideo | None[source]

Provides the parse input media operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

peyk.platforms.telegram.types.parse_input_paid_media(data: dict | None) InputPaidMediaLivePhoto | InputPaidMediaPhoto | InputPaidMediaVideo | None[source]

Provides the parse input paid media operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

peyk.platforms.telegram.types.parse_input_story_content(data: dict | None) InputStoryContentPhoto | InputStoryContentVideo | None[source]

Provides the parse input story content operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

peyk.platforms.telegram.types.parse_maybe_inaccessible_message(data: dict | None)[source]

Provides the parse maybe inaccessible message operation for the Telegram integration.

Parameters:

data – Value used by this operation.

peyk.platforms.telegram.types.parse_menu_button(data: dict | None) MenuButtonCommands | MenuButtonWebApp | MenuButtonDefault | None[source]

Provides the parse menu button operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

peyk.platforms.telegram.types.parse_message_origin(data: dict | None) MessageOriginUser | MessageOriginHiddenUser | MessageOriginChat | MessageOriginChannel | None[source]

Provides the parse message origin operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

peyk.platforms.telegram.types.parse_owned_gift(data: dict | None) OwnedGiftRegular | OwnedGiftUnique | None[source]

Provides the parse owned gift operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

peyk.platforms.telegram.types.parse_paid_media(data: dict | None) PaidMediaLivePhoto | PaidMediaPhoto | PaidMediaPreview | PaidMediaVideo | None[source]

Provides the parse paid media operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

peyk.platforms.telegram.types.parse_passport_element_error(data: dict | None) PassportElementErrorDataField | PassportElementErrorFrontSide | PassportElementErrorReverseSide | PassportElementErrorSelfie | PassportElementErrorFile | PassportElementErrorFiles | PassportElementErrorTranslationFile | PassportElementErrorTranslationFiles | PassportElementErrorUnspecified | None[source]

Provides the parse passport element error operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

peyk.platforms.telegram.types.parse_reaction_type(data: dict | None) ReactionTypeEmoji | ReactionTypeCustomEmoji | ReactionTypePaid | None[source]

Provides the parse reaction type operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

peyk.platforms.telegram.types.parse_revenue_withdrawal_state(data: dict | None) RevenueWithdrawalStatePending | RevenueWithdrawalStateSucceeded | RevenueWithdrawalStateFailed | None[source]

Provides the parse revenue withdrawal state operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

peyk.platforms.telegram.types.parse_transaction_partner(data: dict | None) TransactionPartnerUser | TransactionPartnerFragment | TransactionPartnerTelegramAds | TransactionPartnerOther | TransactionPartnerAffiliateProgram | TransactionPartnerChat | TransactionPartnerTelegramApi | None[source]

Provides the parse transaction partner operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Returns:

Result produced by the operation.

peyk.platforms.telegram.types.serialize_bot_command_scope(value: BotCommandScopeDefault | BotCommandScopeAllPrivateChats | BotCommandScopeAllGroupChats | BotCommandScopeAllChatAdministrators | BotCommandScopeChat | BotCommandScopeChatAdministrators | BotCommandScopeChatMember | Mapping[str, object]) Dict[str, object][source]

Provides the serialize bot command scope operation for the Telegram integration.

Parameters:

value – Value used by this operation.

Returns:

Result produced by the operation.

peyk.platforms.telegram.types.serialize_inline_result(value: InlineQueryResultArticle | InlineQueryResultPhoto | InlineQueryResultGif | InlineQueryResultMpeg4Gif | InlineQueryResultVideo | InlineQueryResultAudio | InlineQueryResultVoice | InlineQueryResultDocument | InlineQueryResultLocation | InlineQueryResultVenue | InlineQueryResultContact | InlineQueryResultGame | InlineQueryResultCachedPhoto | InlineQueryResultCachedGif | InlineQueryResultCachedMpeg4Gif | InlineQueryResultCachedSticker | InlineQueryResultCachedDocument | InlineQueryResultCachedVideo | InlineQueryResultCachedVoice | InlineQueryResultCachedAudio | Mapping[str, object]) Dict[str, object][source]

Provides the serialize inline result operation for the Telegram integration.

Parameters:

value – Value used by this operation.

Returns:

Result produced by the operation.

peyk.platforms.telegram.types.serialize_input_message_content(value: InputTextMessageContent | InputLocationMessageContent | InputVenueMessageContent | InputContactMessageContent | InputInvoiceMessageContent | Mapping[str, object]) Dict[str, object][source]

Provides the serialize input message content operation for the Telegram integration.

Parameters:

value – Value used by this operation.

Returns:

Result produced by the operation.

peyk.platforms.telegram.types.serialize_menu_button(value: MenuButtonCommands | MenuButtonWebApp | MenuButtonDefault | Mapping[str, object]) Dict[str, object][source]

Provides the serialize menu button operation for the Telegram integration.

Parameters:

value – Value used by this operation.

Returns:

Result produced by the operation.

peyk.platforms.telegram.types.serialize_reply_markup(value: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply | Mapping[str, object]) Dict[str, object][source]

Provides the serialize reply markup operation for the Telegram integration.

Parameters:

value – Value used by this operation.

Returns:

Result produced by the operation.

peyk.platforms.telegram.types.validate_callback_data(data: str) None[source]

Provides the validate callback data operation for the Telegram integration.

Parameters:

data – Value used by this operation.

Modules

accepted_gift_types

affiliate_info

animation

audio

background_fill_freeform_gradient

background_fill_gradient

background_fill_solid

background_type_chat_theme

background_type_fill

background_type_pattern

background_type_wallpaper

birthdate

bot_access_settings

bot_command

bot_command_scope_all_chat_administrators

bot_command_scope_all_group_chats

bot_command_scope_all_private_chats

bot_command_scope_chat

bot_command_scope_chat_administrators

bot_command_scope_chat_member

bot_command_scope_default

bot_description

bot_name

bot_short_description

bot_subscription_updated

business_bot_rights

business_connection

business_intro

business_location

business_messages_deleted

business_opening_hours

business_opening_hours_interval

callback_game

callback_query

chat

chat_administrator_rights

chat_background

chat_boost

chat_boost_added

chat_boost_removed

chat_boost_source

chat_boost_source_gift_code

chat_boost_source_giveaway

chat_boost_source_premium

chat_boost_updated

chat_full_info

chat_invite_link

chat_join_request

chat_location

chat_member

T5 tagged union for Telegram chat-member responses.

chat_member_administrator

chat_member_banned

chat_member_left

chat_member_member

chat_member_owner

chat_member_restricted

chat_member_updated

chat_owner_changed

chat_owner_left

chat_permissions

chat_photo

chat_shared

checklist

checklist_task

checklist_tasks_added

checklist_tasks_done

chosen_inline_result

community

community_chat_added

community_chat_joined

community_chat_removed

contact

copy_text_button

dice

direct_message_price_changed

direct_messages_topic

disabled_button

document

encrypted_credentials

encrypted_passport_element

ephemeral_message_parameters

external_reply_info

file

force_reply

forum_topic

forum_topic_closed

forum_topic_created

forum_topic_edited

forum_topic_reopened

game

game_high_score

general_forum_topic_hidden

general_forum_topic_unhidden

gift

gift_background

gift_info

gifts

giveaway

giveaway_completed

giveaway_created

giveaway_winners

inaccessible_message

inline_keyboard_button

inline_keyboard_markup

inline_query

inline_query_result_article

inline_query_result_audio

inline_query_result_cached_audio

inline_query_result_cached_document

inline_query_result_cached_gif

inline_query_result_cached_mpeg4_gif

inline_query_result_cached_photo

inline_query_result_cached_sticker

inline_query_result_cached_video

inline_query_result_cached_voice

inline_query_result_contact

inline_query_result_document

inline_query_result_game

inline_query_result_gif

inline_query_result_location

inline_query_result_mpeg4_gif

inline_query_result_photo

inline_query_result_venue

inline_query_result_video

inline_query_result_voice

inline_query_results_button

input_checklist

input_checklist_task

input_contact_message_content

input_file

input_invoice_message_content

input_location_message_content

input_media_animation

input_media_audio

input_media_document

input_media_item

T3 input-media union alias retained for compatibility.

input_media_link

input_media_live_photo

input_media_location

input_media_photo

input_media_sticker

input_media_venue

input_media_video

input_media_voice_note

input_paid_media_live_photo

input_paid_media_photo

input_paid_media_video

input_poll_media

T4 union alias for poll media.

input_poll_option

input_poll_option_media

T4 union alias for poll-option media.

input_profile_photo_animated

input_profile_photo_static

input_rich_block_anchor

input_rich_block_animation

input_rich_block_audio

input_rich_block_block_quotation

input_rich_block_buttons

input_rich_block_collage

input_rich_block_details

input_rich_block_divider

input_rich_block_document

input_rich_block_expandable_block_quotation

input_rich_block_footer

input_rich_block_list

input_rich_block_list_item

input_rich_block_map

input_rich_block_mathematical_expression

input_rich_block_paragraph

input_rich_block_photo

input_rich_block_preformatted

input_rich_block_pull_quotation

input_rich_block_section_heading

input_rich_block_slideshow

input_rich_block_table

input_rich_block_thinking

input_rich_block_video

input_rich_block_voice_note

input_rich_message

input_rich_message_content

input_rich_message_media

input_sticker

input_story_content_photo

input_story_content_video

input_text_message_content

input_venue_message_content

invoice

keyboard_button

keyboard_button_poll_type

keyboard_button_request_chat

keyboard_button_request_managed_bot

keyboard_button_request_users

labeled_price

link

link_preview_options

live_photo

location

location_address

login_url

managed_bot_created

managed_bot_updated

mask_position

menu_button_commands

menu_button_default

menu_button_web_app

message

message_auto_delete_timer_changed

message_entity

message_generation_stopped

message_id

message_origin_channel

message_origin_chat

message_origin_hidden_user

message_origin_user

message_reaction_count_updated

message_reaction_updated

order_info

owned_gift_regular

owned_gift_unique

owned_gifts

paid_media_info

paid_media_live_photo

paid_media_photo

paid_media_preview

paid_media_purchased

paid_media_video

paid_message_price_changed

passport_data

passport_element_error_data_field

passport_element_error_file

passport_element_error_files

passport_element_error_front_side

passport_element_error_reverse_side

passport_element_error_selfie

passport_element_error_translation_file

passport_element_error_translation_files

passport_element_error_unspecified

passport_file

photo_size

poll

poll_answer

poll_media

poll_option

poll_option_added

poll_option_deleted

pre_checkout_query

prepared_inline_message

prepared_keyboard_button

proximity_alert_triggered

reaction_count

reaction_type_custom_emoji

reaction_type_emoji

reaction_type_paid

refunded_payment

reply_keyboard_markup

reply_keyboard_remove

reply_parameters

response_parameters

revenue_withdrawal_state_failed

revenue_withdrawal_state_pending

revenue_withdrawal_state_succeeded

rich_block_anchor

rich_block_animation

rich_block_audio

rich_block_block_quotation

rich_block_buttons

rich_block_caption

rich_block_collage

rich_block_details

rich_block_divider

rich_block_document

rich_block_expandable_block_quotation

rich_block_footer

rich_block_list

rich_block_list_item

rich_block_map

rich_block_mathematical_expression

rich_block_paragraph

rich_block_photo

rich_block_preformatted

rich_block_pull_quotation

rich_block_section_heading

rich_block_slideshow

rich_block_table

rich_block_table_cell

rich_block_thinking

rich_block_video

rich_block_voice_note

rich_message

rich_message_button

rich_text_anchor

rich_text_anchor_link

rich_text_bank_card_number

rich_text_bold

rich_text_bot_command

rich_text_button

rich_text_cashtag

rich_text_code

rich_text_custom_emoji

rich_text_date_time

rich_text_email_address

rich_text_hashtag

rich_text_italic

rich_text_marked

rich_text_mathematical_expression

rich_text_mention

rich_text_phone_number

rich_text_reference

rich_text_reference_link

rich_text_spoiler

rich_text_strikethrough

rich_text_subscript

rich_text_superscript

rich_text_text_mention

rich_text_underline

rich_text_url

sent_guest_message

sent_web_app_message

shared_user

shipping_address

shipping_option

shipping_query

star_amount

star_transaction

star_transactions

sticker

sticker_set

story

story_area

story_area_position

story_area_type_link

story_area_type_location

story_area_type_suggested_reaction

story_area_type_unique_gift

story_area_type_weather

successful_payment

suggested_post_approval_failed

suggested_post_approved

suggested_post_declined

suggested_post_info

suggested_post_paid

suggested_post_parameters

suggested_post_price

suggested_post_refunded

switch_inline_query_chosen_chat

text_quote

transaction_partner_affiliate_program

transaction_partner_chat

transaction_partner_fragment

transaction_partner_other

transaction_partner_telegram_ads

transaction_partner_telegram_api

transaction_partner_user

unique_gift

unique_gift_backdrop

unique_gift_backdrop_colors

unique_gift_colors

unique_gift_info

unique_gift_model

unique_gift_symbol

update

user

user_chat_boosts

user_profile_audios

user_profile_photos

user_rating

users_shared

venue

video

video_chat_ended

video_chat_participants_invited

video_chat_scheduled

video_chat_started

video_note

video_quality

voice

web_app_data

web_app_info

webhook_info

write_access_allowed