pytdbot.types

class pytdbot.types.AccentColor(id=0, built_in_accent_color_id=0, light_theme_colors=None, dark_theme_colors=None, min_channel_chat_boost_level=0)[source]

Bases: TlObject

Contains information about supported accent color for user/chat name, background of empty chat photo, replies to messages and link previews

Parameters:
  • id (int) – Accent color identifier

  • built_in_accent_color_id (int) – Identifier of a built-in color to use in places, where only one color is needed; 0-6

  • light_theme_colors (List[int]) – The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in light themes

  • dark_theme_colors (List[int]) – The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in dark themes

  • min_channel_chat_boost_level (int) – The minimum chat boost level required to use the color in a channel chat

__init__(id=0, built_in_accent_color_id=0, light_theme_colors=None, dark_theme_colors=None, min_channel_chat_boost_level=0)[source]
Parameters:
  • id (int)

  • built_in_accent_color_id (int)

  • light_theme_colors (List[int] | None)

  • dark_theme_colors (List[int] | None)

  • min_channel_chat_boost_level (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AccentColor]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AccentColor']

classmethod getType()[source]
Return type:

Literal['accentColor']

to_dict()[source]
Return type:

dict

built_in_accent_color_id: int

Identifier of a built-in color to use in places, where only one color is needed; 0-6

dark_theme_colors: List[int]

The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in dark themes

id: int

Accent color identifier

light_theme_colors: List[int]

The list of 1-3 colors in RGB format, describing the accent color, as expected to be shown in light themes

min_channel_chat_boost_level: int

The minimum chat boost level required to use the color in a channel chat

class pytdbot.types.AcceptedGiftTypes(unlimited_gifts=False, limited_gifts=False, upgraded_gifts=False, premium_subscription=False)[source]

Bases: TlObject

Describes gift types that are accepted by a user

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

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

  • upgraded_gifts (bool) – True, if upgraded gifts and regular gifts that can be upgraded for free are accepted

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

__init__(unlimited_gifts=False, limited_gifts=False, upgraded_gifts=False, premium_subscription=False)[source]
Parameters:
  • unlimited_gifts (bool)

  • limited_gifts (bool)

  • upgraded_gifts (bool)

  • premium_subscription (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AcceptedGiftTypes]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AcceptedGiftTypes']

classmethod getType()[source]
Return type:

Literal['acceptedGiftTypes']

to_dict()[source]
Return type:

dict

limited_gifts: bool

True, if limited regular gifts are accepted

premium_subscription: bool

True, if Telegram Premium subscription is accepted

unlimited_gifts: bool

True, if unlimited regular gifts are accepted

upgraded_gifts: bool

True, if upgraded gifts and regular gifts that can be upgraded for free are accepted

class pytdbot.types.AccountInfo(registration_month=0, registration_year=0, phone_number_country_code='', last_name_change_date=0, last_photo_change_date=0)[source]

Bases: TlObject

Contains basic information about another user that started a chat with the current user

Parameters:
  • registration_month (int) – Month when the user was registered in Telegram; 0-12; may be 0 if unknown

  • registration_year (int) – Year when the user was registered in Telegram; 0-9999; may be 0 if unknown

  • phone_number_country_code (str) – A two-letter ISO 3166-1 alpha-2 country code based on the phone number of the user; may be empty if unknown

  • last_name_change_date (int) – Point in time (Unix timestamp) when the user changed name last time; 0 if unknown

  • last_photo_change_date (int) – Point in time (Unix timestamp) when the user changed photo last time; 0 if unknown

__init__(registration_month=0, registration_year=0, phone_number_country_code='', last_name_change_date=0, last_photo_change_date=0)[source]
Parameters:
  • registration_month (int)

  • registration_year (int)

  • phone_number_country_code (str)

  • last_name_change_date (int)

  • last_photo_change_date (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AccountInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AccountInfo']

classmethod getType()[source]
Return type:

Literal['accountInfo']

to_dict()[source]
Return type:

dict

last_name_change_date: int

Point in time (Unix timestamp) when the user changed name last time; 0 if unknown

last_photo_change_date: int

Point in time (Unix timestamp) when the user changed photo last time; 0 if unknown

phone_number_country_code: Optional[str]

A two-letter ISO 3166-1 alpha-2 country code based on the phone number of the user; may be empty if unknown

registration_month: int

Month when the user was registered in Telegram; 0-12; may be 0 if unknown

registration_year: int

Year when the user was registered in Telegram; 0-9999; may be 0 if unknown

class pytdbot.types.AccountTtl(days=0)[source]

Bases: TlObject

Contains information about the period of inactivity after which the current user’s account will automatically be deleted

Parameters:

days (int) – Number of days of inactivity before the account will be flagged for deletion; 30-730 days

__init__(days=0)[source]
Parameters:

days (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AccountTtl]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AccountTtl']

classmethod getType()[source]
Return type:

Literal['accountTtl']

to_dict()[source]
Return type:

dict

days: int

Number of days of inactivity before the account will be flagged for deletion; 30-730 days

class pytdbot.types.AddedReaction(type=None, sender_id=None, is_outgoing=False, date=0)[source]

Bases: TlObject

Represents a reaction applied to a message

Parameters:
  • type ("types.ReactionType") – Type of the reaction

  • sender_id ("types.MessageSender") – Identifier of the chat member, applied the reaction

  • is_outgoing (bool) – True, if the reaction was added by the current user

  • date (int) – Point in time (Unix timestamp) when the reaction was added

__init__(type=None, sender_id=None, is_outgoing=False, date=0)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AddedReaction]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AddedReaction']

classmethod getType()[source]
Return type:

Literal['addedReaction']

to_dict()[source]
Return type:

dict

date: int

Point in time (Unix timestamp) when the reaction was added

is_outgoing: bool

True, if the reaction was added by the current user

sender_id: Union[MessageSenderUser, MessageSenderChat, None]

Identifier of the chat member, applied the reaction

type: Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid, None]

Type of the reaction

class pytdbot.types.AddedReactions(total_count=0, reactions=None, next_offset='')[source]

Bases: TlObject

Represents a list of reactions added to a message

Parameters:
  • total_count (int) – The total number of found reactions

  • reactions (List["types.AddedReaction"]) – The list of added reactions

  • next_offset (str) – The offset for the next request. If empty, then there are no more results

__init__(total_count=0, reactions=None, next_offset='')[source]
Parameters:
  • total_count (int)

  • reactions (List[AddedReaction] | None)

  • next_offset (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AddedReactions]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AddedReactions']

classmethod getType()[source]
Return type:

Literal['addedReactions']

to_dict()[source]
Return type:

dict

next_offset: Optional[str]

The offset for the next request. If empty, then there are no more results

reactions: List[AddedReaction]

The list of added reactions

total_count: int

The total number of found reactions

class pytdbot.types.Address(country_code='', state='', city='', street_line1='', street_line2='', postal_code='')[source]

Bases: TlObject

Describes an address

Parameters:
  • country_code (str) – A two-letter ISO 3166-1 alpha-2 country code

  • state (str) – State, if applicable

  • city (str) – City

  • street_line1 (str) – First line of the address

  • street_line2 (str) – Second line of the address

  • postal_code (str) – Address postal code

__init__(country_code='', state='', city='', street_line1='', street_line2='', postal_code='')[source]
Parameters:
  • country_code (str)

  • state (str)

  • city (str)

  • street_line1 (str)

  • street_line2 (str)

  • postal_code (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Address]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Address']

classmethod getType()[source]
Return type:

Literal['address']

to_dict()[source]
Return type:

dict

city: Optional[str]

City

country_code: Optional[str]

A two-letter ISO 3166-1 alpha-2 country code

postal_code: Optional[str]

Address postal code

state: Optional[str]

State, if applicable

street_line1: Optional[str]

First line of the address

street_line2: Optional[str]

Second line of the address

class pytdbot.types.AdvertisementSponsor(url='', photo=None, info='')[source]

Bases: TlObject

Information about the sponsor of an advertisement

Parameters:
  • url (str) – URL of the sponsor to be opened when the advertisement is clicked

  • photo ("types.Photo") – Photo of the sponsor; may be null if must not be shown

  • info (str) – Additional optional information about the sponsor to be shown along with the advertisement

__init__(url='', photo=None, info='')[source]
Parameters:
  • url (str)

  • photo (Photo | None)

  • info (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AdvertisementSponsor]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AdvertisementSponsor']

classmethod getType()[source]
Return type:

Literal['advertisementSponsor']

to_dict()[source]
Return type:

dict

info: Optional[str]

Additional optional information about the sponsor to be shown along with the advertisement

photo: Optional[Photo]

Photo of the sponsor; may be null if must not be shown

url: Optional[str]

URL of the sponsor to be opened when the advertisement is clicked

class pytdbot.types.AffiliateInfo(commission_per_mille=0, affiliate_chat_id=0, star_amount=None)[source]

Bases: TlObject

Contains information about an affiliate that received commission from a Telegram Star transaction

Parameters:
  • commission_per_mille (int) – The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the program owner

  • affiliate_chat_id (int) – Identifier of the chat which received the commission

  • star_amount ("types.StarAmount") – The amount of Telegram Stars that were received by the affiliate; can be negative for refunds

__init__(commission_per_mille=0, affiliate_chat_id=0, star_amount=None)[source]
Parameters:
  • commission_per_mille (int)

  • affiliate_chat_id (int)

  • star_amount (StarAmount | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AffiliateInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AffiliateInfo']

classmethod getType()[source]
Return type:

Literal['affiliateInfo']

to_dict()[source]
Return type:

dict

affiliate_chat_id: int

Identifier of the chat which received the commission

commission_per_mille: int

The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the program owner

star_amount: Optional[StarAmount]

The amount of Telegram Stars that were received by the affiliate; can be negative for refunds

class pytdbot.types.AffiliateProgramInfo(parameters=None, end_date=0, daily_revenue_per_user_amount=None)[source]

Bases: TlObject

Contains information about an active affiliate program

Parameters:
  • parameters ("types.AffiliateProgramParameters") – Parameters of the affiliate program

  • end_date (int) – Point in time (Unix timestamp) when the affiliate program will be closed; 0 if the affiliate program isn’t scheduled to be closed. If positive, then the program can’t be connected using connectAffiliateProgram, but active connections will work until the date

  • daily_revenue_per_user_amount ("types.StarAmount") – The amount of daily revenue per user in Telegram Stars of the bot that created the affiliate program

__init__(parameters=None, end_date=0, daily_revenue_per_user_amount=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AffiliateProgramInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AffiliateProgramInfo']

classmethod getType()[source]
Return type:

Literal['affiliateProgramInfo']

to_dict()[source]
Return type:

dict

daily_revenue_per_user_amount: Optional[StarAmount]

The amount of daily revenue per user in Telegram Stars of the bot that created the affiliate program

end_date: int

Point in time (Unix timestamp) when the affiliate program will be closed; 0 if the affiliate program isn’t scheduled to be closed. If positive, then the program can’t be connected using connectAffiliateProgram, but active connections will work until the date

parameters: Optional[AffiliateProgramParameters]

Parameters of the affiliate program

class pytdbot.types.AffiliateProgramParameters(commission_per_mille=0, month_count=0)[source]

Bases: TlObject

Describes parameters of an affiliate program

Parameters:
  • commission_per_mille (int) – The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the program owner; getOption("affiliate_program_commission_per_mille_min")-getOption("affiliate_program_commission_per_mille_max")

  • month_count (int) – Number of months the program will be active; 0-36. If 0, then the program is eternal

__init__(commission_per_mille=0, month_count=0)[source]
Parameters:
  • commission_per_mille (int)

  • month_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AffiliateProgramParameters]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AffiliateProgramParameters']

classmethod getType()[source]
Return type:

Literal['affiliateProgramParameters']

to_dict()[source]
Return type:

dict

commission_per_mille: int

The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the program owner; getOption("affiliate_program_commission_per_mille_min")-getOption("affiliate_program_commission_per_mille_max")

month_count: int

Number of months the program will be active; 0-36. If 0, then the program is eternal

class pytdbot.types.AffiliateProgramSortOrder[source]

Bases: object

Describes the order of the found affiliate programs

class pytdbot.types.AffiliateProgramSortOrderCreationDate[source]

Bases: TlObject, AffiliateProgramSortOrder

The affiliate programs must be sorted by creation date

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AffiliateProgramSortOrderCreationDate]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AffiliateProgramSortOrder']

classmethod getType()[source]
Return type:

Literal['affiliateProgramSortOrderCreationDate']

to_dict()[source]
Return type:

dict

class pytdbot.types.AffiliateProgramSortOrderProfitability[source]

Bases: TlObject, AffiliateProgramSortOrder

The affiliate programs must be sorted by the profitability

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AffiliateProgramSortOrderProfitability]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AffiliateProgramSortOrder']

classmethod getType()[source]
Return type:

Literal['affiliateProgramSortOrderProfitability']

to_dict()[source]
Return type:

dict

class pytdbot.types.AffiliateProgramSortOrderRevenue[source]

Bases: TlObject, AffiliateProgramSortOrder

The affiliate programs must be sorted by the expected revenue

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AffiliateProgramSortOrderRevenue]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AffiliateProgramSortOrder']

classmethod getType()[source]
Return type:

Literal['affiliateProgramSortOrderRevenue']

to_dict()[source]
Return type:

dict

class pytdbot.types.AffiliateType[source]

Bases: object

Describes type of affiliate for an affiliate program

class pytdbot.types.AffiliateTypeBot(user_id=0)[source]

Bases: TlObject, AffiliateType

The affiliate is a bot owned by the current user

Parameters:

user_id (int) – User identifier of the bot

__init__(user_id=0)[source]
Parameters:

user_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AffiliateTypeBot]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AffiliateType']

classmethod getType()[source]
Return type:

Literal['affiliateTypeBot']

to_dict()[source]
Return type:

dict

user_id: int

User identifier of the bot

class pytdbot.types.AffiliateTypeChannel(chat_id=0)[source]

Bases: TlObject, AffiliateType

The affiliate is a channel chat where the current user has can_post_messages administrator right

Parameters:

chat_id (int) – Identifier of the channel chat

__init__(chat_id=0)[source]
Parameters:

chat_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AffiliateTypeChannel]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AffiliateType']

classmethod getType()[source]
Return type:

Literal['affiliateTypeChannel']

to_dict()[source]
Return type:

dict

chat_id: int

Identifier of the channel chat

class pytdbot.types.AffiliateTypeCurrentUser[source]

Bases: TlObject, AffiliateType

The affiliate is the current user

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AffiliateTypeCurrentUser]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AffiliateType']

classmethod getType()[source]
Return type:

Literal['affiliateTypeCurrentUser']

to_dict()[source]
Return type:

dict

class pytdbot.types.AgeVerificationParameters(min_age=0, verification_bot_username='', country='')[source]

Bases: TlObject

Describes parameters for age verification of the current user

Parameters:
  • min_age (int) – The minimum age required to view restricted content

  • verification_bot_username (str) – Username of the bot which main Web App may be used to verify age of the user

  • country (str) – Unique name for the country or region, which legislation required age verification. May be used to get the corresponding localization key

__init__(min_age=0, verification_bot_username='', country='')[source]
Parameters:
  • min_age (int)

  • verification_bot_username (str)

  • country (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AgeVerificationParameters]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AgeVerificationParameters']

classmethod getType()[source]
Return type:

Literal['ageVerificationParameters']

to_dict()[source]
Return type:

dict

country: Optional[str]

Unique name for the country or region, which legislation required age verification. May be used to get the corresponding localization key

min_age: int

The minimum age required to view restricted content

verification_bot_username: Optional[str]

Username of the bot which main Web App may be used to verify age of the user

class pytdbot.types.AlternativeVideo(id=0, width=0, height=0, codec='', hls_file=None, video=None)[source]

Bases: TlObject

Describes an alternative re-encoded quality of a video file

Parameters:
  • id (int) – Unique identifier of the alternative video, which is used in the HLS file

  • width (int) – Video width

  • height (int) – Video height

  • codec (str) – Codec used for video file encoding, for example, "h264", "h265", or "av1"

  • hls_file ("types.File") – HLS file describing the video

  • video ("types.File") – File containing the video

__init__(id=0, width=0, height=0, codec='', hls_file=None, video=None)[source]
Parameters:
  • id (int)

  • width (int)

  • height (int)

  • codec (str)

  • hls_file (File | None)

  • video (File | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AlternativeVideo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AlternativeVideo']

classmethod getType()[source]
Return type:

Literal['alternativeVideo']

to_dict()[source]
Return type:

dict

codec: Optional[str]

Codec used for video file encoding, for example, "h264", "h265", or "av1"

height: int

Video height

hls_file: Optional[File]

HLS file describing the video

id: int

Unique identifier of the alternative video, which is used in the HLS file

video: Optional[File]

File containing the video

width: int

Video width

class pytdbot.types.AnimatedChatPhoto(length=0, file=None, main_frame_timestamp=0.0)[source]

Bases: TlObject

Animated variant of a chat photo in MPEG4 format

Parameters:
  • length (int) – Animation width and height

  • file ("types.File") – Information about the animation file

  • main_frame_timestamp (float) – Timestamp of the frame, used as a static chat photo

__init__(length=0, file=None, main_frame_timestamp=0.0)[source]
Parameters:
  • length (int)

  • file (File | None)

  • main_frame_timestamp (float)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AnimatedChatPhoto]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AnimatedChatPhoto']

classmethod getType()[source]
Return type:

Literal['animatedChatPhoto']

to_dict()[source]
Return type:

dict

file: Optional[File]

Information about the animation file

length: int

Animation width and height

main_frame_timestamp: float

Timestamp of the frame, used as a static chat photo

class pytdbot.types.AnimatedEmoji(sticker=None, sticker_width=0, sticker_height=0, fitzpatrick_type=0, sound=None)[source]

Bases: TlObject

Describes an animated or custom representation of an emoji

Parameters:
  • sticker ("types.Sticker") – Sticker for the emoji; may be null if yet unknown for a custom emoji. If the sticker is a custom emoji, then it can have arbitrary format

  • sticker_width (int) – Expected width of the sticker, which can be used if the sticker is null

  • sticker_height (int) – Expected height of the sticker, which can be used if the sticker is null

  • fitzpatrick_type (int) – Emoji modifier fitzpatrick type; 0-6; 0 if none

  • sound ("types.File") – File containing the sound to be played when the sticker is clicked; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container

__init__(sticker=None, sticker_width=0, sticker_height=0, fitzpatrick_type=0, sound=None)[source]
Parameters:
  • sticker (Sticker | None)

  • sticker_width (int)

  • sticker_height (int)

  • fitzpatrick_type (int)

  • sound (File | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AnimatedEmoji]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AnimatedEmoji']

classmethod getType()[source]
Return type:

Literal['animatedEmoji']

to_dict()[source]
Return type:

dict

fitzpatrick_type: int

Emoji modifier fitzpatrick type; 0-6; 0 if none

sound: Optional[File]

File containing the sound to be played when the sticker is clicked; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container

sticker: Optional[Sticker]

Sticker for the emoji; may be null if yet unknown for a custom emoji. If the sticker is a custom emoji, then it can have arbitrary format

sticker_height: int

Expected height of the sticker, which can be used if the sticker is null

sticker_width: int

Expected width of the sticker, which can be used if the sticker is null

class pytdbot.types.Animation(duration=0, width=0, height=0, file_name='', mime_type='', has_stickers=False, minithumbnail=None, thumbnail=None, animation=None)[source]

Bases: TlObject

Describes an animation file. The animation must be encoded in GIF or MPEG4 format

Parameters:
  • duration (int) – Duration of the animation, in seconds; as defined by the sender

  • width (int) – Width of the animation

  • height (int) – Height of the animation

  • file_name (str) – Original name of the file; as defined by the sender

  • mime_type (str) – MIME type of the file, usually "image/gif" or "video/mp4"

  • has_stickers (bool) – True, if stickers were added to the animation. The list of corresponding sticker set can be received using getAttachedStickerSets

  • minithumbnail ("types.Minithumbnail") – Animation minithumbnail; may be null

  • thumbnail ("types.Thumbnail") – Animation thumbnail in JPEG or MPEG4 format; may be null

  • animation ("types.File") – File containing the animation

__init__(duration=0, width=0, height=0, file_name='', mime_type='', has_stickers=False, minithumbnail=None, thumbnail=None, animation=None)[source]
Parameters:
  • duration (int)

  • width (int)

  • height (int)

  • file_name (str)

  • mime_type (str)

  • has_stickers (bool)

  • minithumbnail (Minithumbnail | None)

  • thumbnail (Thumbnail | None)

  • animation (File | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Animation]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Animation']

classmethod getType()[source]
Return type:

Literal['animation']

to_dict()[source]
Return type:

dict

animation: Optional[File]

File containing the animation

duration: int

Duration of the animation, in seconds; as defined by the sender

file_name: Optional[str]

Original name of the file; as defined by the sender

has_stickers: bool

True, if stickers were added to the animation. The list of corresponding sticker set can be received using getAttachedStickerSets

height: int

Height of the animation

mime_type: Optional[str]

MIME type of the file, usually "image/gif" or "video/mp4"

minithumbnail: Optional[Minithumbnail]

Animation minithumbnail; may be null

thumbnail: Optional[Thumbnail]

Animation thumbnail in JPEG or MPEG4 format; may be null

width: int

Width of the animation

class pytdbot.types.Animations(animations=None)[source]

Bases: TlObject

Represents a list of animations

Parameters:

animations (List["types.Animation"]) – List of animations

__init__(animations=None)[source]
Parameters:

animations (List[Animation] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Animations]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Animations']

classmethod getType()[source]
Return type:

Literal['animations']

to_dict()[source]
Return type:

dict

animations: List[Animation]

List of animations

class pytdbot.types.ArchiveChatListSettings(archive_and_mute_new_chats_from_unknown_users=False, keep_unmuted_chats_archived=False, keep_chats_from_folders_archived=False)[source]

Bases: TlObject

Contains settings for automatic moving of chats to and from the Archive chat lists

Parameters:
  • archive_and_mute_new_chats_from_unknown_users (bool) – True, if new chats from non-contacts will be automatically archived and muted. Can be set to true only if the option "can_archive_and_mute_new_chats_from_unknown_users" is true

  • keep_unmuted_chats_archived (bool) – True, if unmuted chats will be kept in the Archive chat list when they get a new message

  • keep_chats_from_folders_archived (bool) – True, if unmuted chats, that are always included or pinned in a folder, will be kept in the Archive chat list when they get a new message. Ignored if keep_unmuted_chats_archived == true

__init__(archive_and_mute_new_chats_from_unknown_users=False, keep_unmuted_chats_archived=False, keep_chats_from_folders_archived=False)[source]
Parameters:
  • archive_and_mute_new_chats_from_unknown_users (bool)

  • keep_unmuted_chats_archived (bool)

  • keep_chats_from_folders_archived (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ArchiveChatListSettings]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ArchiveChatListSettings']

classmethod getType()[source]
Return type:

Literal['archiveChatListSettings']

to_dict()[source]
Return type:

dict

archive_and_mute_new_chats_from_unknown_users: bool

True, if new chats from non-contacts will be automatically archived and muted. Can be set to true only if the option "can_archive_and_mute_new_chats_from_unknown_users" is true

keep_chats_from_folders_archived: bool

True, if unmuted chats, that are always included or pinned in a folder, will be kept in the Archive chat list when they get a new message. Ignored if keep_unmuted_chats_archived == true

keep_unmuted_chats_archived: bool

True, if unmuted chats will be kept in the Archive chat list when they get a new message

class pytdbot.types.AttachmentMenuBot(bot_user_id=0, supports_self_chat=False, supports_user_chats=False, supports_bot_chats=False, supports_group_chats=False, supports_channel_chats=False, request_write_access=False, is_added=False, show_in_attachment_menu=False, show_in_side_menu=False, show_disclaimer_in_side_menu=False, name='', name_color=None, default_icon=None, ios_static_icon=None, ios_animated_icon=None, ios_side_menu_icon=None, android_icon=None, android_side_menu_icon=None, macos_icon=None, macos_side_menu_icon=None, icon_color=None, web_app_placeholder=None)[source]

Bases: TlObject

Represents a bot, which can be added to attachment or side menu

Parameters:
  • bot_user_id (int) – User identifier of the bot

  • supports_self_chat (bool) – True, if the bot supports opening from attachment menu in the chat with the bot

  • supports_user_chats (bool) – True, if the bot supports opening from attachment menu in private chats with ordinary users

  • supports_bot_chats (bool) – True, if the bot supports opening from attachment menu in private chats with other bots

  • supports_group_chats (bool) – True, if the bot supports opening from attachment menu in basic group and supergroup chats

  • supports_channel_chats (bool) – True, if the bot supports opening from attachment menu in channel chats

  • request_write_access (bool) – True, if the user must be asked for the permission to send messages to the bot

  • is_added (bool) – True, if the bot was explicitly added by the user. If the bot isn’t added, then on the first bot launch toggleBotIsAddedToAttachmentMenu must be called and the bot must be added or removed

  • show_in_attachment_menu (bool) – True, if the bot must be shown in the attachment menu

  • show_in_side_menu (bool) – True, if the bot must be shown in the side menu

  • show_disclaimer_in_side_menu (bool) – True, if a disclaimer, why the bot is shown in the side menu, is needed

  • name (str) – Name for the bot in attachment menu

  • name_color ("types.AttachmentMenuBotColor") – Color to highlight selected name of the bot if appropriate; may be null

  • default_icon ("types.File") – Default icon for the bot in SVG format; may be null

  • ios_static_icon ("types.File") – Icon for the bot in SVG format for the official iOS app; may be null

  • ios_animated_icon ("types.File") – Icon for the bot in TGS format for the official iOS app; may be null

  • ios_side_menu_icon ("types.File") – Icon for the bot in PNG format for the official iOS app side menu; may be null

  • android_icon ("types.File") – Icon for the bot in TGS format for the official Android app; may be null

  • android_side_menu_icon ("types.File") – Icon for the bot in SVG format for the official Android app side menu; may be null

  • macos_icon ("types.File") – Icon for the bot in TGS format for the official native macOS app; may be null

  • macos_side_menu_icon ("types.File") – Icon for the bot in PNG format for the official macOS app side menu; may be null

  • icon_color ("types.AttachmentMenuBotColor") – Color to highlight selected icon of the bot if appropriate; may be null

  • web_app_placeholder ("types.File") – Default placeholder for opened Web Apps in SVG format; may be null

__init__(bot_user_id=0, supports_self_chat=False, supports_user_chats=False, supports_bot_chats=False, supports_group_chats=False, supports_channel_chats=False, request_write_access=False, is_added=False, show_in_attachment_menu=False, show_in_side_menu=False, show_disclaimer_in_side_menu=False, name='', name_color=None, default_icon=None, ios_static_icon=None, ios_animated_icon=None, ios_side_menu_icon=None, android_icon=None, android_side_menu_icon=None, macos_icon=None, macos_side_menu_icon=None, icon_color=None, web_app_placeholder=None)[source]
Parameters:
  • bot_user_id (int)

  • supports_self_chat (bool)

  • supports_user_chats (bool)

  • supports_bot_chats (bool)

  • supports_group_chats (bool)

  • supports_channel_chats (bool)

  • request_write_access (bool)

  • is_added (bool)

  • show_in_attachment_menu (bool)

  • show_in_side_menu (bool)

  • show_disclaimer_in_side_menu (bool)

  • name (str)

  • name_color (AttachmentMenuBotColor | None)

  • default_icon (File | None)

  • ios_static_icon (File | None)

  • ios_animated_icon (File | None)

  • ios_side_menu_icon (File | None)

  • android_icon (File | None)

  • android_side_menu_icon (File | None)

  • macos_icon (File | None)

  • macos_side_menu_icon (File | None)

  • icon_color (AttachmentMenuBotColor | None)

  • web_app_placeholder (File | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AttachmentMenuBot]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AttachmentMenuBot']

classmethod getType()[source]
Return type:

Literal['attachmentMenuBot']

to_dict()[source]
Return type:

dict

android_icon: Optional[File]

Icon for the bot in TGS format for the official Android app; may be null

android_side_menu_icon: Optional[File]

Icon for the bot in SVG format for the official Android app side menu; may be null

bot_user_id: int

User identifier of the bot

default_icon: Optional[File]

Default icon for the bot in SVG format; may be null

icon_color: Optional[AttachmentMenuBotColor]

Color to highlight selected icon of the bot if appropriate; may be null

ios_animated_icon: Optional[File]

Icon for the bot in TGS format for the official iOS app; may be null

ios_side_menu_icon: Optional[File]

Icon for the bot in PNG format for the official iOS app side menu; may be null

ios_static_icon: Optional[File]

Icon for the bot in SVG format for the official iOS app; may be null

is_added: bool

True, if the bot was explicitly added by the user. If the bot isn’t added, then on the first bot launch toggleBotIsAddedToAttachmentMenu must be called and the bot must be added or removed

macos_icon: Optional[File]

Icon for the bot in TGS format for the official native macOS app; may be null

macos_side_menu_icon: Optional[File]

Icon for the bot in PNG format for the official macOS app side menu; may be null

name: Optional[str]

Name for the bot in attachment menu

name_color: Optional[AttachmentMenuBotColor]

Color to highlight selected name of the bot if appropriate; may be null

request_write_access: bool

True, if the user must be asked for the permission to send messages to the bot

show_disclaimer_in_side_menu: bool

True, if a disclaimer, why the bot is shown in the side menu, is needed

show_in_attachment_menu: bool

True, if the bot must be shown in the attachment menu

show_in_side_menu: bool

True, if the bot must be shown in the side menu

supports_bot_chats: bool

True, if the bot supports opening from attachment menu in private chats with other bots

supports_channel_chats: bool

True, if the bot supports opening from attachment menu in channel chats

supports_group_chats: bool

True, if the bot supports opening from attachment menu in basic group and supergroup chats

supports_self_chat: bool

True, if the bot supports opening from attachment menu in the chat with the bot

supports_user_chats: bool

True, if the bot supports opening from attachment menu in private chats with ordinary users

web_app_placeholder: Optional[File]

Default placeholder for opened Web Apps in SVG format; may be null

class pytdbot.types.AttachmentMenuBotColor(light_color=0, dark_color=0)[source]

Bases: TlObject

Describes a color to highlight a bot added to attachment menu

Parameters:
  • light_color (int) – Color in the RGB format for light themes

  • dark_color (int) – Color in the RGB format for dark themes

__init__(light_color=0, dark_color=0)[source]
Parameters:
  • light_color (int)

  • dark_color (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AttachmentMenuBotColor]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AttachmentMenuBotColor']

classmethod getType()[source]
Return type:

Literal['attachmentMenuBotColor']

to_dict()[source]
Return type:

dict

dark_color: int

Color in the RGB format for dark themes

light_color: int

Color in the RGB format for light themes

class pytdbot.types.Audio(duration=0, title='', performer='', file_name='', mime_type='', album_cover_minithumbnail=None, album_cover_thumbnail=None, external_album_covers=None, audio=None)[source]

Bases: TlObject

Describes an audio file. Audio is usually in MP3 or M4A format

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

  • title (str) – Title of the audio; as defined by the sender

  • performer (str) – Performer of the audio; as defined by the sender

  • file_name (str) – Original name of the file; as defined by the sender

  • mime_type (str) – The MIME type of the file; as defined by the sender

  • album_cover_minithumbnail ("types.Minithumbnail") – The minithumbnail of the album cover; may be null

  • album_cover_thumbnail ("types.Thumbnail") – The thumbnail of the album cover in JPEG format; as defined by the sender. The full size thumbnail is expected to be extracted from the downloaded audio file; may be null

  • external_album_covers (List["types.Thumbnail"]) – Album cover variants to use if the downloaded audio file contains no album cover. Provided thumbnail dimensions are approximate

  • audio ("types.File") – File containing the audio

__init__(duration=0, title='', performer='', file_name='', mime_type='', album_cover_minithumbnail=None, album_cover_thumbnail=None, external_album_covers=None, audio=None)[source]
Parameters:
  • duration (int)

  • title (str)

  • performer (str)

  • file_name (str)

  • mime_type (str)

  • album_cover_minithumbnail (Minithumbnail | None)

  • album_cover_thumbnail (Thumbnail | None)

  • external_album_covers (List[Thumbnail] | None)

  • audio (File | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Audio]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Audio']

classmethod getType()[source]
Return type:

Literal['audio']

to_dict()[source]
Return type:

dict

album_cover_minithumbnail: Optional[Minithumbnail]

The minithumbnail of the album cover; may be null

album_cover_thumbnail: Optional[Thumbnail]

The thumbnail of the album cover in JPEG format; as defined by the sender. The full size thumbnail is expected to be extracted from the downloaded audio file; may be null

audio: Optional[File]

File containing the audio

duration: int

Duration of the audio, in seconds; as defined by the sender

external_album_covers: List[Thumbnail]

Album cover variants to use if the downloaded audio file contains no album cover. Provided thumbnail dimensions are approximate

file_name: Optional[str]

Original name of the file; as defined by the sender

mime_type: Optional[str]

The MIME type of the file; as defined by the sender

performer: Optional[str]

Performer of the audio; as defined by the sender

title: Optional[str]

Title of the audio; as defined by the sender

class pytdbot.types.Audios(total_count=0, audios=None)[source]

Bases: TlObject

Contains a list of audio files

Parameters:
  • total_count (int) – Approximate total number of audio files found

  • audios (List["types.Audio"]) – List of audio files

__init__(total_count=0, audios=None)[source]
Parameters:
  • total_count (int)

  • audios (List[Audio] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Audios]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Audios']

classmethod getType()[source]
Return type:

Literal['audios']

to_dict()[source]
Return type:

dict

audios: List[Audio]

List of audio files

total_count: int

Approximate total number of audio files found

class pytdbot.types.AuthenticationCodeInfo(phone_number='', type=None, next_type=None, timeout=0)[source]

Bases: TlObject

Information about the authentication code that was sent

Parameters:
  • phone_number (str) – A phone number that is being authenticated

  • type ("types.AuthenticationCodeType") – The way the code was sent to the user

  • next_type ("types.AuthenticationCodeType") – The way the next code will be sent to the user; may be null

  • timeout (int) – Timeout before the code can be re-sent, in seconds

__init__(phone_number='', type=None, next_type=None, timeout=0)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AuthenticationCodeInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AuthenticationCodeInfo']

classmethod getType()[source]
Return type:

Literal['authenticationCodeInfo']

to_dict()[source]
Return type:

dict

next_type: Union[AuthenticationCodeTypeTelegramMessage, AuthenticationCodeTypeSms, AuthenticationCodeTypeSmsWord, AuthenticationCodeTypeSmsPhrase, AuthenticationCodeTypeCall, AuthenticationCodeTypeFlashCall, AuthenticationCodeTypeMissedCall, AuthenticationCodeTypeFragment, AuthenticationCodeTypeFirebaseAndroid, AuthenticationCodeTypeFirebaseIos, None]

The way the next code will be sent to the user; may be null

phone_number: Optional[str]

A phone number that is being authenticated

timeout: int

Timeout before the code can be re-sent, in seconds

type: Union[AuthenticationCodeTypeTelegramMessage, AuthenticationCodeTypeSms, AuthenticationCodeTypeSmsWord, AuthenticationCodeTypeSmsPhrase, AuthenticationCodeTypeCall, AuthenticationCodeTypeFlashCall, AuthenticationCodeTypeMissedCall, AuthenticationCodeTypeFragment, AuthenticationCodeTypeFirebaseAndroid, AuthenticationCodeTypeFirebaseIos, None]

The way the code was sent to the user

class pytdbot.types.AuthenticationCodeType[source]

Bases: object

Provides information about the method by which an authentication code is delivered to the user

class pytdbot.types.AuthenticationCodeTypeCall(length=0)[source]

Bases: TlObject, AuthenticationCodeType

A digit-only authentication code is delivered via a phone call to the specified phone number

Parameters:

length (int) – Length of the code

__init__(length=0)[source]
Parameters:

length (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AuthenticationCodeTypeCall]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AuthenticationCodeType']

classmethod getType()[source]
Return type:

Literal['authenticationCodeTypeCall']

to_dict()[source]
Return type:

dict

length: int

Length of the code

class pytdbot.types.AuthenticationCodeTypeFirebaseAndroid(device_verification_parameters=None, length=0)[source]

Bases: TlObject, AuthenticationCodeType

A digit-only authentication code is delivered via Firebase Authentication to the official Android application

Parameters:
  • device_verification_parameters ("types.FirebaseDeviceVerificationParameters") – Parameters to be used for device verification

  • length (int) – Length of the code

__init__(device_verification_parameters=None, length=0)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AuthenticationCodeTypeFirebaseAndroid]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AuthenticationCodeType']

classmethod getType()[source]
Return type:

Literal['authenticationCodeTypeFirebaseAndroid']

to_dict()[source]
Return type:

dict

device_verification_parameters: Union[FirebaseDeviceVerificationParametersSafetyNet, FirebaseDeviceVerificationParametersPlayIntegrity, None]

Parameters to be used for device verification

length: int

Length of the code

class pytdbot.types.AuthenticationCodeTypeFirebaseIos(receipt='', push_timeout=0, length=0)[source]

Bases: TlObject, AuthenticationCodeType

A digit-only authentication code is delivered via Firebase Authentication to the official iOS application

Parameters:
  • receipt (str) – Receipt of successful application token validation to compare with receipt from push notification

  • push_timeout (int) – Time after the next authentication method is expected to be used if verification push notification isn’t received, in seconds

  • length (int) – Length of the code

__init__(receipt='', push_timeout=0, length=0)[source]
Parameters:
  • receipt (str)

  • push_timeout (int)

  • length (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AuthenticationCodeTypeFirebaseIos]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AuthenticationCodeType']

classmethod getType()[source]
Return type:

Literal['authenticationCodeTypeFirebaseIos']

to_dict()[source]
Return type:

dict

length: int

Length of the code

push_timeout: int

Time after the next authentication method is expected to be used if verification push notification isn’t received, in seconds

receipt: Optional[str]

Receipt of successful application token validation to compare with receipt from push notification

class pytdbot.types.AuthenticationCodeTypeFlashCall(pattern='')[source]

Bases: TlObject, AuthenticationCodeType

An authentication code is delivered by an immediately canceled call to the specified phone number. The phone number that calls is the code that must be entered automatically

Parameters:

pattern (str) – Pattern of the phone number from which the call will be made

__init__(pattern='')[source]
Parameters:

pattern (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AuthenticationCodeTypeFlashCall]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AuthenticationCodeType']

classmethod getType()[source]
Return type:

Literal['authenticationCodeTypeFlashCall']

to_dict()[source]
Return type:

dict

pattern: Optional[str]

Pattern of the phone number from which the call will be made

class pytdbot.types.AuthenticationCodeTypeFragment(url='', length=0)[source]

Bases: TlObject, AuthenticationCodeType

A digit-only authentication code is delivered to https://fragment.com. The user must be logged in there via a wallet owning the phone number’s NFT

Parameters:
  • url (str) – URL to open to receive the code

  • length (int) – Length of the code

__init__(url='', length=0)[source]
Parameters:
  • url (str)

  • length (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AuthenticationCodeTypeFragment]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AuthenticationCodeType']

classmethod getType()[source]
Return type:

Literal['authenticationCodeTypeFragment']

to_dict()[source]
Return type:

dict

length: int

Length of the code

url: Optional[str]

URL to open to receive the code

class pytdbot.types.AuthenticationCodeTypeMissedCall(phone_number_prefix='', length=0)[source]

Bases: TlObject, AuthenticationCodeType

An authentication code is delivered by an immediately canceled call to the specified phone number. The last digits of the phone number that calls are the code that must be entered manually by the user

Parameters:
  • phone_number_prefix (str) – Prefix of the phone number from which the call will be made

  • length (int) – Number of digits in the code, excluding the prefix

__init__(phone_number_prefix='', length=0)[source]
Parameters:
  • phone_number_prefix (str)

  • length (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AuthenticationCodeTypeMissedCall]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AuthenticationCodeType']

classmethod getType()[source]
Return type:

Literal['authenticationCodeTypeMissedCall']

to_dict()[source]
Return type:

dict

length: int

Number of digits in the code, excluding the prefix

phone_number_prefix: Optional[str]

Prefix of the phone number from which the call will be made

class pytdbot.types.AuthenticationCodeTypeSms(length=0)[source]

Bases: TlObject, AuthenticationCodeType

A digit-only authentication code is delivered via an SMS message to the specified phone number; non-official applications may not receive this type of code

Parameters:

length (int) – Length of the code

__init__(length=0)[source]
Parameters:

length (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AuthenticationCodeTypeSms]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AuthenticationCodeType']

classmethod getType()[source]
Return type:

Literal['authenticationCodeTypeSms']

to_dict()[source]
Return type:

dict

length: int

Length of the code

class pytdbot.types.AuthenticationCodeTypeSmsPhrase(first_word='')[source]

Bases: TlObject, AuthenticationCodeType

An authentication code is a phrase from multiple words delivered via an SMS message to the specified phone number; non-official applications may not receive this type of code

Parameters:

first_word (str) – The first word of the phrase if known

__init__(first_word='')[source]
Parameters:

first_word (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AuthenticationCodeTypeSmsPhrase]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AuthenticationCodeType']

classmethod getType()[source]
Return type:

Literal['authenticationCodeTypeSmsPhrase']

to_dict()[source]
Return type:

dict

first_word: Optional[str]

The first word of the phrase if known

class pytdbot.types.AuthenticationCodeTypeSmsWord(first_letter='')[source]

Bases: TlObject, AuthenticationCodeType

An authentication code is a word delivered via an SMS message to the specified phone number; non-official applications may not receive this type of code

Parameters:

first_letter (str) – The first letters of the word if known

__init__(first_letter='')[source]
Parameters:

first_letter (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AuthenticationCodeTypeSmsWord]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AuthenticationCodeType']

classmethod getType()[source]
Return type:

Literal['authenticationCodeTypeSmsWord']

to_dict()[source]
Return type:

dict

first_letter: Optional[str]

The first letters of the word if known

class pytdbot.types.AuthenticationCodeTypeTelegramMessage(length=0)[source]

Bases: TlObject, AuthenticationCodeType

A digit-only authentication code is delivered via a private Telegram message, which can be viewed from another active session

Parameters:

length (int) – Length of the code

__init__(length=0)[source]
Parameters:

length (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AuthenticationCodeTypeTelegramMessage]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AuthenticationCodeType']

classmethod getType()[source]
Return type:

Literal['authenticationCodeTypeTelegramMessage']

to_dict()[source]
Return type:

dict

length: int

Length of the code

class pytdbot.types.AuthorizationState[source]

Bases: object

Represents the current authorization state of the TDLib client

class pytdbot.types.AuthorizationStateClosed[source]

Bases: TlObject, AuthorizationState

TDLib client is in its final state. All databases are closed and all resources are released. No other updates will be received after this. All queries will be responded to with error code 500. To continue working, one must create a new instance of the TDLib client

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AuthorizationStateClosed]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AuthorizationState']

classmethod getType()[source]
Return type:

Literal['authorizationStateClosed']

to_dict()[source]
Return type:

dict

class pytdbot.types.AuthorizationStateClosing[source]

Bases: TlObject, AuthorizationState

TDLib is closing, all subsequent queries will be answered with the error 500. Note that closing TDLib can take a while. All resources will be freed only after authorizationStateClosed has been received

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AuthorizationStateClosing]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AuthorizationState']

classmethod getType()[source]
Return type:

Literal['authorizationStateClosing']

to_dict()[source]
Return type:

dict

class pytdbot.types.AuthorizationStateLoggingOut[source]

Bases: TlObject, AuthorizationState

The user is currently logging out

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AuthorizationStateLoggingOut]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AuthorizationState']

classmethod getType()[source]
Return type:

Literal['authorizationStateLoggingOut']

to_dict()[source]
Return type:

dict

class pytdbot.types.AuthorizationStateReady[source]

Bases: TlObject, AuthorizationState

The user has been successfully authorized. TDLib is now ready to answer general requests

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AuthorizationStateReady]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AuthorizationState']

classmethod getType()[source]
Return type:

Literal['authorizationStateReady']

to_dict()[source]
Return type:

dict

class pytdbot.types.AuthorizationStateWaitCode(code_info=None)[source]

Bases: TlObject, AuthorizationState

TDLib needs the user’s authentication code to authorize. Call checkAuthenticationCode to check the code

Parameters:

code_info ("types.AuthenticationCodeInfo") – Information about the authorization code that was sent

__init__(code_info=None)[source]
Parameters:

code_info (AuthenticationCodeInfo | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AuthorizationStateWaitCode]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AuthorizationState']

classmethod getType()[source]
Return type:

Literal['authorizationStateWaitCode']

to_dict()[source]
Return type:

dict

code_info: Optional[AuthenticationCodeInfo]

Information about the authorization code that was sent

class pytdbot.types.AuthorizationStateWaitEmailAddress(allow_apple_id=False, allow_google_id=False)[source]

Bases: TlObject, AuthorizationState

TDLib needs the user’s email address to authorize. Call setAuthenticationEmailAddress to provide the email address, or directly call checkAuthenticationEmailCode with Apple ID/Google ID token if allowed

Parameters:
  • allow_apple_id (bool) – True, if authorization through Apple ID is allowed

  • allow_google_id (bool) – True, if authorization through Google ID is allowed

__init__(allow_apple_id=False, allow_google_id=False)[source]
Parameters:
  • allow_apple_id (bool)

  • allow_google_id (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AuthorizationStateWaitEmailAddress]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AuthorizationState']

classmethod getType()[source]
Return type:

Literal['authorizationStateWaitEmailAddress']

to_dict()[source]
Return type:

dict

allow_apple_id: bool

True, if authorization through Apple ID is allowed

allow_google_id: bool

True, if authorization through Google ID is allowed

class pytdbot.types.AuthorizationStateWaitEmailCode(allow_apple_id=False, allow_google_id=False, code_info=None, email_address_reset_state=None)[source]

Bases: TlObject, AuthorizationState

TDLib needs the user’s authentication code sent to an email address to authorize. Call checkAuthenticationEmailCode to provide the code

Parameters:
  • allow_apple_id (bool) – True, if authorization through Apple ID is allowed

  • allow_google_id (bool) – True, if authorization through Google ID is allowed

  • code_info ("types.EmailAddressAuthenticationCodeInfo") – Information about the sent authentication code

  • email_address_reset_state ("types.EmailAddressResetState") – Reset state of the email address; may be null if the email address can’t be reset

__init__(allow_apple_id=False, allow_google_id=False, code_info=None, email_address_reset_state=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AuthorizationStateWaitEmailCode]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AuthorizationState']

classmethod getType()[source]
Return type:

Literal['authorizationStateWaitEmailCode']

to_dict()[source]
Return type:

dict

allow_apple_id: bool

True, if authorization through Apple ID is allowed

allow_google_id: bool

True, if authorization through Google ID is allowed

code_info: Optional[EmailAddressAuthenticationCodeInfo]

Information about the sent authentication code

email_address_reset_state: Union[EmailAddressResetStateAvailable, EmailAddressResetStatePending, None]

Reset state of the email address; may be null if the email address can’t be reset

class pytdbot.types.AuthorizationStateWaitOtherDeviceConfirmation(link='')[source]

Bases: TlObject, AuthorizationState

The user needs to confirm authorization on another logged in device by scanning a QR code with the provided link

Parameters:

link (str) – A tg:// URL for the QR code. The link will be updated frequently

__init__(link='')[source]
Parameters:

link (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AuthorizationStateWaitOtherDeviceConfirmation]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AuthorizationState']

classmethod getType()[source]
Return type:

Literal['authorizationStateWaitOtherDeviceConfirmation']

to_dict()[source]
Return type:

dict

link: Optional[str]

// URL for the QR code. The link will be updated frequently

Type:

A tg

class pytdbot.types.AuthorizationStateWaitPassword(password_hint='', has_recovery_email_address=False, has_passport_data=False, recovery_email_address_pattern='')[source]

Bases: TlObject, AuthorizationState

The user has been authorized, but needs to enter a 2-step verification password to start using the application. Call checkAuthenticationPassword to provide the password, or requestAuthenticationPasswordRecovery to recover the password, or deleteAccount to delete the account after a week

Parameters:
  • password_hint (str) – Hint for the password; may be empty

  • has_recovery_email_address (bool) – True, if a recovery email address has been set up

  • has_passport_data (bool) – True, if some Telegram Passport elements were saved

  • recovery_email_address_pattern (str) – Pattern of the email address to which the recovery email was sent; empty until a recovery email has been sent

__init__(password_hint='', has_recovery_email_address=False, has_passport_data=False, recovery_email_address_pattern='')[source]
Parameters:
  • password_hint (str)

  • has_recovery_email_address (bool)

  • has_passport_data (bool)

  • recovery_email_address_pattern (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AuthorizationStateWaitPassword]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AuthorizationState']

classmethod getType()[source]
Return type:

Literal['authorizationStateWaitPassword']

to_dict()[source]
Return type:

dict

has_passport_data: bool

True, if some Telegram Passport elements were saved

has_recovery_email_address: bool

True, if a recovery email address has been set up

password_hint: Optional[str]

Hint for the password; may be empty

recovery_email_address_pattern: Optional[str]

Pattern of the email address to which the recovery email was sent; empty until a recovery email has been sent

class pytdbot.types.AuthorizationStateWaitPhoneNumber[source]

Bases: TlObject, AuthorizationState

TDLib needs the user’s phone number to authorize. Call setAuthenticationPhoneNumber to provide the phone number, or use requestQrCodeAuthentication or checkAuthenticationBotToken for other authentication options

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AuthorizationStateWaitPhoneNumber]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AuthorizationState']

classmethod getType()[source]
Return type:

Literal['authorizationStateWaitPhoneNumber']

to_dict()[source]
Return type:

dict

class pytdbot.types.AuthorizationStateWaitPremiumPurchase(store_product_id='', support_email_address='', support_email_subject='')[source]

Bases: TlObject, AuthorizationState

The user must buy Telegram Premium as an in-store purchase to log in. Call checkAuthenticationPremiumPurchase and then setAuthenticationPremiumPurchaseTransaction

Parameters:
  • store_product_id (str) – Identifier of the store product that must be bought

  • support_email_address (str) – Email address to use for support if the user has issues with Telegram Premium purchase

  • support_email_subject (str) – Subject for the email sent to the support email address

__init__(store_product_id='', support_email_address='', support_email_subject='')[source]
Parameters:
  • store_product_id (str)

  • support_email_address (str)

  • support_email_subject (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AuthorizationStateWaitPremiumPurchase]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AuthorizationState']

classmethod getType()[source]
Return type:

Literal['authorizationStateWaitPremiumPurchase']

to_dict()[source]
Return type:

dict

store_product_id: Optional[str]

Identifier of the store product that must be bought

support_email_address: Optional[str]

Email address to use for support if the user has issues with Telegram Premium purchase

support_email_subject: Optional[str]

Subject for the email sent to the support email address

class pytdbot.types.AuthorizationStateWaitRegistration(terms_of_service=None)[source]

Bases: TlObject, AuthorizationState

The user is unregistered and need to accept terms of service and enter their first name and last name to finish registration. Call registerUser to accept the terms of service and provide the data

Parameters:

terms_of_service ("types.TermsOfService") – Telegram terms of service

__init__(terms_of_service=None)[source]
Parameters:

terms_of_service (TermsOfService | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AuthorizationStateWaitRegistration]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AuthorizationState']

classmethod getType()[source]
Return type:

Literal['authorizationStateWaitRegistration']

to_dict()[source]
Return type:

dict

terms_of_service: Optional[TermsOfService]

Telegram terms of service

class pytdbot.types.AuthorizationStateWaitTdlibParameters[source]

Bases: TlObject, AuthorizationState

Initialization parameters are needed. Call setTdlibParameters to provide them

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AuthorizationStateWaitTdlibParameters]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AuthorizationState']

classmethod getType()[source]
Return type:

Literal['authorizationStateWaitTdlibParameters']

to_dict()[source]
Return type:

dict

class pytdbot.types.AutoDownloadSettings(is_auto_download_enabled=False, max_photo_file_size=0, max_video_file_size=0, max_other_file_size=0, video_upload_bitrate=0, preload_large_videos=False, preload_next_audio=False, preload_stories=False, use_less_data_for_calls=False)[source]

Bases: TlObject

Contains auto-download settings

Parameters:
  • is_auto_download_enabled (bool) – True, if the auto-download is enabled

  • max_photo_file_size (int) – The maximum size of a photo file to be auto-downloaded, in bytes

  • max_video_file_size (int) – The maximum size of a video file to be auto-downloaded, in bytes

  • max_other_file_size (int) – The maximum size of other file types to be auto-downloaded, in bytes

  • video_upload_bitrate (int) – The maximum suggested bitrate for uploaded videos, in kbit/s

  • preload_large_videos (bool) – True, if the beginning of video files needs to be preloaded for instant playback

  • preload_next_audio (bool) – True, if the next audio track needs to be preloaded while the user is listening to an audio file

  • preload_stories (bool) – True, if stories needs to be preloaded

  • use_less_data_for_calls (bool) – True, if "use less data for calls" option needs to be enabled

__init__(is_auto_download_enabled=False, max_photo_file_size=0, max_video_file_size=0, max_other_file_size=0, video_upload_bitrate=0, preload_large_videos=False, preload_next_audio=False, preload_stories=False, use_less_data_for_calls=False)[source]
Parameters:
  • is_auto_download_enabled (bool)

  • max_photo_file_size (int)

  • max_video_file_size (int)

  • max_other_file_size (int)

  • video_upload_bitrate (int)

  • preload_large_videos (bool)

  • preload_next_audio (bool)

  • preload_stories (bool)

  • use_less_data_for_calls (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AutoDownloadSettings]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AutoDownloadSettings']

classmethod getType()[source]
Return type:

Literal['autoDownloadSettings']

to_dict()[source]
Return type:

dict

is_auto_download_enabled: bool

True, if the auto-download is enabled

max_other_file_size: int

The maximum size of other file types to be auto-downloaded, in bytes

max_photo_file_size: int

The maximum size of a photo file to be auto-downloaded, in bytes

max_video_file_size: int

The maximum size of a video file to be auto-downloaded, in bytes

preload_large_videos: bool

True, if the beginning of video files needs to be preloaded for instant playback

preload_next_audio: bool

True, if the next audio track needs to be preloaded while the user is listening to an audio file

preload_stories: bool

True, if stories needs to be preloaded

use_less_data_for_calls: bool

True, if "use less data for calls" option needs to be enabled

video_upload_bitrate: int

The maximum suggested bitrate for uploaded videos, in kbit/s

class pytdbot.types.AutoDownloadSettingsPresets(low=None, medium=None, high=None)[source]

Bases: TlObject

Contains auto-download settings presets for the current user

Parameters:
  • low ("types.AutoDownloadSettings") – Preset with lowest settings; expected to be used by default when roaming

  • medium ("types.AutoDownloadSettings") – Preset with medium settings; expected to be used by default when using mobile data

  • high ("types.AutoDownloadSettings") – Preset with highest settings; expected to be used by default when connected on Wi-Fi

__init__(low=None, medium=None, high=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AutoDownloadSettingsPresets]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AutoDownloadSettingsPresets']

classmethod getType()[source]
Return type:

Literal['autoDownloadSettingsPresets']

to_dict()[source]
Return type:

dict

high: Optional[AutoDownloadSettings]

Preset with highest settings; expected to be used by default when connected on Wi-Fi

low: Optional[AutoDownloadSettings]

Preset with lowest settings; expected to be used by default when roaming

medium: Optional[AutoDownloadSettings]

Preset with medium settings; expected to be used by default when using mobile data

class pytdbot.types.AutosaveSettings(private_chat_settings=None, group_settings=None, channel_settings=None, exceptions=None)[source]

Bases: TlObject

Describes autosave settings

Parameters:
  • private_chat_settings ("types.ScopeAutosaveSettings") – Default autosave settings for private chats

  • group_settings ("types.ScopeAutosaveSettings") – Default autosave settings for basic group and supergroup chats

  • channel_settings ("types.ScopeAutosaveSettings") – Default autosave settings for channel chats

  • exceptions (List["types.AutosaveSettingsException"]) – Autosave settings for specific chats

__init__(private_chat_settings=None, group_settings=None, channel_settings=None, exceptions=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AutosaveSettings]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AutosaveSettings']

classmethod getType()[source]
Return type:

Literal['autosaveSettings']

to_dict()[source]
Return type:

dict

channel_settings: Optional[ScopeAutosaveSettings]

Default autosave settings for channel chats

exceptions: List[AutosaveSettingsException]

Autosave settings for specific chats

group_settings: Optional[ScopeAutosaveSettings]

Default autosave settings for basic group and supergroup chats

private_chat_settings: Optional[ScopeAutosaveSettings]

Default autosave settings for private chats

class pytdbot.types.AutosaveSettingsException(chat_id=0, settings=None)[source]

Bases: TlObject

Contains autosave settings for a chat, which overrides default settings for the corresponding scope

Parameters:
  • chat_id (int) – Chat identifier

  • settings ("types.ScopeAutosaveSettings") – Autosave settings for the chat

__init__(chat_id=0, settings=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AutosaveSettingsException]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AutosaveSettingsException']

classmethod getType()[source]
Return type:

Literal['autosaveSettingsException']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

settings: Optional[ScopeAutosaveSettings]

Autosave settings for the chat

class pytdbot.types.AutosaveSettingsScope[source]

Bases: object

Describes scope of autosave settings

class pytdbot.types.AutosaveSettingsScopeChannelChats[source]

Bases: TlObject, AutosaveSettingsScope

Autosave settings applied to all channel chats without chat-specific settings

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AutosaveSettingsScopeChannelChats]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AutosaveSettingsScope']

classmethod getType()[source]
Return type:

Literal['autosaveSettingsScopeChannelChats']

to_dict()[source]
Return type:

dict

class pytdbot.types.AutosaveSettingsScopeChat(chat_id=0)[source]

Bases: TlObject, AutosaveSettingsScope

Autosave settings applied to a chat

Parameters:

chat_id (int) – Chat identifier

__init__(chat_id=0)[source]
Parameters:

chat_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AutosaveSettingsScopeChat]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AutosaveSettingsScope']

classmethod getType()[source]
Return type:

Literal['autosaveSettingsScopeChat']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

class pytdbot.types.AutosaveSettingsScopeGroupChats[source]

Bases: TlObject, AutosaveSettingsScope

Autosave settings applied to all basic group and supergroup chats without chat-specific settings

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AutosaveSettingsScopeGroupChats]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AutosaveSettingsScope']

classmethod getType()[source]
Return type:

Literal['autosaveSettingsScopeGroupChats']

to_dict()[source]
Return type:

dict

class pytdbot.types.AutosaveSettingsScopePrivateChats[source]

Bases: TlObject, AutosaveSettingsScope

Autosave settings applied to all private chats without chat-specific settings

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AutosaveSettingsScopePrivateChats]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AutosaveSettingsScope']

classmethod getType()[source]
Return type:

Literal['autosaveSettingsScopePrivateChats']

to_dict()[source]
Return type:

dict

class pytdbot.types.AvailableGift(gift=None, resale_count=0, min_resale_star_count=0, title='')[source]

Bases: TlObject

Describes a gift that is available for purchase

Parameters:
  • gift ("types.Gift") – The gift

  • resale_count (int) – Number of gifts that are available for resale

  • min_resale_star_count (int) – The minimum price for the gifts available for resale in Telegram Star equivalent; 0 if there are no such gifts

  • title (str) – The title of the upgraded gift; empty if the gift isn’t available for resale

__init__(gift=None, resale_count=0, min_resale_star_count=0, title='')[source]
Parameters:
  • gift (Gift | None)

  • resale_count (int)

  • min_resale_star_count (int)

  • title (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AvailableGift]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AvailableGift']

classmethod getType()[source]
Return type:

Literal['availableGift']

to_dict()[source]
Return type:

dict

gift: Optional[Gift]

The gift

min_resale_star_count: int

The minimum price for the gifts available for resale in Telegram Star equivalent; 0 if there are no such gifts

resale_count: int

Number of gifts that are available for resale

title: Optional[str]

The title of the upgraded gift; empty if the gift isn’t available for resale

class pytdbot.types.AvailableGifts(gifts=None)[source]

Bases: TlObject

Contains a list of gifts that can be sent to another user or channel chat

Parameters:

gifts (List["types.AvailableGift"]) – The list of gifts

__init__(gifts=None)[source]
Parameters:

gifts (List[AvailableGift] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AvailableGifts]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AvailableGifts']

classmethod getType()[source]
Return type:

Literal['availableGifts']

to_dict()[source]
Return type:

dict

gifts: List[AvailableGift]

The list of gifts

class pytdbot.types.AvailableReaction(type=None, needs_premium=False)[source]

Bases: TlObject

Represents an available reaction

Parameters:
  • type ("types.ReactionType") – Type of the reaction

  • needs_premium (bool) – True, if Telegram Premium is needed to send the reaction

__init__(type=None, needs_premium=False)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AvailableReaction]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AvailableReaction']

classmethod getType()[source]
Return type:

Literal['availableReaction']

to_dict()[source]
Return type:

dict

needs_premium: bool

True, if Telegram Premium is needed to send the reaction

type: Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid, None]

Type of the reaction

class pytdbot.types.AvailableReactions(top_reactions=None, recent_reactions=None, popular_reactions=None, allow_custom_emoji=False, are_tags=False, unavailability_reason=None)[source]

Bases: TlObject

Represents a list of reactions that can be added to a message

Parameters:
  • top_reactions (List["types.AvailableReaction"]) – List of reactions to be shown at the top

  • recent_reactions (List["types.AvailableReaction"]) – List of recently used reactions

  • popular_reactions (List["types.AvailableReaction"]) – List of popular reactions

  • allow_custom_emoji (bool) – True, if any custom emoji reaction can be added by Telegram Premium subscribers

  • are_tags (bool) – True, if the reactions will be tags and the message can be found by them

  • unavailability_reason ("types.ReactionUnavailabilityReason") – The reason why the current user can’t add reactions to the message, despite some other users can; may be null if none

__init__(top_reactions=None, recent_reactions=None, popular_reactions=None, allow_custom_emoji=False, are_tags=False, unavailability_reason=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[AvailableReactions]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['AvailableReactions']

classmethod getType()[source]
Return type:

Literal['availableReactions']

to_dict()[source]
Return type:

dict

allow_custom_emoji: bool

True, if any custom emoji reaction can be added by Telegram Premium subscribers

are_tags: bool

True, if the reactions will be tags and the message can be found by them

popular_reactions: List[AvailableReaction]

List of popular reactions

recent_reactions: List[AvailableReaction]

List of recently used reactions

top_reactions: List[AvailableReaction]

List of reactions to be shown at the top

unavailability_reason: Union[ReactionUnavailabilityReasonAnonymousAdministrator, ReactionUnavailabilityReasonGuest, None]

The reason why the current user can’t add reactions to the message, despite some other users can; may be null if none

class pytdbot.types.Background(id=0, is_default=False, is_dark=False, name='', document=None, type=None)[source]

Bases: TlObject

Describes a chat background

Parameters:
  • id (int) – Unique background identifier

  • is_default (bool) – True, if this is one of default backgrounds

  • is_dark (bool) – True, if the background is dark and is recommended to be used with dark theme

  • name (str) – Unique background name

  • document ("types.Document") – Document with the background; may be null. Null only for filled and chat theme backgrounds

  • type ("types.BackgroundType") – Type of the background

__init__(id=0, is_default=False, is_dark=False, name='', document=None, type=None)[source]
Parameters:
  • id (int)

  • is_default (bool)

  • is_dark (bool)

  • name (str)

  • document (Document | None)

  • type (BackgroundType | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Background]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Background']

classmethod getType()[source]
Return type:

Literal['background']

to_dict()[source]
Return type:

dict

document: Optional[Document]

Document with the background; may be null. Null only for filled and chat theme backgrounds

id: int

Unique background identifier

is_dark: bool

True, if the background is dark and is recommended to be used with dark theme

is_default: bool

True, if this is one of default backgrounds

name: Optional[str]

Unique background name

type: Union[BackgroundTypeWallpaper, BackgroundTypePattern, BackgroundTypeFill, BackgroundTypeChatTheme, None]

Type of the background

class pytdbot.types.BackgroundFill[source]

Bases: object

Describes a fill of a background

class pytdbot.types.BackgroundFillFreeformGradient(colors=None)[source]

Bases: TlObject, BackgroundFill

Describes a freeform gradient fill of a background

Parameters:

colors (List[int]) – A list of 3 or 4 colors of the freeform gradient in the RGB format

__init__(colors=None)[source]
Parameters:

colors (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BackgroundFillFreeformGradient]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BackgroundFill']

classmethod getType()[source]
Return type:

Literal['backgroundFillFreeformGradient']

to_dict()[source]
Return type:

dict

colors: List[int]

A list of 3 or 4 colors of the freeform gradient in the RGB format

class pytdbot.types.BackgroundFillGradient(top_color=0, bottom_color=0, rotation_angle=0)[source]

Bases: TlObject, BackgroundFill

Describes a gradient fill of a background

Parameters:
  • top_color (int) – A top color of the background in the RGB format

  • bottom_color (int) – A bottom color of the background in the RGB format

  • rotation_angle (int) – Clockwise rotation angle of the gradient, in degrees; 0-359. Must always be divisible by 45

__init__(top_color=0, bottom_color=0, rotation_angle=0)[source]
Parameters:
  • top_color (int)

  • bottom_color (int)

  • rotation_angle (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BackgroundFillGradient]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BackgroundFill']

classmethod getType()[source]
Return type:

Literal['backgroundFillGradient']

to_dict()[source]
Return type:

dict

bottom_color: int

A bottom color of the background in the RGB format

rotation_angle: int

Clockwise rotation angle of the gradient, in degrees; 0-359. Must always be divisible by 45

top_color: int

A top color of the background in the RGB format

class pytdbot.types.BackgroundFillSolid(color=0)[source]

Bases: TlObject, BackgroundFill

Describes a solid fill of a background

Parameters:

color (int) – A color of the background in the RGB format

__init__(color=0)[source]
Parameters:

color (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BackgroundFillSolid]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BackgroundFill']

classmethod getType()[source]
Return type:

Literal['backgroundFillSolid']

to_dict()[source]
Return type:

dict

color: int

A color of the background in the RGB format

class pytdbot.types.BackgroundType[source]

Bases: object

Describes the type of background

class pytdbot.types.BackgroundTypeChatTheme(theme_name='')[source]

Bases: TlObject, BackgroundType

A background from a chat theme based on an emoji; can be used only as a chat background in channels

Parameters:

theme_name (str) – Name of the emoji chat theme

__init__(theme_name='')[source]
Parameters:

theme_name (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BackgroundTypeChatTheme]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BackgroundType']

classmethod getType()[source]
Return type:

Literal['backgroundTypeChatTheme']

to_dict()[source]
Return type:

dict

theme_name: Optional[str]

Name of the emoji chat theme

class pytdbot.types.BackgroundTypeFill(fill=None)[source]

Bases: TlObject, BackgroundType

A filled background

Parameters:

fill ("types.BackgroundFill") – The background fill

__init__(fill=None)[source]
Parameters:

fill (BackgroundFill | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BackgroundTypeFill]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BackgroundType']

classmethod getType()[source]
Return type:

Literal['backgroundTypeFill']

to_dict()[source]
Return type:

dict

fill: Union[BackgroundFillSolid, BackgroundFillGradient, BackgroundFillFreeformGradient, None]

The background fill

class pytdbot.types.BackgroundTypePattern(fill=None, intensity=0, is_inverted=False, is_moving=False)[source]

Bases: TlObject, BackgroundType

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

Parameters:
  • fill ("types.BackgroundFill") – Fill of the background

  • intensity (int) – Intensity of the pattern when it is shown above the filled background; 0-100

  • is_inverted (bool) – True, if the background fill must be applied only to the pattern itself. All other pixels are black in this case. For dark themes only

  • is_moving (bool) – True, if the background needs to be slightly moved when device is tilted

__init__(fill=None, intensity=0, is_inverted=False, is_moving=False)[source]
Parameters:
  • fill (BackgroundFill | None)

  • intensity (int)

  • is_inverted (bool)

  • is_moving (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BackgroundTypePattern]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BackgroundType']

classmethod getType()[source]
Return type:

Literal['backgroundTypePattern']

to_dict()[source]
Return type:

dict

fill: Union[BackgroundFillSolid, BackgroundFillGradient, BackgroundFillFreeformGradient, None]

Fill of the background

intensity: int

Intensity of the pattern when it is shown above the filled background; 0-100

is_inverted: bool

True, if the background fill must be applied only to the pattern itself. All other pixels are black in this case. For dark themes only

is_moving: bool

True, if the background needs to be slightly moved when device is tilted

class pytdbot.types.BackgroundTypeWallpaper(is_blurred=False, is_moving=False)[source]

Bases: TlObject, BackgroundType

A wallpaper in JPEG format

Parameters:
  • is_blurred (bool) – True, if the wallpaper must be downscaled to fit in 450x450 square and then box-blurred with radius 12

  • is_moving (bool) – True, if the background needs to be slightly moved when device is tilted

__init__(is_blurred=False, is_moving=False)[source]
Parameters:
  • is_blurred (bool)

  • is_moving (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BackgroundTypeWallpaper]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BackgroundType']

classmethod getType()[source]
Return type:

Literal['backgroundTypeWallpaper']

to_dict()[source]
Return type:

dict

is_blurred: bool

True, if the wallpaper must be downscaled to fit in 450x450 square and then box-blurred with radius 12

is_moving: bool

True, if the background needs to be slightly moved when device is tilted

class pytdbot.types.Backgrounds(backgrounds=None)[source]

Bases: TlObject

Contains a list of backgrounds

Parameters:

backgrounds (List["types.Background"]) – A list of backgrounds

__init__(backgrounds=None)[source]
Parameters:

backgrounds (List[Background] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Backgrounds]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Backgrounds']

classmethod getType()[source]
Return type:

Literal['backgrounds']

to_dict()[source]
Return type:

dict

backgrounds: List[Background]

A list of backgrounds

class pytdbot.types.BankCardActionOpenUrl(text='', url='')[source]

Bases: TlObject

Describes an action associated with a bank card number

Parameters:
  • text (str) – Action text

  • url (str) – The URL to be opened

__init__(text='', url='')[source]
Parameters:
  • text (str)

  • url (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BankCardActionOpenUrl]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BankCardActionOpenUrl']

classmethod getType()[source]
Return type:

Literal['bankCardActionOpenUrl']

to_dict()[source]
Return type:

dict

text: Optional[str]

Action text

url: Optional[str]

The URL to be opened

class pytdbot.types.BankCardInfo(title='', actions=None)[source]

Bases: TlObject

Information about a bank card

Parameters:
  • title (str) – Title of the bank card description

  • actions (List["types.BankCardActionOpenUrl"]) – Actions that can be done with the bank card number

__init__(title='', actions=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BankCardInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BankCardInfo']

classmethod getType()[source]
Return type:

Literal['bankCardInfo']

to_dict()[source]
Return type:

dict

actions: List[BankCardActionOpenUrl]

Actions that can be done with the bank card number

title: Optional[str]

Title of the bank card description

class pytdbot.types.BasicGroup(id=0, member_count=0, status=None, is_active=False, upgraded_to_supergroup_id=0)[source]

Bases: TlObject

Represents a basic group of 0-200 users (must be upgraded to a supergroup to accommodate more than 200 users)

Parameters:
  • id (int) – Group identifier

  • member_count (int) – Number of members in the group

  • status ("types.ChatMemberStatus") – Status of the current user in the group

  • is_active (bool) – True, if the group is active

  • upgraded_to_supergroup_id (int) – Identifier of the supergroup to which this group was upgraded; 0 if none

__init__(id=0, member_count=0, status=None, is_active=False, upgraded_to_supergroup_id=0)[source]
Parameters:
  • id (int)

  • member_count (int)

  • status (ChatMemberStatus | None)

  • is_active (bool)

  • upgraded_to_supergroup_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BasicGroup]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BasicGroup']

classmethod getType()[source]
Return type:

Literal['basicGroup']

to_dict()[source]
Return type:

dict

id: int

Group identifier

is_active: bool

True, if the group is active

member_count: int

Number of members in the group

status: Union[ChatMemberStatusCreator, ChatMemberStatusAdministrator, ChatMemberStatusMember, ChatMemberStatusRestricted, ChatMemberStatusLeft, ChatMemberStatusBanned, None]

Status of the current user in the group

upgraded_to_supergroup_id: int

Identifier of the supergroup to which this group was upgraded; 0 if none

class pytdbot.types.BasicGroupFullInfo(photo=None, description='', creator_user_id=0, members=None, can_hide_members=False, can_toggle_aggressive_anti_spam=False, invite_link=None, bot_commands=None)[source]

Bases: TlObject

Contains full information about a basic group

Parameters:
  • photo ("types.ChatPhoto") – Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo

  • description (str) – Group description. Updated only after the basic group is opened

  • creator_user_id (int) – User identifier of the creator of the group; 0 if unknown

  • members (List["types.ChatMember"]) – Group members

  • can_hide_members (bool) – True, if non-administrators and non-bots can be hidden in responses to getSupergroupMembers and searchChatMembers for non-administrators after upgrading the basic group to a supergroup

  • can_toggle_aggressive_anti_spam (bool) – True, if aggressive anti-spam checks can be enabled or disabled in the supergroup after upgrading the basic group to a supergroup

  • invite_link ("types.ChatInviteLink") – Primary invite link for this group; may be null. For chat administrators with can_invite_users right only. Updated only after the basic group is opened

  • bot_commands (List["types.BotCommands"]) – List of commands of bots in the group

__init__(photo=None, description='', creator_user_id=0, members=None, can_hide_members=False, can_toggle_aggressive_anti_spam=False, invite_link=None, bot_commands=None)[source]
Parameters:
  • photo (ChatPhoto | None)

  • description (str)

  • creator_user_id (int)

  • members (List[ChatMember] | None)

  • can_hide_members (bool)

  • can_toggle_aggressive_anti_spam (bool)

  • invite_link (ChatInviteLink | None)

  • bot_commands (List[BotCommands] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BasicGroupFullInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BasicGroupFullInfo']

classmethod getType()[source]
Return type:

Literal['basicGroupFullInfo']

to_dict()[source]
Return type:

dict

bot_commands: List[BotCommands]

List of commands of bots in the group

can_hide_members: bool

True, if non-administrators and non-bots can be hidden in responses to getSupergroupMembers and searchChatMembers for non-administrators after upgrading the basic group to a supergroup

can_toggle_aggressive_anti_spam: bool

True, if aggressive anti-spam checks can be enabled or disabled in the supergroup after upgrading the basic group to a supergroup

creator_user_id: int

User identifier of the creator of the group; 0 if unknown

description: Optional[str]

Group description. Updated only after the basic group is opened

invite_link: Optional[ChatInviteLink]

Primary invite link for this group; may be null. For chat administrators with can_invite_users right only. Updated only after the basic group is opened

members: List[ChatMember]

Group members

photo: Optional[ChatPhoto]

Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo

class pytdbot.types.Birthdate(day=0, month=0, year=0)[source]

Bases: TlObject

Represents a birthdate of a user

Parameters:
  • day (int) – Day of the month; 1-31

  • month (int) – Month of the year; 1-12

  • year (int) – Birth year; 0 if unknown

__init__(day=0, month=0, year=0)[source]
Parameters:
  • day (int)

  • month (int)

  • year (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Birthdate]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Birthdate']

classmethod getType()[source]
Return type:

Literal['birthdate']

to_dict()[source]
Return type:

dict

day: int

Day of the month; 1-31

month: int

Month of the year; 1-12

year: int

Birth year; 0 if unknown

class pytdbot.types.BlockList[source]

Bases: object

Describes type of block list

class pytdbot.types.BlockListMain[source]

Bases: TlObject, BlockList

The main block list that disallows writing messages to the current user, receiving their status and photo, viewing of stories, and some other actions

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BlockListMain]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BlockList']

classmethod getType()[source]
Return type:

Literal['blockListMain']

to_dict()[source]
Return type:

dict

class pytdbot.types.BlockListStories[source]

Bases: TlObject, BlockList

The block list that disallows viewing of stories of the current user

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BlockListStories]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BlockList']

classmethod getType()[source]
Return type:

Literal['blockListStories']

to_dict()[source]
Return type:

dict

class pytdbot.types.BotCommand(command='', description='')[source]

Bases: TlObject

Represents a command supported by a bot

Parameters:
  • command (str) – Text of the bot command

  • description (str) – Description of the bot command

__init__(command='', description='')[source]
Parameters:
  • command (str)

  • description (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BotCommand]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BotCommand']

classmethod getType()[source]
Return type:

Literal['botCommand']

to_dict()[source]
Return type:

dict

command: Optional[str]

Text of the bot command

description: Optional[str]

Description of the bot command

class pytdbot.types.BotCommandScope[source]

Bases: object

Represents the scope to which bot commands are relevant

class pytdbot.types.BotCommandScopeAllChatAdministrators[source]

Bases: TlObject, BotCommandScope

A scope covering all group and supergroup chat administrators

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BotCommandScopeAllChatAdministrators]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BotCommandScope']

classmethod getType()[source]
Return type:

Literal['botCommandScopeAllChatAdministrators']

to_dict()[source]
Return type:

dict

class pytdbot.types.BotCommandScopeAllGroupChats[source]

Bases: TlObject, BotCommandScope

A scope covering all group and supergroup chats

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BotCommandScopeAllGroupChats]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BotCommandScope']

classmethod getType()[source]
Return type:

Literal['botCommandScopeAllGroupChats']

to_dict()[source]
Return type:

dict

class pytdbot.types.BotCommandScopeAllPrivateChats[source]

Bases: TlObject, BotCommandScope

A scope covering all private chats

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BotCommandScopeAllPrivateChats]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BotCommandScope']

classmethod getType()[source]
Return type:

Literal['botCommandScopeAllPrivateChats']

to_dict()[source]
Return type:

dict

class pytdbot.types.BotCommandScopeChat(chat_id=0)[source]

Bases: TlObject, BotCommandScope

A scope covering all members of a chat

Parameters:

chat_id (int) – Chat identifier

__init__(chat_id=0)[source]
Parameters:

chat_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BotCommandScopeChat]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BotCommandScope']

classmethod getType()[source]
Return type:

Literal['botCommandScopeChat']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

class pytdbot.types.BotCommandScopeChatAdministrators(chat_id=0)[source]

Bases: TlObject, BotCommandScope

A scope covering all administrators of a chat

Parameters:

chat_id (int) – Chat identifier

__init__(chat_id=0)[source]
Parameters:

chat_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BotCommandScopeChatAdministrators]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BotCommandScope']

classmethod getType()[source]
Return type:

Literal['botCommandScopeChatAdministrators']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

class pytdbot.types.BotCommandScopeChatMember(chat_id=0, user_id=0)[source]

Bases: TlObject, BotCommandScope

A scope covering a member of a chat

Parameters:
  • chat_id (int) – Chat identifier

  • user_id (int) – User identifier

__init__(chat_id=0, user_id=0)[source]
Parameters:
  • chat_id (int)

  • user_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BotCommandScopeChatMember]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BotCommandScope']

classmethod getType()[source]
Return type:

Literal['botCommandScopeChatMember']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

user_id: int

User identifier

class pytdbot.types.BotCommandScopeDefault[source]

Bases: TlObject, BotCommandScope

A scope covering all users

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BotCommandScopeDefault]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BotCommandScope']

classmethod getType()[source]
Return type:

Literal['botCommandScopeDefault']

to_dict()[source]
Return type:

dict

class pytdbot.types.BotCommands(bot_user_id=0, commands=None)[source]

Bases: TlObject

Contains a list of bot commands

Parameters:
  • bot_user_id (int) – Bot’s user identifier

  • commands (List["types.BotCommand"]) – List of bot commands

__init__(bot_user_id=0, commands=None)[source]
Parameters:
  • bot_user_id (int)

  • commands (List[BotCommand] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BotCommands]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BotCommands']

classmethod getType()[source]
Return type:

Literal['botCommands']

to_dict()[source]
Return type:

dict

bot_user_id: int

Bot’s user identifier

commands: List[BotCommand]

List of bot commands

class pytdbot.types.BotInfo(short_description='', description='', photo=None, animation=None, menu_button=None, commands=None, privacy_policy_url='', default_group_administrator_rights=None, default_channel_administrator_rights=None, affiliate_program=None, web_app_background_light_color=0, web_app_background_dark_color=0, web_app_header_light_color=0, web_app_header_dark_color=0, verification_parameters=None, can_get_revenue_statistics=False, can_manage_emoji_status=False, has_media_previews=False, edit_commands_link=None, edit_description_link=None, edit_description_media_link=None, edit_settings_link=None)[source]

Bases: TlObject

Contains information about a bot

Parameters:
  • short_description (str) – The text that is shown on the bot’s profile page and is sent together with the link when users share the bot

  • description (str) – The text shown in the chat with the bot if the chat is empty

  • photo ("types.Photo") – Photo shown in the chat with the bot if the chat is empty; may be null

  • animation ("types.Animation") – Animation shown in the chat with the bot if the chat is empty; may be null

  • menu_button ("types.BotMenuButton") – Information about a button to show instead of the bot commands menu button; may be null if ordinary bot commands menu must be shown

  • commands (List["types.BotCommand"]) – List of the bot commands

  • privacy_policy_url (str) – The HTTP link to the privacy policy of the bot. If empty, then /privacy command must be used if supported by the bot. If the command isn’t supported, then https://telegram.org/privacy-tpa must be opened

  • default_group_administrator_rights ("types.ChatAdministratorRights") – Default administrator rights for adding the bot to basic group and supergroup chats; may be null

  • default_channel_administrator_rights ("types.ChatAdministratorRights") – Default administrator rights for adding the bot to channels; may be null

  • affiliate_program ("types.AffiliateProgramInfo") – Information about the affiliate program of the bot; may be null if none

  • web_app_background_light_color (int) – Default light background color for bot Web Apps; -1 if not specified

  • web_app_background_dark_color (int) – Default dark background color for bot Web Apps; -1 if not specified

  • web_app_header_light_color (int) – Default light header color for bot Web Apps; -1 if not specified

  • web_app_header_dark_color (int) – Default dark header color for bot Web Apps; -1 if not specified

  • verification_parameters ("types.BotVerificationParameters") – Parameters of the verification that can be provided by the bot; may be null if none or the current user isn’t the owner of the bot

  • can_get_revenue_statistics (bool) – True, if the bot’s revenue statistics are available to the current user

  • can_manage_emoji_status (bool) – True, if the bot can manage emoji status of the current user

  • has_media_previews (bool) – True, if the bot has media previews

  • edit_commands_link ("types.InternalLinkType") – The internal link, which can be used to edit bot commands; may be null

  • edit_description_link ("types.InternalLinkType") – The internal link, which can be used to edit bot description; may be null

  • edit_description_media_link ("types.InternalLinkType") – The internal link, which can be used to edit the photo or animation shown in the chat with the bot if the chat is empty; may be null

  • edit_settings_link ("types.InternalLinkType") – The internal link, which can be used to edit bot settings; may be null

__init__(short_description='', description='', photo=None, animation=None, menu_button=None, commands=None, privacy_policy_url='', default_group_administrator_rights=None, default_channel_administrator_rights=None, affiliate_program=None, web_app_background_light_color=0, web_app_background_dark_color=0, web_app_header_light_color=0, web_app_header_dark_color=0, verification_parameters=None, can_get_revenue_statistics=False, can_manage_emoji_status=False, has_media_previews=False, edit_commands_link=None, edit_description_link=None, edit_description_media_link=None, edit_settings_link=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BotInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BotInfo']

classmethod getType()[source]
Return type:

Literal['botInfo']

to_dict()[source]
Return type:

dict

affiliate_program: Optional[AffiliateProgramInfo]

Information about the affiliate program of the bot; may be null if none

animation: Optional[Animation]

Animation shown in the chat with the bot if the chat is empty; may be null

can_get_revenue_statistics: bool

True, if the bot’s revenue statistics are available to the current user

can_manage_emoji_status: bool

True, if the bot can manage emoji status of the current user

commands: List[BotCommand]

List of the bot commands

default_channel_administrator_rights: Optional[ChatAdministratorRights]

Default administrator rights for adding the bot to channels; may be null

default_group_administrator_rights: Optional[ChatAdministratorRights]

Default administrator rights for adding the bot to basic group and supergroup chats; may be null

description: Optional[str]

The text shown in the chat with the bot if the chat is empty

edit_commands_link: Union[InternalLinkTypeActiveSessions, InternalLinkTypeAttachmentMenuBot, InternalLinkTypeAuthenticationCode, InternalLinkTypeBackground, InternalLinkTypeBotAddToChannel, InternalLinkTypeBotStart, InternalLinkTypeBotStartInGroup, InternalLinkTypeBusinessChat, InternalLinkTypeBuyStars, InternalLinkTypeChangePhoneNumber, InternalLinkTypeChatAffiliateProgram, InternalLinkTypeChatBoost, InternalLinkTypeChatFolderInvite, InternalLinkTypeChatFolderSettings, InternalLinkTypeChatInvite, InternalLinkTypeDefaultMessageAutoDeleteTimerSettings, InternalLinkTypeDirectMessagesChat, InternalLinkTypeEditProfileSettings, InternalLinkTypeGame, InternalLinkTypeGiftCollection, InternalLinkTypeGroupCall, InternalLinkTypeInstantView, InternalLinkTypeInvoice, InternalLinkTypeLanguagePack, InternalLinkTypeLanguageSettings, InternalLinkTypeMainWebApp, InternalLinkTypeMessage, InternalLinkTypeMessageDraft, InternalLinkTypeMyStars, InternalLinkTypeMyToncoins, InternalLinkTypePassportDataRequest, InternalLinkTypePhoneNumberConfirmation, InternalLinkTypePremiumFeatures, InternalLinkTypePremiumGift, InternalLinkTypePremiumGiftCode, InternalLinkTypePrivacyAndSecuritySettings, InternalLinkTypeProxy, InternalLinkTypePublicChat, InternalLinkTypeQrCodeAuthentication, InternalLinkTypeRestorePurchases, InternalLinkTypeSettings, InternalLinkTypeStickerSet, InternalLinkTypeStory, InternalLinkTypeStoryAlbum, InternalLinkTypeTheme, InternalLinkTypeThemeSettings, InternalLinkTypeUnknownDeepLink, InternalLinkTypeUnsupportedProxy, InternalLinkTypeUpgradedGift, InternalLinkTypeUserPhoneNumber, InternalLinkTypeUserToken, InternalLinkTypeVideoChat, InternalLinkTypeWebApp, None]

The internal link, which can be used to edit bot commands; may be null

edit_description_link: Union[InternalLinkTypeActiveSessions, InternalLinkTypeAttachmentMenuBot, InternalLinkTypeAuthenticationCode, InternalLinkTypeBackground, InternalLinkTypeBotAddToChannel, InternalLinkTypeBotStart, InternalLinkTypeBotStartInGroup, InternalLinkTypeBusinessChat, InternalLinkTypeBuyStars, InternalLinkTypeChangePhoneNumber, InternalLinkTypeChatAffiliateProgram, InternalLinkTypeChatBoost, InternalLinkTypeChatFolderInvite, InternalLinkTypeChatFolderSettings, InternalLinkTypeChatInvite, InternalLinkTypeDefaultMessageAutoDeleteTimerSettings, InternalLinkTypeDirectMessagesChat, InternalLinkTypeEditProfileSettings, InternalLinkTypeGame, InternalLinkTypeGiftCollection, InternalLinkTypeGroupCall, InternalLinkTypeInstantView, InternalLinkTypeInvoice, InternalLinkTypeLanguagePack, InternalLinkTypeLanguageSettings, InternalLinkTypeMainWebApp, InternalLinkTypeMessage, InternalLinkTypeMessageDraft, InternalLinkTypeMyStars, InternalLinkTypeMyToncoins, InternalLinkTypePassportDataRequest, InternalLinkTypePhoneNumberConfirmation, InternalLinkTypePremiumFeatures, InternalLinkTypePremiumGift, InternalLinkTypePremiumGiftCode, InternalLinkTypePrivacyAndSecuritySettings, InternalLinkTypeProxy, InternalLinkTypePublicChat, InternalLinkTypeQrCodeAuthentication, InternalLinkTypeRestorePurchases, InternalLinkTypeSettings, InternalLinkTypeStickerSet, InternalLinkTypeStory, InternalLinkTypeStoryAlbum, InternalLinkTypeTheme, InternalLinkTypeThemeSettings, InternalLinkTypeUnknownDeepLink, InternalLinkTypeUnsupportedProxy, InternalLinkTypeUpgradedGift, InternalLinkTypeUserPhoneNumber, InternalLinkTypeUserToken, InternalLinkTypeVideoChat, InternalLinkTypeWebApp, None]

The internal link, which can be used to edit bot description; may be null

edit_description_media_link: Union[InternalLinkTypeActiveSessions, InternalLinkTypeAttachmentMenuBot, InternalLinkTypeAuthenticationCode, InternalLinkTypeBackground, InternalLinkTypeBotAddToChannel, InternalLinkTypeBotStart, InternalLinkTypeBotStartInGroup, InternalLinkTypeBusinessChat, InternalLinkTypeBuyStars, InternalLinkTypeChangePhoneNumber, InternalLinkTypeChatAffiliateProgram, InternalLinkTypeChatBoost, InternalLinkTypeChatFolderInvite, InternalLinkTypeChatFolderSettings, InternalLinkTypeChatInvite, InternalLinkTypeDefaultMessageAutoDeleteTimerSettings, InternalLinkTypeDirectMessagesChat, InternalLinkTypeEditProfileSettings, InternalLinkTypeGame, InternalLinkTypeGiftCollection, InternalLinkTypeGroupCall, InternalLinkTypeInstantView, InternalLinkTypeInvoice, InternalLinkTypeLanguagePack, InternalLinkTypeLanguageSettings, InternalLinkTypeMainWebApp, InternalLinkTypeMessage, InternalLinkTypeMessageDraft, InternalLinkTypeMyStars, InternalLinkTypeMyToncoins, InternalLinkTypePassportDataRequest, InternalLinkTypePhoneNumberConfirmation, InternalLinkTypePremiumFeatures, InternalLinkTypePremiumGift, InternalLinkTypePremiumGiftCode, InternalLinkTypePrivacyAndSecuritySettings, InternalLinkTypeProxy, InternalLinkTypePublicChat, InternalLinkTypeQrCodeAuthentication, InternalLinkTypeRestorePurchases, InternalLinkTypeSettings, InternalLinkTypeStickerSet, InternalLinkTypeStory, InternalLinkTypeStoryAlbum, InternalLinkTypeTheme, InternalLinkTypeThemeSettings, InternalLinkTypeUnknownDeepLink, InternalLinkTypeUnsupportedProxy, InternalLinkTypeUpgradedGift, InternalLinkTypeUserPhoneNumber, InternalLinkTypeUserToken, InternalLinkTypeVideoChat, InternalLinkTypeWebApp, None]

The internal link, which can be used to edit the photo or animation shown in the chat with the bot if the chat is empty; may be null

edit_settings_link: Union[InternalLinkTypeActiveSessions, InternalLinkTypeAttachmentMenuBot, InternalLinkTypeAuthenticationCode, InternalLinkTypeBackground, InternalLinkTypeBotAddToChannel, InternalLinkTypeBotStart, InternalLinkTypeBotStartInGroup, InternalLinkTypeBusinessChat, InternalLinkTypeBuyStars, InternalLinkTypeChangePhoneNumber, InternalLinkTypeChatAffiliateProgram, InternalLinkTypeChatBoost, InternalLinkTypeChatFolderInvite, InternalLinkTypeChatFolderSettings, InternalLinkTypeChatInvite, InternalLinkTypeDefaultMessageAutoDeleteTimerSettings, InternalLinkTypeDirectMessagesChat, InternalLinkTypeEditProfileSettings, InternalLinkTypeGame, InternalLinkTypeGiftCollection, InternalLinkTypeGroupCall, InternalLinkTypeInstantView, InternalLinkTypeInvoice, InternalLinkTypeLanguagePack, InternalLinkTypeLanguageSettings, InternalLinkTypeMainWebApp, InternalLinkTypeMessage, InternalLinkTypeMessageDraft, InternalLinkTypeMyStars, InternalLinkTypeMyToncoins, InternalLinkTypePassportDataRequest, InternalLinkTypePhoneNumberConfirmation, InternalLinkTypePremiumFeatures, InternalLinkTypePremiumGift, InternalLinkTypePremiumGiftCode, InternalLinkTypePrivacyAndSecuritySettings, InternalLinkTypeProxy, InternalLinkTypePublicChat, InternalLinkTypeQrCodeAuthentication, InternalLinkTypeRestorePurchases, InternalLinkTypeSettings, InternalLinkTypeStickerSet, InternalLinkTypeStory, InternalLinkTypeStoryAlbum, InternalLinkTypeTheme, InternalLinkTypeThemeSettings, InternalLinkTypeUnknownDeepLink, InternalLinkTypeUnsupportedProxy, InternalLinkTypeUpgradedGift, InternalLinkTypeUserPhoneNumber, InternalLinkTypeUserToken, InternalLinkTypeVideoChat, InternalLinkTypeWebApp, None]

The internal link, which can be used to edit bot settings; may be null

has_media_previews: bool

True, if the bot has media previews

menu_button: Optional[BotMenuButton]

Information about a button to show instead of the bot commands menu button; may be null if ordinary bot commands menu must be shown

photo: Optional[Photo]

Photo shown in the chat with the bot if the chat is empty; may be null

privacy_policy_url: Optional[str]

//telegram.org/privacy-tpa must be opened

Type:

The HTTP link to the privacy policy of the bot. If empty, then /privacy command must be used if supported by the bot. If the command isn’t supported, then https

short_description: Optional[str]

The text that is shown on the bot’s profile page and is sent together with the link when users share the bot

verification_parameters: Optional[BotVerificationParameters]

Parameters of the verification that can be provided by the bot; may be null if none or the current user isn’t the owner of the bot

web_app_background_dark_color: int

Default dark background color for bot Web Apps; -1 if not specified

web_app_background_light_color: int

Default light background color for bot Web Apps; -1 if not specified

web_app_header_dark_color: int

Default dark header color for bot Web Apps; -1 if not specified

web_app_header_light_color: int

Default light header color for bot Web Apps; -1 if not specified

class pytdbot.types.BotMediaPreview(date=0, content=None)[source]

Bases: TlObject

Describes media previews of a bot

Parameters:
  • date (int) – Point in time (Unix timestamp) when the preview was added or changed last time

  • content ("types.StoryContent") – Content of the preview

__init__(date=0, content=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BotMediaPreview]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BotMediaPreview']

classmethod getType()[source]
Return type:

Literal['botMediaPreview']

to_dict()[source]
Return type:

dict

content: Union[StoryContentPhoto, StoryContentVideo, StoryContentUnsupported, None]

Content of the preview

date: int

Point in time (Unix timestamp) when the preview was added or changed last time

class pytdbot.types.BotMediaPreviewInfo(previews=None, language_codes=None)[source]

Bases: TlObject

Contains a list of media previews of a bot for the given language and the list of languages for which the bot has dedicated previews

Parameters:
  • previews (List["types.BotMediaPreview"]) – List of media previews

  • language_codes (List[str]) – List of language codes for which the bot has dedicated previews

__init__(previews=None, language_codes=None)[source]
Parameters:
  • previews (List[BotMediaPreview] | None)

  • language_codes (List[str] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BotMediaPreviewInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BotMediaPreviewInfo']

classmethod getType()[source]
Return type:

Literal['botMediaPreviewInfo']

to_dict()[source]
Return type:

dict

language_codes: List[str]

List of language codes for which the bot has dedicated previews

previews: List[BotMediaPreview]

List of media previews

class pytdbot.types.BotMediaPreviews(previews=None)[source]

Bases: TlObject

Contains a list of media previews of a bot

Parameters:

previews (List["types.BotMediaPreview"]) – List of media previews

__init__(previews=None)[source]
Parameters:

previews (List[BotMediaPreview] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BotMediaPreviews]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BotMediaPreviews']

classmethod getType()[source]
Return type:

Literal['botMediaPreviews']

to_dict()[source]
Return type:

dict

previews: List[BotMediaPreview]

List of media previews

class pytdbot.types.BotMenuButton(text='', url='')[source]

Bases: TlObject

Describes a button to be shown instead of bot commands menu button

Parameters:
  • text (str) – Text of the button

  • url (str) – URL of a Web App to open when the button is pressed. If the link is of the type internalLinkTypeWebApp, then it must be processed accordingly. Otherwise, the link must be passed to openWebApp

__init__(text='', url='')[source]
Parameters:
  • text (str)

  • url (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BotMenuButton]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BotMenuButton']

classmethod getType()[source]
Return type:

Literal['botMenuButton']

to_dict()[source]
Return type:

dict

text: Optional[str]

Text of the button

url: Optional[str]

URL of a Web App to open when the button is pressed. If the link is of the type internalLinkTypeWebApp, then it must be processed accordingly. Otherwise, the link must be passed to openWebApp

class pytdbot.types.BotVerification(bot_user_id=0, icon_custom_emoji_id=0, custom_description=None)[source]

Bases: TlObject

Describes verification status provided by a bot

Parameters:
  • bot_user_id (int) – Identifier of the bot that provided the verification

  • icon_custom_emoji_id (int) – Identifier of the custom emoji that is used as the verification sign

  • custom_description ("types.FormattedText") – Custom description of verification reason set by the bot. Can contain only Mention, Hashtag, Cashtag, PhoneNumber, BankCardNumber, Url, and EmailAddress entities

__init__(bot_user_id=0, icon_custom_emoji_id=0, custom_description=None)[source]
Parameters:
  • bot_user_id (int)

  • icon_custom_emoji_id (int)

  • custom_description (FormattedText | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BotVerification]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BotVerification']

classmethod getType()[source]
Return type:

Literal['botVerification']

to_dict()[source]
Return type:

dict

bot_user_id: int

Identifier of the bot that provided the verification

custom_description: Optional[FormattedText]

Custom description of verification reason set by the bot. Can contain only Mention, Hashtag, Cashtag, PhoneNumber, BankCardNumber, Url, and EmailAddress entities

icon_custom_emoji_id: int

Identifier of the custom emoji that is used as the verification sign

class pytdbot.types.BotVerificationParameters(icon_custom_emoji_id=0, organization_name='', default_custom_description=None, can_set_custom_description=False)[source]

Bases: TlObject

Describes parameters of verification that is provided by a bot

Parameters:
  • icon_custom_emoji_id (int) – Identifier of the custom emoji that is used as the verification sign

  • organization_name (str) – Name of the organization that provides verification

  • default_custom_description ("types.FormattedText") – Default custom description of verification reason to be used as placeholder in setMessageSenderBotVerification; may be null if none

  • can_set_custom_description (bool) – True, if the bot is allowed to provide custom description for verified entities

__init__(icon_custom_emoji_id=0, organization_name='', default_custom_description=None, can_set_custom_description=False)[source]
Parameters:
  • icon_custom_emoji_id (int)

  • organization_name (str)

  • default_custom_description (FormattedText | None)

  • can_set_custom_description (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BotVerificationParameters]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BotVerificationParameters']

classmethod getType()[source]
Return type:

Literal['botVerificationParameters']

to_dict()[source]
Return type:

dict

can_set_custom_description: bool

True, if the bot is allowed to provide custom description for verified entities

default_custom_description: Optional[FormattedText]

Default custom description of verification reason to be used as placeholder in setMessageSenderBotVerification; may be null if none

icon_custom_emoji_id: int

Identifier of the custom emoji that is used as the verification sign

organization_name: Optional[str]

Name of the organization that provides verification

class pytdbot.types.BotWriteAccessAllowReason[source]

Bases: object

Describes a reason why a bot was allowed to write messages to the current user

class pytdbot.types.BotWriteAccessAllowReasonAcceptedRequest[source]

Bases: TlObject, BotWriteAccessAllowReason

The user accepted bot’s request to send messages with allowBotToSendMessages

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BotWriteAccessAllowReasonAcceptedRequest]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BotWriteAccessAllowReason']

classmethod getType()[source]
Return type:

Literal['botWriteAccessAllowReasonAcceptedRequest']

to_dict()[source]
Return type:

dict

class pytdbot.types.BotWriteAccessAllowReasonAddedToAttachmentMenu[source]

Bases: TlObject, BotWriteAccessAllowReason

The user added the bot to attachment or side menu using toggleBotIsAddedToAttachmentMenu

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BotWriteAccessAllowReasonAddedToAttachmentMenu]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BotWriteAccessAllowReason']

classmethod getType()[source]
Return type:

Literal['botWriteAccessAllowReasonAddedToAttachmentMenu']

to_dict()[source]
Return type:

dict

class pytdbot.types.BotWriteAccessAllowReasonConnectedWebsite(domain_name='')[source]

Bases: TlObject, BotWriteAccessAllowReason

The user connected a website by logging in using Telegram Login Widget on it

Parameters:

domain_name (str) – Domain name of the connected website

__init__(domain_name='')[source]
Parameters:

domain_name (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BotWriteAccessAllowReasonConnectedWebsite]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BotWriteAccessAllowReason']

classmethod getType()[source]
Return type:

Literal['botWriteAccessAllowReasonConnectedWebsite']

to_dict()[source]
Return type:

dict

domain_name: Optional[str]

Domain name of the connected website

class pytdbot.types.BotWriteAccessAllowReasonLaunchedWebApp(web_app=None)[source]

Bases: TlObject, BotWriteAccessAllowReason

The user launched a Web App using getWebAppLinkUrl

Parameters:

web_app ("types.WebApp") – Information about the Web App

__init__(web_app=None)[source]
Parameters:

web_app (WebApp | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BotWriteAccessAllowReasonLaunchedWebApp]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BotWriteAccessAllowReason']

classmethod getType()[source]
Return type:

Literal['botWriteAccessAllowReasonLaunchedWebApp']

to_dict()[source]
Return type:

dict

web_app: Optional[WebApp]

Information about the Web App

class pytdbot.types.BuiltInTheme[source]

Bases: object

Describes a built-in theme of an official app

class pytdbot.types.BuiltInThemeArctic[source]

Bases: TlObject, BuiltInTheme

Arctic light theme

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BuiltInThemeArctic]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BuiltInTheme']

classmethod getType()[source]
Return type:

Literal['builtInThemeArctic']

to_dict()[source]
Return type:

dict

class pytdbot.types.BuiltInThemeClassic[source]

Bases: TlObject, BuiltInTheme

Classic light theme

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BuiltInThemeClassic]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BuiltInTheme']

classmethod getType()[source]
Return type:

Literal['builtInThemeClassic']

to_dict()[source]
Return type:

dict

class pytdbot.types.BuiltInThemeDay[source]

Bases: TlObject, BuiltInTheme

Regular light theme

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BuiltInThemeDay]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BuiltInTheme']

classmethod getType()[source]
Return type:

Literal['builtInThemeDay']

to_dict()[source]
Return type:

dict

class pytdbot.types.BuiltInThemeNight[source]

Bases: TlObject, BuiltInTheme

Regular dark theme

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BuiltInThemeNight]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BuiltInTheme']

classmethod getType()[source]
Return type:

Literal['builtInThemeNight']

to_dict()[source]
Return type:

dict

class pytdbot.types.BuiltInThemeTinted[source]

Bases: TlObject, BuiltInTheme

Tinted dark theme

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BuiltInThemeTinted]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BuiltInTheme']

classmethod getType()[source]
Return type:

Literal['builtInThemeTinted']

to_dict()[source]
Return type:

dict

class pytdbot.types.BusinessAwayMessageSchedule[source]

Bases: object

Describes conditions for sending of away messages by a Telegram Business account

class pytdbot.types.BusinessAwayMessageScheduleAlways[source]

Bases: TlObject, BusinessAwayMessageSchedule

Send away messages always

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BusinessAwayMessageScheduleAlways]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BusinessAwayMessageSchedule']

classmethod getType()[source]
Return type:

Literal['businessAwayMessageScheduleAlways']

to_dict()[source]
Return type:

dict

class pytdbot.types.BusinessAwayMessageScheduleCustom(start_date=0, end_date=0)[source]

Bases: TlObject, BusinessAwayMessageSchedule

Send away messages only in the specified time span

Parameters:
  • start_date (int) – Point in time (Unix timestamp) when the away messages will start to be sent

  • end_date (int) – Point in time (Unix timestamp) when the away messages will stop to be sent

__init__(start_date=0, end_date=0)[source]
Parameters:
  • start_date (int)

  • end_date (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BusinessAwayMessageScheduleCustom]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BusinessAwayMessageSchedule']

classmethod getType()[source]
Return type:

Literal['businessAwayMessageScheduleCustom']

to_dict()[source]
Return type:

dict

end_date: int

Point in time (Unix timestamp) when the away messages will stop to be sent

start_date: int

Point in time (Unix timestamp) when the away messages will start to be sent

class pytdbot.types.BusinessAwayMessageScheduleOutsideOfOpeningHours[source]

Bases: TlObject, BusinessAwayMessageSchedule

Send away messages outside of the business opening hours

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BusinessAwayMessageScheduleOutsideOfOpeningHours]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BusinessAwayMessageSchedule']

classmethod getType()[source]
Return type:

Literal['businessAwayMessageScheduleOutsideOfOpeningHours']

to_dict()[source]
Return type:

dict

class pytdbot.types.BusinessAwayMessageSettings(shortcut_id=0, recipients=None, schedule=None, offline_only=False)[source]

Bases: TlObject

Describes settings for messages that are automatically sent by a Telegram Business account when it is away

Parameters:
  • shortcut_id (int) – Unique quick reply shortcut identifier for the away messages

  • recipients ("types.BusinessRecipients") – Chosen recipients of the away messages

  • schedule ("types.BusinessAwayMessageSchedule") – Settings used to check whether the current user is away

  • offline_only (bool) – True, if the messages must not be sent if the account was online in the last 10 minutes

__init__(shortcut_id=0, recipients=None, schedule=None, offline_only=False)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BusinessAwayMessageSettings]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BusinessAwayMessageSettings']

classmethod getType()[source]
Return type:

Literal['businessAwayMessageSettings']

to_dict()[source]
Return type:

dict

offline_only: bool

True, if the messages must not be sent if the account was online in the last 10 minutes

recipients: Optional[BusinessRecipients]

Chosen recipients of the away messages

schedule: Union[BusinessAwayMessageScheduleAlways, BusinessAwayMessageScheduleOutsideOfOpeningHours, BusinessAwayMessageScheduleCustom, None]

Settings used to check whether the current user is away

shortcut_id: int

Unique quick reply shortcut identifier for the away messages

class pytdbot.types.BusinessBotManageBar(bot_user_id=0, manage_url='', is_bot_paused=False, can_bot_reply=False)[source]

Bases: TlObject

Contains information about a business bot that manages the chat

Parameters:
  • bot_user_id (int) – User identifier of the bot

  • manage_url (str) – URL to be opened to manage the bot

  • is_bot_paused (bool) – True, if the bot is paused. Use toggleBusinessConnectedBotChatIsPaused to change the value of the field

  • can_bot_reply (bool) – True, if the bot can reply

__init__(bot_user_id=0, manage_url='', is_bot_paused=False, can_bot_reply=False)[source]
Parameters:
  • bot_user_id (int)

  • manage_url (str)

  • is_bot_paused (bool)

  • can_bot_reply (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BusinessBotManageBar]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BusinessBotManageBar']

classmethod getType()[source]
Return type:

Literal['businessBotManageBar']

to_dict()[source]
Return type:

dict

bot_user_id: int

User identifier of the bot

can_bot_reply: bool

True, if the bot can reply

is_bot_paused: bool

True, if the bot is paused. Use toggleBusinessConnectedBotChatIsPaused to change the value of the field

manage_url: Optional[str]

URL to be opened to manage the bot

class pytdbot.types.BusinessBotRights(can_reply=False, can_read_messages=False, can_delete_sent_messages=False, can_delete_all_messages=False, can_edit_name=False, can_edit_bio=False, can_edit_profile_photo=False, can_edit_username=False, can_view_gifts_and_stars=False, can_sell_gifts=False, can_change_gift_settings=False, can_transfer_and_upgrade_gifts=False, can_transfer_stars=False, can_manage_stories=False)[source]

Bases: TlObject

Describes rights of a business bot

Parameters:
  • can_reply (bool) – 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) – True, if the bot can mark incoming private messages as read

  • can_delete_sent_messages (bool) – True, if the bot can delete sent messages

  • can_delete_all_messages (bool) – True, if the bot can delete any message

  • can_edit_name (bool) – True, if the bot can edit name of the business account

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

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

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

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

  • can_sell_gifts (bool) – True, if the bot can sell regular gifts received by the business account

  • can_change_gift_settings (bool) – True, if the bot can change gift receiving settings of the business account

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

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

  • can_manage_stories (bool) – True, if the bot can post, edit and delete stories

__init__(can_reply=False, can_read_messages=False, can_delete_sent_messages=False, can_delete_all_messages=False, can_edit_name=False, can_edit_bio=False, can_edit_profile_photo=False, can_edit_username=False, can_view_gifts_and_stars=False, can_sell_gifts=False, can_change_gift_settings=False, can_transfer_and_upgrade_gifts=False, can_transfer_stars=False, can_manage_stories=False)[source]
Parameters:
  • can_reply (bool)

  • can_read_messages (bool)

  • can_delete_sent_messages (bool)

  • can_delete_all_messages (bool)

  • can_edit_name (bool)

  • can_edit_bio (bool)

  • can_edit_profile_photo (bool)

  • can_edit_username (bool)

  • can_view_gifts_and_stars (bool)

  • can_sell_gifts (bool)

  • can_change_gift_settings (bool)

  • can_transfer_and_upgrade_gifts (bool)

  • can_transfer_stars (bool)

  • can_manage_stories (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BusinessBotRights]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BusinessBotRights']

classmethod getType()[source]
Return type:

Literal['businessBotRights']

to_dict()[source]
Return type:

dict

can_change_gift_settings: bool

True, if the bot can change gift receiving settings of the business account

can_delete_all_messages: bool

True, if the bot can delete any message

can_delete_sent_messages: bool

True, if the bot can delete sent messages

can_edit_bio: bool

True, if the bot can edit bio of the business account

can_edit_name: bool

True, if the bot can edit name of the business account

can_edit_profile_photo: bool

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

can_edit_username: bool

True, if the bot can edit username of the business account

can_manage_stories: bool

True, if the bot can post, edit and delete stories

can_read_messages: bool

True, if the bot can mark incoming private messages as read

can_reply: bool

True, if the bot can send and edit messages in the private chats that had incoming messages in the last 24 hours

can_sell_gifts: bool

True, if the bot can sell regular gifts received by the business account

can_transfer_and_upgrade_gifts: bool

True, if the bot can transfer and upgrade gifts received by the business account

can_transfer_stars: bool

True, if the bot can transfer Telegram Stars received by the business account to account of the bot, or use them to upgrade and transfer gifts

can_view_gifts_and_stars: bool

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

class pytdbot.types.BusinessChatLink(link='', text=None, title='', view_count=0)[source]

Bases: TlObject

Contains information about a business chat link

Parameters:
  • link (str) – The HTTPS link

  • text ("types.FormattedText") – Message draft text that will be added to the input field

  • title (str) – Link title

  • view_count (int) – Number of times the link was used

__init__(link='', text=None, title='', view_count=0)[source]
Parameters:
  • link (str)

  • text (FormattedText | None)

  • title (str)

  • view_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BusinessChatLink]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BusinessChatLink']

classmethod getType()[source]
Return type:

Literal['businessChatLink']

to_dict()[source]
Return type:

dict

link: Optional[str]

The HTTPS link

text: Optional[FormattedText]

Message draft text that will be added to the input field

title: Optional[str]

Link title

view_count: int

Number of times the link was used

class pytdbot.types.BusinessChatLinkInfo(chat_id=0, text=None)[source]

Bases: TlObject

Contains information about a business chat link

Parameters:
  • chat_id (int) – Identifier of the private chat that created the link

  • text ("types.FormattedText") – Message draft text that must be added to the input field

__init__(chat_id=0, text=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BusinessChatLinkInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BusinessChatLinkInfo']

classmethod getType()[source]
Return type:

Literal['businessChatLinkInfo']

to_dict()[source]
Return type:

dict

chat_id: int

Identifier of the private chat that created the link

text: Optional[FormattedText]

Message draft text that must be added to the input field

class pytdbot.types.BusinessChatLinks(links=None)[source]

Bases: TlObject

Contains a list of business chat links created by the user

Parameters:

links (List["types.BusinessChatLink"]) – List of links

__init__(links=None)[source]
Parameters:

links (List[BusinessChatLink] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BusinessChatLinks]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BusinessChatLinks']

classmethod getType()[source]
Return type:

Literal['businessChatLinks']

to_dict()[source]
Return type:

dict

links: List[BusinessChatLink]

List of links

class pytdbot.types.BusinessConnectedBot(bot_user_id=0, recipients=None, rights=None)[source]

Bases: TlObject

Describes a bot connected to a business account

Parameters:
  • bot_user_id (int) – User identifier of the bot

  • recipients ("types.BusinessRecipients") – Private chats that will be accessible to the bot

  • rights ("types.BusinessBotRights") – Rights of the bot

__init__(bot_user_id=0, recipients=None, rights=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BusinessConnectedBot]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BusinessConnectedBot']

classmethod getType()[source]
Return type:

Literal['businessConnectedBot']

to_dict()[source]
Return type:

dict

bot_user_id: int

User identifier of the bot

recipients: Optional[BusinessRecipients]

Private chats that will be accessible to the bot

rights: Optional[BusinessBotRights]

Rights of the bot

class pytdbot.types.BusinessConnection(id='', user_id=0, user_chat_id=0, date=0, rights=None, is_enabled=False)[source]

Bases: TlObject

Describes a connection of the bot with a business account

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

  • user_id (int) – Identifier of the business user that created the connection

  • user_chat_id (int) – Chat identifier of the private chat with the user

  • date (int) – Point in time (Unix timestamp) when the connection was established

  • rights ("types.BusinessBotRights") – Rights of the bot; may be null if the connection was disabled

  • is_enabled (bool) – True, if the connection is enabled; false otherwise

__init__(id='', user_id=0, user_chat_id=0, date=0, rights=None, is_enabled=False)[source]
Parameters:
  • id (str)

  • user_id (int)

  • user_chat_id (int)

  • date (int)

  • rights (BusinessBotRights | None)

  • is_enabled (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BusinessConnection]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BusinessConnection']

classmethod getType()[source]
Return type:

Literal['businessConnection']

to_dict()[source]
Return type:

dict

date: int

Point in time (Unix timestamp) when the connection was established

id: Optional[str]

Unique identifier of the connection

is_enabled: bool

True, if the connection is enabled; false otherwise

rights: Optional[BusinessBotRights]

Rights of the bot; may be null if the connection was disabled

user_chat_id: int

Chat identifier of the private chat with the user

user_id: int

Identifier of the business user that created the connection

class pytdbot.types.BusinessFeature[source]

Bases: object

Describes a feature available to Business user accounts

class pytdbot.types.BusinessFeatureAccountLinks[source]

Bases: TlObject, BusinessFeature

The ability to create links to the business account with predefined message text

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BusinessFeatureAccountLinks]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BusinessFeature']

classmethod getType()[source]
Return type:

Literal['businessFeatureAccountLinks']

to_dict()[source]
Return type:

dict

class pytdbot.types.BusinessFeatureAwayMessage[source]

Bases: TlObject, BusinessFeature

The ability to set up an away message

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BusinessFeatureAwayMessage]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BusinessFeature']

classmethod getType()[source]
Return type:

Literal['businessFeatureAwayMessage']

to_dict()[source]
Return type:

dict

class pytdbot.types.BusinessFeatureBots[source]

Bases: TlObject, BusinessFeature

The ability to connect a bot to the account

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BusinessFeatureBots]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BusinessFeature']

classmethod getType()[source]
Return type:

Literal['businessFeatureBots']

to_dict()[source]
Return type:

dict

class pytdbot.types.BusinessFeatureChatFolderTags[source]

Bases: TlObject, BusinessFeature

The ability to display folder names for each chat in the chat list

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BusinessFeatureChatFolderTags]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BusinessFeature']

classmethod getType()[source]
Return type:

Literal['businessFeatureChatFolderTags']

to_dict()[source]
Return type:

dict

class pytdbot.types.BusinessFeatureEmojiStatus[source]

Bases: TlObject, BusinessFeature

The ability to show an emoji status along with the business name

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BusinessFeatureEmojiStatus]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BusinessFeature']

classmethod getType()[source]
Return type:

Literal['businessFeatureEmojiStatus']

to_dict()[source]
Return type:

dict

class pytdbot.types.BusinessFeatureGreetingMessage[source]

Bases: TlObject, BusinessFeature

The ability to set up a greeting message

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BusinessFeatureGreetingMessage]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BusinessFeature']

classmethod getType()[source]
Return type:

Literal['businessFeatureGreetingMessage']

to_dict()[source]
Return type:

dict

class pytdbot.types.BusinessFeatureLocation[source]

Bases: TlObject, BusinessFeature

The ability to set location

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BusinessFeatureLocation]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BusinessFeature']

classmethod getType()[source]
Return type:

Literal['businessFeatureLocation']

to_dict()[source]
Return type:

dict

class pytdbot.types.BusinessFeatureOpeningHours[source]

Bases: TlObject, BusinessFeature

The ability to set opening hours

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BusinessFeatureOpeningHours]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BusinessFeature']

classmethod getType()[source]
Return type:

Literal['businessFeatureOpeningHours']

to_dict()[source]
Return type:

dict

class pytdbot.types.BusinessFeaturePromotionAnimation(feature=None, animation=None)[source]

Bases: TlObject

Describes a promotion animation for a Business feature

Parameters:
  • feature ("types.BusinessFeature") – Business feature

  • animation ("types.Animation") – Promotion animation for the feature

__init__(feature=None, animation=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BusinessFeaturePromotionAnimation]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BusinessFeaturePromotionAnimation']

classmethod getType()[source]
Return type:

Literal['businessFeaturePromotionAnimation']

to_dict()[source]
Return type:

dict

animation: Optional[Animation]

Promotion animation for the feature

feature: Union[BusinessFeatureLocation, BusinessFeatureOpeningHours, BusinessFeatureQuickReplies, BusinessFeatureGreetingMessage, BusinessFeatureAwayMessage, BusinessFeatureAccountLinks, BusinessFeatureStartPage, BusinessFeatureBots, BusinessFeatureEmojiStatus, BusinessFeatureChatFolderTags, BusinessFeatureUpgradedStories, None]

Business feature

class pytdbot.types.BusinessFeatureQuickReplies[source]

Bases: TlObject, BusinessFeature

The ability to use quick replies

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BusinessFeatureQuickReplies]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BusinessFeature']

classmethod getType()[source]
Return type:

Literal['businessFeatureQuickReplies']

to_dict()[source]
Return type:

dict

class pytdbot.types.BusinessFeatureStartPage[source]

Bases: TlObject, BusinessFeature

The ability to customize start page

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BusinessFeatureStartPage]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BusinessFeature']

classmethod getType()[source]
Return type:

Literal['businessFeatureStartPage']

to_dict()[source]
Return type:

dict

class pytdbot.types.BusinessFeatureUpgradedStories[source]

Bases: TlObject, BusinessFeature

Allowed to use many additional features for stories

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BusinessFeatureUpgradedStories]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BusinessFeature']

classmethod getType()[source]
Return type:

Literal['businessFeatureUpgradedStories']

to_dict()[source]
Return type:

dict

class pytdbot.types.BusinessFeatures(features=None)[source]

Bases: TlObject

Contains information about features, available to Business user accounts

Parameters:

features (List["types.BusinessFeature"]) – The list of available business features

__init__(features=None)[source]
Parameters:

features (List[BusinessFeature] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BusinessFeatures]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BusinessFeatures']

classmethod getType()[source]
Return type:

Literal['businessFeatures']

to_dict()[source]
Return type:

dict

features: List[BusinessFeature]

The list of available business features

class pytdbot.types.BusinessGreetingMessageSettings(shortcut_id=0, recipients=None, inactivity_days=0)[source]

Bases: TlObject

Describes settings for greeting messages that are automatically sent by a Telegram Business account as response to incoming messages in an inactive private chat

Parameters:
  • shortcut_id (int) – Unique quick reply shortcut identifier for the greeting messages

  • recipients ("types.BusinessRecipients") – Chosen recipients of the greeting messages

  • inactivity_days (int) – The number of days after which a chat will be considered as inactive; currently, must be on of 7, 14, 21, or 28

__init__(shortcut_id=0, recipients=None, inactivity_days=0)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BusinessGreetingMessageSettings]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BusinessGreetingMessageSettings']

classmethod getType()[source]
Return type:

Literal['businessGreetingMessageSettings']

to_dict()[source]
Return type:

dict

inactivity_days: int

The number of days after which a chat will be considered as inactive; currently, must be on of 7, 14, 21, or 28

recipients: Optional[BusinessRecipients]

Chosen recipients of the greeting messages

shortcut_id: int

Unique quick reply shortcut identifier for the greeting messages

class pytdbot.types.BusinessInfo(location=None, opening_hours=None, local_opening_hours=None, next_open_in=0, next_close_in=0, greeting_message_settings=None, away_message_settings=None, start_page=None)[source]

Bases: TlObject

Contains information about a Telegram Business account

Parameters:
  • location ("types.BusinessLocation") – Location of the business; may be null if none

  • opening_hours ("types.BusinessOpeningHours") – Opening hours of the business; may be null if none. The hours are guaranteed to be valid and has already been split by week days

  • local_opening_hours ("types.BusinessOpeningHours") – Opening hours of the business in the local time; may be null if none. The hours are guaranteed to be valid and has already been split by week days. Local time zone identifier will be empty. An updateUserFullInfo update is not triggered when value of this field changes

  • next_open_in (int) – Time left before the business will open the next time, in seconds; 0 if unknown. An updateUserFullInfo update is not triggered when value of this field changes

  • next_close_in (int) – Time left before the business will close the next time, in seconds; 0 if unknown. An updateUserFullInfo update is not triggered when value of this field changes

  • greeting_message_settings ("types.BusinessGreetingMessageSettings") – The greeting message; may be null if none or the Business account is not of the current user

  • away_message_settings ("types.BusinessAwayMessageSettings") – The away message; may be null if none or the Business account is not of the current user

  • start_page ("types.BusinessStartPage") – Information about start page of the account; may be null if none

__init__(location=None, opening_hours=None, local_opening_hours=None, next_open_in=0, next_close_in=0, greeting_message_settings=None, away_message_settings=None, start_page=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BusinessInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BusinessInfo']

classmethod getType()[source]
Return type:

Literal['businessInfo']

to_dict()[source]
Return type:

dict

away_message_settings: Optional[BusinessAwayMessageSettings]

The away message; may be null if none or the Business account is not of the current user

greeting_message_settings: Optional[BusinessGreetingMessageSettings]

The greeting message; may be null if none or the Business account is not of the current user

local_opening_hours: Optional[BusinessOpeningHours]

Opening hours of the business in the local time; may be null if none. The hours are guaranteed to be valid and has already been split by week days. Local time zone identifier will be empty. An updateUserFullInfo update is not triggered when value of this field changes

location: Optional[BusinessLocation]

Location of the business; may be null if none

next_close_in: int

Time left before the business will close the next time, in seconds; 0 if unknown. An updateUserFullInfo update is not triggered when value of this field changes

next_open_in: int

Time left before the business will open the next time, in seconds; 0 if unknown. An updateUserFullInfo update is not triggered when value of this field changes

opening_hours: Optional[BusinessOpeningHours]

Opening hours of the business; may be null if none. The hours are guaranteed to be valid and has already been split by week days

start_page: Optional[BusinessStartPage]

Information about start page of the account; may be null if none

class pytdbot.types.BusinessLocation(location=None, address='')[source]

Bases: TlObject

Represents a location of a business

Parameters:
  • location ("types.Location") – The location; may be null if not specified

  • address (str) – Location address; 1-96 characters

__init__(location=None, address='')[source]
Parameters:
  • location (Location | None)

  • address (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BusinessLocation]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BusinessLocation']

classmethod getType()[source]
Return type:

Literal['businessLocation']

to_dict()[source]
Return type:

dict

address: Optional[str]

Location address; 1-96 characters

location: Optional[Location]

The location; may be null if not specified

class pytdbot.types.BusinessMessage(message=None, reply_to_message=None)[source]

Bases: TlObject

Describes a message from a business account as received by a bot

Parameters:
  • message ("types.Message") – The message

  • reply_to_message ("types.Message") – Message that is replied by the message in the same chat; may be null if none

__init__(message=None, reply_to_message=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BusinessMessage]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BusinessMessage']

classmethod getType()[source]
Return type:

Literal['businessMessage']

to_dict()[source]
Return type:

dict

message: Optional[Message]

The message

reply_to_message: Optional[Message]

Message that is replied by the message in the same chat; may be null if none

class pytdbot.types.BusinessMessages(messages=None)[source]

Bases: TlObject

Contains a list of messages from a business account as received by a bot

Parameters:

messages (List["types.BusinessMessage"]) – List of business messages

__init__(messages=None)[source]
Parameters:

messages (List[BusinessMessage] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BusinessMessages]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BusinessMessages']

classmethod getType()[source]
Return type:

Literal['businessMessages']

to_dict()[source]
Return type:

dict

messages: List[BusinessMessage]

List of business messages

class pytdbot.types.BusinessOpeningHours(time_zone_id='', opening_hours=None)[source]

Bases: TlObject

Describes opening hours of a business

Parameters:
  • time_zone_id (str) – Unique time zone identifier

  • opening_hours (List["types.BusinessOpeningHoursInterval"]) – Intervals of the time when the business is open

__init__(time_zone_id='', opening_hours=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BusinessOpeningHours]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BusinessOpeningHours']

classmethod getType()[source]
Return type:

Literal['businessOpeningHours']

to_dict()[source]
Return type:

dict

opening_hours: List[BusinessOpeningHoursInterval]

Intervals of the time when the business is open

time_zone_id: Optional[str]

Unique time zone identifier

class pytdbot.types.BusinessOpeningHoursInterval(start_minute=0, end_minute=0)[source]

Bases: TlObject

Describes an interval of time when the business is open

Parameters:
  • start_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

  • end_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; 1-8*24*60

__init__(start_minute=0, end_minute=0)[source]
Parameters:
  • start_minute (int)

  • end_minute (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BusinessOpeningHoursInterval]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BusinessOpeningHoursInterval']

classmethod getType()[source]
Return type:

Literal['businessOpeningHoursInterval']

to_dict()[source]
Return type:

dict

end_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; 1-8*24*60

start_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

class pytdbot.types.BusinessRecipients(chat_ids=None, excluded_chat_ids=None, select_existing_chats=False, select_new_chats=False, select_contacts=False, select_non_contacts=False, exclude_selected=False)[source]

Bases: TlObject

Describes private chats chosen for automatic interaction with a business

Parameters:
  • chat_ids (List[int]) – Identifiers of selected private chats

  • excluded_chat_ids (List[int]) – Identifiers of private chats that are always excluded; for businessConnectedBot only

  • select_existing_chats (bool) – True, if all existing private chats are selected

  • select_new_chats (bool) – True, if all new private chats are selected

  • select_contacts (bool) – True, if all private chats with contacts are selected

  • select_non_contacts (bool) – True, if all private chats with non-contacts are selected

  • exclude_selected (bool) – If true, then all private chats except the selected are chosen. Otherwise, only the selected chats are chosen

__init__(chat_ids=None, excluded_chat_ids=None, select_existing_chats=False, select_new_chats=False, select_contacts=False, select_non_contacts=False, exclude_selected=False)[source]
Parameters:
  • chat_ids (List[int] | None)

  • excluded_chat_ids (List[int] | None)

  • select_existing_chats (bool)

  • select_new_chats (bool)

  • select_contacts (bool)

  • select_non_contacts (bool)

  • exclude_selected (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BusinessRecipients]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BusinessRecipients']

classmethod getType()[source]
Return type:

Literal['businessRecipients']

to_dict()[source]
Return type:

dict

chat_ids: List[int]

Identifiers of selected private chats

exclude_selected: bool

If true, then all private chats except the selected are chosen. Otherwise, only the selected chats are chosen

excluded_chat_ids: List[int]

Identifiers of private chats that are always excluded; for businessConnectedBot only

select_contacts: bool

True, if all private chats with contacts are selected

select_existing_chats: bool

True, if all existing private chats are selected

select_new_chats: bool

True, if all new private chats are selected

select_non_contacts: bool

True, if all private chats with non-contacts are selected

class pytdbot.types.BusinessStartPage(title='', message='', sticker=None)[source]

Bases: TlObject

Describes settings for a business account start page

Parameters:
  • title (str) – Title text of the start page

  • message (str) – Message text of the start page

  • sticker ("types.Sticker") – Greeting sticker of the start page; may be null if none

__init__(title='', message='', sticker=None)[source]
Parameters:
  • title (str)

  • message (str)

  • sticker (Sticker | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[BusinessStartPage]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['BusinessStartPage']

classmethod getType()[source]
Return type:

Literal['businessStartPage']

to_dict()[source]
Return type:

dict

message: Optional[str]

Message text of the start page

sticker: Optional[Sticker]

Greeting sticker of the start page; may be null if none

title: Optional[str]

Title text of the start page

class pytdbot.types.Call(id=0, user_id=0, is_outgoing=False, is_video=False, state=None)[source]

Bases: TlObject

Describes a call

Parameters:
  • id (int) – Call identifier, not persistent

  • user_id (int) – User identifier of the other call participant

  • is_outgoing (bool) – True, if the call is outgoing

  • is_video (bool) – True, if the call is a video call

  • state ("types.CallState") – Call state

__init__(id=0, user_id=0, is_outgoing=False, is_video=False, state=None)[source]
Parameters:
  • id (int)

  • user_id (int)

  • is_outgoing (bool)

  • is_video (bool)

  • state (CallState | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Call]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Call']

classmethod getType()[source]
Return type:

Literal['call']

to_dict()[source]
Return type:

dict

id: int

Call identifier, not persistent

is_outgoing: bool

True, if the call is outgoing

is_video: bool

True, if the call is a video call

state: Union[CallStatePending, CallStateExchangingKeys, CallStateReady, CallStateHangingUp, CallStateDiscarded, CallStateError, None]

Call state

user_id: int

User identifier of the other call participant

class pytdbot.types.CallDiscardReason[source]

Bases: object

Describes the reason why a call was discarded

class pytdbot.types.CallDiscardReasonDeclined[source]

Bases: TlObject, CallDiscardReason

The call was ended before the conversation started. It was declined by the other party

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CallDiscardReasonDeclined]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CallDiscardReason']

classmethod getType()[source]
Return type:

Literal['callDiscardReasonDeclined']

to_dict()[source]
Return type:

dict

class pytdbot.types.CallDiscardReasonDisconnected[source]

Bases: TlObject, CallDiscardReason

The call was ended during the conversation because the users were disconnected

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CallDiscardReasonDisconnected]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CallDiscardReason']

classmethod getType()[source]
Return type:

Literal['callDiscardReasonDisconnected']

to_dict()[source]
Return type:

dict

class pytdbot.types.CallDiscardReasonEmpty[source]

Bases: TlObject, CallDiscardReason

The call wasn’t discarded, or the reason is unknown

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CallDiscardReasonEmpty]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CallDiscardReason']

classmethod getType()[source]
Return type:

Literal['callDiscardReasonEmpty']

to_dict()[source]
Return type:

dict

class pytdbot.types.CallDiscardReasonHungUp[source]

Bases: TlObject, CallDiscardReason

The call was ended because one of the parties hung up

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CallDiscardReasonHungUp]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CallDiscardReason']

classmethod getType()[source]
Return type:

Literal['callDiscardReasonHungUp']

to_dict()[source]
Return type:

dict

class pytdbot.types.CallDiscardReasonMissed[source]

Bases: TlObject, CallDiscardReason

The call was ended before the conversation started. It was canceled by the caller or missed by the other party

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CallDiscardReasonMissed]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CallDiscardReason']

classmethod getType()[source]
Return type:

Literal['callDiscardReasonMissed']

to_dict()[source]
Return type:

dict

class pytdbot.types.CallDiscardReasonUpgradeToGroupCall(invite_link='')[source]

Bases: TlObject, CallDiscardReason

The call was ended because it has been upgraded to a group call

Parameters:

invite_link (str) – Invite link for the group call

__init__(invite_link='')[source]
Parameters:

invite_link (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CallDiscardReasonUpgradeToGroupCall]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CallDiscardReason']

classmethod getType()[source]
Return type:

Literal['callDiscardReasonUpgradeToGroupCall']

to_dict()[source]
Return type:

dict

invite_link: Optional[str]

Invite link for the group call

class pytdbot.types.CallId(id=0)[source]

Bases: TlObject

Contains the call identifier

Parameters:

id (int) – Call identifier

__init__(id=0)[source]
Parameters:

id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CallId]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CallId']

classmethod getType()[source]
Return type:

Literal['callId']

to_dict()[source]
Return type:

dict

id: int

Call identifier

class pytdbot.types.CallProblem[source]

Bases: object

Describes the exact type of problem with a call

class pytdbot.types.CallProblemDistortedSpeech[source]

Bases: TlObject, CallProblem

The speech was distorted

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CallProblemDistortedSpeech]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CallProblem']

classmethod getType()[source]
Return type:

Literal['callProblemDistortedSpeech']

to_dict()[source]
Return type:

dict

class pytdbot.types.CallProblemDistortedVideo[source]

Bases: TlObject, CallProblem

The video was distorted

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CallProblemDistortedVideo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CallProblem']

classmethod getType()[source]
Return type:

Literal['callProblemDistortedVideo']

to_dict()[source]
Return type:

dict

class pytdbot.types.CallProblemDropped[source]

Bases: TlObject, CallProblem

The call ended unexpectedly

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CallProblemDropped]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CallProblem']

classmethod getType()[source]
Return type:

Literal['callProblemDropped']

to_dict()[source]
Return type:

dict

class pytdbot.types.CallProblemEcho[source]

Bases: TlObject, CallProblem

The user heard their own voice

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CallProblemEcho]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CallProblem']

classmethod getType()[source]
Return type:

Literal['callProblemEcho']

to_dict()[source]
Return type:

dict

class pytdbot.types.CallProblemInterruptions[source]

Bases: TlObject, CallProblem

The other side kept disappearing

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CallProblemInterruptions]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CallProblem']

classmethod getType()[source]
Return type:

Literal['callProblemInterruptions']

to_dict()[source]
Return type:

dict

class pytdbot.types.CallProblemNoise[source]

Bases: TlObject, CallProblem

The user heard background noise

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CallProblemNoise]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CallProblem']

classmethod getType()[source]
Return type:

Literal['callProblemNoise']

to_dict()[source]
Return type:

dict

class pytdbot.types.CallProblemPixelatedVideo[source]

Bases: TlObject, CallProblem

The video was pixelated

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CallProblemPixelatedVideo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CallProblem']

classmethod getType()[source]
Return type:

Literal['callProblemPixelatedVideo']

to_dict()[source]
Return type:

dict

class pytdbot.types.CallProblemSilentLocal[source]

Bases: TlObject, CallProblem

The user couldn’t hear the other side

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CallProblemSilentLocal]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CallProblem']

classmethod getType()[source]
Return type:

Literal['callProblemSilentLocal']

to_dict()[source]
Return type:

dict

class pytdbot.types.CallProblemSilentRemote[source]

Bases: TlObject, CallProblem

The other side couldn’t hear the user

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CallProblemSilentRemote]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CallProblem']

classmethod getType()[source]
Return type:

Literal['callProblemSilentRemote']

to_dict()[source]
Return type:

dict

class pytdbot.types.CallProtocol(udp_p2p=False, udp_reflector=False, min_layer=0, max_layer=0, library_versions=None)[source]

Bases: TlObject

Specifies the supported call protocols

Parameters:
  • udp_p2p (bool) – True, if UDP peer-to-peer connections are supported

  • udp_reflector (bool) – True, if connection through UDP reflectors is supported

  • min_layer (int) – The minimum supported API layer; use 65

  • max_layer (int) – The maximum supported API layer; use 92

  • library_versions (List[str]) – List of supported tgcalls versions

__init__(udp_p2p=False, udp_reflector=False, min_layer=0, max_layer=0, library_versions=None)[source]
Parameters:
  • udp_p2p (bool)

  • udp_reflector (bool)

  • min_layer (int)

  • max_layer (int)

  • library_versions (List[str] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CallProtocol]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CallProtocol']

classmethod getType()[source]
Return type:

Literal['callProtocol']

to_dict()[source]
Return type:

dict

library_versions: List[str]

List of supported tgcalls versions

max_layer: int

The maximum supported API layer; use 92

min_layer: int

The minimum supported API layer; use 65

udp_p2p: bool

True, if UDP peer-to-peer connections are supported

udp_reflector: bool

True, if connection through UDP reflectors is supported

class pytdbot.types.CallServer(id=0, ip_address='', ipv6_address='', port=0, type=None)[source]

Bases: TlObject

Describes a server for relaying call data

Parameters:
  • id (int) – Server identifier

  • ip_address (str) – Server IPv4 address

  • ipv6_address (str) – Server IPv6 address

  • port (int) – Server port number

  • type ("types.CallServerType") – Server type

__init__(id=0, ip_address='', ipv6_address='', port=0, type=None)[source]
Parameters:
  • id (int)

  • ip_address (str)

  • ipv6_address (str)

  • port (int)

  • type (CallServerType | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CallServer]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CallServer']

classmethod getType()[source]
Return type:

Literal['callServer']

to_dict()[source]
Return type:

dict

id: int

Server identifier

ip_address: Optional[str]

Server IPv4 address

ipv6_address: Optional[str]

Server IPv6 address

port: int

Server port number

type: Union[CallServerTypeTelegramReflector, CallServerTypeWebrtc, None]

Server type

class pytdbot.types.CallServerType[source]

Bases: object

Describes the type of call server

class pytdbot.types.CallServerTypeTelegramReflector(peer_tag=b'', is_tcp=False)[source]

Bases: TlObject, CallServerType

A Telegram call reflector

Parameters:
  • peer_tag (bytes) – A peer tag to be used with the reflector

  • is_tcp (bool) – True, if the server uses TCP instead of UDP

__init__(peer_tag=b'', is_tcp=False)[source]
Parameters:
  • peer_tag (bytes)

  • is_tcp (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CallServerTypeTelegramReflector]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CallServerType']

classmethod getType()[source]
Return type:

Literal['callServerTypeTelegramReflector']

to_dict()[source]
Return type:

dict

is_tcp: bool

True, if the server uses TCP instead of UDP

peer_tag: Optional[bytes]

A peer tag to be used with the reflector

class pytdbot.types.CallServerTypeWebrtc(username='', password='', supports_turn=False, supports_stun=False)[source]

Bases: TlObject, CallServerType

A WebRTC server

Parameters:
  • username (str) – Username to be used for authentication

  • password (str) – Authentication password

  • supports_turn (bool) – True, if the server supports TURN

  • supports_stun (bool) – True, if the server supports STUN

__init__(username='', password='', supports_turn=False, supports_stun=False)[source]
Parameters:
  • username (str)

  • password (str)

  • supports_turn (bool)

  • supports_stun (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CallServerTypeWebrtc]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CallServerType']

classmethod getType()[source]
Return type:

Literal['callServerTypeWebrtc']

to_dict()[source]
Return type:

dict

password: Optional[str]

Authentication password

supports_stun: bool

True, if the server supports STUN

supports_turn: bool

True, if the server supports TURN

username: Optional[str]

Username to be used for authentication

class pytdbot.types.CallState[source]

Bases: object

Describes the current call state

class pytdbot.types.CallStateDiscarded(reason=None, need_rating=False, need_debug_information=False, need_log=False)[source]

Bases: TlObject, CallState

The call has ended successfully

Parameters:
  • reason ("types.CallDiscardReason") – The reason why the call has ended

  • need_rating (bool) – True, if the call rating must be sent to the server

  • need_debug_information (bool) – True, if the call debug information must be sent to the server

  • need_log (bool) – True, if the call log must be sent to the server

__init__(reason=None, need_rating=False, need_debug_information=False, need_log=False)[source]
Parameters:
  • reason (CallDiscardReason | None)

  • need_rating (bool)

  • need_debug_information (bool)

  • need_log (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CallStateDiscarded]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CallState']

classmethod getType()[source]
Return type:

Literal['callStateDiscarded']

to_dict()[source]
Return type:

dict

need_debug_information: bool

True, if the call debug information must be sent to the server

need_log: bool

True, if the call log must be sent to the server

need_rating: bool

True, if the call rating must be sent to the server

reason: Union[CallDiscardReasonEmpty, CallDiscardReasonMissed, CallDiscardReasonDeclined, CallDiscardReasonDisconnected, CallDiscardReasonHungUp, CallDiscardReasonUpgradeToGroupCall, None]

The reason why the call has ended

class pytdbot.types.CallStateError(error=None)[source]

Bases: TlObject, CallState

The call has ended with an error

Parameters:

error ("types.Error") – Error. An error with the code 4005000 will be returned if an outgoing call is missed because of an expired timeout

__init__(error=None)[source]
Parameters:

error (Error | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CallStateError]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CallState']

classmethod getType()[source]
Return type:

Literal['callStateError']

to_dict()[source]
Return type:

dict

error: Optional[Error]

Error. An error with the code 4005000 will be returned if an outgoing call is missed because of an expired timeout

class pytdbot.types.CallStateExchangingKeys[source]

Bases: TlObject, CallState

The call has been answered and encryption keys are being exchanged

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CallStateExchangingKeys]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CallState']

classmethod getType()[source]
Return type:

Literal['callStateExchangingKeys']

to_dict()[source]
Return type:

dict

class pytdbot.types.CallStateHangingUp[source]

Bases: TlObject, CallState

The call is hanging up after discardCall has been called

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CallStateHangingUp]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CallState']

classmethod getType()[source]
Return type:

Literal['callStateHangingUp']

to_dict()[source]
Return type:

dict

class pytdbot.types.CallStatePending(is_created=False, is_received=False)[source]

Bases: TlObject, CallState

The call is pending, waiting to be accepted by a user

Parameters:
  • is_created (bool) – True, if the call has already been created by the server

  • is_received (bool) – True, if the call has already been received by the other party

__init__(is_created=False, is_received=False)[source]
Parameters:
  • is_created (bool)

  • is_received (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CallStatePending]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CallState']

classmethod getType()[source]
Return type:

Literal['callStatePending']

to_dict()[source]
Return type:

dict

is_created: bool

True, if the call has already been created by the server

is_received: bool

True, if the call has already been received by the other party

class pytdbot.types.CallStateReady(protocol=None, servers=None, config='', encryption_key=b'', emojis=None, allow_p2p=False, is_group_call_supported=False, custom_parameters='')[source]

Bases: TlObject, CallState

The call is ready to use

Parameters:
  • protocol ("types.CallProtocol") – Call protocols supported by the other call participant

  • servers (List["types.CallServer"]) – List of available call servers

  • config (str) – A JSON-encoded call config

  • encryption_key (bytes) – Call encryption key

  • emojis (List[str]) – Encryption key fingerprint represented as 4 emoji

  • allow_p2p (bool) – True, if peer-to-peer connection is allowed by users privacy settings

  • is_group_call_supported (bool) – True, if the other party supports upgrading of the call to a group call

  • custom_parameters (str) – Custom JSON-encoded call parameters to be passed to tgcalls

__init__(protocol=None, servers=None, config='', encryption_key=b'', emojis=None, allow_p2p=False, is_group_call_supported=False, custom_parameters='')[source]
Parameters:
  • protocol (CallProtocol | None)

  • servers (List[CallServer] | None)

  • config (str)

  • encryption_key (bytes)

  • emojis (List[str] | None)

  • allow_p2p (bool)

  • is_group_call_supported (bool)

  • custom_parameters (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CallStateReady]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CallState']

classmethod getType()[source]
Return type:

Literal['callStateReady']

to_dict()[source]
Return type:

dict

allow_p2p: bool

True, if peer-to-peer connection is allowed by users privacy settings

config: Optional[str]

A JSON-encoded call config

custom_parameters: Optional[str]

Custom JSON-encoded call parameters to be passed to tgcalls

emojis: List[str]

Encryption key fingerprint represented as 4 emoji

encryption_key: Optional[bytes]

Call encryption key

is_group_call_supported: bool

True, if the other party supports upgrading of the call to a group call

protocol: Optional[CallProtocol]

Call protocols supported by the other call participant

servers: List[CallServer]

List of available call servers

class pytdbot.types.CallbackQueryAnswer(text='', show_alert=False, url='')[source]

Bases: TlObject

Contains a bot’s answer to a callback query

Parameters:
  • text (str) – Text of the answer

  • show_alert (bool) – True, if an alert must be shown to the user instead of a toast notification

  • url (str) – URL to be opened

__init__(text='', show_alert=False, url='')[source]
Parameters:
  • text (str)

  • show_alert (bool)

  • url (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CallbackQueryAnswer]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CallbackQueryAnswer']

classmethod getType()[source]
Return type:

Literal['callbackQueryAnswer']

to_dict()[source]
Return type:

dict

show_alert: bool

True, if an alert must be shown to the user instead of a toast notification

text: Optional[str]

Text of the answer

url: Optional[str]

URL to be opened

class pytdbot.types.CallbackQueryPayload[source]

Bases: object

Represents a payload of a callback query

class pytdbot.types.CallbackQueryPayloadData(data=b'')[source]

Bases: TlObject, CallbackQueryPayload

The payload for a general callback button

Parameters:

data (bytes) – Data that was attached to the callback button

__init__(data=b'')[source]
Parameters:

data (bytes)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CallbackQueryPayloadData]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CallbackQueryPayload']

classmethod getType()[source]
Return type:

Literal['callbackQueryPayloadData']

to_dict()[source]
Return type:

dict

data: Optional[bytes]

Data that was attached to the callback button

class pytdbot.types.CallbackQueryPayloadDataWithPassword(password='', data=b'')[source]

Bases: TlObject, CallbackQueryPayload

The payload for a callback button requiring password

Parameters:
  • password (str) – The 2-step verification password for the current user

  • data (bytes) – Data that was attached to the callback button

__init__(password='', data=b'')[source]
Parameters:
  • password (str)

  • data (bytes)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CallbackQueryPayloadDataWithPassword]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CallbackQueryPayload']

classmethod getType()[source]
Return type:

Literal['callbackQueryPayloadDataWithPassword']

to_dict()[source]
Return type:

dict

data: Optional[bytes]

Data that was attached to the callback button

password: Optional[str]

The 2-step verification password for the current user

class pytdbot.types.CallbackQueryPayloadGame(game_short_name='')[source]

Bases: TlObject, CallbackQueryPayload

The payload for a game callback button

Parameters:

game_short_name (str) – A short name of the game that was attached to the callback button

__init__(game_short_name='')[source]
Parameters:

game_short_name (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CallbackQueryPayloadGame]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CallbackQueryPayload']

classmethod getType()[source]
Return type:

Literal['callbackQueryPayloadGame']

to_dict()[source]
Return type:

dict

game_short_name: Optional[str]

A short name of the game that was attached to the callback button

class pytdbot.types.CanPostStoryResult[source]

Bases: object

Represents result of checking whether the current user can post a story on behalf of the specific chat

class pytdbot.types.CanPostStoryResultActiveStoryLimitExceeded[source]

Bases: TlObject, CanPostStoryResult

The limit for the number of active stories exceeded. The user can buy Telegram Premium, delete an active story, or wait for the oldest story to expire

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CanPostStoryResultActiveStoryLimitExceeded]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CanPostStoryResult']

classmethod getType()[source]
Return type:

Literal['canPostStoryResultActiveStoryLimitExceeded']

to_dict()[source]
Return type:

dict

class pytdbot.types.CanPostStoryResultBoostNeeded[source]

Bases: TlObject, CanPostStoryResult

The chat must be boosted first by Telegram Premium subscribers to post more stories. Call getChatBoostStatus to get current boost status of the chat

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CanPostStoryResultBoostNeeded]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CanPostStoryResult']

classmethod getType()[source]
Return type:

Literal['canPostStoryResultBoostNeeded']

to_dict()[source]
Return type:

dict

class pytdbot.types.CanPostStoryResultMonthlyLimitExceeded(retry_after=0)[source]

Bases: TlObject, CanPostStoryResult

The monthly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time

Parameters:

retry_after (int) – Time left before the user can post the next story

__init__(retry_after=0)[source]
Parameters:

retry_after (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CanPostStoryResultMonthlyLimitExceeded]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CanPostStoryResult']

classmethod getType()[source]
Return type:

Literal['canPostStoryResultMonthlyLimitExceeded']

to_dict()[source]
Return type:

dict

retry_after: int

Time left before the user can post the next story

class pytdbot.types.CanPostStoryResultOk(story_count=0)[source]

Bases: TlObject, CanPostStoryResult

A story can be sent

Parameters:

story_count (int) – Number of stories that can be posted by the user

__init__(story_count=0)[source]
Parameters:

story_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CanPostStoryResultOk]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CanPostStoryResult']

classmethod getType()[source]
Return type:

Literal['canPostStoryResultOk']

to_dict()[source]
Return type:

dict

story_count: int

Number of stories that can be posted by the user

class pytdbot.types.CanPostStoryResultPremiumNeeded[source]

Bases: TlObject, CanPostStoryResult

The user must subscribe to Telegram Premium to be able to post stories

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CanPostStoryResultPremiumNeeded]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CanPostStoryResult']

classmethod getType()[source]
Return type:

Literal['canPostStoryResultPremiumNeeded']

to_dict()[source]
Return type:

dict

class pytdbot.types.CanPostStoryResultWeeklyLimitExceeded(retry_after=0)[source]

Bases: TlObject, CanPostStoryResult

The weekly limit for the number of posted stories exceeded. The user needs to buy Telegram Premium or wait specified time

Parameters:

retry_after (int) – Time left before the user can post the next story

__init__(retry_after=0)[source]
Parameters:

retry_after (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CanPostStoryResultWeeklyLimitExceeded]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CanPostStoryResult']

classmethod getType()[source]
Return type:

Literal['canPostStoryResultWeeklyLimitExceeded']

to_dict()[source]
Return type:

dict

retry_after: int

Time left before the user can post the next story

class pytdbot.types.CanSendGiftResult[source]

Bases: object

Describes whether a gift can be sent now by the current user

class pytdbot.types.CanSendGiftResultFail(reason=None)[source]

Bases: TlObject, CanSendGiftResult

The gift can’t be sent now by the current user

Parameters:

reason ("types.FormattedText") – Reason to be shown to the user

__init__(reason=None)[source]
Parameters:

reason (FormattedText | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CanSendGiftResultFail]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CanSendGiftResult']

classmethod getType()[source]
Return type:

Literal['canSendGiftResultFail']

to_dict()[source]
Return type:

dict

reason: Optional[FormattedText]

Reason to be shown to the user

class pytdbot.types.CanSendGiftResultOk[source]

Bases: TlObject, CanSendGiftResult

The gift can be sent now by the current user

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CanSendGiftResultOk]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CanSendGiftResult']

classmethod getType()[source]
Return type:

Literal['canSendGiftResultOk']

to_dict()[source]
Return type:

dict

class pytdbot.types.CanSendMessageToUserResult[source]

Bases: object

Describes result of canSendMessageToUser

class pytdbot.types.CanSendMessageToUserResultOk[source]

Bases: TlObject, CanSendMessageToUserResult

The user can be messaged

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CanSendMessageToUserResultOk]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CanSendMessageToUserResult']

classmethod getType()[source]
Return type:

Literal['canSendMessageToUserResultOk']

to_dict()[source]
Return type:

dict

class pytdbot.types.CanSendMessageToUserResultUserHasPaidMessages(outgoing_paid_message_star_count=0)[source]

Bases: TlObject, CanSendMessageToUserResult

The user can be messaged, but the messages are paid

Parameters:

outgoing_paid_message_star_count (int) – Number of Telegram Stars that must be paid by the current user for each sent message to the user

__init__(outgoing_paid_message_star_count=0)[source]
Parameters:

outgoing_paid_message_star_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CanSendMessageToUserResultUserHasPaidMessages]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CanSendMessageToUserResult']

classmethod getType()[source]
Return type:

Literal['canSendMessageToUserResultUserHasPaidMessages']

to_dict()[source]
Return type:

dict

outgoing_paid_message_star_count: int

Number of Telegram Stars that must be paid by the current user for each sent message to the user

class pytdbot.types.CanSendMessageToUserResultUserIsDeleted[source]

Bases: TlObject, CanSendMessageToUserResult

The user can’t be messaged, because they are deleted or unknown

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CanSendMessageToUserResultUserIsDeleted]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CanSendMessageToUserResult']

classmethod getType()[source]
Return type:

Literal['canSendMessageToUserResultUserIsDeleted']

to_dict()[source]
Return type:

dict

class pytdbot.types.CanSendMessageToUserResultUserRestrictsNewChats[source]

Bases: TlObject, CanSendMessageToUserResult

The user can’t be messaged, because they restrict new chats with non-contacts

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CanSendMessageToUserResultUserRestrictsNewChats]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CanSendMessageToUserResult']

classmethod getType()[source]
Return type:

Literal['canSendMessageToUserResultUserRestrictsNewChats']

to_dict()[source]
Return type:

dict

class pytdbot.types.CanTransferOwnershipResult[source]

Bases: object

Represents result of checking whether the current session can be used to transfer a chat ownership to another user

class pytdbot.types.CanTransferOwnershipResultOk[source]

Bases: TlObject, CanTransferOwnershipResult

The session can be used

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CanTransferOwnershipResultOk]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CanTransferOwnershipResult']

classmethod getType()[source]
Return type:

Literal['canTransferOwnershipResultOk']

to_dict()[source]
Return type:

dict

class pytdbot.types.CanTransferOwnershipResultPasswordNeeded[source]

Bases: TlObject, CanTransferOwnershipResult

The 2-step verification needs to be enabled first

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CanTransferOwnershipResultPasswordNeeded]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CanTransferOwnershipResult']

classmethod getType()[source]
Return type:

Literal['canTransferOwnershipResultPasswordNeeded']

to_dict()[source]
Return type:

dict

class pytdbot.types.CanTransferOwnershipResultPasswordTooFresh(retry_after=0)[source]

Bases: TlObject, CanTransferOwnershipResult

The 2-step verification was enabled recently, user needs to wait

Parameters:

retry_after (int) – Time left before the session can be used to transfer ownership of a chat, in seconds

__init__(retry_after=0)[source]
Parameters:

retry_after (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CanTransferOwnershipResultPasswordTooFresh]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CanTransferOwnershipResult']

classmethod getType()[source]
Return type:

Literal['canTransferOwnershipResultPasswordTooFresh']

to_dict()[source]
Return type:

dict

retry_after: int

Time left before the session can be used to transfer ownership of a chat, in seconds

class pytdbot.types.CanTransferOwnershipResultSessionTooFresh(retry_after=0)[source]

Bases: TlObject, CanTransferOwnershipResult

The session was created recently, user needs to wait

Parameters:

retry_after (int) – Time left before the session can be used to transfer ownership of a chat, in seconds

__init__(retry_after=0)[source]
Parameters:

retry_after (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CanTransferOwnershipResultSessionTooFresh]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CanTransferOwnershipResult']

classmethod getType()[source]
Return type:

Literal['canTransferOwnershipResultSessionTooFresh']

to_dict()[source]
Return type:

dict

retry_after: int

Time left before the session can be used to transfer ownership of a chat, in seconds

class pytdbot.types.Chat(id=0, type=None, title='', photo=None, accent_color_id=0, background_custom_emoji_id=0, profile_accent_color_id=0, profile_background_custom_emoji_id=0, permissions=None, last_message=None, positions=None, chat_lists=None, message_sender_id=None, block_list=None, has_protected_content=False, is_translatable=False, is_marked_as_unread=False, view_as_topics=False, has_scheduled_messages=False, can_be_deleted_only_for_self=False, can_be_deleted_for_all_users=False, can_be_reported=False, default_disable_notification=False, unread_count=0, last_read_inbox_message_id=0, last_read_outbox_message_id=0, unread_mention_count=0, unread_reaction_count=0, notification_settings=None, available_reactions=None, message_auto_delete_time=0, emoji_status=None, background=None, theme=None, action_bar=None, business_bot_manage_bar=None, video_chat=None, pending_join_requests=None, reply_markup_message_id=0, draft_message=None, client_data='')[source]

Bases: TlObject

A chat. (Can be a private chat, basic group, supergroup, or secret chat)

Parameters:
  • id (int) – Chat unique identifier

  • type ("types.ChatType") – Type of the chat

  • title (str) – Chat title

  • photo ("types.ChatPhotoInfo") – Chat photo; may be null

  • accent_color_id (int) – Identifier of the accent color for message sender name, and backgrounds of chat photo, reply header, and link preview

  • background_custom_emoji_id (int) – Identifier of a custom emoji to be shown on the reply header and link preview background for messages sent by the chat; 0 if none

  • profile_accent_color_id (int) – Identifier of the profile accent color for the chat’s profile; -1 if none

  • profile_background_custom_emoji_id (int) – Identifier of a custom emoji to be shown on the background of the chat’s profile; 0 if none

  • permissions ("types.ChatPermissions") – Actions that non-administrator chat members are allowed to take in the chat

  • last_message ("types.Message") – Last message in the chat; may be null if none or unknown

  • positions (List["types.ChatPosition"]) – Positions of the chat in chat lists

  • chat_lists (List["types.ChatList"]) – Chat lists to which the chat belongs. A chat can have a non-zero position in a chat list even if it doesn’t belong to the chat list and have no position in a chat list even if it belongs to the chat list

  • message_sender_id ("types.MessageSender") – Identifier of a user or chat that is selected to send messages in the chat; may be null if the user can’t change message sender

  • block_list ("types.BlockList") – Block list to which the chat is added; may be null if none

  • has_protected_content (bool) – True, if chat content can’t be saved locally, forwarded, or copied

  • is_translatable (bool) – True, if translation of all messages in the chat must be suggested to the user

  • is_marked_as_unread (bool) – True, if the chat is marked as unread

  • view_as_topics (bool) – True, if the chat is a forum supergroup that must be shown in the "View as topics" mode, or Saved Messages chat that must be shown in the "View as chats"

  • has_scheduled_messages (bool) – True, if the chat has scheduled messages

  • can_be_deleted_only_for_self (bool) – True, if the chat messages can be deleted only for the current user while other users will continue to see the messages

  • can_be_deleted_for_all_users (bool) – True, if the chat messages can be deleted for all users

  • can_be_reported (bool) – True, if the chat can be reported to Telegram moderators through reportChat or reportChatPhoto

  • default_disable_notification (bool) – Default value of the disable_notification parameter, used when a message is sent to the chat

  • unread_count (int) – Number of unread messages in the chat

  • last_read_inbox_message_id (int) – Identifier of the last read incoming message

  • last_read_outbox_message_id (int) – Identifier of the last read outgoing message

  • unread_mention_count (int) – Number of unread messages with a mention/reply in the chat

  • unread_reaction_count (int) – Number of messages with unread reactions in the chat

  • notification_settings ("types.ChatNotificationSettings") – Notification settings for the chat

  • available_reactions ("types.ChatAvailableReactions") – Types of reaction, available in the chat

  • message_auto_delete_time (int) – Current message auto-delete or self-destruct timer setting for the chat, in seconds; 0 if disabled. Self-destruct timer in secret chats starts after the message or its content is viewed. Auto-delete timer in other chats starts from the send date

  • emoji_status ("types.EmojiStatus") – Emoji status to be shown along with chat title; may be null

  • background ("types.ChatBackground") – Background set for the chat; may be null if none

  • theme ("types.ChatTheme") – Theme set for the chat; may be null if none

  • action_bar ("types.ChatActionBar") – Information about actions which must be possible to do through the chat action bar; may be null if none

  • business_bot_manage_bar ("types.BusinessBotManageBar") – Information about bar for managing a business bot in the chat; may be null if none

  • video_chat ("types.VideoChat") – Information about video chat of the chat

  • pending_join_requests ("types.ChatJoinRequestsInfo") – Information about pending join requests; may be null if none

  • reply_markup_message_id (int) – Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat

  • draft_message ("types.DraftMessage") – A draft of a message in the chat; may be null if none

  • client_data (str) – Application-specific data associated with the chat. (For example, the chat scroll position or local chat notification settings can be stored here.) Persistent if the message database is used

__init__(id=0, type=None, title='', photo=None, accent_color_id=0, background_custom_emoji_id=0, profile_accent_color_id=0, profile_background_custom_emoji_id=0, permissions=None, last_message=None, positions=None, chat_lists=None, message_sender_id=None, block_list=None, has_protected_content=False, is_translatable=False, is_marked_as_unread=False, view_as_topics=False, has_scheduled_messages=False, can_be_deleted_only_for_self=False, can_be_deleted_for_all_users=False, can_be_reported=False, default_disable_notification=False, unread_count=0, last_read_inbox_message_id=0, last_read_outbox_message_id=0, unread_mention_count=0, unread_reaction_count=0, notification_settings=None, available_reactions=None, message_auto_delete_time=0, emoji_status=None, background=None, theme=None, action_bar=None, business_bot_manage_bar=None, video_chat=None, pending_join_requests=None, reply_markup_message_id=0, draft_message=None, client_data='')[source]
Parameters:
  • id (int)

  • type (ChatType | None)

  • title (str)

  • photo (ChatPhotoInfo | None)

  • accent_color_id (int)

  • background_custom_emoji_id (int)

  • profile_accent_color_id (int)

  • profile_background_custom_emoji_id (int)

  • permissions (ChatPermissions | None)

  • last_message (Message | None)

  • positions (List[ChatPosition] | None)

  • chat_lists (List[ChatList] | None)

  • message_sender_id (MessageSender | None)

  • block_list (BlockList | None)

  • has_protected_content (bool)

  • is_translatable (bool)

  • is_marked_as_unread (bool)

  • view_as_topics (bool)

  • has_scheduled_messages (bool)

  • can_be_deleted_only_for_self (bool)

  • can_be_deleted_for_all_users (bool)

  • can_be_reported (bool)

  • default_disable_notification (bool)

  • unread_count (int)

  • last_read_inbox_message_id (int)

  • last_read_outbox_message_id (int)

  • unread_mention_count (int)

  • unread_reaction_count (int)

  • notification_settings (ChatNotificationSettings | None)

  • available_reactions (ChatAvailableReactions | None)

  • message_auto_delete_time (int)

  • emoji_status (EmojiStatus | None)

  • background (ChatBackground | None)

  • theme (ChatTheme | None)

  • action_bar (ChatActionBar | None)

  • business_bot_manage_bar (BusinessBotManageBar | None)

  • video_chat (VideoChat | None)

  • pending_join_requests (ChatJoinRequestsInfo | None)

  • reply_markup_message_id (int)

  • draft_message (DraftMessage | None)

  • client_data (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Chat]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Chat']

classmethod getType()[source]
Return type:

Literal['chat']

to_dict()[source]
Return type:

dict

accent_color_id: int

Identifier of the accent color for message sender name, and backgrounds of chat photo, reply header, and link preview

action_bar: Union[ChatActionBarReportSpam, ChatActionBarInviteMembers, ChatActionBarReportAddBlock, ChatActionBarAddContact, ChatActionBarSharePhoneNumber, ChatActionBarJoinRequest, None]

Information about actions which must be possible to do through the chat action bar; may be null if none

available_reactions: Union[ChatAvailableReactionsAll, ChatAvailableReactionsSome, None]

Types of reaction, available in the chat

background: Optional[ChatBackground]

Background set for the chat; may be null if none

background_custom_emoji_id: int

Identifier of a custom emoji to be shown on the reply header and link preview background for messages sent by the chat; 0 if none

block_list: Union[BlockListMain, BlockListStories, None]

Block list to which the chat is added; may be null if none

business_bot_manage_bar: Optional[BusinessBotManageBar]

Information about bar for managing a business bot in the chat; may be null if none

can_be_deleted_for_all_users: bool

True, if the chat messages can be deleted for all users

can_be_deleted_only_for_self: bool

True, if the chat messages can be deleted only for the current user while other users will continue to see the messages

can_be_reported: bool

True, if the chat can be reported to Telegram moderators through reportChat or reportChatPhoto

chat_lists: List[ChatList]

Chat lists to which the chat belongs. A chat can have a non-zero position in a chat list even if it doesn’t belong to the chat list and have no position in a chat list even if it belongs to the chat list

client_data: Optional[str]

Application-specific data associated with the chat. (For example, the chat scroll position or local chat notification settings can be stored here.) Persistent if the message database is used

default_disable_notification: bool

Default value of the disable_notification parameter, used when a message is sent to the chat

draft_message: Optional[DraftMessage]

A draft of a message in the chat; may be null if none

emoji_status: Optional[EmojiStatus]

Emoji status to be shown along with chat title; may be null

has_protected_content: bool

True, if chat content can’t be saved locally, forwarded, or copied

has_scheduled_messages: bool

True, if the chat has scheduled messages

id: int

Chat unique identifier

is_marked_as_unread: bool

True, if the chat is marked as unread

is_translatable: bool

True, if translation of all messages in the chat must be suggested to the user

last_message: Optional[Message]

Last message in the chat; may be null if none or unknown

last_read_inbox_message_id: int

Identifier of the last read incoming message

last_read_outbox_message_id: int

Identifier of the last read outgoing message

message_auto_delete_time: int

Current message auto-delete or self-destruct timer setting for the chat, in seconds; 0 if disabled. Self-destruct timer in secret chats starts after the message or its content is viewed. Auto-delete timer in other chats starts from the send date

message_sender_id: Union[MessageSenderUser, MessageSenderChat, None]

Identifier of a user or chat that is selected to send messages in the chat; may be null if the user can’t change message sender

notification_settings: Optional[ChatNotificationSettings]

Notification settings for the chat

pending_join_requests: Optional[ChatJoinRequestsInfo]

Information about pending join requests; may be null if none

permissions: Optional[ChatPermissions]

Actions that non-administrator chat members are allowed to take in the chat

photo: Optional[ChatPhotoInfo]

Chat photo; may be null

positions: List[ChatPosition]

Positions of the chat in chat lists

profile_accent_color_id: int

Identifier of the profile accent color for the chat’s profile; -1 if none

profile_background_custom_emoji_id: int

Identifier of a custom emoji to be shown on the background of the chat’s profile; 0 if none

reply_markup_message_id: int

Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat

theme: Union[ChatThemeEmoji, ChatThemeGift, None]

Theme set for the chat; may be null if none

title: Optional[str]

Chat title

type: Union[ChatTypePrivate, ChatTypeBasicGroup, ChatTypeSupergroup, ChatTypeSecret, None]

Type of the chat

unread_count: int

Number of unread messages in the chat

unread_mention_count: int

Number of unread messages with a mention/reply in the chat

unread_reaction_count: int

Number of messages with unread reactions in the chat

video_chat: Optional[VideoChat]

Information about video chat of the chat

view_as_topics: bool

True, if the chat is a forum supergroup that must be shown in the "View as topics" mode, or Saved Messages chat that must be shown in the "View as chats"

class pytdbot.types.ChatAction[source]

Bases: object

Describes the different types of activity in a chat

class pytdbot.types.ChatActionBar[source]

Bases: object

Describes actions which must be possible to do through a chat action bar

class pytdbot.types.ChatActionBarAddContact[source]

Bases: TlObject, ChatActionBar

The chat is a private or secret chat and the other user can be added to the contact list using the method addContact

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatActionBarAddContact]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatActionBar']

classmethod getType()[source]
Return type:

Literal['chatActionBarAddContact']

to_dict()[source]
Return type:

dict

class pytdbot.types.ChatActionBarInviteMembers[source]

Bases: TlObject, ChatActionBar

The chat is a recently created group chat to which new members can be invited

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatActionBarInviteMembers]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatActionBar']

classmethod getType()[source]
Return type:

Literal['chatActionBarInviteMembers']

to_dict()[source]
Return type:

dict

class pytdbot.types.ChatActionBarJoinRequest(title='', is_channel=False, request_date=0)[source]

Bases: TlObject, ChatActionBar

The chat is a private chat with an administrator of a chat to which the user sent join request

Parameters:
  • title (str) – Title of the chat to which the join request was sent

  • is_channel (bool) – True, if the join request was sent to a channel chat

  • request_date (int) – Point in time (Unix timestamp) when the join request was sent

__init__(title='', is_channel=False, request_date=0)[source]
Parameters:
  • title (str)

  • is_channel (bool)

  • request_date (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatActionBarJoinRequest]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatActionBar']

classmethod getType()[source]
Return type:

Literal['chatActionBarJoinRequest']

to_dict()[source]
Return type:

dict

is_channel: bool

True, if the join request was sent to a channel chat

request_date: int

Point in time (Unix timestamp) when the join request was sent

title: Optional[str]

Title of the chat to which the join request was sent

class pytdbot.types.ChatActionBarReportAddBlock(can_unarchive=False, account_info=None)[source]

Bases: TlObject, ChatActionBar

The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be blocked using the method setMessageSenderBlockList, or the other user can be added to the contact list using the method addContact. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown

Parameters:
  • can_unarchive (bool) – If true, the chat was automatically archived and can be moved back to the main chat list using addChatToList simultaneously with setting chat notification settings to default using setChatNotificationSettings

  • account_info ("types.AccountInfo") – Basic information about the other user in the chat; may be null if unknown

__init__(can_unarchive=False, account_info=None)[source]
Parameters:
  • can_unarchive (bool)

  • account_info (AccountInfo | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatActionBarReportAddBlock]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatActionBar']

classmethod getType()[source]
Return type:

Literal['chatActionBarReportAddBlock']

to_dict()[source]
Return type:

dict

account_info: Optional[AccountInfo]

Basic information about the other user in the chat; may be null if unknown

can_unarchive: bool

If true, the chat was automatically archived and can be moved back to the main chat list using addChatToList simultaneously with setting chat notification settings to default using setChatNotificationSettings

class pytdbot.types.ChatActionBarReportSpam(can_unarchive=False)[source]

Bases: TlObject, ChatActionBar

The chat can be reported as spam using the method reportChat with an empty option_id and message_ids. If the chat is a private chat with a user with an emoji status, then a notice about emoji status usage must be shown

Parameters:

can_unarchive (bool) – If true, the chat was automatically archived and can be moved back to the main chat list using addChatToList simultaneously with setting chat notification settings to default using setChatNotificationSettings

__init__(can_unarchive=False)[source]
Parameters:

can_unarchive (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatActionBarReportSpam]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatActionBar']

classmethod getType()[source]
Return type:

Literal['chatActionBarReportSpam']

to_dict()[source]
Return type:

dict

can_unarchive: bool

If true, the chat was automatically archived and can be moved back to the main chat list using addChatToList simultaneously with setting chat notification settings to default using setChatNotificationSettings

class pytdbot.types.ChatActionBarSharePhoneNumber[source]

Bases: TlObject, ChatActionBar

The chat is a private or secret chat with a mutual contact and the user’s phone number can be shared with the other user using the method sharePhoneNumber

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatActionBarSharePhoneNumber]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatActionBar']

classmethod getType()[source]
Return type:

Literal['chatActionBarSharePhoneNumber']

to_dict()[source]
Return type:

dict

class pytdbot.types.ChatActionCancel[source]

Bases: TlObject, ChatAction

The user has canceled the previous action

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatActionCancel]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatAction']

classmethod getType()[source]
Return type:

Literal['chatActionCancel']

to_dict()[source]
Return type:

dict

class pytdbot.types.ChatActionChoosingContact[source]

Bases: TlObject, ChatAction

The user is picking a contact to send

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatActionChoosingContact]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatAction']

classmethod getType()[source]
Return type:

Literal['chatActionChoosingContact']

to_dict()[source]
Return type:

dict

class pytdbot.types.ChatActionChoosingLocation[source]

Bases: TlObject, ChatAction

The user is picking a location or venue to send

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatActionChoosingLocation]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatAction']

classmethod getType()[source]
Return type:

Literal['chatActionChoosingLocation']

to_dict()[source]
Return type:

dict

class pytdbot.types.ChatActionChoosingSticker[source]

Bases: TlObject, ChatAction

The user is picking a sticker to send

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatActionChoosingSticker]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatAction']

classmethod getType()[source]
Return type:

Literal['chatActionChoosingSticker']

to_dict()[source]
Return type:

dict

class pytdbot.types.ChatActionRecordingVideo[source]

Bases: TlObject, ChatAction

The user is recording a video

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatActionRecordingVideo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatAction']

classmethod getType()[source]
Return type:

Literal['chatActionRecordingVideo']

to_dict()[source]
Return type:

dict

class pytdbot.types.ChatActionRecordingVideoNote[source]

Bases: TlObject, ChatAction

The user is recording a video note

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatActionRecordingVideoNote]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatAction']

classmethod getType()[source]
Return type:

Literal['chatActionRecordingVideoNote']

to_dict()[source]
Return type:

dict

class pytdbot.types.ChatActionRecordingVoiceNote[source]

Bases: TlObject, ChatAction

The user is recording a voice note

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatActionRecordingVoiceNote]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatAction']

classmethod getType()[source]
Return type:

Literal['chatActionRecordingVoiceNote']

to_dict()[source]
Return type:

dict

class pytdbot.types.ChatActionStartPlayingGame[source]

Bases: TlObject, ChatAction

The user has started to play a game

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatActionStartPlayingGame]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatAction']

classmethod getType()[source]
Return type:

Literal['chatActionStartPlayingGame']

to_dict()[source]
Return type:

dict

class pytdbot.types.ChatActionTyping[source]

Bases: TlObject, ChatAction

The user is typing a message

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatActionTyping]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatAction']

classmethod getType()[source]
Return type:

Literal['chatActionTyping']

to_dict()[source]
Return type:

dict

class pytdbot.types.ChatActionUploadingDocument(progress=0)[source]

Bases: TlObject, ChatAction

The user is uploading a document

Parameters:

progress (int) – Upload progress, as a percentage

__init__(progress=0)[source]
Parameters:

progress (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatActionUploadingDocument]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatAction']

classmethod getType()[source]
Return type:

Literal['chatActionUploadingDocument']

to_dict()[source]
Return type:

dict

progress: int

Upload progress, as a percentage

class pytdbot.types.ChatActionUploadingPhoto(progress=0)[source]

Bases: TlObject, ChatAction

The user is uploading a photo

Parameters:

progress (int) – Upload progress, as a percentage

__init__(progress=0)[source]
Parameters:

progress (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatActionUploadingPhoto]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatAction']

classmethod getType()[source]
Return type:

Literal['chatActionUploadingPhoto']

to_dict()[source]
Return type:

dict

progress: int

Upload progress, as a percentage

class pytdbot.types.ChatActionUploadingVideo(progress=0)[source]

Bases: TlObject, ChatAction

The user is uploading a video

Parameters:

progress (int) – Upload progress, as a percentage

__init__(progress=0)[source]
Parameters:

progress (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatActionUploadingVideo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatAction']

classmethod getType()[source]
Return type:

Literal['chatActionUploadingVideo']

to_dict()[source]
Return type:

dict

progress: int

Upload progress, as a percentage

class pytdbot.types.ChatActionUploadingVideoNote(progress=0)[source]

Bases: TlObject, ChatAction

The user is uploading a video note

Parameters:

progress (int) – Upload progress, as a percentage

__init__(progress=0)[source]
Parameters:

progress (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatActionUploadingVideoNote]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatAction']

classmethod getType()[source]
Return type:

Literal['chatActionUploadingVideoNote']

to_dict()[source]
Return type:

dict

progress: int

Upload progress, as a percentage

class pytdbot.types.ChatActionUploadingVoiceNote(progress=0)[source]

Bases: TlObject, ChatAction

The user is uploading a voice note

Parameters:

progress (int) – Upload progress, as a percentage

__init__(progress=0)[source]
Parameters:

progress (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatActionUploadingVoiceNote]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatAction']

classmethod getType()[source]
Return type:

Literal['chatActionUploadingVoiceNote']

to_dict()[source]
Return type:

dict

progress: int

Upload progress, as a percentage

class pytdbot.types.ChatActionWatchingAnimations(emoji='')[source]

Bases: TlObject, ChatAction

The user is watching animations sent by the other party by clicking on an animated emoji

Parameters:

emoji (str) – The animated emoji

__init__(emoji='')[source]
Parameters:

emoji (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatActionWatchingAnimations]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatAction']

classmethod getType()[source]
Return type:

Literal['chatActionWatchingAnimations']

to_dict()[source]
Return type:

dict

emoji: Optional[str]

The animated emoji

class pytdbot.types.ChatActiveStories(chat_id=0, list=None, order=0, can_be_archived=False, max_read_story_id=0, stories=None)[source]

Bases: TlObject

Describes active stories posted by a chat

Parameters:
  • chat_id (int) – Identifier of the chat that posted the stories

  • list ("types.StoryList") – Identifier of the story list in which the stories are shown; may be null if the stories aren’t shown in a story list

  • order (int) – A parameter used to determine order of the stories in the story list; 0 if the stories doesn’t need to be shown in the story list. Stories must be sorted by the pair (order, story_poster_chat_id) in descending order

  • can_be_archived (bool) – True, if the stories are shown in the main story list and can be archived; otherwise, the stories can be hidden from the main story list only by calling removeTopChat with topChatCategoryUsers and the chat_id. Stories of the current user can’t be archived nor hidden using removeTopChat

  • max_read_story_id (int) – Identifier of the last read active story

  • stories (List["types.StoryInfo"]) – Basic information about the stories; use getStory to get full information about the stories. The stories are in chronological order (i.e., in order of increasing story identifiers)

__init__(chat_id=0, list=None, order=0, can_be_archived=False, max_read_story_id=0, stories=None)[source]
Parameters:
  • chat_id (int)

  • list (StoryList | None)

  • order (int)

  • can_be_archived (bool)

  • max_read_story_id (int)

  • stories (List[StoryInfo] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatActiveStories]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatActiveStories']

classmethod getType()[source]
Return type:

Literal['chatActiveStories']

to_dict()[source]
Return type:

dict

can_be_archived: bool

True, if the stories are shown in the main story list and can be archived; otherwise, the stories can be hidden from the main story list only by calling removeTopChat with topChatCategoryUsers and the chat_id. Stories of the current user can’t be archived nor hidden using removeTopChat

chat_id: int

Identifier of the chat that posted the stories

list: Union[StoryListMain, StoryListArchive, None]

Identifier of the story list in which the stories are shown; may be null if the stories aren’t shown in a story list

max_read_story_id: int

Identifier of the last read active story

order: int

A parameter used to determine order of the stories in the story list; 0 if the stories doesn’t need to be shown in the story list. Stories must be sorted by the pair (order, story_poster_chat_id) in descending order

stories: List[StoryInfo]

Basic information about the stories; use getStory to get full information about the stories. The stories are in chronological order (i.e., in order of increasing story identifiers)

class pytdbot.types.ChatAdministrator(user_id=0, custom_title='', is_owner=False)[source]

Bases: TlObject

Contains information about a chat administrator

Parameters:
  • user_id (int) – User identifier of the administrator

  • custom_title (str) – Custom title of the administrator

  • is_owner (bool) – True, if the user is the owner of the chat

__init__(user_id=0, custom_title='', is_owner=False)[source]
Parameters:
  • user_id (int)

  • custom_title (str)

  • is_owner (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatAdministrator]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatAdministrator']

classmethod getType()[source]
Return type:

Literal['chatAdministrator']

to_dict()[source]
Return type:

dict

custom_title: Optional[str]

Custom title of the administrator

is_owner: bool

True, if the user is the owner of the chat

user_id: int

User identifier of the administrator

class pytdbot.types.ChatAdministratorRights(can_manage_chat=False, can_change_info=False, can_post_messages=False, can_edit_messages=False, can_delete_messages=False, can_invite_users=False, can_restrict_members=False, can_pin_messages=False, can_manage_topics=False, can_promote_members=False, can_manage_video_chats=False, can_post_stories=False, can_edit_stories=False, can_delete_stories=False, can_manage_direct_messages=False, is_anonymous=False)[source]

Bases: TlObject

Describes rights of the administrator

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

  • can_change_info (bool) – True, if the administrator can change the chat title, photo, and other settings

  • can_post_messages (bool) – True, if the administrator can create channel posts, approve suggested channel posts, or view channel statistics; applicable to channels only

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

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

  • can_invite_users (bool) – True, if the administrator can invite new users to the chat

  • can_restrict_members (bool) – True, if the administrator can restrict, ban, or unban chat members or view supergroup statistics; always true for channels

  • can_pin_messages (bool) – True, if the administrator can pin messages; applicable to basic groups and supergroups only

  • can_manage_topics (bool) – True, if the administrator can create, rename, close, reopen, hide, and unhide forum topics; applicable to forum supergroups only

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

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

  • can_post_stories (bool) – True, if the administrator can create new chat stories, or edit and delete posted stories; applicable to supergroups and channels only

  • can_edit_stories (bool) – True, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access story archive; applicable to supergroups and channels only

  • can_delete_stories (bool) – True, if the administrator can delete stories posted by other users; applicable to supergroups and channels only

  • can_manage_direct_messages (bool) – True, if the administrator can answer to channel direct messages; applicable to channels only

  • is_anonymous (bool) – True, if the administrator isn’t shown in the chat member list and sends messages anonymously; applicable to supergroups only

__init__(can_manage_chat=False, can_change_info=False, can_post_messages=False, can_edit_messages=False, can_delete_messages=False, can_invite_users=False, can_restrict_members=False, can_pin_messages=False, can_manage_topics=False, can_promote_members=False, can_manage_video_chats=False, can_post_stories=False, can_edit_stories=False, can_delete_stories=False, can_manage_direct_messages=False, is_anonymous=False)[source]
Parameters:
  • can_manage_chat (bool)

  • can_change_info (bool)

  • can_post_messages (bool)

  • can_edit_messages (bool)

  • can_delete_messages (bool)

  • can_invite_users (bool)

  • can_restrict_members (bool)

  • can_pin_messages (bool)

  • can_manage_topics (bool)

  • can_promote_members (bool)

  • can_manage_video_chats (bool)

  • can_post_stories (bool)

  • can_edit_stories (bool)

  • can_delete_stories (bool)

  • can_manage_direct_messages (bool)

  • is_anonymous (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatAdministratorRights]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatAdministratorRights']

classmethod getType()[source]
Return type:

Literal['chatAdministratorRights']

to_dict()[source]
Return type:

dict

can_change_info: bool

True, if the administrator can change the chat title, photo, and other settings

can_delete_messages: bool

True, if the administrator can delete messages of other users

can_delete_stories: bool

True, if the administrator can delete stories posted by other users; applicable to supergroups and channels only

can_edit_messages: bool

True, if the administrator can edit messages of other users and pin messages; applicable to channels only

can_edit_stories: bool

True, if the administrator can edit stories posted by other users, post stories to the chat page, pin chat stories, and access story archive; applicable to supergroups and channels only

can_invite_users: bool

True, if the administrator can invite new users to the chat

can_manage_chat: bool

True, if the administrator can access the chat event log, get boost list, see hidden supergroup and channel members, report supergroup spam messages, ignore slow mode, and send messages to the chat without paying Telegram Stars. Implied by any other privilege; applicable to supergroups and channels only

can_manage_direct_messages: bool

True, if the administrator can answer to channel direct messages; applicable to channels only

can_manage_topics: bool

True, if the administrator can create, rename, close, reopen, hide, and unhide forum topics; applicable to forum supergroups only

can_manage_video_chats: bool

True, if the administrator can manage video chats

can_pin_messages: bool

True, if the administrator can pin messages; applicable to basic groups and supergroups only

can_post_messages: bool

True, if the administrator can create channel posts, approve suggested channel posts, or view channel statistics; applicable to channels only

can_post_stories: bool

True, if the administrator can create new chat stories, or edit and delete posted stories; applicable to supergroups and channels only

can_promote_members: bool

True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that were directly or indirectly promoted by them

can_restrict_members: bool

True, if the administrator can restrict, ban, or unban chat members or view supergroup statistics; always true for channels

is_anonymous: bool

True, if the administrator isn’t shown in the chat member list and sends messages anonymously; applicable to supergroups only

class pytdbot.types.ChatAdministrators(administrators=None)[source]

Bases: TlObject

Represents a list of chat administrators

Parameters:

administrators (List["types.ChatAdministrator"]) – A list of chat administrators

__init__(administrators=None)[source]
Parameters:

administrators (List[ChatAdministrator] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatAdministrators]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatAdministrators']

classmethod getType()[source]
Return type:

Literal['chatAdministrators']

to_dict()[source]
Return type:

dict

administrators: List[ChatAdministrator]

A list of chat administrators

class pytdbot.types.ChatAvailableReactions[source]

Bases: object

Describes reactions available in the chat

class pytdbot.types.ChatAvailableReactionsAll(max_reaction_count=0)[source]

Bases: TlObject, ChatAvailableReactions

All reactions are available in the chat, excluding the paid reaction and custom reactions in channel chats

Parameters:

max_reaction_count (int) – The maximum allowed number of reactions per message; 1-11

__init__(max_reaction_count=0)[source]
Parameters:

max_reaction_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatAvailableReactionsAll]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatAvailableReactions']

classmethod getType()[source]
Return type:

Literal['chatAvailableReactionsAll']

to_dict()[source]
Return type:

dict

max_reaction_count: int

The maximum allowed number of reactions per message; 1-11

class pytdbot.types.ChatAvailableReactionsSome(reactions=None, max_reaction_count=0)[source]

Bases: TlObject, ChatAvailableReactions

Only specific reactions are available in the chat

Parameters:
  • reactions (List["types.ReactionType"]) – The list of reactions

  • max_reaction_count (int) – The maximum allowed number of reactions per message; 1-11

__init__(reactions=None, max_reaction_count=0)[source]
Parameters:
  • reactions (List[ReactionType] | None)

  • max_reaction_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatAvailableReactionsSome]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatAvailableReactions']

classmethod getType()[source]
Return type:

Literal['chatAvailableReactionsSome']

to_dict()[source]
Return type:

dict

max_reaction_count: int

The maximum allowed number of reactions per message; 1-11

reactions: List[ReactionType]

The list of reactions

class pytdbot.types.ChatBackground(background=None, dark_theme_dimming=0)[source]

Bases: TlObject

Describes a background set for a specific chat

Parameters:
  • background ("types.Background") – The background

  • dark_theme_dimming (int) – Dimming of the background in dark themes, as a percentage; 0-100. Applied only to Wallpaper and Fill types of background

__init__(background=None, dark_theme_dimming=0)[source]
Parameters:
  • background (Background | None)

  • dark_theme_dimming (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatBackground]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatBackground']

classmethod getType()[source]
Return type:

Literal['chatBackground']

to_dict()[source]
Return type:

dict

background: Optional[Background]

The background

dark_theme_dimming: int

Dimming of the background in dark themes, as a percentage; 0-100. Applied only to Wallpaper and Fill types of background

class pytdbot.types.ChatBoost(id='', count=0, source=None, start_date=0, expiration_date=0)[source]

Bases: TlObject

Describes a boost applied to a chat

Parameters:
  • id (str) – Unique identifier of the boost

  • count (int) – The number of identical boosts applied

  • source ("types.ChatBoostSource") – Source of the boost

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

  • expiration_date (int) – Point in time (Unix timestamp) when the boost will expire

__init__(id='', count=0, source=None, start_date=0, expiration_date=0)[source]
Parameters:
  • id (str)

  • count (int)

  • source (ChatBoostSource | None)

  • start_date (int)

  • expiration_date (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatBoost]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatBoost']

classmethod getType()[source]
Return type:

Literal['chatBoost']

to_dict()[source]
Return type:

dict

count: int

The number of identical boosts applied

expiration_date: int

Point in time (Unix timestamp) when the boost will expire

id: Optional[str]

Unique identifier of the boost

source: Union[ChatBoostSourceGiftCode, ChatBoostSourceGiveaway, ChatBoostSourcePremium, None]

Source of the boost

start_date: int

Point in time (Unix timestamp) when the chat was boosted

class pytdbot.types.ChatBoostFeatures(features=None, min_profile_background_custom_emoji_boost_level=0, min_background_custom_emoji_boost_level=0, min_emoji_status_boost_level=0, min_chat_theme_background_boost_level=0, min_custom_background_boost_level=0, min_custom_emoji_sticker_set_boost_level=0, min_automatic_translation_boost_level=0, min_speech_recognition_boost_level=0, min_sponsored_message_disable_boost_level=0)[source]

Bases: TlObject

Contains a list of features available on the first chat boost levels

Parameters:
  • features (List["types.ChatBoostLevelFeatures"]) – The list of features

  • min_profile_background_custom_emoji_boost_level (int) – The minimum boost level required to set custom emoji for profile background

  • min_background_custom_emoji_boost_level (int) – The minimum boost level required to set custom emoji for reply header and link preview background; for channel chats only

  • min_emoji_status_boost_level (int) – The minimum boost level required to set emoji status

  • min_chat_theme_background_boost_level (int) – The minimum boost level required to set a chat theme background as chat background

  • min_custom_background_boost_level (int) – The minimum boost level required to set custom chat background

  • min_custom_emoji_sticker_set_boost_level (int) – The minimum boost level required to set custom emoji sticker set for the chat; for supergroup chats only

  • min_automatic_translation_boost_level (int) – The minimum boost level allowing to enable automatic translation of messages for non-Premium users; for channel chats only

  • min_speech_recognition_boost_level (int) – The minimum boost level allowing to recognize speech in video note and voice note messages for non-Premium users; for supergroup chats only

  • min_sponsored_message_disable_boost_level (int) – The minimum boost level allowing to disable sponsored messages in the chat; for channel chats only

__init__(features=None, min_profile_background_custom_emoji_boost_level=0, min_background_custom_emoji_boost_level=0, min_emoji_status_boost_level=0, min_chat_theme_background_boost_level=0, min_custom_background_boost_level=0, min_custom_emoji_sticker_set_boost_level=0, min_automatic_translation_boost_level=0, min_speech_recognition_boost_level=0, min_sponsored_message_disable_boost_level=0)[source]
Parameters:
  • features (List[ChatBoostLevelFeatures] | None)

  • min_profile_background_custom_emoji_boost_level (int)

  • min_background_custom_emoji_boost_level (int)

  • min_emoji_status_boost_level (int)

  • min_chat_theme_background_boost_level (int)

  • min_custom_background_boost_level (int)

  • min_custom_emoji_sticker_set_boost_level (int)

  • min_automatic_translation_boost_level (int)

  • min_speech_recognition_boost_level (int)

  • min_sponsored_message_disable_boost_level (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatBoostFeatures]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatBoostFeatures']

classmethod getType()[source]
Return type:

Literal['chatBoostFeatures']

to_dict()[source]
Return type:

dict

features: List[ChatBoostLevelFeatures]

The list of features

min_automatic_translation_boost_level: int

The minimum boost level allowing to enable automatic translation of messages for non-Premium users; for channel chats only

min_background_custom_emoji_boost_level: int

The minimum boost level required to set custom emoji for reply header and link preview background; for channel chats only

min_chat_theme_background_boost_level: int

The minimum boost level required to set a chat theme background as chat background

min_custom_background_boost_level: int

The minimum boost level required to set custom chat background

min_custom_emoji_sticker_set_boost_level: int

The minimum boost level required to set custom emoji sticker set for the chat; for supergroup chats only

min_emoji_status_boost_level: int

The minimum boost level required to set emoji status

min_profile_background_custom_emoji_boost_level: int

The minimum boost level required to set custom emoji for profile background

min_speech_recognition_boost_level: int

The minimum boost level allowing to recognize speech in video note and voice note messages for non-Premium users; for supergroup chats only

min_sponsored_message_disable_boost_level: int

The minimum boost level allowing to disable sponsored messages in the chat; for channel chats only

class pytdbot.types.ChatBoostLevelFeatures(level=0, story_per_day_count=0, custom_emoji_reaction_count=0, title_color_count=0, profile_accent_color_count=0, can_set_profile_background_custom_emoji=False, accent_color_count=0, can_set_background_custom_emoji=False, can_set_emoji_status=False, chat_theme_background_count=0, can_set_custom_background=False, can_set_custom_emoji_sticker_set=False, can_enable_automatic_translation=False, can_recognize_speech=False, can_disable_sponsored_messages=False)[source]

Bases: TlObject

Contains a list of features available on a specific chat boost level

Parameters:
  • level (int) – Target chat boost level

  • story_per_day_count (int) – Number of stories that the chat can publish daily

  • custom_emoji_reaction_count (int) – Number of custom emoji reactions that can be added to the list of available reactions

  • title_color_count (int) – Number of custom colors for chat title

  • profile_accent_color_count (int) – Number of custom colors for profile photo background

  • can_set_profile_background_custom_emoji (bool) – True, if custom emoji for profile background can be set

  • accent_color_count (int) – Number of custom colors for background of empty chat photo, replies to messages and link previews

  • can_set_background_custom_emoji (bool) – True, if custom emoji for reply header and link preview background can be set

  • can_set_emoji_status (bool) – True, if emoji status can be set

  • chat_theme_background_count (int) – Number of chat theme backgrounds that can be set as chat background

  • can_set_custom_background (bool) – True, if custom background can be set in the chat for all users

  • can_set_custom_emoji_sticker_set (bool) – True, if custom emoji sticker set can be set for the chat

  • can_enable_automatic_translation (bool) – True, if automatic translation of messages can be enabled in the chat

  • can_recognize_speech (bool) – True, if speech recognition can be used for video note and voice note messages by all users

  • can_disable_sponsored_messages (bool) – True, if sponsored messages can be disabled in the chat

__init__(level=0, story_per_day_count=0, custom_emoji_reaction_count=0, title_color_count=0, profile_accent_color_count=0, can_set_profile_background_custom_emoji=False, accent_color_count=0, can_set_background_custom_emoji=False, can_set_emoji_status=False, chat_theme_background_count=0, can_set_custom_background=False, can_set_custom_emoji_sticker_set=False, can_enable_automatic_translation=False, can_recognize_speech=False, can_disable_sponsored_messages=False)[source]
Parameters:
  • level (int)

  • story_per_day_count (int)

  • custom_emoji_reaction_count (int)

  • title_color_count (int)

  • profile_accent_color_count (int)

  • can_set_profile_background_custom_emoji (bool)

  • accent_color_count (int)

  • can_set_background_custom_emoji (bool)

  • can_set_emoji_status (bool)

  • chat_theme_background_count (int)

  • can_set_custom_background (bool)

  • can_set_custom_emoji_sticker_set (bool)

  • can_enable_automatic_translation (bool)

  • can_recognize_speech (bool)

  • can_disable_sponsored_messages (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatBoostLevelFeatures]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatBoostLevelFeatures']

classmethod getType()[source]
Return type:

Literal['chatBoostLevelFeatures']

to_dict()[source]
Return type:

dict

accent_color_count: int

Number of custom colors for background of empty chat photo, replies to messages and link previews

can_disable_sponsored_messages: bool

True, if sponsored messages can be disabled in the chat

can_enable_automatic_translation: bool

True, if automatic translation of messages can be enabled in the chat

can_recognize_speech: bool

True, if speech recognition can be used for video note and voice note messages by all users

can_set_background_custom_emoji: bool

True, if custom emoji for reply header and link preview background can be set

can_set_custom_background: bool

True, if custom background can be set in the chat for all users

can_set_custom_emoji_sticker_set: bool

True, if custom emoji sticker set can be set for the chat

can_set_emoji_status: bool

True, if emoji status can be set

can_set_profile_background_custom_emoji: bool

True, if custom emoji for profile background can be set

chat_theme_background_count: int

Number of chat theme backgrounds that can be set as chat background

custom_emoji_reaction_count: int

Number of custom emoji reactions that can be added to the list of available reactions

level: int

Target chat boost level

profile_accent_color_count: int

Number of custom colors for profile photo background

story_per_day_count: int

Number of stories that the chat can publish daily

title_color_count: int

Number of custom colors for chat title

class pytdbot.types.ChatBoostLink(link='', is_public=False)[source]

Bases: TlObject

Contains an HTTPS link to boost a chat

Parameters:
  • link (str) – The link

  • is_public (bool) – True, if the link will work for non-members of the chat

__init__(link='', is_public=False)[source]
Parameters:
  • link (str)

  • is_public (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatBoostLink]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatBoostLink']

classmethod getType()[source]
Return type:

Literal['chatBoostLink']

to_dict()[source]
Return type:

dict

is_public: bool

True, if the link will work for non-members of the chat

link: Optional[str]

The link

class pytdbot.types.ChatBoostLinkInfo(is_public=False, chat_id=0)[source]

Bases: TlObject

Contains information about a link to boost a chat

Parameters:
  • is_public (bool) – True, if the link will work for non-members of the chat

  • chat_id (int) – Identifier of the chat to which the link points; 0 if the chat isn’t found

__init__(is_public=False, chat_id=0)[source]
Parameters:
  • is_public (bool)

  • chat_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatBoostLinkInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatBoostLinkInfo']

classmethod getType()[source]
Return type:

Literal['chatBoostLinkInfo']

to_dict()[source]
Return type:

dict

chat_id: int

Identifier of the chat to which the link points; 0 if the chat isn’t found

is_public: bool

True, if the link will work for non-members of the chat

class pytdbot.types.ChatBoostSlot(slot_id=0, currently_boosted_chat_id=0, start_date=0, expiration_date=0, cooldown_until_date=0)[source]

Bases: TlObject

Describes a slot for chat boost

Parameters:
  • slot_id (int) – Unique identifier of the slot

  • currently_boosted_chat_id (int) – Identifier of the currently boosted chat; 0 if none

  • start_date (int) – Point in time (Unix timestamp) when the chat was boosted; 0 if none

  • expiration_date (int) – Point in time (Unix timestamp) when the boost will expire

  • cooldown_until_date (int) – Point in time (Unix timestamp) after which the boost can be used for another chat

__init__(slot_id=0, currently_boosted_chat_id=0, start_date=0, expiration_date=0, cooldown_until_date=0)[source]
Parameters:
  • slot_id (int)

  • currently_boosted_chat_id (int)

  • start_date (int)

  • expiration_date (int)

  • cooldown_until_date (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatBoostSlot]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatBoostSlot']

classmethod getType()[source]
Return type:

Literal['chatBoostSlot']

to_dict()[source]
Return type:

dict

cooldown_until_date: int

Point in time (Unix timestamp) after which the boost can be used for another chat

currently_boosted_chat_id: int

Identifier of the currently boosted chat; 0 if none

expiration_date: int

Point in time (Unix timestamp) when the boost will expire

slot_id: int

Unique identifier of the slot

start_date: int

Point in time (Unix timestamp) when the chat was boosted; 0 if none

class pytdbot.types.ChatBoostSlots(slots=None)[source]

Bases: TlObject

Contains a list of chat boost slots

Parameters:

slots (List["types.ChatBoostSlot"]) – List of boost slots

__init__(slots=None)[source]
Parameters:

slots (List[ChatBoostSlot] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatBoostSlots]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatBoostSlots']

classmethod getType()[source]
Return type:

Literal['chatBoostSlots']

to_dict()[source]
Return type:

dict

slots: List[ChatBoostSlot]

List of boost slots

class pytdbot.types.ChatBoostSource[source]

Bases: object

Describes source of a chat boost

class pytdbot.types.ChatBoostSourceGiftCode(user_id=0, gift_code='')[source]

Bases: TlObject, ChatBoostSource

The chat created a Telegram Premium gift code for a user

Parameters:
  • user_id (int) – Identifier of a user, for which the gift code was created

  • gift_code (str) – The created Telegram Premium gift code, which is known only if this is a gift code for the current user, or it has already been claimed

__init__(user_id=0, gift_code='')[source]
Parameters:
  • user_id (int)

  • gift_code (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatBoostSourceGiftCode]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatBoostSource']

classmethod getType()[source]
Return type:

Literal['chatBoostSourceGiftCode']

to_dict()[source]
Return type:

dict

gift_code: Optional[str]

The created Telegram Premium gift code, which is known only if this is a gift code for the current user, or it has already been claimed

user_id: int

Identifier of a user, for which the gift code was created

class pytdbot.types.ChatBoostSourceGiveaway(user_id=0, gift_code='', star_count=0, giveaway_message_id=0, is_unclaimed=False)[source]

Bases: TlObject, ChatBoostSource

The chat created a giveaway

Parameters:
  • user_id (int) – Identifier of a user that won in the giveaway; 0 if none

  • gift_code (str) – The created Telegram Premium gift code if it was used by the user or can be claimed by the current user; an empty string otherwise; for Telegram Premium giveways only

  • star_count (int) – Number of Telegram Stars distributed among winners of the giveaway

  • giveaway_message_id (int) – Identifier of the corresponding giveaway message; can be an identifier of a deleted message

  • is_unclaimed (bool) – True, if the winner for the corresponding giveaway prize wasn’t chosen, because there were not enough participants

__init__(user_id=0, gift_code='', star_count=0, giveaway_message_id=0, is_unclaimed=False)[source]
Parameters:
  • user_id (int)

  • gift_code (str)

  • star_count (int)

  • giveaway_message_id (int)

  • is_unclaimed (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatBoostSourceGiveaway]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatBoostSource']

classmethod getType()[source]
Return type:

Literal['chatBoostSourceGiveaway']

to_dict()[source]
Return type:

dict

gift_code: Optional[str]

The created Telegram Premium gift code if it was used by the user or can be claimed by the current user; an empty string otherwise; for Telegram Premium giveways only

giveaway_message_id: int

Identifier of the corresponding giveaway message; can be an identifier of a deleted message

is_unclaimed: bool

True, if the winner for the corresponding giveaway prize wasn’t chosen, because there were not enough participants

star_count: int

Number of Telegram Stars distributed among winners of the giveaway

user_id: int

Identifier of a user that won in the giveaway; 0 if none

class pytdbot.types.ChatBoostSourcePremium(user_id=0)[source]

Bases: TlObject, ChatBoostSource

A user with Telegram Premium subscription or gifted Telegram Premium boosted the chat

Parameters:

user_id (int) – Identifier of the user

__init__(user_id=0)[source]
Parameters:

user_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatBoostSourcePremium]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatBoostSource']

classmethod getType()[source]
Return type:

Literal['chatBoostSourcePremium']

to_dict()[source]
Return type:

dict

user_id: int

Identifier of the user

class pytdbot.types.ChatBoostStatus(boost_url='', applied_slot_ids=None, level=0, gift_code_boost_count=0, boost_count=0, current_level_boost_count=0, next_level_boost_count=0, premium_member_count=0, premium_member_percentage=0.0, prepaid_giveaways=None)[source]

Bases: TlObject

Describes current boost status of a chat

Parameters:
  • boost_url (str) – An HTTP URL, which can be used to boost the chat

  • applied_slot_ids (List[int]) – Identifiers of boost slots of the current user applied to the chat

  • level (int) – Current boost level of the chat

  • gift_code_boost_count (int) – The number of boosts received by the chat from created Telegram Premium gift codes and giveaways; always 0 if the current user isn’t an administrator in the chat

  • boost_count (int) – The number of boosts received by the chat

  • current_level_boost_count (int) – The number of boosts added to reach the current level

  • next_level_boost_count (int) – The number of boosts needed to reach the next level; 0 if the next level isn’t available

  • premium_member_count (int) – Approximate number of Telegram Premium subscribers joined the chat; always 0 if the current user isn’t an administrator in the chat

  • premium_member_percentage (float) – A percentage of Telegram Premium subscribers joined the chat; always 0 if the current user isn’t an administrator in the chat

  • prepaid_giveaways (List["types.PrepaidGiveaway"]) – The list of prepaid giveaways available for the chat; only for chat administrators

__init__(boost_url='', applied_slot_ids=None, level=0, gift_code_boost_count=0, boost_count=0, current_level_boost_count=0, next_level_boost_count=0, premium_member_count=0, premium_member_percentage=0.0, prepaid_giveaways=None)[source]
Parameters:
  • boost_url (str)

  • applied_slot_ids (List[int] | None)

  • level (int)

  • gift_code_boost_count (int)

  • boost_count (int)

  • current_level_boost_count (int)

  • next_level_boost_count (int)

  • premium_member_count (int)

  • premium_member_percentage (float)

  • prepaid_giveaways (List[PrepaidGiveaway] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatBoostStatus]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatBoostStatus']

classmethod getType()[source]
Return type:

Literal['chatBoostStatus']

to_dict()[source]
Return type:

dict

applied_slot_ids: List[int]

Identifiers of boost slots of the current user applied to the chat

boost_count: int

The number of boosts received by the chat

boost_url: Optional[str]

An HTTP URL, which can be used to boost the chat

current_level_boost_count: int

The number of boosts added to reach the current level

gift_code_boost_count: int

The number of boosts received by the chat from created Telegram Premium gift codes and giveaways; always 0 if the current user isn’t an administrator in the chat

level: int

Current boost level of the chat

next_level_boost_count: int

The number of boosts needed to reach the next level; 0 if the next level isn’t available

premium_member_count: int

Approximate number of Telegram Premium subscribers joined the chat; always 0 if the current user isn’t an administrator in the chat

premium_member_percentage: float

A percentage of Telegram Premium subscribers joined the chat; always 0 if the current user isn’t an administrator in the chat

prepaid_giveaways: List[PrepaidGiveaway]

The list of prepaid giveaways available for the chat; only for chat administrators

class pytdbot.types.ChatEvent(id=0, date=0, member_id=None, action=None)[source]

Bases: TlObject

Represents a chat event

Parameters:
  • id (int) – Chat event identifier

  • date (int) – Point in time (Unix timestamp) when the event happened

  • member_id ("types.MessageSender") – Identifier of the user or chat who performed the action

  • action ("types.ChatEventAction") – The action

__init__(id=0, date=0, member_id=None, action=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEvent]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEvent']

classmethod getType()[source]
Return type:

Literal['chatEvent']

to_dict()[source]
Return type:

dict

action: Union[ChatEventMessageEdited, ChatEventMessageDeleted, ChatEventMessagePinned, ChatEventMessageUnpinned, ChatEventPollStopped, ChatEventMemberJoined, ChatEventMemberJoinedByInviteLink, ChatEventMemberJoinedByRequest, ChatEventMemberInvited, ChatEventMemberLeft, ChatEventMemberPromoted, ChatEventMemberRestricted, ChatEventMemberSubscriptionExtended, ChatEventAvailableReactionsChanged, ChatEventBackgroundChanged, ChatEventDescriptionChanged, ChatEventEmojiStatusChanged, ChatEventLinkedChatChanged, ChatEventLocationChanged, ChatEventMessageAutoDeleteTimeChanged, ChatEventPermissionsChanged, ChatEventPhotoChanged, ChatEventSlowModeDelayChanged, ChatEventStickerSetChanged, ChatEventCustomEmojiStickerSetChanged, ChatEventTitleChanged, ChatEventUsernameChanged, ChatEventActiveUsernamesChanged, ChatEventAccentColorChanged, ChatEventProfileAccentColorChanged, ChatEventHasProtectedContentToggled, ChatEventInvitesToggled, ChatEventIsAllHistoryAvailableToggled, ChatEventHasAggressiveAntiSpamEnabledToggled, ChatEventSignMessagesToggled, ChatEventShowMessageSenderToggled, ChatEventAutomaticTranslationToggled, ChatEventInviteLinkEdited, ChatEventInviteLinkRevoked, ChatEventInviteLinkDeleted, ChatEventVideoChatCreated, ChatEventVideoChatEnded, ChatEventVideoChatMuteNewParticipantsToggled, ChatEventVideoChatParticipantIsMutedToggled, ChatEventVideoChatParticipantVolumeLevelChanged, ChatEventIsForumToggled, ChatEventForumTopicCreated, ChatEventForumTopicEdited, ChatEventForumTopicToggleIsClosed, ChatEventForumTopicToggleIsHidden, ChatEventForumTopicDeleted, ChatEventForumTopicPinned, None]

The action

date: int

Point in time (Unix timestamp) when the event happened

id: int

Chat event identifier

member_id: Union[MessageSenderUser, MessageSenderChat, None]

Identifier of the user or chat who performed the action

class pytdbot.types.ChatEventAccentColorChanged(old_accent_color_id=0, old_background_custom_emoji_id=0, new_accent_color_id=0, new_background_custom_emoji_id=0)[source]

Bases: TlObject, ChatEventAction

The chat accent color or background custom emoji were changed

Parameters:
  • old_accent_color_id (int) – Previous identifier of chat accent color

  • old_background_custom_emoji_id (int) – Previous identifier of the custom emoji; 0 if none

  • new_accent_color_id (int) – New identifier of chat accent color

  • new_background_custom_emoji_id (int) – New identifier of the custom emoji; 0 if none

__init__(old_accent_color_id=0, old_background_custom_emoji_id=0, new_accent_color_id=0, new_background_custom_emoji_id=0)[source]
Parameters:
  • old_accent_color_id (int)

  • old_background_custom_emoji_id (int)

  • new_accent_color_id (int)

  • new_background_custom_emoji_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventAccentColorChanged]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventAccentColorChanged']

to_dict()[source]
Return type:

dict

new_accent_color_id: int

New identifier of chat accent color

new_background_custom_emoji_id: int

New identifier of the custom emoji; 0 if none

old_accent_color_id: int

Previous identifier of chat accent color

old_background_custom_emoji_id: int

Previous identifier of the custom emoji; 0 if none

class pytdbot.types.ChatEventAction[source]

Bases: object

Represents a chat event

class pytdbot.types.ChatEventActiveUsernamesChanged(old_usernames=None, new_usernames=None)[source]

Bases: TlObject, ChatEventAction

The chat active usernames were changed

Parameters:
  • old_usernames (List[str]) – Previous list of active usernames

  • new_usernames (List[str]) – New list of active usernames

__init__(old_usernames=None, new_usernames=None)[source]
Parameters:
  • old_usernames (List[str] | None)

  • new_usernames (List[str] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventActiveUsernamesChanged]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventActiveUsernamesChanged']

to_dict()[source]
Return type:

dict

new_usernames: List[str]

New list of active usernames

old_usernames: List[str]

Previous list of active usernames

class pytdbot.types.ChatEventAutomaticTranslationToggled(has_automatic_translation=False)[source]

Bases: TlObject, ChatEventAction

The has_automatic_translation setting of a channel was toggled

Parameters:

has_automatic_translation (bool) – New value of has_automatic_translation

__init__(has_automatic_translation=False)[source]
Parameters:

has_automatic_translation (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventAutomaticTranslationToggled]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventAutomaticTranslationToggled']

to_dict()[source]
Return type:

dict

has_automatic_translation: bool

New value of has_automatic_translation

class pytdbot.types.ChatEventAvailableReactionsChanged(old_available_reactions=None, new_available_reactions=None)[source]

Bases: TlObject, ChatEventAction

The chat available reactions were changed

Parameters:
  • old_available_reactions ("types.ChatAvailableReactions") – Previous chat available reactions

  • new_available_reactions ("types.ChatAvailableReactions") – New chat available reactions

__init__(old_available_reactions=None, new_available_reactions=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventAvailableReactionsChanged]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventAvailableReactionsChanged']

to_dict()[source]
Return type:

dict

new_available_reactions: Union[ChatAvailableReactionsAll, ChatAvailableReactionsSome, None]

New chat available reactions

old_available_reactions: Union[ChatAvailableReactionsAll, ChatAvailableReactionsSome, None]

Previous chat available reactions

class pytdbot.types.ChatEventBackgroundChanged(old_background=None, new_background=None)[source]

Bases: TlObject, ChatEventAction

The chat background was changed

Parameters:
  • old_background ("types.ChatBackground") – Previous background; may be null if none

  • new_background ("types.ChatBackground") – New background; may be null if none

__init__(old_background=None, new_background=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventBackgroundChanged]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventBackgroundChanged']

to_dict()[source]
Return type:

dict

new_background: Optional[ChatBackground]

New background; may be null if none

old_background: Optional[ChatBackground]

Previous background; may be null if none

class pytdbot.types.ChatEventCustomEmojiStickerSetChanged(old_sticker_set_id=0, new_sticker_set_id=0)[source]

Bases: TlObject, ChatEventAction

The supergroup sticker set with allowed custom emoji was changed

Parameters:
  • old_sticker_set_id (int) – Previous identifier of the chat sticker set; 0 if none

  • new_sticker_set_id (int) – New identifier of the chat sticker set; 0 if none

__init__(old_sticker_set_id=0, new_sticker_set_id=0)[source]
Parameters:
  • old_sticker_set_id (int)

  • new_sticker_set_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventCustomEmojiStickerSetChanged]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventCustomEmojiStickerSetChanged']

to_dict()[source]
Return type:

dict

new_sticker_set_id: int

New identifier of the chat sticker set; 0 if none

old_sticker_set_id: int

Previous identifier of the chat sticker set; 0 if none

class pytdbot.types.ChatEventDescriptionChanged(old_description='', new_description='')[source]

Bases: TlObject, ChatEventAction

The chat description was changed

Parameters:
  • old_description (str) – Previous chat description

  • new_description (str) – New chat description

__init__(old_description='', new_description='')[source]
Parameters:
  • old_description (str)

  • new_description (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventDescriptionChanged]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventDescriptionChanged']

to_dict()[source]
Return type:

dict

new_description: Optional[str]

New chat description

old_description: Optional[str]

Previous chat description

class pytdbot.types.ChatEventEmojiStatusChanged(old_emoji_status=None, new_emoji_status=None)[source]

Bases: TlObject, ChatEventAction

The chat emoji status was changed

Parameters:
  • old_emoji_status ("types.EmojiStatus") – Previous emoji status; may be null if none

  • new_emoji_status ("types.EmojiStatus") – New emoji status; may be null if none

__init__(old_emoji_status=None, new_emoji_status=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventEmojiStatusChanged]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventEmojiStatusChanged']

to_dict()[source]
Return type:

dict

new_emoji_status: Optional[EmojiStatus]

New emoji status; may be null if none

old_emoji_status: Optional[EmojiStatus]

Previous emoji status; may be null if none

class pytdbot.types.ChatEventForumTopicCreated(topic_info=None)[source]

Bases: TlObject, ChatEventAction

A new forum topic was created

Parameters:

topic_info ("types.ForumTopicInfo") – Information about the topic

__init__(topic_info=None)[source]
Parameters:

topic_info (ForumTopicInfo | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventForumTopicCreated]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventForumTopicCreated']

to_dict()[source]
Return type:

dict

topic_info: Optional[ForumTopicInfo]

Information about the topic

class pytdbot.types.ChatEventForumTopicDeleted(topic_info=None)[source]

Bases: TlObject, ChatEventAction

A forum topic was deleted

Parameters:

topic_info ("types.ForumTopicInfo") – Information about the topic

__init__(topic_info=None)[source]
Parameters:

topic_info (ForumTopicInfo | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventForumTopicDeleted]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventForumTopicDeleted']

to_dict()[source]
Return type:

dict

topic_info: Optional[ForumTopicInfo]

Information about the topic

class pytdbot.types.ChatEventForumTopicEdited(old_topic_info=None, new_topic_info=None)[source]

Bases: TlObject, ChatEventAction

A forum topic was edited

Parameters:
  • old_topic_info ("types.ForumTopicInfo") – Old information about the topic

  • new_topic_info ("types.ForumTopicInfo") – New information about the topic

__init__(old_topic_info=None, new_topic_info=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventForumTopicEdited]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventForumTopicEdited']

to_dict()[source]
Return type:

dict

new_topic_info: Optional[ForumTopicInfo]

New information about the topic

old_topic_info: Optional[ForumTopicInfo]

Old information about the topic

class pytdbot.types.ChatEventForumTopicPinned(old_topic_info=None, new_topic_info=None)[source]

Bases: TlObject, ChatEventAction

A pinned forum topic was changed

Parameters:
  • old_topic_info ("types.ForumTopicInfo") – Information about the old pinned topic; may be null

  • new_topic_info ("types.ForumTopicInfo") – Information about the new pinned topic; may be null

__init__(old_topic_info=None, new_topic_info=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventForumTopicPinned]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventForumTopicPinned']

to_dict()[source]
Return type:

dict

new_topic_info: Optional[ForumTopicInfo]

Information about the new pinned topic; may be null

old_topic_info: Optional[ForumTopicInfo]

Information about the old pinned topic; may be null

class pytdbot.types.ChatEventForumTopicToggleIsClosed(topic_info=None)[source]

Bases: TlObject, ChatEventAction

A forum topic was closed or reopened

Parameters:

topic_info ("types.ForumTopicInfo") – New information about the topic

__init__(topic_info=None)[source]
Parameters:

topic_info (ForumTopicInfo | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventForumTopicToggleIsClosed]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventForumTopicToggleIsClosed']

to_dict()[source]
Return type:

dict

topic_info: Optional[ForumTopicInfo]

New information about the topic

class pytdbot.types.ChatEventForumTopicToggleIsHidden(topic_info=None)[source]

Bases: TlObject, ChatEventAction

The General forum topic was hidden or unhidden

Parameters:

topic_info ("types.ForumTopicInfo") – New information about the topic

__init__(topic_info=None)[source]
Parameters:

topic_info (ForumTopicInfo | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventForumTopicToggleIsHidden]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventForumTopicToggleIsHidden']

to_dict()[source]
Return type:

dict

topic_info: Optional[ForumTopicInfo]

New information about the topic

class pytdbot.types.ChatEventHasAggressiveAntiSpamEnabledToggled(has_aggressive_anti_spam_enabled=False)[source]

Bases: TlObject, ChatEventAction

The has_aggressive_anti_spam_enabled setting of a supergroup was toggled

Parameters:

has_aggressive_anti_spam_enabled (bool) – New value of has_aggressive_anti_spam_enabled

__init__(has_aggressive_anti_spam_enabled=False)[source]
Parameters:

has_aggressive_anti_spam_enabled (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventHasAggressiveAntiSpamEnabledToggled]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventHasAggressiveAntiSpamEnabledToggled']

to_dict()[source]
Return type:

dict

has_aggressive_anti_spam_enabled: bool

New value of has_aggressive_anti_spam_enabled

class pytdbot.types.ChatEventHasProtectedContentToggled(has_protected_content=False)[source]

Bases: TlObject, ChatEventAction

The has_protected_content setting of a channel was toggled

Parameters:

has_protected_content (bool) – New value of has_protected_content

__init__(has_protected_content=False)[source]
Parameters:

has_protected_content (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventHasProtectedContentToggled]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventHasProtectedContentToggled']

to_dict()[source]
Return type:

dict

has_protected_content: bool

New value of has_protected_content

class pytdbot.types.ChatEventInviteLinkDeleted(invite_link=None)[source]

Bases: TlObject, ChatEventAction

A revoked chat invite link was deleted

Parameters:

invite_link ("types.ChatInviteLink") – The invite link

__init__(invite_link=None)[source]
Parameters:

invite_link (ChatInviteLink | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventInviteLinkDeleted]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventInviteLinkDeleted']

to_dict()[source]
Return type:

dict

invite_link: Optional[ChatInviteLink]

The invite link

class pytdbot.types.ChatEventInviteLinkEdited(old_invite_link=None, new_invite_link=None)[source]

Bases: TlObject, ChatEventAction

A chat invite link was edited

Parameters:
  • old_invite_link ("types.ChatInviteLink") – Previous information about the invite link

  • new_invite_link ("types.ChatInviteLink") – New information about the invite link

__init__(old_invite_link=None, new_invite_link=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventInviteLinkEdited]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventInviteLinkEdited']

to_dict()[source]
Return type:

dict

new_invite_link: Optional[ChatInviteLink]

New information about the invite link

old_invite_link: Optional[ChatInviteLink]

Previous information about the invite link

class pytdbot.types.ChatEventInviteLinkRevoked(invite_link=None)[source]

Bases: TlObject, ChatEventAction

A chat invite link was revoked

Parameters:

invite_link ("types.ChatInviteLink") – The invite link

__init__(invite_link=None)[source]
Parameters:

invite_link (ChatInviteLink | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventInviteLinkRevoked]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventInviteLinkRevoked']

to_dict()[source]
Return type:

dict

invite_link: Optional[ChatInviteLink]

The invite link

class pytdbot.types.ChatEventInvitesToggled(can_invite_users=False)[source]

Bases: TlObject, ChatEventAction

The can_invite_users permission of a supergroup chat was toggled

Parameters:

can_invite_users (bool) – New value of can_invite_users permission

__init__(can_invite_users=False)[source]
Parameters:

can_invite_users (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventInvitesToggled]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventInvitesToggled']

to_dict()[source]
Return type:

dict

can_invite_users: bool

New value of can_invite_users permission

class pytdbot.types.ChatEventIsAllHistoryAvailableToggled(is_all_history_available=False)[source]

Bases: TlObject, ChatEventAction

The is_all_history_available setting of a supergroup was toggled

Parameters:

is_all_history_available (bool) – New value of is_all_history_available

__init__(is_all_history_available=False)[source]
Parameters:

is_all_history_available (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventIsAllHistoryAvailableToggled]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventIsAllHistoryAvailableToggled']

to_dict()[source]
Return type:

dict

is_all_history_available: bool

New value of is_all_history_available

class pytdbot.types.ChatEventIsForumToggled(is_forum=False)[source]

Bases: TlObject, ChatEventAction

The is_forum setting of a channel was toggled

Parameters:

is_forum (bool) – New value of is_forum

__init__(is_forum=False)[source]
Parameters:

is_forum (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventIsForumToggled]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventIsForumToggled']

to_dict()[source]
Return type:

dict

is_forum: bool

New value of is_forum

class pytdbot.types.ChatEventLinkedChatChanged(old_linked_chat_id=0, new_linked_chat_id=0)[source]

Bases: TlObject, ChatEventAction

The linked chat of a supergroup was changed

Parameters:
  • old_linked_chat_id (int) – Previous supergroup linked chat identifier

  • new_linked_chat_id (int) – New supergroup linked chat identifier

__init__(old_linked_chat_id=0, new_linked_chat_id=0)[source]
Parameters:
  • old_linked_chat_id (int)

  • new_linked_chat_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventLinkedChatChanged]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventLinkedChatChanged']

to_dict()[source]
Return type:

dict

new_linked_chat_id: int

New supergroup linked chat identifier

old_linked_chat_id: int

Previous supergroup linked chat identifier

class pytdbot.types.ChatEventLocationChanged(old_location=None, new_location=None)[source]

Bases: TlObject, ChatEventAction

The supergroup location was changed

Parameters:
  • old_location ("types.ChatLocation") – Previous location; may be null

  • new_location ("types.ChatLocation") – New location; may be null

__init__(old_location=None, new_location=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventLocationChanged]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventLocationChanged']

to_dict()[source]
Return type:

dict

new_location: Optional[ChatLocation]

New location; may be null

old_location: Optional[ChatLocation]

Previous location; may be null

class pytdbot.types.ChatEventLogFilters(message_edits=False, message_deletions=False, message_pins=False, member_joins=False, member_leaves=False, member_invites=False, member_promotions=False, member_restrictions=False, info_changes=False, setting_changes=False, invite_link_changes=False, video_chat_changes=False, forum_changes=False, subscription_extensions=False)[source]

Bases: TlObject

Represents a set of filters used to obtain a chat event log

Parameters:
  • message_edits (bool) – True, if message edits need to be returned

  • message_deletions (bool) – True, if message deletions need to be returned

  • message_pins (bool) – True, if pin/unpin events need to be returned

  • member_joins (bool) – True, if members joining events need to be returned

  • member_leaves (bool) – True, if members leaving events need to be returned

  • member_invites (bool) – True, if invited member events need to be returned

  • member_promotions (bool) – True, if member promotion/demotion events need to be returned

  • member_restrictions (bool) – True, if member restricted/unrestricted/banned/unbanned events need to be returned

  • info_changes (bool) – True, if changes in chat information need to be returned

  • setting_changes (bool) – True, if changes in chat settings need to be returned

  • invite_link_changes (bool) – True, if changes to invite links need to be returned

  • video_chat_changes (bool) – True, if video chat actions need to be returned

  • forum_changes (bool) – True, if forum-related actions need to be returned

  • subscription_extensions (bool) – True, if subscription extensions need to be returned

__init__(message_edits=False, message_deletions=False, message_pins=False, member_joins=False, member_leaves=False, member_invites=False, member_promotions=False, member_restrictions=False, info_changes=False, setting_changes=False, invite_link_changes=False, video_chat_changes=False, forum_changes=False, subscription_extensions=False)[source]
Parameters:
  • message_edits (bool)

  • message_deletions (bool)

  • message_pins (bool)

  • member_joins (bool)

  • member_leaves (bool)

  • member_invites (bool)

  • member_promotions (bool)

  • member_restrictions (bool)

  • info_changes (bool)

  • setting_changes (bool)

  • invite_link_changes (bool)

  • video_chat_changes (bool)

  • forum_changes (bool)

  • subscription_extensions (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventLogFilters]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventLogFilters']

classmethod getType()[source]
Return type:

Literal['chatEventLogFilters']

to_dict()[source]
Return type:

dict

forum_changes: bool

True, if forum-related actions need to be returned

info_changes: bool

True, if changes in chat information need to be returned

invite_link_changes: bool

True, if changes to invite links need to be returned

member_invites: bool

True, if invited member events need to be returned

member_joins: bool

True, if members joining events need to be returned

member_leaves: bool

True, if members leaving events need to be returned

member_promotions: bool

True, if member promotion/demotion events need to be returned

member_restrictions: bool

True, if member restricted/unrestricted/banned/unbanned events need to be returned

message_deletions: bool

True, if message deletions need to be returned

message_edits: bool

True, if message edits need to be returned

message_pins: bool

True, if pin/unpin events need to be returned

setting_changes: bool

True, if changes in chat settings need to be returned

subscription_extensions: bool

True, if subscription extensions need to be returned

video_chat_changes: bool

True, if video chat actions need to be returned

class pytdbot.types.ChatEventMemberInvited(user_id=0, status=None)[source]

Bases: TlObject, ChatEventAction

A new chat member was invited

Parameters:
  • user_id (int) – New member user identifier

  • status ("types.ChatMemberStatus") – New member status

__init__(user_id=0, status=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventMemberInvited]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventMemberInvited']

to_dict()[source]
Return type:

dict

status: Union[ChatMemberStatusCreator, ChatMemberStatusAdministrator, ChatMemberStatusMember, ChatMemberStatusRestricted, ChatMemberStatusLeft, ChatMemberStatusBanned, None]

New member status

user_id: int

New member user identifier

class pytdbot.types.ChatEventMemberJoined[source]

Bases: TlObject, ChatEventAction

A new member joined the chat

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventMemberJoined]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventMemberJoined']

to_dict()[source]
Return type:

dict

class pytdbot.types.ChatEventMemberJoinedByInviteLink(invite_link=None, via_chat_folder_invite_link=False)[source]

Bases: TlObject, ChatEventAction

A new member joined the chat via an invite link

Parameters:
  • invite_link ("types.ChatInviteLink") – Invite link used to join the chat

  • via_chat_folder_invite_link (bool) – True, if the user has joined the chat using an invite link for a chat folder

__init__(invite_link=None, via_chat_folder_invite_link=False)[source]
Parameters:
  • invite_link (ChatInviteLink | None)

  • via_chat_folder_invite_link (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventMemberJoinedByInviteLink]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventMemberJoinedByInviteLink']

to_dict()[source]
Return type:

dict

invite_link: Optional[ChatInviteLink]

Invite link used to join the chat

via_chat_folder_invite_link: bool

True, if the user has joined the chat using an invite link for a chat folder

class pytdbot.types.ChatEventMemberJoinedByRequest(approver_user_id=0, invite_link=None)[source]

Bases: TlObject, ChatEventAction

A new member was accepted to the chat by an administrator

Parameters:
  • approver_user_id (int) – User identifier of the chat administrator, approved user join request

  • invite_link ("types.ChatInviteLink") – Invite link used to join the chat; may be null

__init__(approver_user_id=0, invite_link=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventMemberJoinedByRequest]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventMemberJoinedByRequest']

to_dict()[source]
Return type:

dict

approver_user_id: int

User identifier of the chat administrator, approved user join request

invite_link: Optional[ChatInviteLink]

Invite link used to join the chat; may be null

class pytdbot.types.ChatEventMemberLeft[source]

Bases: TlObject, ChatEventAction

A member left the chat

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventMemberLeft]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventMemberLeft']

to_dict()[source]
Return type:

dict

class pytdbot.types.ChatEventMemberPromoted(user_id=0, old_status=None, new_status=None)[source]

Bases: TlObject, ChatEventAction

A chat member has gained/lost administrator status, or the list of their administrator privileges has changed

Parameters:
  • user_id (int) – Affected chat member user identifier

  • old_status ("types.ChatMemberStatus") – Previous status of the chat member

  • new_status ("types.ChatMemberStatus") – New status of the chat member

__init__(user_id=0, old_status=None, new_status=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventMemberPromoted]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventMemberPromoted']

to_dict()[source]
Return type:

dict

new_status: Union[ChatMemberStatusCreator, ChatMemberStatusAdministrator, ChatMemberStatusMember, ChatMemberStatusRestricted, ChatMemberStatusLeft, ChatMemberStatusBanned, None]

New status of the chat member

old_status: Union[ChatMemberStatusCreator, ChatMemberStatusAdministrator, ChatMemberStatusMember, ChatMemberStatusRestricted, ChatMemberStatusLeft, ChatMemberStatusBanned, None]

Previous status of the chat member

user_id: int

Affected chat member user identifier

class pytdbot.types.ChatEventMemberRestricted(member_id=None, old_status=None, new_status=None)[source]

Bases: TlObject, ChatEventAction

A chat member was restricted/unrestricted or banned/unbanned, or the list of their restrictions has changed

Parameters:
  • member_id ("types.MessageSender") – Affected chat member identifier

  • old_status ("types.ChatMemberStatus") – Previous status of the chat member

  • new_status ("types.ChatMemberStatus") – New status of the chat member

__init__(member_id=None, old_status=None, new_status=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventMemberRestricted]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventMemberRestricted']

to_dict()[source]
Return type:

dict

member_id: Union[MessageSenderUser, MessageSenderChat, None]

Affected chat member identifier

new_status: Union[ChatMemberStatusCreator, ChatMemberStatusAdministrator, ChatMemberStatusMember, ChatMemberStatusRestricted, ChatMemberStatusLeft, ChatMemberStatusBanned, None]

New status of the chat member

old_status: Union[ChatMemberStatusCreator, ChatMemberStatusAdministrator, ChatMemberStatusMember, ChatMemberStatusRestricted, ChatMemberStatusLeft, ChatMemberStatusBanned, None]

Previous status of the chat member

class pytdbot.types.ChatEventMemberSubscriptionExtended(user_id=0, old_status=None, new_status=None)[source]

Bases: TlObject, ChatEventAction

A chat member extended their subscription to the chat

Parameters:
  • user_id (int) – Affected chat member user identifier

  • old_status ("types.ChatMemberStatus") – Previous status of the chat member

  • new_status ("types.ChatMemberStatus") – New status of the chat member

__init__(user_id=0, old_status=None, new_status=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventMemberSubscriptionExtended]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventMemberSubscriptionExtended']

to_dict()[source]
Return type:

dict

new_status: Union[ChatMemberStatusCreator, ChatMemberStatusAdministrator, ChatMemberStatusMember, ChatMemberStatusRestricted, ChatMemberStatusLeft, ChatMemberStatusBanned, None]

New status of the chat member

old_status: Union[ChatMemberStatusCreator, ChatMemberStatusAdministrator, ChatMemberStatusMember, ChatMemberStatusRestricted, ChatMemberStatusLeft, ChatMemberStatusBanned, None]

Previous status of the chat member

user_id: int

Affected chat member user identifier

class pytdbot.types.ChatEventMessageAutoDeleteTimeChanged(old_message_auto_delete_time=0, new_message_auto_delete_time=0)[source]

Bases: TlObject, ChatEventAction

The message auto-delete timer was changed

Parameters:
  • old_message_auto_delete_time (int) – Previous value of message_auto_delete_time

  • new_message_auto_delete_time (int) – New value of message_auto_delete_time

__init__(old_message_auto_delete_time=0, new_message_auto_delete_time=0)[source]
Parameters:
  • old_message_auto_delete_time (int)

  • new_message_auto_delete_time (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventMessageAutoDeleteTimeChanged]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventMessageAutoDeleteTimeChanged']

to_dict()[source]
Return type:

dict

new_message_auto_delete_time: int

New value of message_auto_delete_time

old_message_auto_delete_time: int

Previous value of message_auto_delete_time

class pytdbot.types.ChatEventMessageDeleted(message=None, can_report_anti_spam_false_positive=False)[source]

Bases: TlObject, ChatEventAction

A message was deleted

Parameters:
  • message ("types.Message") – Deleted message

  • can_report_anti_spam_false_positive (bool) – True, if the message deletion can be reported via reportSupergroupAntiSpamFalsePositive

__init__(message=None, can_report_anti_spam_false_positive=False)[source]
Parameters:
  • message (Message | None)

  • can_report_anti_spam_false_positive (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventMessageDeleted]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventMessageDeleted']

to_dict()[source]
Return type:

dict

can_report_anti_spam_false_positive: bool

True, if the message deletion can be reported via reportSupergroupAntiSpamFalsePositive

message: Optional[Message]

Deleted message

class pytdbot.types.ChatEventMessageEdited(old_message=None, new_message=None)[source]

Bases: TlObject, ChatEventAction

A message was edited

Parameters:
  • old_message ("types.Message") – The original message before the edit

  • new_message ("types.Message") – The message after it was edited

__init__(old_message=None, new_message=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventMessageEdited]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventMessageEdited']

to_dict()[source]
Return type:

dict

new_message: Optional[Message]

The message after it was edited

old_message: Optional[Message]

The original message before the edit

class pytdbot.types.ChatEventMessagePinned(message=None)[source]

Bases: TlObject, ChatEventAction

A message was pinned

Parameters:

message ("types.Message") – Pinned message

__init__(message=None)[source]
Parameters:

message (Message | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventMessagePinned]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventMessagePinned']

to_dict()[source]
Return type:

dict

message: Optional[Message]

Pinned message

class pytdbot.types.ChatEventMessageUnpinned(message=None)[source]

Bases: TlObject, ChatEventAction

A message was unpinned

Parameters:

message ("types.Message") – Unpinned message

__init__(message=None)[source]
Parameters:

message (Message | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventMessageUnpinned]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventMessageUnpinned']

to_dict()[source]
Return type:

dict

message: Optional[Message]

Unpinned message

class pytdbot.types.ChatEventPermissionsChanged(old_permissions=None, new_permissions=None)[source]

Bases: TlObject, ChatEventAction

The chat permissions were changed

Parameters:
  • old_permissions ("types.ChatPermissions") – Previous chat permissions

  • new_permissions ("types.ChatPermissions") – New chat permissions

__init__(old_permissions=None, new_permissions=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventPermissionsChanged]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventPermissionsChanged']

to_dict()[source]
Return type:

dict

new_permissions: Optional[ChatPermissions]

New chat permissions

old_permissions: Optional[ChatPermissions]

Previous chat permissions

class pytdbot.types.ChatEventPhotoChanged(old_photo=None, new_photo=None)[source]

Bases: TlObject, ChatEventAction

The chat photo was changed

Parameters:
  • old_photo ("types.ChatPhoto") – Previous chat photo value; may be null

  • new_photo ("types.ChatPhoto") – New chat photo value; may be null

__init__(old_photo=None, new_photo=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventPhotoChanged]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventPhotoChanged']

to_dict()[source]
Return type:

dict

new_photo: Optional[ChatPhoto]

New chat photo value; may be null

old_photo: Optional[ChatPhoto]

Previous chat photo value; may be null

class pytdbot.types.ChatEventPollStopped(message=None)[source]

Bases: TlObject, ChatEventAction

A poll in a message was stopped

Parameters:

message ("types.Message") – The message with the poll

__init__(message=None)[source]
Parameters:

message (Message | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventPollStopped]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventPollStopped']

to_dict()[source]
Return type:

dict

message: Optional[Message]

The message with the poll

class pytdbot.types.ChatEventProfileAccentColorChanged(old_profile_accent_color_id=0, old_profile_background_custom_emoji_id=0, new_profile_accent_color_id=0, new_profile_background_custom_emoji_id=0)[source]

Bases: TlObject, ChatEventAction

The chat’s profile accent color or profile background custom emoji were changed

Parameters:
  • old_profile_accent_color_id (int) – Previous identifier of chat’s profile accent color; -1 if none

  • old_profile_background_custom_emoji_id (int) – Previous identifier of the custom emoji; 0 if none

  • new_profile_accent_color_id (int) – New identifier of chat’s profile accent color; -1 if none

  • new_profile_background_custom_emoji_id (int) – New identifier of the custom emoji; 0 if none

__init__(old_profile_accent_color_id=0, old_profile_background_custom_emoji_id=0, new_profile_accent_color_id=0, new_profile_background_custom_emoji_id=0)[source]
Parameters:
  • old_profile_accent_color_id (int)

  • old_profile_background_custom_emoji_id (int)

  • new_profile_accent_color_id (int)

  • new_profile_background_custom_emoji_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventProfileAccentColorChanged]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventProfileAccentColorChanged']

to_dict()[source]
Return type:

dict

new_profile_accent_color_id: int

New identifier of chat’s profile accent color; -1 if none

new_profile_background_custom_emoji_id: int

New identifier of the custom emoji; 0 if none

old_profile_accent_color_id: int

Previous identifier of chat’s profile accent color; -1 if none

old_profile_background_custom_emoji_id: int

Previous identifier of the custom emoji; 0 if none

class pytdbot.types.ChatEventShowMessageSenderToggled(show_message_sender=False)[source]

Bases: TlObject, ChatEventAction

The show_message_sender setting of a channel was toggled

Parameters:

show_message_sender (bool) – New value of show_message_sender

__init__(show_message_sender=False)[source]
Parameters:

show_message_sender (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventShowMessageSenderToggled]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventShowMessageSenderToggled']

to_dict()[source]
Return type:

dict

show_message_sender: bool

New value of show_message_sender

class pytdbot.types.ChatEventSignMessagesToggled(sign_messages=False)[source]

Bases: TlObject, ChatEventAction

The sign_messages setting of a channel was toggled

Parameters:

sign_messages (bool) – New value of sign_messages

__init__(sign_messages=False)[source]
Parameters:

sign_messages (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventSignMessagesToggled]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventSignMessagesToggled']

to_dict()[source]
Return type:

dict

sign_messages: bool

New value of sign_messages

class pytdbot.types.ChatEventSlowModeDelayChanged(old_slow_mode_delay=0, new_slow_mode_delay=0)[source]

Bases: TlObject, ChatEventAction

The slow_mode_delay setting of a supergroup was changed

Parameters:
  • old_slow_mode_delay (int) – Previous value of slow_mode_delay, in seconds

  • new_slow_mode_delay (int) – New value of slow_mode_delay, in seconds

__init__(old_slow_mode_delay=0, new_slow_mode_delay=0)[source]
Parameters:
  • old_slow_mode_delay (int)

  • new_slow_mode_delay (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventSlowModeDelayChanged]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventSlowModeDelayChanged']

to_dict()[source]
Return type:

dict

new_slow_mode_delay: int

New value of slow_mode_delay, in seconds

old_slow_mode_delay: int

Previous value of slow_mode_delay, in seconds

class pytdbot.types.ChatEventStickerSetChanged(old_sticker_set_id=0, new_sticker_set_id=0)[source]

Bases: TlObject, ChatEventAction

The supergroup sticker set was changed

Parameters:
  • old_sticker_set_id (int) – Previous identifier of the chat sticker set; 0 if none

  • new_sticker_set_id (int) – New identifier of the chat sticker set; 0 if none

__init__(old_sticker_set_id=0, new_sticker_set_id=0)[source]
Parameters:
  • old_sticker_set_id (int)

  • new_sticker_set_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventStickerSetChanged]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventStickerSetChanged']

to_dict()[source]
Return type:

dict

new_sticker_set_id: int

New identifier of the chat sticker set; 0 if none

old_sticker_set_id: int

Previous identifier of the chat sticker set; 0 if none

class pytdbot.types.ChatEventTitleChanged(old_title='', new_title='')[source]

Bases: TlObject, ChatEventAction

The chat title was changed

Parameters:
  • old_title (str) – Previous chat title

  • new_title (str) – New chat title

__init__(old_title='', new_title='')[source]
Parameters:
  • old_title (str)

  • new_title (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventTitleChanged]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventTitleChanged']

to_dict()[source]
Return type:

dict

new_title: Optional[str]

New chat title

old_title: Optional[str]

Previous chat title

class pytdbot.types.ChatEventUsernameChanged(old_username='', new_username='')[source]

Bases: TlObject, ChatEventAction

The chat editable username was changed

Parameters:
  • old_username (str) – Previous chat username

  • new_username (str) – New chat username

__init__(old_username='', new_username='')[source]
Parameters:
  • old_username (str)

  • new_username (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventUsernameChanged]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventUsernameChanged']

to_dict()[source]
Return type:

dict

new_username: Optional[str]

New chat username

old_username: Optional[str]

Previous chat username

class pytdbot.types.ChatEventVideoChatCreated(group_call_id=0)[source]

Bases: TlObject, ChatEventAction

A video chat was created

Parameters:

group_call_id (int) – Identifier of the video chat. The video chat can be received through the method getGroupCall

__init__(group_call_id=0)[source]
Parameters:

group_call_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventVideoChatCreated]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventVideoChatCreated']

to_dict()[source]
Return type:

dict

group_call_id: int

Identifier of the video chat. The video chat can be received through the method getGroupCall

class pytdbot.types.ChatEventVideoChatEnded(group_call_id=0)[source]

Bases: TlObject, ChatEventAction

A video chat was ended

Parameters:

group_call_id (int) – Identifier of the video chat. The video chat can be received through the method getGroupCall

__init__(group_call_id=0)[source]
Parameters:

group_call_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventVideoChatEnded]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventVideoChatEnded']

to_dict()[source]
Return type:

dict

group_call_id: int

Identifier of the video chat. The video chat can be received through the method getGroupCall

class pytdbot.types.ChatEventVideoChatMuteNewParticipantsToggled(mute_new_participants=False)[source]

Bases: TlObject, ChatEventAction

The mute_new_participants setting of a video chat was toggled

Parameters:

mute_new_participants (bool) – New value of the mute_new_participants setting

__init__(mute_new_participants=False)[source]
Parameters:

mute_new_participants (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventVideoChatMuteNewParticipantsToggled]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventVideoChatMuteNewParticipantsToggled']

to_dict()[source]
Return type:

dict

mute_new_participants: bool

New value of the mute_new_participants setting

class pytdbot.types.ChatEventVideoChatParticipantIsMutedToggled(participant_id=None, is_muted=False)[source]

Bases: TlObject, ChatEventAction

A video chat participant was muted or unmuted

Parameters:
  • participant_id ("types.MessageSender") – Identifier of the affected group call participant

  • is_muted (bool) – New value of is_muted

__init__(participant_id=None, is_muted=False)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventVideoChatParticipantIsMutedToggled]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventVideoChatParticipantIsMutedToggled']

to_dict()[source]
Return type:

dict

is_muted: bool

New value of is_muted

participant_id: Union[MessageSenderUser, MessageSenderChat, None]

Identifier of the affected group call participant

class pytdbot.types.ChatEventVideoChatParticipantVolumeLevelChanged(participant_id=None, volume_level=0)[source]

Bases: TlObject, ChatEventAction

A video chat participant volume level was changed

Parameters:
  • participant_id ("types.MessageSender") – Identifier of the affected group call participant

  • volume_level (int) – New value of volume_level; 1-20000 in hundreds of percents

__init__(participant_id=None, volume_level=0)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEventVideoChatParticipantVolumeLevelChanged]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEventAction']

classmethod getType()[source]
Return type:

Literal['chatEventVideoChatParticipantVolumeLevelChanged']

to_dict()[source]
Return type:

dict

participant_id: Union[MessageSenderUser, MessageSenderChat, None]

Identifier of the affected group call participant

volume_level: int

New value of volume_level; 1-20000 in hundreds of percents

class pytdbot.types.ChatEvents(events=None)[source]

Bases: TlObject

Contains a list of chat events

Parameters:

events (List["types.ChatEvent"]) – List of events

__init__(events=None)[source]
Parameters:

events (List[ChatEvent] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatEvents]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatEvents']

classmethod getType()[source]
Return type:

Literal['chatEvents']

to_dict()[source]
Return type:

dict

events: List[ChatEvent]

List of events

class pytdbot.types.ChatFolder(name=None, icon=None, color_id=0, is_shareable=False, pinned_chat_ids=None, included_chat_ids=None, excluded_chat_ids=None, exclude_muted=False, exclude_read=False, exclude_archived=False, include_contacts=False, include_non_contacts=False, include_bots=False, include_groups=False, include_channels=False)[source]

Bases: TlObject

Represents a folder for user chats

Parameters:
  • name ("types.ChatFolderName") – The name of the folder

  • icon ("types.ChatFolderIcon") – The chosen icon for the chat folder; may be null. If null, use getChatFolderDefaultIconName to get default icon name for the folder

  • color_id (int) – The identifier of the chosen color for the chat folder icon; from -1 to 6. If -1, then color is disabled. Can’t be changed if folder tags are disabled or the current user doesn’t have Telegram Premium subscription

  • is_shareable (bool) – True, if at least one link has been created for the folder

  • pinned_chat_ids (List[int]) – The chat identifiers of pinned chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium

  • included_chat_ids (List[int]) – The chat identifiers of always included chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium

  • excluded_chat_ids (List[int]) – The chat identifiers of always excluded chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") always excluded non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium

  • exclude_muted (bool) – True, if muted chats need to be excluded

  • exclude_read (bool) – True, if read chats need to be excluded

  • exclude_archived (bool) – True, if archived chats need to be excluded

  • include_contacts (bool) – True, if contacts need to be included

  • include_non_contacts (bool) – True, if non-contact users need to be included

  • include_bots (bool) – True, if bots need to be included

  • include_groups (bool) – True, if basic groups and supergroups need to be included

  • include_channels (bool) – True, if channels need to be included

__init__(name=None, icon=None, color_id=0, is_shareable=False, pinned_chat_ids=None, included_chat_ids=None, excluded_chat_ids=None, exclude_muted=False, exclude_read=False, exclude_archived=False, include_contacts=False, include_non_contacts=False, include_bots=False, include_groups=False, include_channels=False)[source]
Parameters:
  • name (ChatFolderName | None)

  • icon (ChatFolderIcon | None)

  • color_id (int)

  • is_shareable (bool)

  • pinned_chat_ids (List[int] | None)

  • included_chat_ids (List[int] | None)

  • excluded_chat_ids (List[int] | None)

  • exclude_muted (bool)

  • exclude_read (bool)

  • exclude_archived (bool)

  • include_contacts (bool)

  • include_non_contacts (bool)

  • include_bots (bool)

  • include_groups (bool)

  • include_channels (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatFolder]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatFolder']

classmethod getType()[source]
Return type:

Literal['chatFolder']

to_dict()[source]
Return type:

dict

color_id: int

The identifier of the chosen color for the chat folder icon; from -1 to 6. If -1, then color is disabled. Can’t be changed if folder tags are disabled or the current user doesn’t have Telegram Premium subscription

exclude_archived: bool

True, if archived chats need to be excluded

exclude_muted: bool

True, if muted chats need to be excluded

exclude_read: bool

True, if read chats need to be excluded

excluded_chat_ids: List[int]

The chat identifiers of always excluded chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") always excluded non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium

icon: Optional[ChatFolderIcon]

The chosen icon for the chat folder; may be null. If null, use getChatFolderDefaultIconName to get default icon name for the folder

include_bots: bool

True, if bots need to be included

include_channels: bool

True, if channels need to be included

include_contacts: bool

True, if contacts need to be included

include_groups: bool

True, if basic groups and supergroups need to be included

include_non_contacts: bool

True, if non-contact users need to be included

included_chat_ids: List[int]

The chat identifiers of always included chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium

is_shareable: bool

True, if at least one link has been created for the folder

name: Optional[ChatFolderName]

The name of the folder

pinned_chat_ids: List[int]

The chat identifiers of pinned chats in the folder. There can be up to getOption("chat_folder_chosen_chat_count_max") pinned and always included non-secret chats and the same number of secret chats, but the limit can be increased with Telegram Premium

class pytdbot.types.ChatFolderIcon(name='')[source]

Bases: TlObject

Represents an icon for a chat folder

Parameters:

name (str) – The chosen icon name for short folder representation; one of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work", "Airplane", "Book", "Light", "Like", "Money", "Note", "Palette"

__init__(name='')[source]
Parameters:

name (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatFolderIcon]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatFolderIcon']

classmethod getType()[source]
Return type:

Literal['chatFolderIcon']

to_dict()[source]
Return type:

dict

name: Optional[str]

The chosen icon name for short folder representation; one of "All", "Unread", "Unmuted", "Bots", "Channels", "Groups", "Private", "Custom", "Setup", "Cat", "Crown", "Favorite", "Flower", "Game", "Home", "Love", "Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work", "Airplane", "Book", "Light", "Like", "Money", "Note", "Palette"

class pytdbot.types.ChatFolderInfo(id=0, name=None, icon=None, color_id=0, is_shareable=False, has_my_invite_links=False)[source]

Bases: TlObject

Contains basic information about a chat folder

Parameters:
  • id (int) – Unique chat folder identifier

  • name ("types.ChatFolderName") – The name of the folder

  • icon ("types.ChatFolderIcon") – The chosen or default icon for the chat folder

  • color_id (int) – The identifier of the chosen color for the chat folder icon; from -1 to 6. If -1, then color is disabled

  • is_shareable (bool) – True, if at least one link has been created for the folder

  • has_my_invite_links (bool) – True, if the chat folder has invite links created by the current user

__init__(id=0, name=None, icon=None, color_id=0, is_shareable=False, has_my_invite_links=False)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatFolderInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatFolderInfo']

classmethod getType()[source]
Return type:

Literal['chatFolderInfo']

to_dict()[source]
Return type:

dict

color_id: int

The identifier of the chosen color for the chat folder icon; from -1 to 6. If -1, then color is disabled

has_my_invite_links: bool

True, if the chat folder has invite links created by the current user

icon: Optional[ChatFolderIcon]

The chosen or default icon for the chat folder

id: int

Unique chat folder identifier

is_shareable: bool

True, if at least one link has been created for the folder

name: Optional[ChatFolderName]

The name of the folder

class pytdbot.types.ChatFolderInviteLink(invite_link='', name='', chat_ids=None)[source]

Bases: TlObject

Contains a chat folder invite link

Parameters:
  • invite_link (str) – The chat folder invite link

  • name (str) – Name of the link

  • chat_ids (List[int]) – Identifiers of chats, included in the link

__init__(invite_link='', name='', chat_ids=None)[source]
Parameters:
  • invite_link (str)

  • name (str)

  • chat_ids (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatFolderInviteLink]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatFolderInviteLink']

classmethod getType()[source]
Return type:

Literal['chatFolderInviteLink']

to_dict()[source]
Return type:

dict

chat_ids: List[int]

Identifiers of chats, included in the link

invite_link: Optional[str]

The chat folder invite link

name: Optional[str]

Name of the link

class pytdbot.types.ChatFolderInviteLinkInfo(chat_folder_info=None, missing_chat_ids=None, added_chat_ids=None)[source]

Bases: TlObject

Contains information about an invite link to a chat folder

Parameters:
  • chat_folder_info ("types.ChatFolderInfo") – Basic information about the chat folder; chat folder identifier will be 0 if the user didn’t have the chat folder yet

  • missing_chat_ids (List[int]) – Identifiers of the chats from the link, which aren’t added to the folder yet

  • added_chat_ids (List[int]) – Identifiers of the chats from the link, which are added to the folder already

__init__(chat_folder_info=None, missing_chat_ids=None, added_chat_ids=None)[source]
Parameters:
  • chat_folder_info (ChatFolderInfo | None)

  • missing_chat_ids (List[int] | None)

  • added_chat_ids (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatFolderInviteLinkInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatFolderInviteLinkInfo']

classmethod getType()[source]
Return type:

Literal['chatFolderInviteLinkInfo']

to_dict()[source]
Return type:

dict

added_chat_ids: List[int]

Identifiers of the chats from the link, which are added to the folder already

chat_folder_info: Optional[ChatFolderInfo]

Basic information about the chat folder; chat folder identifier will be 0 if the user didn’t have the chat folder yet

missing_chat_ids: List[int]

Identifiers of the chats from the link, which aren’t added to the folder yet

class pytdbot.types.ChatFolderInviteLinks(invite_links=None)[source]

Bases: TlObject

Represents a list of chat folder invite links

Parameters:

invite_links (List["types.ChatFolderInviteLink"]) – List of the invite links

__init__(invite_links=None)[source]
Parameters:

invite_links (List[ChatFolderInviteLink] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatFolderInviteLinks]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatFolderInviteLinks']

classmethod getType()[source]
Return type:

Literal['chatFolderInviteLinks']

to_dict()[source]
Return type:

dict

invite_links: List[ChatFolderInviteLink]

List of the invite links

class pytdbot.types.ChatFolderName(text=None, animate_custom_emoji=False)[source]

Bases: TlObject

Describes name of a chat folder

Parameters:
  • text ("types.FormattedText") – The text of the chat folder name; 1-12 characters without line feeds. May contain only CustomEmoji entities

  • animate_custom_emoji (bool) – True, if custom emoji in the name must be animated

__init__(text=None, animate_custom_emoji=False)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatFolderName]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatFolderName']

classmethod getType()[source]
Return type:

Literal['chatFolderName']

to_dict()[source]
Return type:

dict

animate_custom_emoji: bool

True, if custom emoji in the name must be animated

text: Optional[FormattedText]

The text of the chat folder name; 1-12 characters without line feeds. May contain only CustomEmoji entities

class pytdbot.types.ChatInviteLink(invite_link='', name='', creator_user_id=0, date=0, edit_date=0, expiration_date=0, subscription_pricing=None, member_limit=0, member_count=0, expired_member_count=0, pending_join_request_count=0, creates_join_request=False, is_primary=False, is_revoked=False)[source]

Bases: TlObject

Contains a chat invite link

Parameters:
  • invite_link (str) – Chat invite link

  • name (str) – Name of the link

  • creator_user_id (int) – User identifier of an administrator created the link

  • date (int) – Point in time (Unix timestamp) when the link was created

  • edit_date (int) – Point in time (Unix timestamp) when the link was last edited; 0 if never or unknown

  • expiration_date (int) – Point in time (Unix timestamp) when the link will expire; 0 if never

  • subscription_pricing ("types.StarSubscriptionPricing") – Information about subscription plan that is applied to the users joining the chat by the link; may be null if the link doesn’t require subscription

  • member_limit (int) – The maximum number of members, which can join the chat using the link simultaneously; 0 if not limited. Always 0 if the link requires approval

  • member_count (int) – Number of chat members, which joined the chat using the link

  • expired_member_count (int) – Number of chat members, which joined the chat using the link, but have already left because of expired subscription; for subscription links only

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

  • creates_join_request (bool) – True, if the link only creates join request. If true, total number of joining members will be unlimited

  • is_primary (bool) – True, if the link is primary. Primary invite link can’t have name, expiration date, or usage limit. There is exactly one primary invite link for each administrator with can_invite_users right at a given time

  • is_revoked (bool) – True, if the link was revoked

__init__(invite_link='', name='', creator_user_id=0, date=0, edit_date=0, expiration_date=0, subscription_pricing=None, member_limit=0, member_count=0, expired_member_count=0, pending_join_request_count=0, creates_join_request=False, is_primary=False, is_revoked=False)[source]
Parameters:
  • invite_link (str)

  • name (str)

  • creator_user_id (int)

  • date (int)

  • edit_date (int)

  • expiration_date (int)

  • subscription_pricing (StarSubscriptionPricing | None)

  • member_limit (int)

  • member_count (int)

  • expired_member_count (int)

  • pending_join_request_count (int)

  • creates_join_request (bool)

  • is_primary (bool)

  • is_revoked (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatInviteLink]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatInviteLink']

classmethod getType()[source]
Return type:

Literal['chatInviteLink']

to_dict()[source]
Return type:

dict

creates_join_request: bool

True, if the link only creates join request. If true, total number of joining members will be unlimited

creator_user_id: int

User identifier of an administrator created the link

date: int

Point in time (Unix timestamp) when the link was created

edit_date: int

Point in time (Unix timestamp) when the link was last edited; 0 if never or unknown

expiration_date: int

Point in time (Unix timestamp) when the link will expire; 0 if never

expired_member_count: int

Number of chat members, which joined the chat using the link, but have already left because of expired subscription; for subscription links only

invite_link: Optional[str]

Chat invite link

is_primary: bool

True, if the link is primary. Primary invite link can’t have name, expiration date, or usage limit. There is exactly one primary invite link for each administrator with can_invite_users right at a given time

is_revoked: bool

True, if the link was revoked

member_count: int

Number of chat members, which joined the chat using the link

member_limit: int

The maximum number of members, which can join the chat using the link simultaneously; 0 if not limited. Always 0 if the link requires approval

name: Optional[str]

Name of the link

pending_join_request_count: int

Number of pending join requests created using this link

subscription_pricing: Optional[StarSubscriptionPricing]

Information about subscription plan that is applied to the users joining the chat by the link; may be null if the link doesn’t require subscription

class pytdbot.types.ChatInviteLinkCount(user_id=0, invite_link_count=0, revoked_invite_link_count=0)[source]

Bases: TlObject

Describes a chat administrator with a number of active and revoked chat invite links

Parameters:
  • user_id (int) – Administrator’s user identifier

  • invite_link_count (int) – Number of active invite links

  • revoked_invite_link_count (int) – Number of revoked invite links

__init__(user_id=0, invite_link_count=0, revoked_invite_link_count=0)[source]
Parameters:
  • user_id (int)

  • invite_link_count (int)

  • revoked_invite_link_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatInviteLinkCount]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatInviteLinkCount']

classmethod getType()[source]
Return type:

Literal['chatInviteLinkCount']

to_dict()[source]
Return type:

dict

invite_link_count: int

Number of active invite links

revoked_invite_link_count: int

Number of revoked invite links

user_id: int

Administrator’s user identifier

class pytdbot.types.ChatInviteLinkCounts(invite_link_counts=None)[source]

Bases: TlObject

Contains a list of chat invite link counts

Parameters:

invite_link_counts (List["types.ChatInviteLinkCount"]) – List of invite link counts

__init__(invite_link_counts=None)[source]
Parameters:

invite_link_counts (List[ChatInviteLinkCount] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatInviteLinkCounts]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatInviteLinkCounts']

classmethod getType()[source]
Return type:

Literal['chatInviteLinkCounts']

to_dict()[source]
Return type:

dict

invite_link_counts: List[ChatInviteLinkCount]

List of invite link counts

class pytdbot.types.ChatInviteLinkInfo(chat_id=0, accessible_for=0, type=None, title='', photo=None, accent_color_id=0, description='', member_count=0, member_user_ids=None, subscription_info=None, creates_join_request=False, is_public=False, verification_status=None)[source]

Bases: TlObject

Contains information about a chat invite link

Parameters:
  • chat_id (int) – Chat identifier of the invite link; 0 if the user has no access to the chat before joining

  • accessible_for (int) – If non-zero, the amount of time for which read access to the chat will remain available, in seconds

  • type ("types.InviteLinkChatType") – Type of the chat

  • title (str) – Title of the chat

  • photo ("types.ChatPhotoInfo") – Chat photo; may be null

  • accent_color_id (int) – Identifier of the accent color for chat title and background of chat photo

  • description (str) – Chat description

  • member_count (int) – Number of members in the chat

  • member_user_ids (List[int]) – User identifiers of some chat members that may be known to the current user

  • subscription_info ("types.ChatInviteLinkSubscriptionInfo") – Information about subscription plan that must be paid by the user to use the link; may be null if the link doesn’t require subscription

  • creates_join_request (bool) – True, if the link only creates join request

  • is_public (bool) – True, if the chat is a public supergroup or channel, i.e. it has a username or it is a location-based supergroup

  • verification_status ("types.VerificationStatus") – Information about verification status of the chat; may be null if none

__init__(chat_id=0, accessible_for=0, type=None, title='', photo=None, accent_color_id=0, description='', member_count=0, member_user_ids=None, subscription_info=None, creates_join_request=False, is_public=False, verification_status=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatInviteLinkInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatInviteLinkInfo']

classmethod getType()[source]
Return type:

Literal['chatInviteLinkInfo']

to_dict()[source]
Return type:

dict

accent_color_id: int

Identifier of the accent color for chat title and background of chat photo

accessible_for: int

If non-zero, the amount of time for which read access to the chat will remain available, in seconds

chat_id: int

Chat identifier of the invite link; 0 if the user has no access to the chat before joining

creates_join_request: bool

True, if the link only creates join request

description: Optional[str]

Chat description

is_public: bool

True, if the chat is a public supergroup or channel, i.e. it has a username or it is a location-based supergroup

member_count: int

Number of members in the chat

member_user_ids: List[int]

User identifiers of some chat members that may be known to the current user

photo: Optional[ChatPhotoInfo]

Chat photo; may be null

subscription_info: Optional[ChatInviteLinkSubscriptionInfo]

Information about subscription plan that must be paid by the user to use the link; may be null if the link doesn’t require subscription

title: Optional[str]

Title of the chat

type: Union[InviteLinkChatTypeBasicGroup, InviteLinkChatTypeSupergroup, InviteLinkChatTypeChannel, None]

Type of the chat

verification_status: Optional[VerificationStatus]

Information about verification status of the chat; may be null if none

class pytdbot.types.ChatInviteLinkMember(user_id=0, joined_chat_date=0, via_chat_folder_invite_link=False, approver_user_id=0)[source]

Bases: TlObject

Describes a chat member joined a chat via an invite link

Parameters:
  • user_id (int) – User identifier

  • joined_chat_date (int) – Point in time (Unix timestamp) when the user joined the chat

  • via_chat_folder_invite_link (bool) – True, if the user has joined the chat using an invite link for a chat folder

  • approver_user_id (int) – User identifier of the chat administrator, approved user join request

__init__(user_id=0, joined_chat_date=0, via_chat_folder_invite_link=False, approver_user_id=0)[source]
Parameters:
  • user_id (int)

  • joined_chat_date (int)

  • via_chat_folder_invite_link (bool)

  • approver_user_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatInviteLinkMember]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatInviteLinkMember']

classmethod getType()[source]
Return type:

Literal['chatInviteLinkMember']

to_dict()[source]
Return type:

dict

approver_user_id: int

User identifier of the chat administrator, approved user join request

joined_chat_date: int

Point in time (Unix timestamp) when the user joined the chat

user_id: int

User identifier

via_chat_folder_invite_link: bool

True, if the user has joined the chat using an invite link for a chat folder

class pytdbot.types.ChatInviteLinkMembers(total_count=0, members=None)[source]

Bases: TlObject

Contains a list of chat members joined a chat via an invite link

Parameters:
  • total_count (int) – Approximate total number of chat members found

  • members (List["types.ChatInviteLinkMember"]) – List of chat members, joined a chat via an invite link

__init__(total_count=0, members=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatInviteLinkMembers]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatInviteLinkMembers']

classmethod getType()[source]
Return type:

Literal['chatInviteLinkMembers']

to_dict()[source]
Return type:

dict

members: List[ChatInviteLinkMember]

List of chat members, joined a chat via an invite link

total_count: int

Approximate total number of chat members found

class pytdbot.types.ChatInviteLinkSubscriptionInfo(pricing=None, can_reuse=False, form_id=0)[source]

Bases: TlObject

Contains information about subscription plan that must be paid by the user to use a chat invite link

Parameters:
  • pricing ("types.StarSubscriptionPricing") – Information about subscription plan that must be paid by the user to use the link

  • can_reuse (bool) – True, if the user has already paid for the subscription and can use joinChatByInviteLink to join the subscribed chat again

  • form_id (int) – Identifier of the payment form to use for subscription payment; 0 if the subscription can’t be paid

__init__(pricing=None, can_reuse=False, form_id=0)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatInviteLinkSubscriptionInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatInviteLinkSubscriptionInfo']

classmethod getType()[source]
Return type:

Literal['chatInviteLinkSubscriptionInfo']

to_dict()[source]
Return type:

dict

can_reuse: bool

True, if the user has already paid for the subscription and can use joinChatByInviteLink to join the subscribed chat again

form_id: int

Identifier of the payment form to use for subscription payment; 0 if the subscription can’t be paid

pricing: Optional[StarSubscriptionPricing]

Information about subscription plan that must be paid by the user to use the link

class pytdbot.types.ChatInviteLinks(total_count=0, invite_links=None)[source]

Bases: TlObject

Contains a list of chat invite links

Parameters:
  • total_count (int) – Approximate total number of chat invite links found

  • invite_links (List["types.ChatInviteLink"]) – List of invite links

__init__(total_count=0, invite_links=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatInviteLinks]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatInviteLinks']

classmethod getType()[source]
Return type:

Literal['chatInviteLinks']

to_dict()[source]
Return type:

dict

invite_links: List[ChatInviteLink]

List of invite links

total_count: int

Approximate total number of chat invite links found

class pytdbot.types.ChatJoinRequest(user_id=0, date=0, bio='')[source]

Bases: TlObject

Describes a user that sent a join request and waits for administrator approval

Parameters:
  • user_id (int) – User identifier

  • date (int) – Point in time (Unix timestamp) when the user sent the join request

  • bio (str) – A short bio of the user

__init__(user_id=0, date=0, bio='')[source]
Parameters:
  • user_id (int)

  • date (int)

  • bio (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatJoinRequest]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatJoinRequest']

classmethod getType()[source]
Return type:

Literal['chatJoinRequest']

to_dict()[source]
Return type:

dict

bio: Optional[str]

A short bio of the user

date: int

Point in time (Unix timestamp) when the user sent the join request

user_id: int

User identifier

class pytdbot.types.ChatJoinRequests(total_count=0, requests=None)[source]

Bases: TlObject

Contains a list of requests to join a chat

Parameters:
  • total_count (int) – Approximate total number of requests found

  • requests (List["types.ChatJoinRequest"]) – List of the requests

__init__(total_count=0, requests=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatJoinRequests]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatJoinRequests']

classmethod getType()[source]
Return type:

Literal['chatJoinRequests']

to_dict()[source]
Return type:

dict

requests: List[ChatJoinRequest]

List of the requests

total_count: int

Approximate total number of requests found

class pytdbot.types.ChatJoinRequestsInfo(total_count=0, user_ids=None)[source]

Bases: TlObject

Contains information about pending join requests for a chat

Parameters:
  • total_count (int) – Total number of pending join requests

  • user_ids (List[int]) – Identifiers of at most 3 users sent the newest pending join requests

__init__(total_count=0, user_ids=None)[source]
Parameters:
  • total_count (int)

  • user_ids (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatJoinRequestsInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatJoinRequestsInfo']

classmethod getType()[source]
Return type:

Literal['chatJoinRequestsInfo']

to_dict()[source]
Return type:

dict

total_count: int

Total number of pending join requests

user_ids: List[int]

Identifiers of at most 3 users sent the newest pending join requests

class pytdbot.types.ChatList[source]

Bases: object

Describes a list of chats

class pytdbot.types.ChatListArchive[source]

Bases: TlObject, ChatList

A list of chats usually located at the top of the main chat list. Unmuted chats are automatically moved from the Archive to the Main chat list when a new message arrives

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatListArchive]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatList']

classmethod getType()[source]
Return type:

Literal['chatListArchive']

to_dict()[source]
Return type:

dict

class pytdbot.types.ChatListFolder(chat_folder_id=0)[source]

Bases: TlObject, ChatList

A list of chats added to a chat folder

Parameters:

chat_folder_id (int) – Chat folder identifier

__init__(chat_folder_id=0)[source]
Parameters:

chat_folder_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatListFolder]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatList']

classmethod getType()[source]
Return type:

Literal['chatListFolder']

to_dict()[source]
Return type:

dict

chat_folder_id: int

Chat folder identifier

class pytdbot.types.ChatListMain[source]

Bases: TlObject, ChatList

A main list of chats

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatListMain]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatList']

classmethod getType()[source]
Return type:

Literal['chatListMain']

to_dict()[source]
Return type:

dict

class pytdbot.types.ChatLists(chat_lists=None)[source]

Bases: TlObject

Contains a list of chat lists

Parameters:

chat_lists (List["types.ChatList"]) – List of chat lists

__init__(chat_lists=None)[source]
Parameters:

chat_lists (List[ChatList] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatLists]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatLists']

classmethod getType()[source]
Return type:

Literal['chatLists']

to_dict()[source]
Return type:

dict

chat_lists: List[ChatList]

List of chat lists

class pytdbot.types.ChatLocation(location=None, address='')[source]

Bases: TlObject

Represents a location to which a chat is connected

Parameters:
  • location ("types.Location") – The location

  • address (str) – Location address; 1-64 characters, as defined by the chat owner

__init__(location=None, address='')[source]
Parameters:
  • location (Location | None)

  • address (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatLocation]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatLocation']

classmethod getType()[source]
Return type:

Literal['chatLocation']

to_dict()[source]
Return type:

dict

address: Optional[str]

Location address; 1-64 characters, as defined by the chat owner

location: Optional[Location]

The location

class pytdbot.types.ChatMember(member_id=None, inviter_user_id=0, joined_chat_date=0, status=None)[source]

Bases: TlObject

Describes a user or a chat as a member of another chat

Parameters:
  • member_id ("types.MessageSender") – Identifier of the chat member. Currently, other chats can be only Left or Banned. Only supergroups and channels can have other chats as Left or Banned members and these chats must be supergroups or channels

  • inviter_user_id (int) – Identifier of a user that invited/promoted/banned this member in the chat; 0 if unknown

  • joined_chat_date (int) – Point in time (Unix timestamp) when the user joined/was promoted/was banned in the chat

  • status ("types.ChatMemberStatus") – Status of the member in the chat

__init__(member_id=None, inviter_user_id=0, joined_chat_date=0, status=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatMember]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatMember']

classmethod getType()[source]
Return type:

Literal['chatMember']

to_dict()[source]
Return type:

dict

inviter_user_id: int

Identifier of a user that invited/promoted/banned this member in the chat; 0 if unknown

joined_chat_date: int

Point in time (Unix timestamp) when the user joined/was promoted/was banned in the chat

member_id: Union[MessageSenderUser, MessageSenderChat, None]

Identifier of the chat member. Currently, other chats can be only Left or Banned. Only supergroups and channels can have other chats as Left or Banned members and these chats must be supergroups or channels

status: Union[ChatMemberStatusCreator, ChatMemberStatusAdministrator, ChatMemberStatusMember, ChatMemberStatusRestricted, ChatMemberStatusLeft, ChatMemberStatusBanned, None]

Status of the member in the chat

class pytdbot.types.ChatMemberStatus[source]

Bases: object

Provides information about the status of a member in a chat

class pytdbot.types.ChatMemberStatusAdministrator(custom_title='', can_be_edited=False, rights=None)[source]

Bases: TlObject, ChatMemberStatus

The user is a member of the chat and has some additional privileges. In basic groups, administrators can edit and delete messages sent by others, add new members, ban unprivileged members, and manage video chats. In supergroups and channels, there are more detailed options for administrator privileges

Parameters:
  • custom_title (str) – A custom title of the administrator; 0-16 characters without emoji; applicable to supergroups only

  • can_be_edited (bool) – True, if the current user can edit the administrator privileges for the called user

  • rights ("types.ChatAdministratorRights") – Rights of the administrator

__init__(custom_title='', can_be_edited=False, rights=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatMemberStatusAdministrator]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatMemberStatus']

classmethod getType()[source]
Return type:

Literal['chatMemberStatusAdministrator']

to_dict()[source]
Return type:

dict

can_be_edited: bool

True, if the current user can edit the administrator privileges for the called user

custom_title: Optional[str]

A custom title of the administrator; 0-16 characters without emoji; applicable to supergroups only

rights: Optional[ChatAdministratorRights]

Rights of the administrator

class pytdbot.types.ChatMemberStatusBanned(banned_until_date=0)[source]

Bases: TlObject, ChatMemberStatus

The user or the chat was banned (and hence is not a member of the chat). Implies the user can’t return to the chat, view messages, or be used as a participant identifier to join a video chat of the chat

Parameters:

banned_until_date (int) – Point in time (Unix timestamp) when the user will be unbanned; 0 if never. If the user is banned for more than 366 days or for less than 30 seconds from the current time, the user is considered to be banned forever. Always 0 in basic groups

__init__(banned_until_date=0)[source]
Parameters:

banned_until_date (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatMemberStatusBanned]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatMemberStatus']

classmethod getType()[source]
Return type:

Literal['chatMemberStatusBanned']

to_dict()[source]
Return type:

dict

banned_until_date: int

Point in time (Unix timestamp) when the user will be unbanned; 0 if never. If the user is banned for more than 366 days or for less than 30 seconds from the current time, the user is considered to be banned forever. Always 0 in basic groups

class pytdbot.types.ChatMemberStatusCreator(custom_title='', is_anonymous=False, is_member=False)[source]

Bases: TlObject, ChatMemberStatus

The user is the owner of the chat and has all the administrator privileges

Parameters:
  • custom_title (str) – A custom title of the owner; 0-16 characters without emoji; applicable to supergroups only

  • is_anonymous (bool) – True, if the creator isn’t shown in the chat member list and sends messages anonymously; applicable to supergroups only

  • is_member (bool) – True, if the user is a member of the chat

__init__(custom_title='', is_anonymous=False, is_member=False)[source]
Parameters:
  • custom_title (str)

  • is_anonymous (bool)

  • is_member (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatMemberStatusCreator]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatMemberStatus']

classmethod getType()[source]
Return type:

Literal['chatMemberStatusCreator']

to_dict()[source]
Return type:

dict

custom_title: Optional[str]

A custom title of the owner; 0-16 characters without emoji; applicable to supergroups only

is_anonymous: bool

True, if the creator isn’t shown in the chat member list and sends messages anonymously; applicable to supergroups only

is_member: bool

True, if the user is a member of the chat

class pytdbot.types.ChatMemberStatusLeft[source]

Bases: TlObject, ChatMemberStatus

The user or the chat is not a chat member

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatMemberStatusLeft]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatMemberStatus']

classmethod getType()[source]
Return type:

Literal['chatMemberStatusLeft']

to_dict()[source]
Return type:

dict

class pytdbot.types.ChatMemberStatusMember(member_until_date=0)[source]

Bases: TlObject, ChatMemberStatus

The user is a member of the chat, without any additional privileges or restrictions

Parameters:

member_until_date (int) – Point in time (Unix timestamp) when the user will be removed from the chat because of the expired subscription; 0 if never. Ignored in setChatMemberStatus

__init__(member_until_date=0)[source]
Parameters:

member_until_date (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatMemberStatusMember]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatMemberStatus']

classmethod getType()[source]
Return type:

Literal['chatMemberStatusMember']

to_dict()[source]
Return type:

dict

member_until_date: int

Point in time (Unix timestamp) when the user will be removed from the chat because of the expired subscription; 0 if never. Ignored in setChatMemberStatus

class pytdbot.types.ChatMemberStatusRestricted(is_member=False, restricted_until_date=0, permissions=None)[source]

Bases: TlObject, ChatMemberStatus

The user is under certain restrictions in the chat. Not supported in basic groups and channels

Parameters:
  • is_member (bool) – True, if the user is a member of the chat

  • restricted_until_date (int) – Point in time (Unix timestamp) when restrictions will be lifted from the user; 0 if never. If the user is restricted for more than 366 days or for less than 30 seconds from the current time, the user is considered to be restricted forever

  • permissions ("types.ChatPermissions") – User permissions in the chat

__init__(is_member=False, restricted_until_date=0, permissions=None)[source]
Parameters:
  • is_member (bool)

  • restricted_until_date (int)

  • permissions (ChatPermissions | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatMemberStatusRestricted]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatMemberStatus']

classmethod getType()[source]
Return type:

Literal['chatMemberStatusRestricted']

to_dict()[source]
Return type:

dict

is_member: bool

True, if the user is a member of the chat

permissions: Optional[ChatPermissions]

User permissions in the chat

restricted_until_date: int

Point in time (Unix timestamp) when restrictions will be lifted from the user; 0 if never. If the user is restricted for more than 366 days or for less than 30 seconds from the current time, the user is considered to be restricted forever

class pytdbot.types.ChatMembers(total_count=0, members=None)[source]

Bases: TlObject

Contains a list of chat members

Parameters:
  • total_count (int) – Approximate total number of chat members found

  • members (List["types.ChatMember"]) – A list of chat members

__init__(total_count=0, members=None)[source]
Parameters:
  • total_count (int)

  • members (List[ChatMember] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatMembers]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatMembers']

classmethod getType()[source]
Return type:

Literal['chatMembers']

to_dict()[source]
Return type:

dict

members: List[ChatMember]

A list of chat members

total_count: int

Approximate total number of chat members found

class pytdbot.types.ChatMembersFilter[source]

Bases: object

Specifies the kind of chat members to return in searchChatMembers

class pytdbot.types.ChatMembersFilterAdministrators[source]

Bases: TlObject, ChatMembersFilter

Returns the owner and administrators

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatMembersFilterAdministrators]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatMembersFilter']

classmethod getType()[source]
Return type:

Literal['chatMembersFilterAdministrators']

to_dict()[source]
Return type:

dict

class pytdbot.types.ChatMembersFilterBanned[source]

Bases: TlObject, ChatMembersFilter

Returns users banned from the chat; can be used only by administrators in a supergroup or in a channel

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatMembersFilterBanned]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatMembersFilter']

classmethod getType()[source]
Return type:

Literal['chatMembersFilterBanned']

to_dict()[source]
Return type:

dict

class pytdbot.types.ChatMembersFilterBots[source]

Bases: TlObject, ChatMembersFilter

Returns bot members of the chat

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatMembersFilterBots]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatMembersFilter']

classmethod getType()[source]
Return type:

Literal['chatMembersFilterBots']

to_dict()[source]
Return type:

dict

class pytdbot.types.ChatMembersFilterContacts[source]

Bases: TlObject, ChatMembersFilter

Returns contacts of the user

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatMembersFilterContacts]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatMembersFilter']

classmethod getType()[source]
Return type:

Literal['chatMembersFilterContacts']

to_dict()[source]
Return type:

dict

class pytdbot.types.ChatMembersFilterMembers[source]

Bases: TlObject, ChatMembersFilter

Returns all chat members, including restricted chat members

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatMembersFilterMembers]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatMembersFilter']

classmethod getType()[source]
Return type:

Literal['chatMembersFilterMembers']

to_dict()[source]
Return type:

dict

class pytdbot.types.ChatMembersFilterMention(message_thread_id=0)[source]

Bases: TlObject, ChatMembersFilter

Returns users which can be mentioned in the chat

Parameters:

message_thread_id (int) – If non-zero, the identifier of the current message thread

__init__(message_thread_id=0)[source]
Parameters:

message_thread_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatMembersFilterMention]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatMembersFilter']

classmethod getType()[source]
Return type:

Literal['chatMembersFilterMention']

to_dict()[source]
Return type:

dict

message_thread_id: int

If non-zero, the identifier of the current message thread

class pytdbot.types.ChatMembersFilterRestricted[source]

Bases: TlObject, ChatMembersFilter

Returns users under certain restrictions in the chat; can be used only by administrators in a supergroup

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatMembersFilterRestricted]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatMembersFilter']

classmethod getType()[source]
Return type:

Literal['chatMembersFilterRestricted']

to_dict()[source]
Return type:

dict

class pytdbot.types.ChatMessageSender(sender=None, needs_premium=False)[source]

Bases: TlObject

Represents a message sender, which can be used to send messages in a chat

Parameters:
  • sender ("types.MessageSender") – The message sender

  • needs_premium (bool) – True, if Telegram Premium is needed to use the message sender

__init__(sender=None, needs_premium=False)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatMessageSender]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatMessageSender']

classmethod getType()[source]
Return type:

Literal['chatMessageSender']

to_dict()[source]
Return type:

dict

needs_premium: bool

True, if Telegram Premium is needed to use the message sender

sender: Union[MessageSenderUser, MessageSenderChat, None]

The message sender

class pytdbot.types.ChatMessageSenders(senders=None)[source]

Bases: TlObject

Represents a list of message senders, which can be used to send messages in a chat

Parameters:

senders (List["types.ChatMessageSender"]) – List of available message senders

__init__(senders=None)[source]
Parameters:

senders (List[ChatMessageSender] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatMessageSenders]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatMessageSenders']

classmethod getType()[source]
Return type:

Literal['chatMessageSenders']

to_dict()[source]
Return type:

dict

senders: List[ChatMessageSender]

List of available message senders

class pytdbot.types.ChatNotificationSettings(use_default_mute_for=False, mute_for=0, use_default_sound=False, sound_id=0, use_default_show_preview=False, show_preview=False, use_default_mute_stories=False, mute_stories=False, use_default_story_sound=False, story_sound_id=0, use_default_show_story_poster=False, show_story_poster=False, use_default_disable_pinned_message_notifications=False, disable_pinned_message_notifications=False, use_default_disable_mention_notifications=False, disable_mention_notifications=False)[source]

Bases: TlObject

Contains information about notification settings for a chat or a forum topic

Parameters:
  • use_default_mute_for (bool) – If true, the value for the relevant type of chat or the forum chat is used instead of mute_for

  • mute_for (int) – Time left before notifications will be unmuted, in seconds

  • use_default_sound (bool) – If true, the value for the relevant type of chat or the forum chat is used instead of sound_id

  • sound_id (int) – Identifier of the notification sound to be played for messages; 0 if sound is disabled

  • use_default_show_preview (bool) – If true, the value for the relevant type of chat or the forum chat is used instead of show_preview

  • show_preview (bool) – True, if message content must be displayed in notifications

  • use_default_mute_stories (bool) – If true, the value for the relevant type of chat is used instead of mute_stories

  • mute_stories (bool) – True, if story notifications are disabled for the chat

  • use_default_story_sound (bool) – If true, the value for the relevant type of chat is used instead of story_sound_id

  • story_sound_id (int) – Identifier of the notification sound to be played for stories; 0 if sound is disabled

  • use_default_show_story_poster (bool) – If true, the value for the relevant type of chat is used instead of show_story_poster

  • show_story_poster (bool) – True, if the chat that posted a story must be displayed in notifications

  • use_default_disable_pinned_message_notifications (bool) – If true, the value for the relevant type of chat or the forum chat is used instead of disable_pinned_message_notifications

  • disable_pinned_message_notifications (bool) – If true, notifications for incoming pinned messages will be created as for an ordinary unread message

  • use_default_disable_mention_notifications (bool) – If true, the value for the relevant type of chat or the forum chat is used instead of disable_mention_notifications

  • disable_mention_notifications (bool) – If true, notifications for messages with mentions will be created as for an ordinary unread message

__init__(use_default_mute_for=False, mute_for=0, use_default_sound=False, sound_id=0, use_default_show_preview=False, show_preview=False, use_default_mute_stories=False, mute_stories=False, use_default_story_sound=False, story_sound_id=0, use_default_show_story_poster=False, show_story_poster=False, use_default_disable_pinned_message_notifications=False, disable_pinned_message_notifications=False, use_default_disable_mention_notifications=False, disable_mention_notifications=False)[source]
Parameters:
  • use_default_mute_for (bool)

  • mute_for (int)

  • use_default_sound (bool)

  • sound_id (int)

  • use_default_show_preview (bool)

  • show_preview (bool)

  • use_default_mute_stories (bool)

  • mute_stories (bool)

  • use_default_story_sound (bool)

  • story_sound_id (int)

  • use_default_show_story_poster (bool)

  • show_story_poster (bool)

  • use_default_disable_pinned_message_notifications (bool)

  • disable_pinned_message_notifications (bool)

  • use_default_disable_mention_notifications (bool)

  • disable_mention_notifications (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatNotificationSettings]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatNotificationSettings']

classmethod getType()[source]
Return type:

Literal['chatNotificationSettings']

to_dict()[source]
Return type:

dict

disable_mention_notifications: bool

If true, notifications for messages with mentions will be created as for an ordinary unread message

disable_pinned_message_notifications: bool

If true, notifications for incoming pinned messages will be created as for an ordinary unread message

mute_for: int

Time left before notifications will be unmuted, in seconds

mute_stories: bool

True, if story notifications are disabled for the chat

show_preview: bool

True, if message content must be displayed in notifications

show_story_poster: bool

True, if the chat that posted a story must be displayed in notifications

sound_id: int

Identifier of the notification sound to be played for messages; 0 if sound is disabled

story_sound_id: int

Identifier of the notification sound to be played for stories; 0 if sound is disabled

use_default_disable_mention_notifications: bool

If true, the value for the relevant type of chat or the forum chat is used instead of disable_mention_notifications

use_default_disable_pinned_message_notifications: bool

If true, the value for the relevant type of chat or the forum chat is used instead of disable_pinned_message_notifications

use_default_mute_for: bool

If true, the value for the relevant type of chat or the forum chat is used instead of mute_for

use_default_mute_stories: bool

If true, the value for the relevant type of chat is used instead of mute_stories

use_default_show_preview: bool

If true, the value for the relevant type of chat or the forum chat is used instead of show_preview

use_default_show_story_poster: bool

If true, the value for the relevant type of chat is used instead of show_story_poster

use_default_sound: bool

If true, the value for the relevant type of chat or the forum chat is used instead of sound_id

use_default_story_sound: bool

If true, the value for the relevant type of chat is used instead of story_sound_id

class pytdbot.types.ChatPermissions(can_send_basic_messages=False, can_send_audios=False, can_send_documents=False, can_send_photos=False, can_send_videos=False, can_send_video_notes=False, can_send_voice_notes=False, can_send_polls=False, can_send_other_messages=False, can_add_link_previews=False, can_change_info=False, can_invite_users=False, can_pin_messages=False, can_create_topics=False)[source]

Bases: TlObject

Describes actions that a user is allowed to take in a chat

Parameters:
  • can_send_basic_messages (bool) – True, if the user can send text messages, contacts, giveaways, giveaway winners, invoices, locations, and venues

  • can_send_audios (bool) – True, if the user can send music files

  • can_send_documents (bool) – True, if the user can send documents

  • can_send_photos (bool) – True, if the user can send photos

  • can_send_videos (bool) – True, if the user can send videos

  • can_send_video_notes (bool) – True, if the user can send video notes

  • can_send_voice_notes (bool) – True, if the user can send voice notes

  • can_send_polls (bool) – True, if the user can send polls and checklists

  • can_send_other_messages (bool) – True, if the user can send animations, games, stickers, and dice and use inline bots

  • can_add_link_previews (bool) – True, if the user may add a link preview to their messages

  • can_change_info (bool) – True, if the user can change the chat title, photo, and other settings

  • can_invite_users (bool) – True, if the user can invite new users to the chat

  • can_pin_messages (bool) – True, if the user can pin messages

  • can_create_topics (bool) – True, if the user can create topics

__init__(can_send_basic_messages=False, can_send_audios=False, can_send_documents=False, can_send_photos=False, can_send_videos=False, can_send_video_notes=False, can_send_voice_notes=False, can_send_polls=False, can_send_other_messages=False, can_add_link_previews=False, can_change_info=False, can_invite_users=False, can_pin_messages=False, can_create_topics=False)[source]
Parameters:
  • can_send_basic_messages (bool)

  • can_send_audios (bool)

  • can_send_documents (bool)

  • can_send_photos (bool)

  • can_send_videos (bool)

  • can_send_video_notes (bool)

  • can_send_voice_notes (bool)

  • can_send_polls (bool)

  • can_send_other_messages (bool)

  • can_add_link_previews (bool)

  • can_change_info (bool)

  • can_invite_users (bool)

  • can_pin_messages (bool)

  • can_create_topics (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatPermissions]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatPermissions']

classmethod getType()[source]
Return type:

Literal['chatPermissions']

to_dict()[source]
Return type:

dict

can_add_link_previews: bool

True, if the user may add a link preview to their messages

can_change_info: bool

True, if the user can change the chat title, photo, and other settings

can_create_topics: bool

True, if the user can create topics

can_invite_users: bool

True, if the user can invite new users to the chat

can_pin_messages: bool

True, if the user can pin messages

can_send_audios: bool

True, if the user can send music files

can_send_basic_messages: bool

True, if the user can send text messages, contacts, giveaways, giveaway winners, invoices, locations, and venues

can_send_documents: bool

True, if the user can send documents

can_send_other_messages: bool

True, if the user can send animations, games, stickers, and dice and use inline bots

can_send_photos: bool

True, if the user can send photos

can_send_polls: bool

True, if the user can send polls and checklists

can_send_video_notes: bool

True, if the user can send video notes

can_send_videos: bool

True, if the user can send videos

can_send_voice_notes: bool

True, if the user can send voice notes

class pytdbot.types.ChatPhoto(id=0, added_date=0, minithumbnail=None, sizes=None, animation=None, small_animation=None, sticker=None)[source]

Bases: TlObject

Describes a chat or user profile photo

Parameters:
  • id (int) – Unique photo identifier

  • added_date (int) – Point in time (Unix timestamp) when the photo has been added

  • minithumbnail ("types.Minithumbnail") – Photo minithumbnail; may be null

  • sizes (List["types.PhotoSize"]) – Available variants of the photo in JPEG format, in different size

  • animation ("types.AnimatedChatPhoto") – A big (up to 1280x1280) animated variant of the photo in MPEG4 format; may be null

  • small_animation ("types.AnimatedChatPhoto") – A small (160x160) animated variant of the photo in MPEG4 format; may be null even if the big animation is available

  • sticker ("types.ChatPhotoSticker") – Sticker-based version of the chat photo; may be null

__init__(id=0, added_date=0, minithumbnail=None, sizes=None, animation=None, small_animation=None, sticker=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatPhoto]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatPhoto']

classmethod getType()[source]
Return type:

Literal['chatPhoto']

to_dict()[source]
Return type:

dict

added_date: int

Point in time (Unix timestamp) when the photo has been added

animation: Optional[AnimatedChatPhoto]

A big (up to 1280x1280) animated variant of the photo in MPEG4 format; may be null

id: int

Unique photo identifier

minithumbnail: Optional[Minithumbnail]

Photo minithumbnail; may be null

sizes: List[PhotoSize]

Available variants of the photo in JPEG format, in different size

small_animation: Optional[AnimatedChatPhoto]

A small (160x160) animated variant of the photo in MPEG4 format; may be null even if the big animation is available

sticker: Optional[ChatPhotoSticker]

Sticker-based version of the chat photo; may be null

class pytdbot.types.ChatPhotoInfo(small=None, big=None, minithumbnail=None, has_animation=False, is_personal=False)[source]

Bases: TlObject

Contains basic information about the photo of a chat

Parameters:
  • small ("types.File") – A small (160x160) chat photo variant in JPEG format. The file can be downloaded only before the photo is changed

  • big ("types.File") – A big (640x640) chat photo variant in JPEG format. The file can be downloaded only before the photo is changed

  • minithumbnail ("types.Minithumbnail") – Chat photo minithumbnail; may be null

  • has_animation (bool) – True, if the photo has animated variant

  • is_personal (bool) – True, if the photo is visible only for the current user

__init__(small=None, big=None, minithumbnail=None, has_animation=False, is_personal=False)[source]
Parameters:
  • small (File | None)

  • big (File | None)

  • minithumbnail (Minithumbnail | None)

  • has_animation (bool)

  • is_personal (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatPhotoInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatPhotoInfo']

classmethod getType()[source]
Return type:

Literal['chatPhotoInfo']

to_dict()[source]
Return type:

dict

big: Optional[File]

A big (640x640) chat photo variant in JPEG format. The file can be downloaded only before the photo is changed

has_animation: bool

True, if the photo has animated variant

is_personal: bool

True, if the photo is visible only for the current user

minithumbnail: Optional[Minithumbnail]

Chat photo minithumbnail; may be null

small: Optional[File]

A small (160x160) chat photo variant in JPEG format. The file can be downloaded only before the photo is changed

class pytdbot.types.ChatPhotoSticker(type=None, background_fill=None)[source]

Bases: TlObject

Information about the sticker, which was used to create the chat photo. The sticker is shown at the center of the photo and occupies at most 67% of it

Parameters:
  • type ("types.ChatPhotoStickerType") – Type of the sticker

  • background_fill ("types.BackgroundFill") – The fill to be used as background for the sticker; rotation angle in backgroundFillGradient isn’t supported

__init__(type=None, background_fill=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatPhotoSticker]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatPhotoSticker']

classmethod getType()[source]
Return type:

Literal['chatPhotoSticker']

to_dict()[source]
Return type:

dict

background_fill: Union[BackgroundFillSolid, BackgroundFillGradient, BackgroundFillFreeformGradient, None]

The fill to be used as background for the sticker; rotation angle in backgroundFillGradient isn’t supported

type: Union[ChatPhotoStickerTypeRegularOrMask, ChatPhotoStickerTypeCustomEmoji, None]

Type of the sticker

class pytdbot.types.ChatPhotoStickerType[source]

Bases: object

Describes type of sticker, which was used to create a chat photo

class pytdbot.types.ChatPhotoStickerTypeCustomEmoji(custom_emoji_id=0)[source]

Bases: TlObject, ChatPhotoStickerType

Information about the custom emoji, which was used to create the chat photo

Parameters:

custom_emoji_id (int) – Identifier of the custom emoji

__init__(custom_emoji_id=0)[source]
Parameters:

custom_emoji_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatPhotoStickerTypeCustomEmoji]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatPhotoStickerType']

classmethod getType()[source]
Return type:

Literal['chatPhotoStickerTypeCustomEmoji']

to_dict()[source]
Return type:

dict

custom_emoji_id: int

Identifier of the custom emoji

class pytdbot.types.ChatPhotoStickerTypeRegularOrMask(sticker_set_id=0, sticker_id=0)[source]

Bases: TlObject, ChatPhotoStickerType

Information about the sticker, which was used to create the chat photo

Parameters:
  • sticker_set_id (int) – Sticker set identifier

  • sticker_id (int) – Identifier of the sticker in the set

__init__(sticker_set_id=0, sticker_id=0)[source]
Parameters:
  • sticker_set_id (int)

  • sticker_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatPhotoStickerTypeRegularOrMask]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatPhotoStickerType']

classmethod getType()[source]
Return type:

Literal['chatPhotoStickerTypeRegularOrMask']

to_dict()[source]
Return type:

dict

sticker_id: int

Identifier of the sticker in the set

sticker_set_id: int

Sticker set identifier

class pytdbot.types.ChatPhotos(total_count=0, photos=None)[source]

Bases: TlObject

Contains a list of chat or user profile photos

Parameters:
  • total_count (int) – Total number of photos

  • photos (List["types.ChatPhoto"]) – List of photos

__init__(total_count=0, photos=None)[source]
Parameters:
  • total_count (int)

  • photos (List[ChatPhoto] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatPhotos]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatPhotos']

classmethod getType()[source]
Return type:

Literal['chatPhotos']

to_dict()[source]
Return type:

dict

photos: List[ChatPhoto]

List of photos

total_count: int

Total number of photos

class pytdbot.types.ChatPosition(list=None, order=0, is_pinned=False, source=None)[source]

Bases: TlObject

Describes a position of a chat in a chat list

Parameters:
  • list ("types.ChatList") – The chat list

  • order (int) – A parameter used to determine order of the chat in the chat list. Chats must be sorted by the pair (order, chat.id) in descending order

  • is_pinned (bool) – True, if the chat is pinned in the chat list

  • source ("types.ChatSource") – Source of the chat in the chat list; may be null

__init__(list=None, order=0, is_pinned=False, source=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatPosition]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatPosition']

classmethod getType()[source]
Return type:

Literal['chatPosition']

to_dict()[source]
Return type:

dict

is_pinned: bool

True, if the chat is pinned in the chat list

list: Union[ChatListMain, ChatListArchive, ChatListFolder, None]

The chat list

order: int

A parameter used to determine order of the chat in the chat list. Chats must be sorted by the pair (order, chat.id) in descending order

source: Union[ChatSourceMtprotoProxy, ChatSourcePublicServiceAnnouncement, None]

Source of the chat in the chat list; may be null

class pytdbot.types.ChatRevenueAmount(cryptocurrency='', total_amount=0, balance_amount=0, available_amount=0, withdrawal_enabled=False)[source]

Bases: TlObject

Contains information about revenue earned from sponsored messages in a chat

Parameters:
  • cryptocurrency (str) – Cryptocurrency in which revenue is calculated

  • total_amount (int) – Total amount of the cryptocurrency earned, in the smallest units of the cryptocurrency

  • balance_amount (int) – Amount of the cryptocurrency that isn’t withdrawn yet, in the smallest units of the cryptocurrency

  • available_amount (int) – Amount of the cryptocurrency available for withdrawal, in the smallest units of the cryptocurrency

  • withdrawal_enabled (bool) – True, if Telegram Stars can be withdrawn now or later

__init__(cryptocurrency='', total_amount=0, balance_amount=0, available_amount=0, withdrawal_enabled=False)[source]
Parameters:
  • cryptocurrency (str)

  • total_amount (int)

  • balance_amount (int)

  • available_amount (int)

  • withdrawal_enabled (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatRevenueAmount]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatRevenueAmount']

classmethod getType()[source]
Return type:

Literal['chatRevenueAmount']

to_dict()[source]
Return type:

dict

available_amount: int

Amount of the cryptocurrency available for withdrawal, in the smallest units of the cryptocurrency

balance_amount: int

Amount of the cryptocurrency that isn’t withdrawn yet, in the smallest units of the cryptocurrency

cryptocurrency: Optional[str]

Cryptocurrency in which revenue is calculated

total_amount: int

Total amount of the cryptocurrency earned, in the smallest units of the cryptocurrency

withdrawal_enabled: bool

True, if Telegram Stars can be withdrawn now or later

class pytdbot.types.ChatRevenueStatistics(revenue_by_hour_graph=None, revenue_graph=None, revenue_amount=None, usd_rate=0.0)[source]

Bases: TlObject

A detailed statistics about revenue earned from sponsored messages in a chat

Parameters:
  • revenue_by_hour_graph ("types.StatisticalGraph") – A graph containing amount of revenue in a given hour

  • revenue_graph ("types.StatisticalGraph") – A graph containing amount of revenue

  • revenue_amount ("types.ChatRevenueAmount") – Amount of earned revenue

  • usd_rate (float) – Current conversion rate of the cryptocurrency in which revenue is calculated to USD

__init__(revenue_by_hour_graph=None, revenue_graph=None, revenue_amount=None, usd_rate=0.0)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatRevenueStatistics]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatRevenueStatistics']

classmethod getType()[source]
Return type:

Literal['chatRevenueStatistics']

to_dict()[source]
Return type:

dict

revenue_amount: Optional[ChatRevenueAmount]

Amount of earned revenue

revenue_by_hour_graph: Union[StatisticalGraphData, StatisticalGraphAsync, StatisticalGraphError, None]

A graph containing amount of revenue in a given hour

revenue_graph: Union[StatisticalGraphData, StatisticalGraphAsync, StatisticalGraphError, None]

A graph containing amount of revenue

usd_rate: float

Current conversion rate of the cryptocurrency in which revenue is calculated to USD

class pytdbot.types.ChatRevenueTransaction(cryptocurrency='', cryptocurrency_amount=0, type=None)[source]

Bases: TlObject

Contains a chat revenue transactions

Parameters:
  • cryptocurrency (str) – Cryptocurrency in which revenue is calculated

  • cryptocurrency_amount (int) – The withdrawn amount, in the smallest units of the cryptocurrency

  • type ("types.ChatRevenueTransactionType") – Type of the transaction

__init__(cryptocurrency='', cryptocurrency_amount=0, type=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatRevenueTransaction]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatRevenueTransaction']

classmethod getType()[source]
Return type:

Literal['chatRevenueTransaction']

to_dict()[source]
Return type:

dict

cryptocurrency: Optional[str]

Cryptocurrency in which revenue is calculated

cryptocurrency_amount: int

The withdrawn amount, in the smallest units of the cryptocurrency

type: Union[ChatRevenueTransactionTypeUnsupported, ChatRevenueTransactionTypeSponsoredMessageEarnings, ChatRevenueTransactionTypeSuggestedPostEarnings, ChatRevenueTransactionTypeFragmentWithdrawal, ChatRevenueTransactionTypeFragmentRefund, None]

Type of the transaction

class pytdbot.types.ChatRevenueTransactionType[source]

Bases: object

Describes type of transaction for revenue earned from sponsored messages in a chat

class pytdbot.types.ChatRevenueTransactionTypeFragmentRefund(refund_date=0)[source]

Bases: TlObject, ChatRevenueTransactionType

Describes a refund for failed withdrawal of earnings through Fragment

Parameters:

refund_date (int) – Point in time (Unix timestamp) when the transaction was refunded

__init__(refund_date=0)[source]
Parameters:

refund_date (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatRevenueTransactionTypeFragmentRefund]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatRevenueTransactionType']

classmethod getType()[source]
Return type:

Literal['chatRevenueTransactionTypeFragmentRefund']

to_dict()[source]
Return type:

dict

refund_date: int

Point in time (Unix timestamp) when the transaction was refunded

class pytdbot.types.ChatRevenueTransactionTypeFragmentWithdrawal(withdrawal_date=0, state=None)[source]

Bases: TlObject, ChatRevenueTransactionType

Describes a withdrawal of earnings through Fragment

Parameters:
  • withdrawal_date (int) – Point in time (Unix timestamp) when the earnings withdrawal started

  • state ("types.RevenueWithdrawalState") – State of the withdrawal

__init__(withdrawal_date=0, state=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatRevenueTransactionTypeFragmentWithdrawal]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatRevenueTransactionType']

classmethod getType()[source]
Return type:

Literal['chatRevenueTransactionTypeFragmentWithdrawal']

to_dict()[source]
Return type:

dict

state: Union[RevenueWithdrawalStatePending, RevenueWithdrawalStateSucceeded, RevenueWithdrawalStateFailed, None]

State of the withdrawal

withdrawal_date: int

Point in time (Unix timestamp) when the earnings withdrawal started

class pytdbot.types.ChatRevenueTransactionTypeSponsoredMessageEarnings(start_date=0, end_date=0)[source]

Bases: TlObject, ChatRevenueTransactionType

Describes earnings from sponsored messages in a chat in some time frame

Parameters:
  • start_date (int) – Point in time (Unix timestamp) when the earnings started

  • end_date (int) – Point in time (Unix timestamp) when the earnings ended

__init__(start_date=0, end_date=0)[source]
Parameters:
  • start_date (int)

  • end_date (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatRevenueTransactionTypeSponsoredMessageEarnings]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatRevenueTransactionType']

classmethod getType()[source]
Return type:

Literal['chatRevenueTransactionTypeSponsoredMessageEarnings']

to_dict()[source]
Return type:

dict

end_date: int

Point in time (Unix timestamp) when the earnings ended

start_date: int

Point in time (Unix timestamp) when the earnings started

class pytdbot.types.ChatRevenueTransactionTypeSuggestedPostEarnings(user_id=0)[source]

Bases: TlObject, ChatRevenueTransactionType

Describes earnings from a published suggested post

Parameters:

user_id (int) – Identifier of the user that paid for the suggested post

__init__(user_id=0)[source]
Parameters:

user_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatRevenueTransactionTypeSuggestedPostEarnings]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatRevenueTransactionType']

classmethod getType()[source]
Return type:

Literal['chatRevenueTransactionTypeSuggestedPostEarnings']

to_dict()[source]
Return type:

dict

user_id: int

Identifier of the user that paid for the suggested post

class pytdbot.types.ChatRevenueTransactionTypeUnsupported[source]

Bases: TlObject, ChatRevenueTransactionType

Describes an unsupported transaction

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatRevenueTransactionTypeUnsupported]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatRevenueTransactionType']

classmethod getType()[source]
Return type:

Literal['chatRevenueTransactionTypeUnsupported']

to_dict()[source]
Return type:

dict

class pytdbot.types.ChatRevenueTransactions(ton_amount=0, transactions=None, next_offset='')[source]

Bases: TlObject

Contains a list of chat revenue transactions

Parameters:
  • ton_amount (int) – The amount of owned Toncoins; in the smallest units of the cryptocurrency

  • transactions (List["types.ChatRevenueTransaction"]) – List of transactions

  • next_offset (str) – The offset for the next request. If empty, then there are no more results

__init__(ton_amount=0, transactions=None, next_offset='')[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatRevenueTransactions]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatRevenueTransactions']

classmethod getType()[source]
Return type:

Literal['chatRevenueTransactions']

to_dict()[source]
Return type:

dict

next_offset: Optional[str]

The offset for the next request. If empty, then there are no more results

ton_amount: int

The amount of owned Toncoins; in the smallest units of the cryptocurrency

transactions: List[ChatRevenueTransaction]

List of transactions

class pytdbot.types.ChatSource[source]

Bases: object

Describes a reason why an external chat is shown in a chat list

class pytdbot.types.ChatSourceMtprotoProxy[source]

Bases: TlObject, ChatSource

The chat is sponsored by the user’s MTProxy server

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatSourceMtprotoProxy]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatSource']

classmethod getType()[source]
Return type:

Literal['chatSourceMtprotoProxy']

to_dict()[source]
Return type:

dict

class pytdbot.types.ChatSourcePublicServiceAnnouncement(type='', text='')[source]

Bases: TlObject, ChatSource

The chat contains a public service announcement

Parameters:
  • type (str) – The type of the announcement

  • text (str) – The text of the announcement

__init__(type='', text='')[source]
Parameters:
  • type (str)

  • text (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatSourcePublicServiceAnnouncement]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatSource']

classmethod getType()[source]
Return type:

Literal['chatSourcePublicServiceAnnouncement']

to_dict()[source]
Return type:

dict

text: Optional[str]

The text of the announcement

type: Optional[str]

The type of the announcement

class pytdbot.types.ChatStatistics[source]

Bases: object

Contains a detailed statistics about a chat

class pytdbot.types.ChatStatisticsAdministratorActionsInfo(user_id=0, deleted_message_count=0, banned_user_count=0, restricted_user_count=0)[source]

Bases: TlObject

Contains statistics about administrator actions done by a user

Parameters:
  • user_id (int) – Administrator user identifier

  • deleted_message_count (int) – Number of messages deleted by the administrator

  • banned_user_count (int) – Number of users banned by the administrator

  • restricted_user_count (int) – Number of users restricted by the administrator

__init__(user_id=0, deleted_message_count=0, banned_user_count=0, restricted_user_count=0)[source]
Parameters:
  • user_id (int)

  • deleted_message_count (int)

  • banned_user_count (int)

  • restricted_user_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatStatisticsAdministratorActionsInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatStatisticsAdministratorActionsInfo']

classmethod getType()[source]
Return type:

Literal['chatStatisticsAdministratorActionsInfo']

to_dict()[source]
Return type:

dict

banned_user_count: int

Number of users banned by the administrator

deleted_message_count: int

Number of messages deleted by the administrator

restricted_user_count: int

Number of users restricted by the administrator

user_id: int

Administrator user identifier

class pytdbot.types.ChatStatisticsChannel(period=None, member_count=None, mean_message_view_count=None, mean_message_share_count=None, mean_message_reaction_count=None, mean_story_view_count=None, mean_story_share_count=None, mean_story_reaction_count=None, enabled_notifications_percentage=0.0, member_count_graph=None, join_graph=None, mute_graph=None, view_count_by_hour_graph=None, view_count_by_source_graph=None, join_by_source_graph=None, language_graph=None, message_interaction_graph=None, message_reaction_graph=None, story_interaction_graph=None, story_reaction_graph=None, instant_view_interaction_graph=None, recent_interactions=None)[source]

Bases: TlObject, ChatStatistics

A detailed statistics about a channel chat

Parameters:
  • period ("types.DateRange") – A period to which the statistics applies

  • member_count ("types.StatisticalValue") – Number of members in the chat

  • mean_message_view_count ("types.StatisticalValue") – Mean number of times the recently sent messages were viewed

  • mean_message_share_count ("types.StatisticalValue") – Mean number of times the recently sent messages were shared

  • mean_message_reaction_count ("types.StatisticalValue") – Mean number of times reactions were added to the recently sent messages

  • mean_story_view_count ("types.StatisticalValue") – Mean number of times the recently posted stories were viewed

  • mean_story_share_count ("types.StatisticalValue") – Mean number of times the recently posted stories were shared

  • mean_story_reaction_count ("types.StatisticalValue") – Mean number of times reactions were added to the recently posted stories

  • enabled_notifications_percentage (float) – A percentage of users with enabled notifications for the chat; 0-100

  • member_count_graph ("types.StatisticalGraph") – A graph containing number of members in the chat

  • join_graph ("types.StatisticalGraph") – A graph containing number of members joined and left the chat

  • mute_graph ("types.StatisticalGraph") – A graph containing number of members muted and unmuted the chat

  • view_count_by_hour_graph ("types.StatisticalGraph") – A graph containing number of message views in a given hour in the last two weeks

  • view_count_by_source_graph ("types.StatisticalGraph") – A graph containing number of message views per source

  • join_by_source_graph ("types.StatisticalGraph") – A graph containing number of new member joins per source

  • language_graph ("types.StatisticalGraph") – A graph containing number of users viewed chat messages per language

  • message_interaction_graph ("types.StatisticalGraph") – A graph containing number of chat message views and shares

  • message_reaction_graph ("types.StatisticalGraph") – A graph containing number of reactions on messages

  • story_interaction_graph ("types.StatisticalGraph") – A graph containing number of story views and shares

  • story_reaction_graph ("types.StatisticalGraph") – A graph containing number of reactions on stories

  • instant_view_interaction_graph ("types.StatisticalGraph") – A graph containing number of views of associated with the chat instant views

  • recent_interactions (List["types.ChatStatisticsInteractionInfo"]) – Detailed statistics about number of views and shares of recently sent messages and posted stories

__init__(period=None, member_count=None, mean_message_view_count=None, mean_message_share_count=None, mean_message_reaction_count=None, mean_story_view_count=None, mean_story_share_count=None, mean_story_reaction_count=None, enabled_notifications_percentage=0.0, member_count_graph=None, join_graph=None, mute_graph=None, view_count_by_hour_graph=None, view_count_by_source_graph=None, join_by_source_graph=None, language_graph=None, message_interaction_graph=None, message_reaction_graph=None, story_interaction_graph=None, story_reaction_graph=None, instant_view_interaction_graph=None, recent_interactions=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatStatisticsChannel]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatStatistics']

classmethod getType()[source]
Return type:

Literal['chatStatisticsChannel']

to_dict()[source]
Return type:

dict

enabled_notifications_percentage: float

A percentage of users with enabled notifications for the chat; 0-100

instant_view_interaction_graph: Union[StatisticalGraphData, StatisticalGraphAsync, StatisticalGraphError, None]

A graph containing number of views of associated with the chat instant views

join_by_source_graph: Union[StatisticalGraphData, StatisticalGraphAsync, StatisticalGraphError, None]

A graph containing number of new member joins per source

join_graph: Union[StatisticalGraphData, StatisticalGraphAsync, StatisticalGraphError, None]

A graph containing number of members joined and left the chat

language_graph: Union[StatisticalGraphData, StatisticalGraphAsync, StatisticalGraphError, None]

A graph containing number of users viewed chat messages per language

mean_message_reaction_count: Optional[StatisticalValue]

Mean number of times reactions were added to the recently sent messages

mean_message_share_count: Optional[StatisticalValue]

Mean number of times the recently sent messages were shared

mean_message_view_count: Optional[StatisticalValue]

Mean number of times the recently sent messages were viewed

mean_story_reaction_count: Optional[StatisticalValue]

Mean number of times reactions were added to the recently posted stories

mean_story_share_count: Optional[StatisticalValue]

Mean number of times the recently posted stories were shared

mean_story_view_count: Optional[StatisticalValue]

Mean number of times the recently posted stories were viewed

member_count: Optional[StatisticalValue]

Number of members in the chat

member_count_graph: Union[StatisticalGraphData, StatisticalGraphAsync, StatisticalGraphError, None]

A graph containing number of members in the chat

message_interaction_graph: Union[StatisticalGraphData, StatisticalGraphAsync, StatisticalGraphError, None]

A graph containing number of chat message views and shares

message_reaction_graph: Union[StatisticalGraphData, StatisticalGraphAsync, StatisticalGraphError, None]

A graph containing number of reactions on messages

mute_graph: Union[StatisticalGraphData, StatisticalGraphAsync, StatisticalGraphError, None]

A graph containing number of members muted and unmuted the chat

period: Optional[DateRange]

A period to which the statistics applies

recent_interactions: List[ChatStatisticsInteractionInfo]

Detailed statistics about number of views and shares of recently sent messages and posted stories

story_interaction_graph: Union[StatisticalGraphData, StatisticalGraphAsync, StatisticalGraphError, None]

A graph containing number of story views and shares

story_reaction_graph: Union[StatisticalGraphData, StatisticalGraphAsync, StatisticalGraphError, None]

A graph containing number of reactions on stories

view_count_by_hour_graph: Union[StatisticalGraphData, StatisticalGraphAsync, StatisticalGraphError, None]

A graph containing number of message views in a given hour in the last two weeks

view_count_by_source_graph: Union[StatisticalGraphData, StatisticalGraphAsync, StatisticalGraphError, None]

A graph containing number of message views per source

class pytdbot.types.ChatStatisticsInteractionInfo(object_type=None, view_count=0, forward_count=0, reaction_count=0)[source]

Bases: TlObject

Contains statistics about interactions with a message sent in the chat or a story posted on behalf of the chat

Parameters:
  • object_type ("types.ChatStatisticsObjectType") – Type of the object

  • view_count (int) – Number of times the object was viewed

  • forward_count (int) – Number of times the object was forwarded

  • reaction_count (int) – Number of times reactions were added to the object

__init__(object_type=None, view_count=0, forward_count=0, reaction_count=0)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatStatisticsInteractionInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatStatisticsInteractionInfo']

classmethod getType()[source]
Return type:

Literal['chatStatisticsInteractionInfo']

to_dict()[source]
Return type:

dict

forward_count: int

Number of times the object was forwarded

object_type: Union[ChatStatisticsObjectTypeMessage, ChatStatisticsObjectTypeStory, None]

Type of the object

reaction_count: int

Number of times reactions were added to the object

view_count: int

Number of times the object was viewed

class pytdbot.types.ChatStatisticsInviterInfo(user_id=0, added_member_count=0)[source]

Bases: TlObject

Contains statistics about number of new members invited by a user

Parameters:
  • user_id (int) – User identifier

  • added_member_count (int) – Number of new members invited by the user

__init__(user_id=0, added_member_count=0)[source]
Parameters:
  • user_id (int)

  • added_member_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatStatisticsInviterInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatStatisticsInviterInfo']

classmethod getType()[source]
Return type:

Literal['chatStatisticsInviterInfo']

to_dict()[source]
Return type:

dict

added_member_count: int

Number of new members invited by the user

user_id: int

User identifier

class pytdbot.types.ChatStatisticsMessageSenderInfo(user_id=0, sent_message_count=0, average_character_count=0)[source]

Bases: TlObject

Contains statistics about messages sent by a user

Parameters:
  • user_id (int) – User identifier

  • sent_message_count (int) – Number of sent messages

  • average_character_count (int) – Average number of characters in sent messages; 0 if unknown

__init__(user_id=0, sent_message_count=0, average_character_count=0)[source]
Parameters:
  • user_id (int)

  • sent_message_count (int)

  • average_character_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatStatisticsMessageSenderInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatStatisticsMessageSenderInfo']

classmethod getType()[source]
Return type:

Literal['chatStatisticsMessageSenderInfo']

to_dict()[source]
Return type:

dict

average_character_count: int

Average number of characters in sent messages; 0 if unknown

sent_message_count: int

Number of sent messages

user_id: int

User identifier

class pytdbot.types.ChatStatisticsObjectType[source]

Bases: object

Describes type of object, for which statistics are provided

class pytdbot.types.ChatStatisticsObjectTypeMessage(message_id=0)[source]

Bases: TlObject, ChatStatisticsObjectType

Describes a message sent in the chat

Parameters:

message_id (int) – Message identifier

__init__(message_id=0)[source]
Parameters:

message_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatStatisticsObjectTypeMessage]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatStatisticsObjectType']

classmethod getType()[source]
Return type:

Literal['chatStatisticsObjectTypeMessage']

to_dict()[source]
Return type:

dict

message_id: int

Message identifier

class pytdbot.types.ChatStatisticsObjectTypeStory(story_id=0)[source]

Bases: TlObject, ChatStatisticsObjectType

Describes a story posted on behalf of the chat

Parameters:

story_id (int) – Story identifier

__init__(story_id=0)[source]
Parameters:

story_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatStatisticsObjectTypeStory]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatStatisticsObjectType']

classmethod getType()[source]
Return type:

Literal['chatStatisticsObjectTypeStory']

to_dict()[source]
Return type:

dict

story_id: int

Story identifier

class pytdbot.types.ChatStatisticsSupergroup(period=None, member_count=None, message_count=None, viewer_count=None, sender_count=None, member_count_graph=None, join_graph=None, join_by_source_graph=None, language_graph=None, message_content_graph=None, action_graph=None, day_graph=None, week_graph=None, top_senders=None, top_administrators=None, top_inviters=None)[source]

Bases: TlObject, ChatStatistics

A detailed statistics about a supergroup chat

Parameters:
  • period ("types.DateRange") – A period to which the statistics applies

  • member_count ("types.StatisticalValue") – Number of members in the chat

  • message_count ("types.StatisticalValue") – Number of messages sent to the chat

  • viewer_count ("types.StatisticalValue") – Number of users who viewed messages in the chat

  • sender_count ("types.StatisticalValue") – Number of users who sent messages to the chat

  • member_count_graph ("types.StatisticalGraph") – A graph containing number of members in the chat

  • join_graph ("types.StatisticalGraph") – A graph containing number of members joined and left the chat

  • join_by_source_graph ("types.StatisticalGraph") – A graph containing number of new member joins per source

  • language_graph ("types.StatisticalGraph") – A graph containing distribution of active users per language

  • message_content_graph ("types.StatisticalGraph") – A graph containing distribution of sent messages by content type

  • action_graph ("types.StatisticalGraph") – A graph containing number of different actions in the chat

  • day_graph ("types.StatisticalGraph") – A graph containing distribution of message views per hour

  • week_graph ("types.StatisticalGraph") – A graph containing distribution of message views per day of week

  • top_senders (List["types.ChatStatisticsMessageSenderInfo"]) – List of users sent most messages in the last week

  • top_administrators (List["types.ChatStatisticsAdministratorActionsInfo"]) – List of most active administrators in the last week

  • top_inviters (List["types.ChatStatisticsInviterInfo"]) – List of most active inviters of new members in the last week

__init__(period=None, member_count=None, message_count=None, viewer_count=None, sender_count=None, member_count_graph=None, join_graph=None, join_by_source_graph=None, language_graph=None, message_content_graph=None, action_graph=None, day_graph=None, week_graph=None, top_senders=None, top_administrators=None, top_inviters=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatStatisticsSupergroup]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatStatistics']

classmethod getType()[source]
Return type:

Literal['chatStatisticsSupergroup']

to_dict()[source]
Return type:

dict

action_graph: Union[StatisticalGraphData, StatisticalGraphAsync, StatisticalGraphError, None]

A graph containing number of different actions in the chat

day_graph: Union[StatisticalGraphData, StatisticalGraphAsync, StatisticalGraphError, None]

A graph containing distribution of message views per hour

join_by_source_graph: Union[StatisticalGraphData, StatisticalGraphAsync, StatisticalGraphError, None]

A graph containing number of new member joins per source

join_graph: Union[StatisticalGraphData, StatisticalGraphAsync, StatisticalGraphError, None]

A graph containing number of members joined and left the chat

language_graph: Union[StatisticalGraphData, StatisticalGraphAsync, StatisticalGraphError, None]

A graph containing distribution of active users per language

member_count: Optional[StatisticalValue]

Number of members in the chat

member_count_graph: Union[StatisticalGraphData, StatisticalGraphAsync, StatisticalGraphError, None]

A graph containing number of members in the chat

message_content_graph: Union[StatisticalGraphData, StatisticalGraphAsync, StatisticalGraphError, None]

A graph containing distribution of sent messages by content type

message_count: Optional[StatisticalValue]

Number of messages sent to the chat

period: Optional[DateRange]

A period to which the statistics applies

sender_count: Optional[StatisticalValue]

Number of users who sent messages to the chat

top_administrators: List[ChatStatisticsAdministratorActionsInfo]

List of most active administrators in the last week

top_inviters: List[ChatStatisticsInviterInfo]

List of most active inviters of new members in the last week

top_senders: List[ChatStatisticsMessageSenderInfo]

List of users sent most messages in the last week

viewer_count: Optional[StatisticalValue]

Number of users who viewed messages in the chat

week_graph: Union[StatisticalGraphData, StatisticalGraphAsync, StatisticalGraphError, None]

A graph containing distribution of message views per day of week

class pytdbot.types.ChatTheme[source]

Bases: object

Describes a chat theme

class pytdbot.types.ChatThemeEmoji(name='')[source]

Bases: TlObject, ChatTheme

A chat theme based on an emoji

Parameters:

name (str) – Name of the theme; full theme description is received through updateEmojiChatThemes

__init__(name='')[source]
Parameters:

name (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatThemeEmoji]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatTheme']

classmethod getType()[source]
Return type:

Literal['chatThemeEmoji']

to_dict()[source]
Return type:

dict

name: Optional[str]

Name of the theme; full theme description is received through updateEmojiChatThemes

class pytdbot.types.ChatThemeGift(gift_theme=None)[source]

Bases: TlObject, ChatTheme

A chat theme based on an upgraded gift

Parameters:

gift_theme ("types.GiftChatTheme") – The chat theme

__init__(gift_theme=None)[source]
Parameters:

gift_theme (GiftChatTheme | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatThemeGift]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatTheme']

classmethod getType()[source]
Return type:

Literal['chatThemeGift']

to_dict()[source]
Return type:

dict

gift_theme: Optional[GiftChatTheme]

The chat theme

class pytdbot.types.ChatType[source]

Bases: object

Describes the type of chat

class pytdbot.types.ChatTypeBasicGroup(basic_group_id=0)[source]

Bases: TlObject, ChatType

A basic group (a chat with 0-200 other users)

Parameters:

basic_group_id (int) – Basic group identifier

__init__(basic_group_id=0)[source]
Parameters:

basic_group_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatTypeBasicGroup]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatType']

classmethod getType()[source]
Return type:

Literal['chatTypeBasicGroup']

to_dict()[source]
Return type:

dict

basic_group_id: int

Basic group identifier

class pytdbot.types.ChatTypePrivate(user_id=0)[source]

Bases: TlObject, ChatType

An ordinary chat with a user

Parameters:

user_id (int) – User identifier

__init__(user_id=0)[source]
Parameters:

user_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatTypePrivate]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatType']

classmethod getType()[source]
Return type:

Literal['chatTypePrivate']

to_dict()[source]
Return type:

dict

user_id: int

User identifier

class pytdbot.types.ChatTypeSecret(secret_chat_id=0, user_id=0)[source]

Bases: TlObject, ChatType

A secret chat with a user

Parameters:
  • secret_chat_id (int) – Secret chat identifier

  • user_id (int) – User identifier of the other user in the secret chat

__init__(secret_chat_id=0, user_id=0)[source]
Parameters:
  • secret_chat_id (int)

  • user_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatTypeSecret]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatType']

classmethod getType()[source]
Return type:

Literal['chatTypeSecret']

to_dict()[source]
Return type:

dict

secret_chat_id: int

Secret chat identifier

user_id: int

User identifier of the other user in the secret chat

class pytdbot.types.ChatTypeSupergroup(supergroup_id=0, is_channel=False)[source]

Bases: TlObject, ChatType

A supergroup or channel (with unlimited members)

Parameters:
  • supergroup_id (int) – Supergroup or channel identifier

  • is_channel (bool) – True, if the supergroup is a channel

__init__(supergroup_id=0, is_channel=False)[source]
Parameters:
  • supergroup_id (int)

  • is_channel (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChatTypeSupergroup]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChatType']

classmethod getType()[source]
Return type:

Literal['chatTypeSupergroup']

to_dict()[source]
Return type:

dict

is_channel: bool

True, if the supergroup is a channel

supergroup_id: int

Supergroup or channel identifier

class pytdbot.types.Chats(total_count=0, chat_ids=None)[source]

Bases: TlObject

Represents a list of chats

Parameters:
  • total_count (int) – Approximate total number of chats found

  • chat_ids (List[int]) – List of chat identifiers

__init__(total_count=0, chat_ids=None)[source]
Parameters:
  • total_count (int)

  • chat_ids (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Chats]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Chats']

classmethod getType()[source]
Return type:

Literal['chats']

to_dict()[source]
Return type:

dict

chat_ids: List[int]

List of chat identifiers

total_count: int

Approximate total number of chats found

class pytdbot.types.CheckChatUsernameResult[source]

Bases: object

Represents result of checking whether a username can be set for a chat

class pytdbot.types.CheckChatUsernameResultOk[source]

Bases: TlObject, CheckChatUsernameResult

The username can be set

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CheckChatUsernameResultOk]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CheckChatUsernameResult']

classmethod getType()[source]
Return type:

Literal['checkChatUsernameResultOk']

to_dict()[source]
Return type:

dict

class pytdbot.types.CheckChatUsernameResultPublicChatsTooMany[source]

Bases: TlObject, CheckChatUsernameResult

The user has too many chats with username, one of them must be made private first

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CheckChatUsernameResultPublicChatsTooMany]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CheckChatUsernameResult']

classmethod getType()[source]
Return type:

Literal['checkChatUsernameResultPublicChatsTooMany']

to_dict()[source]
Return type:

dict

class pytdbot.types.CheckChatUsernameResultPublicGroupsUnavailable[source]

Bases: TlObject, CheckChatUsernameResult

The user can’t be a member of a public supergroup

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CheckChatUsernameResultPublicGroupsUnavailable]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CheckChatUsernameResult']

classmethod getType()[source]
Return type:

Literal['checkChatUsernameResultPublicGroupsUnavailable']

to_dict()[source]
Return type:

dict

class pytdbot.types.CheckChatUsernameResultUsernameInvalid[source]

Bases: TlObject, CheckChatUsernameResult

The username is invalid

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CheckChatUsernameResultUsernameInvalid]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CheckChatUsernameResult']

classmethod getType()[source]
Return type:

Literal['checkChatUsernameResultUsernameInvalid']

to_dict()[source]
Return type:

dict

class pytdbot.types.CheckChatUsernameResultUsernameOccupied[source]

Bases: TlObject, CheckChatUsernameResult

The username is occupied

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CheckChatUsernameResultUsernameOccupied]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CheckChatUsernameResult']

classmethod getType()[source]
Return type:

Literal['checkChatUsernameResultUsernameOccupied']

to_dict()[source]
Return type:

dict

class pytdbot.types.CheckChatUsernameResultUsernamePurchasable[source]

Bases: TlObject, CheckChatUsernameResult

The username can be purchased at https://fragment.com. Information about the username can be received using getCollectibleItemInfo

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CheckChatUsernameResultUsernamePurchasable]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CheckChatUsernameResult']

classmethod getType()[source]
Return type:

Literal['checkChatUsernameResultUsernamePurchasable']

to_dict()[source]
Return type:

dict

class pytdbot.types.CheckStickerSetNameResult[source]

Bases: object

Represents result of checking whether a name can be used for a new sticker set

class pytdbot.types.CheckStickerSetNameResultNameInvalid[source]

Bases: TlObject, CheckStickerSetNameResult

The name is invalid

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CheckStickerSetNameResultNameInvalid]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CheckStickerSetNameResult']

classmethod getType()[source]
Return type:

Literal['checkStickerSetNameResultNameInvalid']

to_dict()[source]
Return type:

dict

class pytdbot.types.CheckStickerSetNameResultNameOccupied[source]

Bases: TlObject, CheckStickerSetNameResult

The name is occupied

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CheckStickerSetNameResultNameOccupied]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CheckStickerSetNameResult']

classmethod getType()[source]
Return type:

Literal['checkStickerSetNameResultNameOccupied']

to_dict()[source]
Return type:

dict

class pytdbot.types.CheckStickerSetNameResultOk[source]

Bases: TlObject, CheckStickerSetNameResult

The name can be set

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CheckStickerSetNameResultOk]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CheckStickerSetNameResult']

classmethod getType()[source]
Return type:

Literal['checkStickerSetNameResultOk']

to_dict()[source]
Return type:

dict

class pytdbot.types.Checklist(title=None, tasks=None, others_can_add_tasks=False, can_add_tasks=False, others_can_mark_tasks_as_done=False, can_mark_tasks_as_done=False)[source]

Bases: TlObject

Describes a checklist

Parameters:
  • title ("types.FormattedText") – Title of the checklist; may contain only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities

  • tasks (List["types.ChecklistTask"]) – List of tasks in the checklist

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

  • can_add_tasks (bool) – True, if the current user can add tasks to the list if they have Telegram Premium subscription

  • others_can_mark_tasks_as_done (bool) – True, if users other than creator of the list can mark tasks as done or not done. If true, then the checklist is called "group checklist"

  • can_mark_tasks_as_done (bool) – True, if the current user can mark tasks as done or not done if they have Telegram Premium subscription

__init__(title=None, tasks=None, others_can_add_tasks=False, can_add_tasks=False, others_can_mark_tasks_as_done=False, can_mark_tasks_as_done=False)[source]
Parameters:
  • title (FormattedText | None)

  • tasks (List[ChecklistTask] | None)

  • others_can_add_tasks (bool)

  • can_add_tasks (bool)

  • others_can_mark_tasks_as_done (bool)

  • can_mark_tasks_as_done (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Checklist]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Checklist']

classmethod getType()[source]
Return type:

Literal['checklist']

to_dict()[source]
Return type:

dict

can_add_tasks: bool

True, if the current user can add tasks to the list if they have Telegram Premium subscription

can_mark_tasks_as_done: bool

True, if the current user can mark tasks as done or not done if they have Telegram Premium subscription

others_can_add_tasks: bool

True, if users other than creator of the list can add tasks to the list

others_can_mark_tasks_as_done: bool

True, if users other than creator of the list can mark tasks as done or not done. If true, then the checklist is called "group checklist"

tasks: List[ChecklistTask]

List of tasks in the checklist

title: Optional[FormattedText]

Title of the checklist; may contain only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities

class pytdbot.types.ChecklistTask(id=0, text=None, completed_by_user_id=0, completion_date=0)[source]

Bases: TlObject

Describes a task in a checklist

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

  • text ("types.FormattedText") – Text of the task; may contain only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Url, EmailAddress, Mention, Hashtag, Cashtag and PhoneNumber entities

  • completed_by_user_id (int) – Identifier of the user that completed the task; 0 if the task isn’t completed

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

__init__(id=0, text=None, completed_by_user_id=0, completion_date=0)[source]
Parameters:
  • id (int)

  • text (FormattedText | None)

  • completed_by_user_id (int)

  • completion_date (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ChecklistTask]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ChecklistTask']

classmethod getType()[source]
Return type:

Literal['checklistTask']

to_dict()[source]
Return type:

dict

completed_by_user_id: int

Identifier of the user that completed the task; 0 if the task isn’t completed

completion_date: int

Point in time (Unix timestamp) when the task was completed; 0 if the task isn’t completed

id: int

Unique identifier of the task

text: Optional[FormattedText]

Text of the task; may contain only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Url, EmailAddress, Mention, Hashtag, Cashtag and PhoneNumber entities

class pytdbot.types.CloseBirthdayUser(user_id=0, birthdate=None)[source]

Bases: TlObject

Describes a user that had or will have a birthday soon

Parameters:
  • user_id (int) – User identifier

  • birthdate ("types.Birthdate") – Birthdate of the user

__init__(user_id=0, birthdate=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CloseBirthdayUser]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CloseBirthdayUser']

classmethod getType()[source]
Return type:

Literal['closeBirthdayUser']

to_dict()[source]
Return type:

dict

birthdate: Optional[Birthdate]

Birthdate of the user

user_id: int

User identifier

class pytdbot.types.ClosedVectorPath(commands=None)[source]

Bases: TlObject

Represents a closed vector path. The path begins at the end point of the last command. The coordinate system origin is in the upper-left corner

Parameters:

commands (List["types.VectorPathCommand"]) – List of vector path commands

__init__(commands=None)[source]
Parameters:

commands (List[VectorPathCommand] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ClosedVectorPath]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ClosedVectorPath']

classmethod getType()[source]
Return type:

Literal['closedVectorPath']

to_dict()[source]
Return type:

dict

commands: List[VectorPathCommand]

List of vector path commands

class pytdbot.types.CollectibleItemInfo(purchase_date=0, currency='', amount=0, cryptocurrency='', cryptocurrency_amount=0, url='')[source]

Bases: TlObject

Contains information about a collectible item and its last purchase

Parameters:
  • purchase_date (int) – Point in time (Unix timestamp) when the item was purchased

  • currency (str) – Currency for the paid amount

  • amount (int) – The paid amount, in the smallest units of the currency

  • cryptocurrency (str) – Cryptocurrency used to pay for the item

  • cryptocurrency_amount (int) – The paid amount, in the smallest units of the cryptocurrency

  • url (str) – Individual URL for the item on https://fragment.com

__init__(purchase_date=0, currency='', amount=0, cryptocurrency='', cryptocurrency_amount=0, url='')[source]
Parameters:
  • purchase_date (int)

  • currency (str)

  • amount (int)

  • cryptocurrency (str)

  • cryptocurrency_amount (int)

  • url (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CollectibleItemInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CollectibleItemInfo']

classmethod getType()[source]
Return type:

Literal['collectibleItemInfo']

to_dict()[source]
Return type:

dict

amount: int

The paid amount, in the smallest units of the currency

cryptocurrency: Optional[str]

Cryptocurrency used to pay for the item

cryptocurrency_amount: int

The paid amount, in the smallest units of the cryptocurrency

currency: Optional[str]

Currency for the paid amount

purchase_date: int

Point in time (Unix timestamp) when the item was purchased

url: Optional[str]

//fragment.com

Type:

Individual URL for the item on https

class pytdbot.types.CollectibleItemType[source]

Bases: object

Describes a collectible item that can be purchased at https://fragment.com

class pytdbot.types.CollectibleItemTypePhoneNumber(phone_number='')[source]

Bases: TlObject, CollectibleItemType

A phone number

Parameters:

phone_number (str) – The phone number

__init__(phone_number='')[source]
Parameters:

phone_number (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CollectibleItemTypePhoneNumber]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CollectibleItemType']

classmethod getType()[source]
Return type:

Literal['collectibleItemTypePhoneNumber']

to_dict()[source]
Return type:

dict

phone_number: Optional[str]

The phone number

class pytdbot.types.CollectibleItemTypeUsername(username='')[source]

Bases: TlObject, CollectibleItemType

A username

Parameters:

username (str) – The username

__init__(username='')[source]
Parameters:

username (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CollectibleItemTypeUsername]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CollectibleItemType']

classmethod getType()[source]
Return type:

Literal['collectibleItemTypeUsername']

to_dict()[source]
Return type:

dict

username: Optional[str]

The username

class pytdbot.types.ConnectedAffiliateProgram(url='', bot_user_id=0, parameters=None, connection_date=0, is_disconnected=False, user_count=0, revenue_star_count=0)[source]

Bases: TlObject

Describes an affiliate program that was connected to an affiliate

Parameters:
  • url (str) – The link that can be used to refer users if the program is still active

  • bot_user_id (int) – User identifier of the bot created the program

  • parameters ("types.AffiliateProgramParameters") – The parameters of the affiliate program

  • connection_date (int) – Point in time (Unix timestamp) when the affiliate program was connected

  • is_disconnected (bool) – True, if the program was canceled by the bot, or disconnected by the chat owner and isn’t available anymore

  • user_count (int) – The number of users that used the affiliate program

  • revenue_star_count (int) – The number of Telegram Stars that were earned by the affiliate program

__init__(url='', bot_user_id=0, parameters=None, connection_date=0, is_disconnected=False, user_count=0, revenue_star_count=0)[source]
Parameters:
  • url (str)

  • bot_user_id (int)

  • parameters (AffiliateProgramParameters | None)

  • connection_date (int)

  • is_disconnected (bool)

  • user_count (int)

  • revenue_star_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ConnectedAffiliateProgram]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ConnectedAffiliateProgram']

classmethod getType()[source]
Return type:

Literal['connectedAffiliateProgram']

to_dict()[source]
Return type:

dict

bot_user_id: int

User identifier of the bot created the program

connection_date: int

Point in time (Unix timestamp) when the affiliate program was connected

is_disconnected: bool

True, if the program was canceled by the bot, or disconnected by the chat owner and isn’t available anymore

parameters: Optional[AffiliateProgramParameters]

The parameters of the affiliate program

revenue_star_count: int

The number of Telegram Stars that were earned by the affiliate program

url: Optional[str]

The link that can be used to refer users if the program is still active

user_count: int

The number of users that used the affiliate program

class pytdbot.types.ConnectedAffiliatePrograms(total_count=0, programs=None, next_offset='')[source]

Bases: TlObject

Represents a list of affiliate programs that were connected to an affiliate

Parameters:
  • total_count (int) – The total number of affiliate programs that were connected to the affiliate

  • programs (List["types.ConnectedAffiliateProgram"]) – The list of connected affiliate programs

  • next_offset (str) – The offset for the next request. If empty, then there are no more results

__init__(total_count=0, programs=None, next_offset='')[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ConnectedAffiliatePrograms]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ConnectedAffiliatePrograms']

classmethod getType()[source]
Return type:

Literal['connectedAffiliatePrograms']

to_dict()[source]
Return type:

dict

next_offset: Optional[str]

The offset for the next request. If empty, then there are no more results

programs: List[ConnectedAffiliateProgram]

The list of connected affiliate programs

total_count: int

The total number of affiliate programs that were connected to the affiliate

class pytdbot.types.ConnectedWebsite(id=0, domain_name='', bot_user_id=0, browser='', platform='', log_in_date=0, last_active_date=0, ip_address='', location='')[source]

Bases: TlObject

Contains information about one website the current user is logged in with Telegram

Parameters:
  • id (int) – Website identifier

  • domain_name (str) – The domain name of the website

  • bot_user_id (int) – User identifier of a bot linked with the website

  • browser (str) – The version of a browser used to log in

  • platform (str) – Operating system the browser is running on

  • log_in_date (int) – Point in time (Unix timestamp) when the user was logged in

  • last_active_date (int) – Point in time (Unix timestamp) when obtained authorization was last used

  • ip_address (str) – IP address from which the user was logged in, in human-readable format

  • location (str) – Human-readable description of a country and a region from which the user was logged in, based on the IP address

__init__(id=0, domain_name='', bot_user_id=0, browser='', platform='', log_in_date=0, last_active_date=0, ip_address='', location='')[source]
Parameters:
  • id (int)

  • domain_name (str)

  • bot_user_id (int)

  • browser (str)

  • platform (str)

  • log_in_date (int)

  • last_active_date (int)

  • ip_address (str)

  • location (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ConnectedWebsite]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ConnectedWebsite']

classmethod getType()[source]
Return type:

Literal['connectedWebsite']

to_dict()[source]
Return type:

dict

bot_user_id: int

User identifier of a bot linked with the website

browser: Optional[str]

The version of a browser used to log in

domain_name: Optional[str]

The domain name of the website

id: int

Website identifier

ip_address: Optional[str]

IP address from which the user was logged in, in human-readable format

last_active_date: int

Point in time (Unix timestamp) when obtained authorization was last used

location: Optional[str]

Human-readable description of a country and a region from which the user was logged in, based on the IP address

log_in_date: int

Point in time (Unix timestamp) when the user was logged in

platform: Optional[str]

Operating system the browser is running on

class pytdbot.types.ConnectedWebsites(websites=None)[source]

Bases: TlObject

Contains a list of websites the current user is logged in with Telegram

Parameters:

websites (List["types.ConnectedWebsite"]) – List of connected websites

__init__(websites=None)[source]
Parameters:

websites (List[ConnectedWebsite] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ConnectedWebsites]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ConnectedWebsites']

classmethod getType()[source]
Return type:

Literal['connectedWebsites']

to_dict()[source]
Return type:

dict

websites: List[ConnectedWebsite]

List of connected websites

class pytdbot.types.ConnectionState[source]

Bases: object

Describes the current state of the connection to Telegram servers

class pytdbot.types.ConnectionStateConnecting[source]

Bases: TlObject, ConnectionState

Establishing a connection to the Telegram servers

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ConnectionStateConnecting]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ConnectionState']

classmethod getType()[source]
Return type:

Literal['connectionStateConnecting']

to_dict()[source]
Return type:

dict

class pytdbot.types.ConnectionStateConnectingToProxy[source]

Bases: TlObject, ConnectionState

Establishing a connection with a proxy server

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ConnectionStateConnectingToProxy]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ConnectionState']

classmethod getType()[source]
Return type:

Literal['connectionStateConnectingToProxy']

to_dict()[source]
Return type:

dict

class pytdbot.types.ConnectionStateReady[source]

Bases: TlObject, ConnectionState

There is a working connection to the Telegram servers

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ConnectionStateReady]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ConnectionState']

classmethod getType()[source]
Return type:

Literal['connectionStateReady']

to_dict()[source]
Return type:

dict

class pytdbot.types.ConnectionStateUpdating[source]

Bases: TlObject, ConnectionState

Downloading data expected to be received while the application was offline

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ConnectionStateUpdating]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ConnectionState']

classmethod getType()[source]
Return type:

Literal['connectionStateUpdating']

to_dict()[source]
Return type:

dict

class pytdbot.types.ConnectionStateWaitingForNetwork[source]

Bases: TlObject, ConnectionState

Waiting for the network to become available. Use setNetworkType to change the available network type

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ConnectionStateWaitingForNetwork]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ConnectionState']

classmethod getType()[source]
Return type:

Literal['connectionStateWaitingForNetwork']

to_dict()[source]
Return type:

dict

class pytdbot.types.Contact(phone_number='', first_name='', last_name='', vcard='', user_id=0)[source]

Bases: TlObject

Describes a user contact

Parameters:
  • phone_number (str) – Phone number of the user

  • first_name (str) – First name of the user; 1-255 characters in length

  • last_name (str) – Last name of the user

  • vcard (str) – Additional data about the user in a form of vCard; 0-2048 bytes in length

  • user_id (int) – Identifier of the user, if known; 0 otherwise

__init__(phone_number='', first_name='', last_name='', vcard='', user_id=0)[source]
Parameters:
  • phone_number (str)

  • first_name (str)

  • last_name (str)

  • vcard (str)

  • user_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Contact]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Contact']

classmethod getType()[source]
Return type:

Literal['contact']

to_dict()[source]
Return type:

dict

first_name: Optional[str]

First name of the user; 1-255 characters in length

last_name: Optional[str]

Last name of the user

phone_number: Optional[str]

Phone number of the user

user_id: int

Identifier of the user, if known; 0 otherwise

vcard: Optional[str]

Additional data about the user in a form of vCard; 0-2048 bytes in length

class pytdbot.types.Count(count=0)[source]

Bases: TlObject

Contains a counter

Parameters:

count (int) – Count

__init__(count=0)[source]
Parameters:

count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Count]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Count']

classmethod getType()[source]
Return type:

Literal['count']

to_dict()[source]
Return type:

dict

count: int

Count

class pytdbot.types.Countries(countries=None)[source]

Bases: TlObject

Contains information about countries

Parameters:

countries (List["types.CountryInfo"]) – The list of countries

__init__(countries=None)[source]
Parameters:

countries (List[CountryInfo] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Countries]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Countries']

classmethod getType()[source]
Return type:

Literal['countries']

to_dict()[source]
Return type:

dict

countries: List[CountryInfo]

The list of countries

class pytdbot.types.CountryInfo(country_code='', name='', english_name='', is_hidden=False, calling_codes=None)[source]

Bases: TlObject

Contains information about a country

Parameters:
  • country_code (str) – A two-letter ISO 3166-1 alpha-2 country code

  • name (str) – Native name of the country

  • english_name (str) – English name of the country

  • is_hidden (bool) – True, if the country must be hidden from the list of all countries

  • calling_codes (List[str]) – List of country calling codes

__init__(country_code='', name='', english_name='', is_hidden=False, calling_codes=None)[source]
Parameters:
  • country_code (str)

  • name (str)

  • english_name (str)

  • is_hidden (bool)

  • calling_codes (List[str] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CountryInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CountryInfo']

classmethod getType()[source]
Return type:

Literal['countryInfo']

to_dict()[source]
Return type:

dict

calling_codes: List[str]

List of country calling codes

country_code: Optional[str]

A two-letter ISO 3166-1 alpha-2 country code

english_name: Optional[str]

English name of the country

is_hidden: bool

True, if the country must be hidden from the list of all countries

name: Optional[str]

Native name of the country

class pytdbot.types.CreatedBasicGroupChat(chat_id=0, failed_to_add_members=None)[source]

Bases: TlObject

Contains information about a newly created basic group chat

Parameters:
  • chat_id (int) – Chat identifier

  • failed_to_add_members ("types.FailedToAddMembers") – Information about failed to add members

__init__(chat_id=0, failed_to_add_members=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CreatedBasicGroupChat]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CreatedBasicGroupChat']

classmethod getType()[source]
Return type:

Literal['createdBasicGroupChat']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

failed_to_add_members: Optional[FailedToAddMembers]

Information about failed to add members

class pytdbot.types.CurrentWeather(temperature=0.0, emoji='')[source]

Bases: TlObject

Describes the current weather

Parameters:
  • temperature (float) – Temperature, in degree Celsius

  • emoji (str) – Emoji representing the weather

__init__(temperature=0.0, emoji='')[source]
Parameters:
  • temperature (float)

  • emoji (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CurrentWeather]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CurrentWeather']

classmethod getType()[source]
Return type:

Literal['currentWeather']

to_dict()[source]
Return type:

dict

emoji: Optional[str]

Emoji representing the weather

temperature: float

Temperature, in degree Celsius

class pytdbot.types.CustomRequestResult(result='')[source]

Bases: TlObject

Contains the result of a custom request

Parameters:

result (str) – A JSON-serialized result

__init__(result='')[source]
Parameters:

result (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[CustomRequestResult]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['CustomRequestResult']

classmethod getType()[source]
Return type:

Literal['customRequestResult']

to_dict()[source]
Return type:

dict

result: Optional[str]

A JSON-serialized result

class pytdbot.types.Data(data=b'')[source]

Bases: TlObject

Contains some binary data

Parameters:

data (bytes) – Data

__init__(data=b'')[source]
Parameters:

data (bytes)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Data]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Data']

classmethod getType()[source]
Return type:

Literal['data']

to_dict()[source]
Return type:

dict

data: Optional[bytes]

Data

class pytdbot.types.DatabaseStatistics(statistics='')[source]

Bases: TlObject

Contains database statistics

Parameters:

statistics (str) – Database statistics in an unspecified human-readable format

__init__(statistics='')[source]
Parameters:

statistics (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[DatabaseStatistics]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['DatabaseStatistics']

classmethod getType()[source]
Return type:

Literal['databaseStatistics']

to_dict()[source]
Return type:

dict

statistics: Optional[str]

Database statistics in an unspecified human-readable format

class pytdbot.types.Date(day=0, month=0, year=0)[source]

Bases: TlObject

Represents a date according to the Gregorian calendar

Parameters:
  • day (int) – Day of the month; 1-31

  • month (int) – Month; 1-12

  • year (int) – Year; 1-9999

__init__(day=0, month=0, year=0)[source]
Parameters:
  • day (int)

  • month (int)

  • year (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Date]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Date']

classmethod getType()[source]
Return type:

Literal['date']

to_dict()[source]
Return type:

dict

day: int

Day of the month; 1-31

month: int

Month; 1-12

year: int

Year; 1-9999

class pytdbot.types.DateRange(start_date=0, end_date=0)[source]

Bases: TlObject

Represents a date range

Parameters:
  • start_date (int) – Point in time (Unix timestamp) at which the date range begins

  • end_date (int) – Point in time (Unix timestamp) at which the date range ends

__init__(start_date=0, end_date=0)[source]
Parameters:
  • start_date (int)

  • end_date (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[DateRange]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['DateRange']

classmethod getType()[source]
Return type:

Literal['dateRange']

to_dict()[source]
Return type:

dict

end_date: int

Point in time (Unix timestamp) at which the date range ends

start_date: int

Point in time (Unix timestamp) at which the date range begins

class pytdbot.types.DatedFile(file=None, date=0)[source]

Bases: TlObject

File with the date it was uploaded

Parameters:
  • file ("types.File") – The file

  • date (int) – Point in time (Unix timestamp) when the file was uploaded

__init__(file=None, date=0)[source]
Parameters:
  • file (File | None)

  • date (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[DatedFile]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['DatedFile']

classmethod getType()[source]
Return type:

Literal['datedFile']

to_dict()[source]
Return type:

dict

date: int

Point in time (Unix timestamp) when the file was uploaded

file: Optional[File]

The file

class pytdbot.types.DeepLinkInfo(text=None, need_update_application=False)[source]

Bases: TlObject

Contains information about a tg: deep link

Parameters:
  • text ("types.FormattedText") – Text to be shown to the user

  • need_update_application (bool) – True, if the user must be asked to update the application

__init__(text=None, need_update_application=False)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[DeepLinkInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['DeepLinkInfo']

classmethod getType()[source]
Return type:

Literal['deepLinkInfo']

to_dict()[source]
Return type:

dict

need_update_application: bool

True, if the user must be asked to update the application

text: Optional[FormattedText]

Text to be shown to the user

class pytdbot.types.DeviceToken[source]

Bases: object

Represents a data needed to subscribe for push notifications through registerDevice method. To use specific push notification service, the correct application platform must be specified and a valid server authentication data must be uploaded at https://my.telegram.org

class pytdbot.types.DeviceTokenApplePush(device_token='', is_app_sandbox=False)[source]

Bases: TlObject, DeviceToken

A token for Apple Push Notification service

Parameters:
  • device_token (str) – Device token; may be empty to deregister a device

  • is_app_sandbox (bool) – True, if App Sandbox is enabled

__init__(device_token='', is_app_sandbox=False)[source]
Parameters:
  • device_token (str)

  • is_app_sandbox (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[DeviceTokenApplePush]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['DeviceToken']

classmethod getType()[source]
Return type:

Literal['deviceTokenApplePush']

to_dict()[source]
Return type:

dict

device_token: Optional[str]

Device token; may be empty to deregister a device

is_app_sandbox: bool

True, if App Sandbox is enabled

class pytdbot.types.DeviceTokenApplePushVoIP(device_token='', is_app_sandbox=False, encrypt=False)[source]

Bases: TlObject, DeviceToken

A token for Apple Push Notification service VoIP notifications

Parameters:
  • device_token (str) – Device token; may be empty to deregister a device

  • is_app_sandbox (bool) – True, if App Sandbox is enabled

  • encrypt (bool) – True, if push notifications must be additionally encrypted

__init__(device_token='', is_app_sandbox=False, encrypt=False)[source]
Parameters:
  • device_token (str)

  • is_app_sandbox (bool)

  • encrypt (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[DeviceTokenApplePushVoIP]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['DeviceToken']

classmethod getType()[source]
Return type:

Literal['deviceTokenApplePushVoIP']

to_dict()[source]
Return type:

dict

device_token: Optional[str]

Device token; may be empty to deregister a device

encrypt: bool

True, if push notifications must be additionally encrypted

is_app_sandbox: bool

True, if App Sandbox is enabled

class pytdbot.types.DeviceTokenBlackBerryPush(token='')[source]

Bases: TlObject, DeviceToken

A token for BlackBerry Push Service

Parameters:

token (str) – Token; may be empty to deregister a device

__init__(token='')[source]
Parameters:

token (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[DeviceTokenBlackBerryPush]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['DeviceToken']

classmethod getType()[source]
Return type:

Literal['deviceTokenBlackBerryPush']

to_dict()[source]
Return type:

dict

token: Optional[str]

Token; may be empty to deregister a device

class pytdbot.types.DeviceTokenFirebaseCloudMessaging(token='', encrypt=False)[source]

Bases: TlObject, DeviceToken

A token for Firebase Cloud Messaging

Parameters:
  • token (str) – Device registration token; may be empty to deregister a device

  • encrypt (bool) – True, if push notifications must be additionally encrypted

__init__(token='', encrypt=False)[source]
Parameters:
  • token (str)

  • encrypt (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[DeviceTokenFirebaseCloudMessaging]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['DeviceToken']

classmethod getType()[source]
Return type:

Literal['deviceTokenFirebaseCloudMessaging']

to_dict()[source]
Return type:

dict

encrypt: bool

True, if push notifications must be additionally encrypted

token: Optional[str]

Device registration token; may be empty to deregister a device

class pytdbot.types.DeviceTokenHuaweiPush(token='', encrypt=False)[source]

Bases: TlObject, DeviceToken

A token for HUAWEI Push Service

Parameters:
  • token (str) – Device registration token; may be empty to deregister a device

  • encrypt (bool) – True, if push notifications must be additionally encrypted

__init__(token='', encrypt=False)[source]
Parameters:
  • token (str)

  • encrypt (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[DeviceTokenHuaweiPush]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['DeviceToken']

classmethod getType()[source]
Return type:

Literal['deviceTokenHuaweiPush']

to_dict()[source]
Return type:

dict

encrypt: bool

True, if push notifications must be additionally encrypted

token: Optional[str]

Device registration token; may be empty to deregister a device

class pytdbot.types.DeviceTokenMicrosoftPush(channel_uri='')[source]

Bases: TlObject, DeviceToken

A token for Microsoft Push Notification Service

Parameters:

channel_uri (str) – Push notification channel URI; may be empty to deregister a device

__init__(channel_uri='')[source]
Parameters:

channel_uri (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[DeviceTokenMicrosoftPush]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['DeviceToken']

classmethod getType()[source]
Return type:

Literal['deviceTokenMicrosoftPush']

to_dict()[source]
Return type:

dict

channel_uri: Optional[str]

Push notification channel URI; may be empty to deregister a device

class pytdbot.types.DeviceTokenMicrosoftPushVoIP(channel_uri='')[source]

Bases: TlObject, DeviceToken

A token for Microsoft Push Notification Service VoIP channel

Parameters:

channel_uri (str) – Push notification channel URI; may be empty to deregister a device

__init__(channel_uri='')[source]
Parameters:

channel_uri (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[DeviceTokenMicrosoftPushVoIP]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['DeviceToken']

classmethod getType()[source]
Return type:

Literal['deviceTokenMicrosoftPushVoIP']

to_dict()[source]
Return type:

dict

channel_uri: Optional[str]

Push notification channel URI; may be empty to deregister a device

class pytdbot.types.DeviceTokenSimplePush(endpoint='')[source]

Bases: TlObject, DeviceToken

A token for Simple Push API for Firefox OS

Parameters:

endpoint (str) – Absolute URL exposed by the push service where the application server can send push messages; may be empty to deregister a device

__init__(endpoint='')[source]
Parameters:

endpoint (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[DeviceTokenSimplePush]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['DeviceToken']

classmethod getType()[source]
Return type:

Literal['deviceTokenSimplePush']

to_dict()[source]
Return type:

dict

endpoint: Optional[str]

Absolute URL exposed by the push service where the application server can send push messages; may be empty to deregister a device

class pytdbot.types.DeviceTokenTizenPush(reg_id='')[source]

Bases: TlObject, DeviceToken

A token for Tizen Push Service

Parameters:

reg_id (str) – Push service registration identifier; may be empty to deregister a device

__init__(reg_id='')[source]
Parameters:

reg_id (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[DeviceTokenTizenPush]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['DeviceToken']

classmethod getType()[source]
Return type:

Literal['deviceTokenTizenPush']

to_dict()[source]
Return type:

dict

reg_id: Optional[str]

Push service registration identifier; may be empty to deregister a device

class pytdbot.types.DeviceTokenUbuntuPush(token='')[source]

Bases: TlObject, DeviceToken

A token for Ubuntu Push Client service

Parameters:

token (str) – Token; may be empty to deregister a device

__init__(token='')[source]
Parameters:

token (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[DeviceTokenUbuntuPush]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['DeviceToken']

classmethod getType()[source]
Return type:

Literal['deviceTokenUbuntuPush']

to_dict()[source]
Return type:

dict

token: Optional[str]

Token; may be empty to deregister a device

class pytdbot.types.DeviceTokenWebPush(endpoint='', p256dh_base64url='', auth_base64url='')[source]

Bases: TlObject, DeviceToken

A token for web Push API

Parameters:
  • endpoint (str) – Absolute URL exposed by the push service where the application server can send push messages; may be empty to deregister a device

  • p256dh_base64url (str) – Base64url-encoded P-256 elliptic curve Diffie-Hellman public key

  • auth_base64url (str) – Base64url-encoded authentication secret

__init__(endpoint='', p256dh_base64url='', auth_base64url='')[source]
Parameters:
  • endpoint (str)

  • p256dh_base64url (str)

  • auth_base64url (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[DeviceTokenWebPush]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['DeviceToken']

classmethod getType()[source]
Return type:

Literal['deviceTokenWebPush']

to_dict()[source]
Return type:

dict

auth_base64url: Optional[str]

Base64url-encoded authentication secret

endpoint: Optional[str]

Absolute URL exposed by the push service where the application server can send push messages; may be empty to deregister a device

p256dh_base64url: Optional[str]

Base64url-encoded P-256 elliptic curve Diffie-Hellman public key

class pytdbot.types.DeviceTokenWindowsPush(access_token='')[source]

Bases: TlObject, DeviceToken

A token for Windows Push Notification Services

Parameters:

access_token (str) – The access token that will be used to send notifications; may be empty to deregister a device

__init__(access_token='')[source]
Parameters:

access_token (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[DeviceTokenWindowsPush]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['DeviceToken']

classmethod getType()[source]
Return type:

Literal['deviceTokenWindowsPush']

to_dict()[source]
Return type:

dict

access_token: Optional[str]

The access token that will be used to send notifications; may be empty to deregister a device

class pytdbot.types.DiceStickers[source]

Bases: object

Contains animated stickers which must be used for dice animation rendering

class pytdbot.types.DiceStickersRegular(sticker=None)[source]

Bases: TlObject, DiceStickers

A regular animated sticker

Parameters:

sticker ("types.Sticker") – The animated sticker with the dice animation

__init__(sticker=None)[source]
Parameters:

sticker (Sticker | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[DiceStickersRegular]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['DiceStickers']

classmethod getType()[source]
Return type:

Literal['diceStickersRegular']

to_dict()[source]
Return type:

dict

sticker: Optional[Sticker]

The animated sticker with the dice animation

class pytdbot.types.DiceStickersSlotMachine(background=None, lever=None, left_reel=None, center_reel=None, right_reel=None)[source]

Bases: TlObject, DiceStickers

Animated stickers to be combined into a slot machine

Parameters:
  • background ("types.Sticker") – The animated sticker with the slot machine background. The background animation must start playing after all reel animations finish

  • lever ("types.Sticker") – The animated sticker with the lever animation. The lever animation must play once in the initial dice state

  • left_reel ("types.Sticker") – The animated sticker with the left reel

  • center_reel ("types.Sticker") – The animated sticker with the center reel

  • right_reel ("types.Sticker") – The animated sticker with the right reel

__init__(background=None, lever=None, left_reel=None, center_reel=None, right_reel=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[DiceStickersSlotMachine]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['DiceStickers']

classmethod getType()[source]
Return type:

Literal['diceStickersSlotMachine']

to_dict()[source]
Return type:

dict

background: Optional[Sticker]

The animated sticker with the slot machine background. The background animation must start playing after all reel animations finish

center_reel: Optional[Sticker]

The animated sticker with the center reel

left_reel: Optional[Sticker]

The animated sticker with the left reel

lever: Optional[Sticker]

The animated sticker with the lever animation. The lever animation must play once in the initial dice state

right_reel: Optional[Sticker]

The animated sticker with the right reel

class pytdbot.types.DirectMessagesChatTopic(chat_id=0, id=0, sender_id=None, order=0, can_send_unpaid_messages=False, is_marked_as_unread=False, unread_count=0, last_read_inbox_message_id=0, last_read_outbox_message_id=0, unread_reaction_count=0, last_message=None, draft_message=None)[source]

Bases: TlObject

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

Parameters:
  • chat_id (int) – Identifier of the chat to which the topic belongs

  • id (int) – Unique topic identifier

  • sender_id ("types.MessageSender") – Identifier of the user or chat that sends the messages to the topic

  • order (int) – A parameter used to determine order of the topic in the topic list. Topics must be sorted by the order in descending order

  • can_send_unpaid_messages (bool) – True, if the other party can send unpaid messages even if the chat has paid messages enabled

  • is_marked_as_unread (bool) – True, if the forum topic is marked as unread

  • unread_count (int) – Number of unread messages in the chat

  • last_read_inbox_message_id (int) – Identifier of the last read incoming message

  • last_read_outbox_message_id (int) – Identifier of the last read outgoing message

  • unread_reaction_count (int) – Number of messages with unread reactions in the chat

  • last_message ("types.Message") – Last message in the topic; may be null if none or unknown

  • draft_message ("types.DraftMessage") – A draft of a message in the topic; may be null if none

__init__(chat_id=0, id=0, sender_id=None, order=0, can_send_unpaid_messages=False, is_marked_as_unread=False, unread_count=0, last_read_inbox_message_id=0, last_read_outbox_message_id=0, unread_reaction_count=0, last_message=None, draft_message=None)[source]
Parameters:
  • chat_id (int)

  • id (int)

  • sender_id (MessageSender | None)

  • order (int)

  • can_send_unpaid_messages (bool)

  • is_marked_as_unread (bool)

  • unread_count (int)

  • last_read_inbox_message_id (int)

  • last_read_outbox_message_id (int)

  • unread_reaction_count (int)

  • last_message (Message | None)

  • draft_message (DraftMessage | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[DirectMessagesChatTopic]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['DirectMessagesChatTopic']

classmethod getType()[source]
Return type:

Literal['directMessagesChatTopic']

to_dict()[source]
Return type:

dict

can_send_unpaid_messages: bool

True, if the other party can send unpaid messages even if the chat has paid messages enabled

chat_id: int

Identifier of the chat to which the topic belongs

draft_message: Optional[DraftMessage]

A draft of a message in the topic; may be null if none

id: int

Unique topic identifier

is_marked_as_unread: bool

True, if the forum topic is marked as unread

last_message: Optional[Message]

Last message in the topic; may be null if none or unknown

last_read_inbox_message_id: int

Identifier of the last read incoming message

last_read_outbox_message_id: int

Identifier of the last read outgoing message

order: int

A parameter used to determine order of the topic in the topic list. Topics must be sorted by the order in descending order

sender_id: Union[MessageSenderUser, MessageSenderChat, None]

Identifier of the user or chat that sends the messages to the topic

unread_count: int

Number of unread messages in the chat

unread_reaction_count: int

Number of messages with unread reactions in the chat

class pytdbot.types.Document(file_name='', mime_type='', minithumbnail=None, thumbnail=None, document=None)[source]

Bases: TlObject

Describes a document of any type

Parameters:
  • file_name (str) – Original name of the file; as defined by the sender

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

  • minithumbnail ("types.Minithumbnail") – Document minithumbnail; may be null

  • thumbnail ("types.Thumbnail") – Document thumbnail in JPEG or PNG format (PNG will be used only for background patterns); as defined by the sender; may be null

  • document ("types.File") – File containing the document

__init__(file_name='', mime_type='', minithumbnail=None, thumbnail=None, document=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Document]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Document']

classmethod getType()[source]
Return type:

Literal['document']

to_dict()[source]
Return type:

dict

document: Optional[File]

File containing the document

file_name: Optional[str]

Original name of the file; as defined by the sender

mime_type: Optional[str]

MIME type of the file; as defined by the sender

minithumbnail: Optional[Minithumbnail]

Document minithumbnail; may be null

thumbnail: Optional[Thumbnail]

Document thumbnail in JPEG or PNG format (PNG will be used only for background patterns); as defined by the sender; may be null

class pytdbot.types.DownloadedFileCounts(active_count=0, paused_count=0, completed_count=0)[source]

Bases: TlObject

Contains number of being downloaded and recently downloaded files found

Parameters:
  • active_count (int) – Number of active file downloads found, including paused

  • paused_count (int) – Number of paused file downloads found

  • completed_count (int) – Number of completed file downloads found

__init__(active_count=0, paused_count=0, completed_count=0)[source]
Parameters:
  • active_count (int)

  • paused_count (int)

  • completed_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[DownloadedFileCounts]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['DownloadedFileCounts']

classmethod getType()[source]
Return type:

Literal['downloadedFileCounts']

to_dict()[source]
Return type:

dict

active_count: int

Number of active file downloads found, including paused

completed_count: int

Number of completed file downloads found

paused_count: int

Number of paused file downloads found

class pytdbot.types.DraftMessage(reply_to=None, date=0, input_message_text=None, effect_id=0, suggested_post_info=None)[source]

Bases: TlObject

Contains information about a message draft

Parameters:
  • reply_to ("types.InputMessageReplyTo") – Information about the message to be replied; must be of the type inputMessageReplyToMessage; may be null if none

  • date (int) – Point in time (Unix timestamp) when the draft was created

  • input_message_text ("types.InputMessageContent") – Content of the message draft; must be of the type inputMessageText, inputMessageVideoNote, or inputMessageVoiceNote

  • effect_id (int) – Identifier of the effect to apply to the message when it is sent; 0 if none

  • suggested_post_info ("types.InputSuggestedPostInfo") – Information about the suggested post; may be null if none

__init__(reply_to=None, date=0, input_message_text=None, effect_id=0, suggested_post_info=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[DraftMessage]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['DraftMessage']

classmethod getType()[source]
Return type:

Literal['draftMessage']

to_dict()[source]
Return type:

dict

date: int

Point in time (Unix timestamp) when the draft was created

effect_id: int

Identifier of the effect to apply to the message when it is sent; 0 if none

input_message_text: Union[InputMessageText, InputMessageAnimation, InputMessageAudio, InputMessageDocument, InputMessagePaidMedia, InputMessagePhoto, InputMessageSticker, InputMessageVideo, InputMessageVideoNote, InputMessageVoiceNote, InputMessageLocation, InputMessageVenue, InputMessageContact, InputMessageDice, InputMessageGame, InputMessageInvoice, InputMessagePoll, InputMessageStory, InputMessageChecklist, InputMessageForwarded, None]

Content of the message draft; must be of the type inputMessageText, inputMessageVideoNote, or inputMessageVoiceNote

reply_to: Union[InputMessageReplyToMessage, InputMessageReplyToExternalMessage, InputMessageReplyToStory, None]

Information about the message to be replied; must be of the type inputMessageReplyToMessage; may be null if none

suggested_post_info: Optional[InputSuggestedPostInfo]

Information about the suggested post; may be null if none

class pytdbot.types.EmailAddressAuthentication[source]

Bases: object

Contains authentication data for an email address

class pytdbot.types.EmailAddressAuthenticationAppleId(token='')[source]

Bases: TlObject, EmailAddressAuthentication

An authentication token received through Apple ID

Parameters:

token (str) – The token

__init__(token='')[source]
Parameters:

token (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[EmailAddressAuthenticationAppleId]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['EmailAddressAuthentication']

classmethod getType()[source]
Return type:

Literal['emailAddressAuthenticationAppleId']

to_dict()[source]
Return type:

dict

token: Optional[str]

The token

class pytdbot.types.EmailAddressAuthenticationCode(code='')[source]

Bases: TlObject, EmailAddressAuthentication

An authentication code delivered to a user’s email address

Parameters:

code (str) – The code

__init__(code='')[source]
Parameters:

code (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[EmailAddressAuthenticationCode]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['EmailAddressAuthentication']

classmethod getType()[source]
Return type:

Literal['emailAddressAuthenticationCode']

to_dict()[source]
Return type:

dict

code: Optional[str]

The code

class pytdbot.types.EmailAddressAuthenticationCodeInfo(email_address_pattern='', length=0)[source]

Bases: TlObject

Information about the email address authentication code that was sent

Parameters:
  • email_address_pattern (str) – Pattern of the email address to which an authentication code was sent

  • length (int) – Length of the code; 0 if unknown

__init__(email_address_pattern='', length=0)[source]
Parameters:
  • email_address_pattern (str)

  • length (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[EmailAddressAuthenticationCodeInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['EmailAddressAuthenticationCodeInfo']

classmethod getType()[source]
Return type:

Literal['emailAddressAuthenticationCodeInfo']

to_dict()[source]
Return type:

dict

email_address_pattern: Optional[str]

Pattern of the email address to which an authentication code was sent

length: int

Length of the code; 0 if unknown

class pytdbot.types.EmailAddressAuthenticationGoogleId(token='')[source]

Bases: TlObject, EmailAddressAuthentication

An authentication token received through Google ID

Parameters:

token (str) – The token

__init__(token='')[source]
Parameters:

token (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[EmailAddressAuthenticationGoogleId]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['EmailAddressAuthentication']

classmethod getType()[source]
Return type:

Literal['emailAddressAuthenticationGoogleId']

to_dict()[source]
Return type:

dict

token: Optional[str]

The token

class pytdbot.types.EmailAddressResetState[source]

Bases: object

Describes reset state of an email address

class pytdbot.types.EmailAddressResetStateAvailable(wait_period=0)[source]

Bases: TlObject, EmailAddressResetState

Email address can be reset after the given period. Call resetAuthenticationEmailAddress to reset it and allow the user to authorize with a code sent to the user’s phone number

Parameters:

wait_period (int) – Time required to wait before the email address can be reset; 0 if the user is subscribed to Telegram Premium

__init__(wait_period=0)[source]
Parameters:

wait_period (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[EmailAddressResetStateAvailable]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['EmailAddressResetState']

classmethod getType()[source]
Return type:

Literal['emailAddressResetStateAvailable']

to_dict()[source]
Return type:

dict

wait_period: int

Time required to wait before the email address can be reset; 0 if the user is subscribed to Telegram Premium

class pytdbot.types.EmailAddressResetStatePending(reset_in=0)[source]

Bases: TlObject, EmailAddressResetState

Email address reset has already been requested. Call resetAuthenticationEmailAddress to check whether immediate reset is possible

Parameters:

reset_in (int) – Left time before the email address will be reset, in seconds. updateAuthorizationState is not sent when this field changes

__init__(reset_in=0)[source]
Parameters:

reset_in (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[EmailAddressResetStatePending]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['EmailAddressResetState']

classmethod getType()[source]
Return type:

Literal['emailAddressResetStatePending']

to_dict()[source]
Return type:

dict

reset_in: int

Left time before the email address will be reset, in seconds. updateAuthorizationState is not sent when this field changes

class pytdbot.types.EmojiCategories(categories=None)[source]

Bases: TlObject

Represents a list of emoji categories

Parameters:

categories (List["types.EmojiCategory"]) – List of categories

__init__(categories=None)[source]
Parameters:

categories (List[EmojiCategory] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[EmojiCategories]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['EmojiCategories']

classmethod getType()[source]
Return type:

Literal['emojiCategories']

to_dict()[source]
Return type:

dict

categories: List[EmojiCategory]

List of categories

class pytdbot.types.EmojiCategory(name='', icon=None, source=None, is_greeting=False)[source]

Bases: TlObject

Describes an emoji category

Parameters:
  • name (str) – Name of the category

  • icon ("types.Sticker") – Custom emoji sticker, which represents icon of the category

  • source ("types.EmojiCategorySource") – Source of stickers for the emoji category

  • is_greeting (bool) – True, if the category must be shown first when choosing a sticker for the start page

__init__(name='', icon=None, source=None, is_greeting=False)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[EmojiCategory]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['EmojiCategory']

classmethod getType()[source]
Return type:

Literal['emojiCategory']

to_dict()[source]
Return type:

dict

icon: Optional[Sticker]

Custom emoji sticker, which represents icon of the category

is_greeting: bool

True, if the category must be shown first when choosing a sticker for the start page

name: Optional[str]

Name of the category

source: Union[EmojiCategorySourceSearch, EmojiCategorySourcePremium, None]

Source of stickers for the emoji category

class pytdbot.types.EmojiCategorySource[source]

Bases: object

Describes source of stickers for an emoji category

class pytdbot.types.EmojiCategorySourcePremium[source]

Bases: TlObject, EmojiCategorySource

The category contains premium stickers that must be found by getPremiumStickers

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[EmojiCategorySourcePremium]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['EmojiCategorySource']

classmethod getType()[source]
Return type:

Literal['emojiCategorySourcePremium']

to_dict()[source]
Return type:

dict

class pytdbot.types.EmojiCategorySourceSearch(emojis=None)[source]

Bases: TlObject, EmojiCategorySource

The category contains a list of similar emoji to search for in getStickers and searchStickers for stickers, or getInlineQueryResults with the bot getOption("animation_search_bot_username") for animations

Parameters:

emojis (List[str]) – List of emojis to search for

__init__(emojis=None)[source]
Parameters:

emojis (List[str] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[EmojiCategorySourceSearch]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['EmojiCategorySource']

classmethod getType()[source]
Return type:

Literal['emojiCategorySourceSearch']

to_dict()[source]
Return type:

dict

emojis: List[str]

List of emojis to search for

class pytdbot.types.EmojiCategoryType[source]

Bases: object

Describes type of emoji category

class pytdbot.types.EmojiCategoryTypeChatPhoto[source]

Bases: TlObject, EmojiCategoryType

The category must be used for chat photo emoji selection

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[EmojiCategoryTypeChatPhoto]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['EmojiCategoryType']

classmethod getType()[source]
Return type:

Literal['emojiCategoryTypeChatPhoto']

to_dict()[source]
Return type:

dict

class pytdbot.types.EmojiCategoryTypeDefault[source]

Bases: TlObject, EmojiCategoryType

The category must be used by default (e.g., for custom emoji or animation search)

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[EmojiCategoryTypeDefault]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['EmojiCategoryType']

classmethod getType()[source]
Return type:

Literal['emojiCategoryTypeDefault']

to_dict()[source]
Return type:

dict

class pytdbot.types.EmojiCategoryTypeEmojiStatus[source]

Bases: TlObject, EmojiCategoryType

The category must be used for emoji status selection

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[EmojiCategoryTypeEmojiStatus]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['EmojiCategoryType']

classmethod getType()[source]
Return type:

Literal['emojiCategoryTypeEmojiStatus']

to_dict()[source]
Return type:

dict

class pytdbot.types.EmojiCategoryTypeRegularStickers[source]

Bases: TlObject, EmojiCategoryType

The category must be used by default for regular sticker selection. It may contain greeting emoji category and premium stickers

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[EmojiCategoryTypeRegularStickers]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['EmojiCategoryType']

classmethod getType()[source]
Return type:

Literal['emojiCategoryTypeRegularStickers']

to_dict()[source]
Return type:

dict

class pytdbot.types.EmojiChatTheme(name='', light_settings=None, dark_settings=None)[source]

Bases: TlObject

Describes a chat theme based on an emoji

Parameters:
  • name (str) – Theme name

  • light_settings ("types.ThemeSettings") – Theme settings for a light chat theme

  • dark_settings ("types.ThemeSettings") – Theme settings for a dark chat theme

__init__(name='', light_settings=None, dark_settings=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[EmojiChatTheme]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['EmojiChatTheme']

classmethod getType()[source]
Return type:

Literal['emojiChatTheme']

to_dict()[source]
Return type:

dict

dark_settings: Optional[ThemeSettings]

Theme settings for a dark chat theme

light_settings: Optional[ThemeSettings]

Theme settings for a light chat theme

name: Optional[str]

Theme name

class pytdbot.types.EmojiKeyword(emoji='', keyword='')[source]

Bases: TlObject

Represents an emoji with its keyword

Parameters:
  • emoji (str) – The emoji

  • keyword (str) – The keyword

__init__(emoji='', keyword='')[source]
Parameters:
  • emoji (str)

  • keyword (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[EmojiKeyword]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['EmojiKeyword']

classmethod getType()[source]
Return type:

Literal['emojiKeyword']

to_dict()[source]
Return type:

dict

emoji: Optional[str]

The emoji

keyword: Optional[str]

The keyword

class pytdbot.types.EmojiKeywords(emoji_keywords=None)[source]

Bases: TlObject

Represents a list of emojis with their keywords

Parameters:

emoji_keywords (List["types.EmojiKeyword"]) – List of emojis with their keywords

__init__(emoji_keywords=None)[source]
Parameters:

emoji_keywords (List[EmojiKeyword] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[EmojiKeywords]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['EmojiKeywords']

classmethod getType()[source]
Return type:

Literal['emojiKeywords']

to_dict()[source]
Return type:

dict

emoji_keywords: List[EmojiKeyword]

List of emojis with their keywords

class pytdbot.types.EmojiReaction(emoji='', title='', is_active=False, static_icon=None, appear_animation=None, select_animation=None, activate_animation=None, effect_animation=None, around_animation=None, center_animation=None)[source]

Bases: TlObject

Contains information about an emoji reaction

Parameters:
  • emoji (str) – Text representation of the reaction

  • title (str) – Reaction title

  • is_active (bool) – True, if the reaction can be added to new messages and enabled in chats

  • static_icon ("types.Sticker") – Static icon for the reaction

  • appear_animation ("types.Sticker") – Appear animation for the reaction

  • select_animation ("types.Sticker") – Select animation for the reaction

  • activate_animation ("types.Sticker") – Activate animation for the reaction

  • effect_animation ("types.Sticker") – Effect animation for the reaction

  • around_animation ("types.Sticker") – Around animation for the reaction; may be null

  • center_animation ("types.Sticker") – Center animation for the reaction; may be null

__init__(emoji='', title='', is_active=False, static_icon=None, appear_animation=None, select_animation=None, activate_animation=None, effect_animation=None, around_animation=None, center_animation=None)[source]
Parameters:
  • emoji (str)

  • title (str)

  • is_active (bool)

  • static_icon (Sticker | None)

  • appear_animation (Sticker | None)

  • select_animation (Sticker | None)

  • activate_animation (Sticker | None)

  • effect_animation (Sticker | None)

  • around_animation (Sticker | None)

  • center_animation (Sticker | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[EmojiReaction]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['EmojiReaction']

classmethod getType()[source]
Return type:

Literal['emojiReaction']

to_dict()[source]
Return type:

dict

activate_animation: Optional[Sticker]

Activate animation for the reaction

appear_animation: Optional[Sticker]

Appear animation for the reaction

around_animation: Optional[Sticker]

Around animation for the reaction; may be null

center_animation: Optional[Sticker]

Center animation for the reaction; may be null

effect_animation: Optional[Sticker]

Effect animation for the reaction

emoji: Optional[str]

Text representation of the reaction

is_active: bool

True, if the reaction can be added to new messages and enabled in chats

select_animation: Optional[Sticker]

Select animation for the reaction

static_icon: Optional[Sticker]

Static icon for the reaction

title: Optional[str]

Reaction title

class pytdbot.types.EmojiStatus(type=None, expiration_date=0)[source]

Bases: TlObject

Describes an emoji to be shown instead of the Telegram Premium badge

Parameters:
  • type ("types.EmojiStatusType") – Type of the emoji status

  • expiration_date (int) – Point in time (Unix timestamp) when the status will expire; 0 if never

__init__(type=None, expiration_date=0)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[EmojiStatus]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['EmojiStatus']

classmethod getType()[source]
Return type:

Literal['emojiStatus']

to_dict()[source]
Return type:

dict

expiration_date: int

Point in time (Unix timestamp) when the status will expire; 0 if never

type: Union[EmojiStatusTypeCustomEmoji, EmojiStatusTypeUpgradedGift, None]

Type of the emoji status

class pytdbot.types.EmojiStatusCustomEmojis(custom_emoji_ids=None)[source]

Bases: TlObject

Contains a list of custom emoji identifiers for emoji statuses

Parameters:

custom_emoji_ids (List[int]) – The list of custom emoji identifiers

__init__(custom_emoji_ids=None)[source]
Parameters:

custom_emoji_ids (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[EmojiStatusCustomEmojis]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['EmojiStatusCustomEmojis']

classmethod getType()[source]
Return type:

Literal['emojiStatusCustomEmojis']

to_dict()[source]
Return type:

dict

custom_emoji_ids: List[int]

The list of custom emoji identifiers

class pytdbot.types.EmojiStatusType[source]

Bases: object

Describes type of emoji status

class pytdbot.types.EmojiStatusTypeCustomEmoji(custom_emoji_id=0)[source]

Bases: TlObject, EmojiStatusType

A custom emoji set as emoji status

Parameters:

custom_emoji_id (int) – Identifier of the custom emoji in stickerFormatTgs format

__init__(custom_emoji_id=0)[source]
Parameters:

custom_emoji_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[EmojiStatusTypeCustomEmoji]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['EmojiStatusType']

classmethod getType()[source]
Return type:

Literal['emojiStatusTypeCustomEmoji']

to_dict()[source]
Return type:

dict

custom_emoji_id: int

Identifier of the custom emoji in stickerFormatTgs format

class pytdbot.types.EmojiStatusTypeUpgradedGift(upgraded_gift_id=0, gift_title='', gift_name='', model_custom_emoji_id=0, symbol_custom_emoji_id=0, backdrop_colors=None)[source]

Bases: TlObject, EmojiStatusType

An upgraded gift set as emoji status

Parameters:
  • upgraded_gift_id (int) – Identifier of the upgraded gift

  • gift_title (str) – The title of the upgraded gift

  • gift_name (str) – Unique name of the upgraded gift that can be used with internalLinkTypeUpgradedGift

  • model_custom_emoji_id (int) – Custom emoji identifier of the model of the upgraded gift

  • symbol_custom_emoji_id (int) – Custom emoji identifier of the symbol of the upgraded gift

  • backdrop_colors ("types.UpgradedGiftBackdropColors") – Colors of the backdrop of the upgraded gift

__init__(upgraded_gift_id=0, gift_title='', gift_name='', model_custom_emoji_id=0, symbol_custom_emoji_id=0, backdrop_colors=None)[source]
Parameters:
  • upgraded_gift_id (int)

  • gift_title (str)

  • gift_name (str)

  • model_custom_emoji_id (int)

  • symbol_custom_emoji_id (int)

  • backdrop_colors (UpgradedGiftBackdropColors | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[EmojiStatusTypeUpgradedGift]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['EmojiStatusType']

classmethod getType()[source]
Return type:

Literal['emojiStatusTypeUpgradedGift']

to_dict()[source]
Return type:

dict

backdrop_colors: Optional[UpgradedGiftBackdropColors]

Colors of the backdrop of the upgraded gift

gift_name: Optional[str]

Unique name of the upgraded gift that can be used with internalLinkTypeUpgradedGift

gift_title: Optional[str]

The title of the upgraded gift

model_custom_emoji_id: int

Custom emoji identifier of the model of the upgraded gift

symbol_custom_emoji_id: int

Custom emoji identifier of the symbol of the upgraded gift

upgraded_gift_id: int

Identifier of the upgraded gift

class pytdbot.types.EmojiStatuses(emoji_statuses=None)[source]

Bases: TlObject

Contains a list of emoji statuses

Parameters:

emoji_statuses (List["types.EmojiStatus"]) – The list of emoji statuses identifiers

__init__(emoji_statuses=None)[source]
Parameters:

emoji_statuses (List[EmojiStatus] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[EmojiStatuses]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['EmojiStatuses']

classmethod getType()[source]
Return type:

Literal['emojiStatuses']

to_dict()[source]
Return type:

dict

emoji_statuses: List[EmojiStatus]

The list of emoji statuses identifiers

class pytdbot.types.Emojis(emojis=None)[source]

Bases: TlObject

Represents a list of emojis

Parameters:

emojis (List[str]) – List of emojis

__init__(emojis=None)[source]
Parameters:

emojis (List[str] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Emojis]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Emojis']

classmethod getType()[source]
Return type:

Literal['emojis']

to_dict()[source]
Return type:

dict

emojis: List[str]

List of emojis

class pytdbot.types.EncryptedCredentials(data=b'', hash=b'', secret=b'')[source]

Bases: TlObject

Contains encrypted Telegram Passport data credentials

Parameters:
  • data (bytes) – The encrypted credentials

  • hash (bytes) – The decrypted data hash

  • secret (bytes) – Secret for data decryption, encrypted with the service’s public key

__init__(data=b'', hash=b'', secret=b'')[source]
Parameters:
  • data (bytes)

  • hash (bytes)

  • secret (bytes)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[EncryptedCredentials]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['EncryptedCredentials']

classmethod getType()[source]
Return type:

Literal['encryptedCredentials']

to_dict()[source]
Return type:

dict

data: Optional[bytes]

The encrypted credentials

hash: Optional[bytes]

The decrypted data hash

secret: Optional[bytes]

Secret for data decryption, encrypted with the service’s public key

class pytdbot.types.EncryptedPassportElement(type=None, data=b'', front_side=None, reverse_side=None, selfie=None, translation=None, files=None, value='', hash='')[source]

Bases: TlObject

Contains information about an encrypted Telegram Passport element; for bots only

Parameters:
  • type ("types.PassportElementType") – Type of Telegram Passport element

  • data (bytes) – Encrypted JSON-encoded data about the user

  • front_side ("types.DatedFile") – The front side of an identity document

  • reverse_side ("types.DatedFile") – The reverse side of an identity document; may be null

  • selfie ("types.DatedFile") – Selfie with the document; may be null

  • translation (List["types.DatedFile"]) – List of files containing a certified English translation of the document

  • files (List["types.DatedFile"]) – List of attached files

  • value (str) – Unencrypted data, phone number or email address

  • hash (str) – Hash of the entire element

__init__(type=None, data=b'', front_side=None, reverse_side=None, selfie=None, translation=None, files=None, value='', hash='')[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[EncryptedPassportElement]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['EncryptedPassportElement']

classmethod getType()[source]
Return type:

Literal['encryptedPassportElement']

to_dict()[source]
Return type:

dict

data: Optional[bytes]

Encrypted JSON-encoded data about the user

files: List[DatedFile]

List of attached files

front_side: Optional[DatedFile]

The front side of an identity document

hash: Optional[str]

Hash of the entire element

reverse_side: Optional[DatedFile]

The reverse side of an identity document; may be null

selfie: Optional[DatedFile]

Selfie with the document; may be null

translation: List[DatedFile]

List of files containing a certified English translation of the document

type: Union[PassportElementTypePersonalDetails, PassportElementTypePassport, PassportElementTypeDriverLicense, PassportElementTypeIdentityCard, PassportElementTypeInternalPassport, PassportElementTypeAddress, PassportElementTypeUtilityBill, PassportElementTypeBankStatement, PassportElementTypeRentalAgreement, PassportElementTypePassportRegistration, PassportElementTypeTemporaryRegistration, PassportElementTypePhoneNumber, PassportElementTypeEmailAddress, None]

Type of Telegram Passport element

value: Optional[str]

Unencrypted data, phone number or email address

class pytdbot.types.Error(code=0, message='')[source]

Bases: TlObject

An object of this type can be returned on every function call, in case of an error

Parameters:
  • code (int) – Error code; subject to future changes. If the error code is 406, the error message must not be processed in any way and must not be displayed to the user

  • message (str) – Error message; subject to future changes

__init__(code=0, message='')[source]
Parameters:
  • code (int)

  • message (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Error]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Error']

classmethod getType()[source]
Return type:

Literal['error']

to_dict()[source]
Return type:

dict

code: int

Error code; subject to future changes. If the error code is 406, the error message must not be processed in any way and must not be displayed to the user

message: Optional[str]

Error message; subject to future changes

class pytdbot.types.FactCheck(text=None, country_code='')[source]

Bases: TlObject

Describes a fact-check added to the message by an independent checker

Parameters:
  • text ("types.FormattedText") – Text of the fact-check

  • country_code (str) – A two-letter ISO 3166-1 alpha-2 country code of the country for which the fact-check is shown

__init__(text=None, country_code='')[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FactCheck]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FactCheck']

classmethod getType()[source]
Return type:

Literal['factCheck']

to_dict()[source]
Return type:

dict

country_code: Optional[str]

A two-letter ISO 3166-1 alpha-2 country code of the country for which the fact-check is shown

text: Optional[FormattedText]

Text of the fact-check

class pytdbot.types.FailedToAddMember(user_id=0, premium_would_allow_invite=False, premium_required_to_send_messages=False)[source]

Bases: TlObject

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

Parameters:
  • user_id (int) – User identifier

  • premium_would_allow_invite (bool) – True, if subscription to Telegram Premium would have allowed to add the user to the chat

  • premium_required_to_send_messages (bool) – True, if subscription to Telegram Premium is required to send the user chat invite link

__init__(user_id=0, premium_would_allow_invite=False, premium_required_to_send_messages=False)[source]
Parameters:
  • user_id (int)

  • premium_would_allow_invite (bool)

  • premium_required_to_send_messages (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FailedToAddMember]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FailedToAddMember']

classmethod getType()[source]
Return type:

Literal['failedToAddMember']

to_dict()[source]
Return type:

dict

premium_required_to_send_messages: bool

True, if subscription to Telegram Premium is required to send the user chat invite link

premium_would_allow_invite: bool

True, if subscription to Telegram Premium would have allowed to add the user to the chat

user_id: int

User identifier

class pytdbot.types.FailedToAddMembers(failed_to_add_members=None)[source]

Bases: TlObject

Represents a list of users that has failed to be added to a chat

Parameters:

failed_to_add_members (List["types.FailedToAddMember"]) – Information about users that weren’t added to the chat

__init__(failed_to_add_members=None)[source]
Parameters:

failed_to_add_members (List[FailedToAddMember] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FailedToAddMembers]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FailedToAddMembers']

classmethod getType()[source]
Return type:

Literal['failedToAddMembers']

to_dict()[source]
Return type:

dict

failed_to_add_members: List[FailedToAddMember]

Information about users that weren’t added to the chat

class pytdbot.types.File(id=0, size=0, expected_size=0, local=None, remote=None)[source]

Bases: TlObject, FileBoundMethods

Represents a file

Parameters:
  • id (int) – Unique file identifier

  • size (int) – File size, in bytes; 0 if unknown

  • expected_size (int) – Approximate file size in bytes in case the exact file size is unknown. Can be used to show download/upload progress

  • local ("types.LocalFile") – Information about the local copy of the file

  • remote ("types.RemoteFile") – Information about the remote copy of the file

__init__(id=0, size=0, expected_size=0, local=None, remote=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[File]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['File']

classmethod getType()[source]
Return type:

Literal['file']

to_dict()[source]
Return type:

dict

expected_size: int

Approximate file size in bytes in case the exact file size is unknown. Can be used to show download/upload progress

id: int

Unique file identifier

local: Optional[LocalFile]

Information about the local copy of the file

remote: Optional[RemoteFile]

Information about the remote copy of the file

size: int

File size, in bytes; 0 if unknown

class pytdbot.types.FileDownload(file_id=0, message=None, add_date=0, complete_date=0, is_paused=False)[source]

Bases: TlObject

Describes a file added to file download list

Parameters:
  • file_id (int) – File identifier

  • message ("types.Message") – The message with the file

  • add_date (int) – Point in time (Unix timestamp) when the file was added to the download list

  • complete_date (int) – Point in time (Unix timestamp) when the file downloading was completed; 0 if the file downloading isn’t completed

  • is_paused (bool) – True, if downloading of the file is paused

__init__(file_id=0, message=None, add_date=0, complete_date=0, is_paused=False)[source]
Parameters:
  • file_id (int)

  • message (Message | None)

  • add_date (int)

  • complete_date (int)

  • is_paused (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FileDownload]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FileDownload']

classmethod getType()[source]
Return type:

Literal['fileDownload']

to_dict()[source]
Return type:

dict

add_date: int

Point in time (Unix timestamp) when the file was added to the download list

complete_date: int

Point in time (Unix timestamp) when the file downloading was completed; 0 if the file downloading isn’t completed

file_id: int

File identifier

is_paused: bool

True, if downloading of the file is paused

message: Optional[Message]

The message with the file

class pytdbot.types.FileDownloadedPrefixSize(size=0)[source]

Bases: TlObject

Contains size of downloaded prefix of a file

Parameters:

size (int) – The prefix size, in bytes

__init__(size=0)[source]
Parameters:

size (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FileDownloadedPrefixSize]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FileDownloadedPrefixSize']

classmethod getType()[source]
Return type:

Literal['fileDownloadedPrefixSize']

to_dict()[source]
Return type:

dict

size: int

The prefix size, in bytes

class pytdbot.types.FileType[source]

Bases: object

Represents the type of file

class pytdbot.types.FileTypeAnimation[source]

Bases: TlObject, FileType

The file is an animation

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FileTypeAnimation]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FileType']

classmethod getType()[source]
Return type:

Literal['fileTypeAnimation']

to_dict()[source]
Return type:

dict

class pytdbot.types.FileTypeAudio[source]

Bases: TlObject, FileType

The file is an audio file

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FileTypeAudio]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FileType']

classmethod getType()[source]
Return type:

Literal['fileTypeAudio']

to_dict()[source]
Return type:

dict

class pytdbot.types.FileTypeDocument[source]

Bases: TlObject, FileType

The file is a document

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FileTypeDocument]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FileType']

classmethod getType()[source]
Return type:

Literal['fileTypeDocument']

to_dict()[source]
Return type:

dict

class pytdbot.types.FileTypeNone[source]

Bases: TlObject, FileType

The data is not a file

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FileTypeNone]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FileType']

classmethod getType()[source]
Return type:

Literal['fileTypeNone']

to_dict()[source]
Return type:

dict

class pytdbot.types.FileTypeNotificationSound[source]

Bases: TlObject, FileType

The file is a notification sound

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FileTypeNotificationSound]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FileType']

classmethod getType()[source]
Return type:

Literal['fileTypeNotificationSound']

to_dict()[source]
Return type:

dict

class pytdbot.types.FileTypePhoto[source]

Bases: TlObject, FileType

The file is a photo

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FileTypePhoto]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FileType']

classmethod getType()[source]
Return type:

Literal['fileTypePhoto']

to_dict()[source]
Return type:

dict

class pytdbot.types.FileTypePhotoStory[source]

Bases: TlObject, FileType

The file is a photo published as a story

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FileTypePhotoStory]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FileType']

classmethod getType()[source]
Return type:

Literal['fileTypePhotoStory']

to_dict()[source]
Return type:

dict

class pytdbot.types.FileTypeProfilePhoto[source]

Bases: TlObject, FileType

The file is a profile photo

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FileTypeProfilePhoto]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FileType']

classmethod getType()[source]
Return type:

Literal['fileTypeProfilePhoto']

to_dict()[source]
Return type:

dict

class pytdbot.types.FileTypeSecret[source]

Bases: TlObject, FileType

The file was sent to a secret chat (the file type is not known to the server)

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FileTypeSecret]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FileType']

classmethod getType()[source]
Return type:

Literal['fileTypeSecret']

to_dict()[source]
Return type:

dict

class pytdbot.types.FileTypeSecretThumbnail[source]

Bases: TlObject, FileType

The file is a thumbnail of a file from a secret chat

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FileTypeSecretThumbnail]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FileType']

classmethod getType()[source]
Return type:

Literal['fileTypeSecretThumbnail']

to_dict()[source]
Return type:

dict

class pytdbot.types.FileTypeSecure[source]

Bases: TlObject, FileType

The file is a file from Secure storage used for storing Telegram Passport files

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FileTypeSecure]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FileType']

classmethod getType()[source]
Return type:

Literal['fileTypeSecure']

to_dict()[source]
Return type:

dict

class pytdbot.types.FileTypeSelfDestructingPhoto[source]

Bases: TlObject, FileType

The file is a self-destructing photo in a private chat

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FileTypeSelfDestructingPhoto]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FileType']

classmethod getType()[source]
Return type:

Literal['fileTypeSelfDestructingPhoto']

to_dict()[source]
Return type:

dict

class pytdbot.types.FileTypeSelfDestructingVideo[source]

Bases: TlObject, FileType

The file is a self-destructing video in a private chat

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FileTypeSelfDestructingVideo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FileType']

classmethod getType()[source]
Return type:

Literal['fileTypeSelfDestructingVideo']

to_dict()[source]
Return type:

dict

class pytdbot.types.FileTypeSelfDestructingVideoNote[source]

Bases: TlObject, FileType

The file is a self-destructing video note in a private chat

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FileTypeSelfDestructingVideoNote]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FileType']

classmethod getType()[source]
Return type:

Literal['fileTypeSelfDestructingVideoNote']

to_dict()[source]
Return type:

dict

class pytdbot.types.FileTypeSelfDestructingVoiceNote[source]

Bases: TlObject, FileType

The file is a self-destructing voice note in a private chat

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FileTypeSelfDestructingVoiceNote]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FileType']

classmethod getType()[source]
Return type:

Literal['fileTypeSelfDestructingVoiceNote']

to_dict()[source]
Return type:

dict

class pytdbot.types.FileTypeSticker[source]

Bases: TlObject, FileType

The file is a sticker

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FileTypeSticker]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FileType']

classmethod getType()[source]
Return type:

Literal['fileTypeSticker']

to_dict()[source]
Return type:

dict

class pytdbot.types.FileTypeThumbnail[source]

Bases: TlObject, FileType

The file is a thumbnail of another file

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FileTypeThumbnail]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FileType']

classmethod getType()[source]
Return type:

Literal['fileTypeThumbnail']

to_dict()[source]
Return type:

dict

class pytdbot.types.FileTypeUnknown[source]

Bases: TlObject, FileType

The file type is not yet known

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FileTypeUnknown]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FileType']

classmethod getType()[source]
Return type:

Literal['fileTypeUnknown']

to_dict()[source]
Return type:

dict

class pytdbot.types.FileTypeVideo[source]

Bases: TlObject, FileType

The file is a video

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FileTypeVideo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FileType']

classmethod getType()[source]
Return type:

Literal['fileTypeVideo']

to_dict()[source]
Return type:

dict

class pytdbot.types.FileTypeVideoNote[source]

Bases: TlObject, FileType

The file is a video note

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FileTypeVideoNote]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FileType']

classmethod getType()[source]
Return type:

Literal['fileTypeVideoNote']

to_dict()[source]
Return type:

dict

class pytdbot.types.FileTypeVideoStory[source]

Bases: TlObject, FileType

The file is a video published as a story

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FileTypeVideoStory]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FileType']

classmethod getType()[source]
Return type:

Literal['fileTypeVideoStory']

to_dict()[source]
Return type:

dict

class pytdbot.types.FileTypeVoiceNote[source]

Bases: TlObject, FileType

The file is a voice note

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FileTypeVoiceNote]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FileType']

classmethod getType()[source]
Return type:

Literal['fileTypeVoiceNote']

to_dict()[source]
Return type:

dict

class pytdbot.types.FileTypeWallpaper[source]

Bases: TlObject, FileType

The file is a wallpaper or a background pattern

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FileTypeWallpaper]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FileType']

classmethod getType()[source]
Return type:

Literal['fileTypeWallpaper']

to_dict()[source]
Return type:

dict

class pytdbot.types.FirebaseAuthenticationSettings[source]

Bases: object

Contains settings for Firebase Authentication in the official applications

class pytdbot.types.FirebaseAuthenticationSettingsAndroid[source]

Bases: TlObject, FirebaseAuthenticationSettings

Settings for Firebase Authentication in the official Android application

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FirebaseAuthenticationSettingsAndroid]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FirebaseAuthenticationSettings']

classmethod getType()[source]
Return type:

Literal['firebaseAuthenticationSettingsAndroid']

to_dict()[source]
Return type:

dict

class pytdbot.types.FirebaseAuthenticationSettingsIos(device_token='', is_app_sandbox=False)[source]

Bases: TlObject, FirebaseAuthenticationSettings

Settings for Firebase Authentication in the official iOS application

Parameters:
  • device_token (str) – Device token from Apple Push Notification service

  • is_app_sandbox (bool) – True, if App Sandbox is enabled

__init__(device_token='', is_app_sandbox=False)[source]
Parameters:
  • device_token (str)

  • is_app_sandbox (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FirebaseAuthenticationSettingsIos]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FirebaseAuthenticationSettings']

classmethod getType()[source]
Return type:

Literal['firebaseAuthenticationSettingsIos']

to_dict()[source]
Return type:

dict

device_token: Optional[str]

Device token from Apple Push Notification service

is_app_sandbox: bool

True, if App Sandbox is enabled

class pytdbot.types.FirebaseDeviceVerificationParameters[source]

Bases: object

Describes parameters to be used for device verification

class pytdbot.types.FirebaseDeviceVerificationParametersPlayIntegrity(nonce='', cloud_project_number=0)[source]

Bases: TlObject, FirebaseDeviceVerificationParameters

Device verification must be performed with the classic Play Integrity verification (https://developer.android.com/google/play/integrity/classic)

Parameters:
  • nonce (str) – Base64url-encoded nonce to pass to the Play Integrity API

  • cloud_project_number (int) – Cloud project number to pass to the Play Integrity API

__init__(nonce='', cloud_project_number=0)[source]
Parameters:
  • nonce (str)

  • cloud_project_number (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FirebaseDeviceVerificationParametersPlayIntegrity]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FirebaseDeviceVerificationParameters']

classmethod getType()[source]
Return type:

Literal['firebaseDeviceVerificationParametersPlayIntegrity']

to_dict()[source]
Return type:

dict

cloud_project_number: int

Cloud project number to pass to the Play Integrity API

nonce: Optional[str]

Base64url-encoded nonce to pass to the Play Integrity API

class pytdbot.types.FirebaseDeviceVerificationParametersSafetyNet(nonce=b'')[source]

Bases: TlObject, FirebaseDeviceVerificationParameters

Device verification must be performed with the SafetyNet Attestation API

Parameters:

nonce (bytes) – Nonce to pass to the SafetyNet Attestation API

__init__(nonce=b'')[source]
Parameters:

nonce (bytes)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FirebaseDeviceVerificationParametersSafetyNet]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FirebaseDeviceVerificationParameters']

classmethod getType()[source]
Return type:

Literal['firebaseDeviceVerificationParametersSafetyNet']

to_dict()[source]
Return type:

dict

nonce: Optional[bytes]

Nonce to pass to the SafetyNet Attestation API

class pytdbot.types.FormattedText(text='', entities=None)[source]

Bases: TlObject

A text with some entities

Parameters:
  • text (str) – The text

  • entities (List["types.TextEntity"]) – Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. Pre, Code and PreCode entities can’t contain other entities. BlockQuote entities can’t contain other BlockQuote entities. Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and can be part of any other entities. All other entities can’t contain each other

__init__(text='', entities=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FormattedText]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FormattedText']

classmethod getType()[source]
Return type:

Literal['formattedText']

to_dict()[source]
Return type:

dict

entities: List[TextEntity]

Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. Pre, Code and PreCode entities can’t contain other entities. BlockQuote entities can’t contain other BlockQuote entities. Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and can be part of any other entities. All other entities can’t contain each other

text: Optional[str]

The text

class pytdbot.types.ForumTopic(info=None, last_message=None, order=0, is_pinned=False, unread_count=0, last_read_inbox_message_id=0, last_read_outbox_message_id=0, unread_mention_count=0, unread_reaction_count=0, notification_settings=None, draft_message=None)[source]

Bases: TlObject

Describes a forum topic

Parameters:
  • info ("types.ForumTopicInfo") – Basic information about the topic

  • last_message ("types.Message") – Last message in the topic; may be null if unknown

  • order (int) – A parameter used to determine order of the topic in the topic list. Topics must be sorted by the order in descending order

  • is_pinned (bool) – True, if the topic is pinned in the topic list

  • unread_count (int) – Number of unread messages in the topic

  • last_read_inbox_message_id (int) – Identifier of the last read incoming message

  • last_read_outbox_message_id (int) – Identifier of the last read outgoing message

  • unread_mention_count (int) – Number of unread messages with a mention/reply in the topic

  • unread_reaction_count (int) – Number of messages with unread reactions in the topic

  • notification_settings ("types.ChatNotificationSettings") – Notification settings for the topic

  • draft_message ("types.DraftMessage") – A draft of a message in the topic; may be null if none

__init__(info=None, last_message=None, order=0, is_pinned=False, unread_count=0, last_read_inbox_message_id=0, last_read_outbox_message_id=0, unread_mention_count=0, unread_reaction_count=0, notification_settings=None, draft_message=None)[source]
Parameters:
  • info (ForumTopicInfo | None)

  • last_message (Message | None)

  • order (int)

  • is_pinned (bool)

  • unread_count (int)

  • last_read_inbox_message_id (int)

  • last_read_outbox_message_id (int)

  • unread_mention_count (int)

  • unread_reaction_count (int)

  • notification_settings (ChatNotificationSettings | None)

  • draft_message (DraftMessage | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ForumTopic]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ForumTopic']

classmethod getType()[source]
Return type:

Literal['forumTopic']

to_dict()[source]
Return type:

dict

draft_message: Optional[DraftMessage]

A draft of a message in the topic; may be null if none

info: Optional[ForumTopicInfo]

Basic information about the topic

is_pinned: bool

True, if the topic is pinned in the topic list

last_message: Optional[Message]

Last message in the topic; may be null if unknown

last_read_inbox_message_id: int

Identifier of the last read incoming message

last_read_outbox_message_id: int

Identifier of the last read outgoing message

notification_settings: Optional[ChatNotificationSettings]

Notification settings for the topic

order: int

A parameter used to determine order of the topic in the topic list. Topics must be sorted by the order in descending order

unread_count: int

Number of unread messages in the topic

unread_mention_count: int

Number of unread messages with a mention/reply in the topic

unread_reaction_count: int

Number of messages with unread reactions in the topic

class pytdbot.types.ForumTopicIcon(color=0, custom_emoji_id=0)[source]

Bases: TlObject

Describes a forum topic icon

Parameters:
  • color (int) – Color of the topic icon in RGB format

  • custom_emoji_id (int) – Unique identifier of the custom emoji shown on the topic icon; 0 if none

__init__(color=0, custom_emoji_id=0)[source]
Parameters:
  • color (int)

  • custom_emoji_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ForumTopicIcon]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ForumTopicIcon']

classmethod getType()[source]
Return type:

Literal['forumTopicIcon']

to_dict()[source]
Return type:

dict

color: int

Color of the topic icon in RGB format

custom_emoji_id: int

Unique identifier of the custom emoji shown on the topic icon; 0 if none

class pytdbot.types.ForumTopicInfo(chat_id=0, forum_topic_id=0, message_thread_id=0, name='', icon=None, creation_date=0, creator_id=None, is_general=False, is_outgoing=False, is_closed=False, is_hidden=False)[source]

Bases: TlObject

Contains basic information about a forum topic

Parameters:
  • chat_id (int) – Identifier of the forum chat to which the topic belongs

  • forum_topic_id (int) – Forum topic identifier of the topic

  • message_thread_id (int) – Message thread identifier of the topic

  • name (str) – Name of the topic

  • icon ("types.ForumTopicIcon") – Icon of the topic

  • creation_date (int) – Point in time (Unix timestamp) when the topic was created

  • creator_id ("types.MessageSender") – Identifier of the creator of the topic

  • is_general (bool) – True, if the topic is the General topic list

  • is_outgoing (bool) – True, if the topic was created by the current user

  • is_closed (bool) – True, if the topic is closed. If the topic is closed, then the user must have can_manage_topics administrator right in the supergroup or must be the creator of the topic to send messages there

  • is_hidden (bool) – True, if the topic is hidden above the topic list and closed; for General topic only

__init__(chat_id=0, forum_topic_id=0, message_thread_id=0, name='', icon=None, creation_date=0, creator_id=None, is_general=False, is_outgoing=False, is_closed=False, is_hidden=False)[source]
Parameters:
  • chat_id (int)

  • forum_topic_id (int)

  • message_thread_id (int)

  • name (str)

  • icon (ForumTopicIcon | None)

  • creation_date (int)

  • creator_id (MessageSender | None)

  • is_general (bool)

  • is_outgoing (bool)

  • is_closed (bool)

  • is_hidden (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ForumTopicInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ForumTopicInfo']

classmethod getType()[source]
Return type:

Literal['forumTopicInfo']

to_dict()[source]
Return type:

dict

chat_id: int

Identifier of the forum chat to which the topic belongs

creation_date: int

Point in time (Unix timestamp) when the topic was created

creator_id: Union[MessageSenderUser, MessageSenderChat, None]

Identifier of the creator of the topic

forum_topic_id: int

Forum topic identifier of the topic

icon: Optional[ForumTopicIcon]

Icon of the topic

is_closed: bool

True, if the topic is closed. If the topic is closed, then the user must have can_manage_topics administrator right in the supergroup or must be the creator of the topic to send messages there

is_general: bool

True, if the topic is the General topic list

is_hidden: bool

True, if the topic is hidden above the topic list and closed; for General topic only

is_outgoing: bool

True, if the topic was created by the current user

message_thread_id: int

Message thread identifier of the topic

name: Optional[str]

Name of the topic

class pytdbot.types.ForumTopics(total_count=0, topics=None, next_offset_date=0, next_offset_message_id=0, next_offset_message_thread_id=0)[source]

Bases: TlObject

Describes a list of forum topics

Parameters:
  • total_count (int) – Approximate total number of forum topics found

  • topics (List["types.ForumTopic"]) – List of forum topics

  • next_offset_date (int) – Offset date for the next getForumTopics request

  • next_offset_message_id (int) – Offset message identifier for the next getForumTopics request

  • next_offset_message_thread_id (int) – Offset message thread identifier for the next getForumTopics request

__init__(total_count=0, topics=None, next_offset_date=0, next_offset_message_id=0, next_offset_message_thread_id=0)[source]
Parameters:
  • total_count (int)

  • topics (List[ForumTopic] | None)

  • next_offset_date (int)

  • next_offset_message_id (int)

  • next_offset_message_thread_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ForumTopics]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ForumTopics']

classmethod getType()[source]
Return type:

Literal['forumTopics']

to_dict()[source]
Return type:

dict

next_offset_date: int

Offset date for the next getForumTopics request

next_offset_message_id: int

Offset message identifier for the next getForumTopics request

next_offset_message_thread_id: int

Offset message thread identifier for the next getForumTopics request

topics: List[ForumTopic]

List of forum topics

total_count: int

Approximate total number of forum topics found

class pytdbot.types.ForwardSource(chat_id=0, message_id=0, sender_id=None, sender_name='', date=0, is_outgoing=False)[source]

Bases: TlObject

Contains information about the last message from which a new message was forwarded last time

Parameters:
  • chat_id (int) – Identifier of the chat to which the message that was forwarded belonged; may be 0 if unknown

  • message_id (int) – Identifier of the message; may be 0 if unknown

  • sender_id ("types.MessageSender") – Identifier of the sender of the message; may be null if unknown or the new message was forwarded not to Saved Messages

  • sender_name (str) – Name of the sender of the message if the sender is hidden by their privacy settings

  • date (int) – Point in time (Unix timestamp) when the message is sent; 0 if unknown

  • is_outgoing (bool) – True, if the message that was forwarded is outgoing; always false if sender is unknown

__init__(chat_id=0, message_id=0, sender_id=None, sender_name='', date=0, is_outgoing=False)[source]
Parameters:
  • chat_id (int)

  • message_id (int)

  • sender_id (MessageSender | None)

  • sender_name (str)

  • date (int)

  • is_outgoing (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ForwardSource]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ForwardSource']

classmethod getType()[source]
Return type:

Literal['forwardSource']

to_dict()[source]
Return type:

dict

chat_id: int

Identifier of the chat to which the message that was forwarded belonged; may be 0 if unknown

date: int

Point in time (Unix timestamp) when the message is sent; 0 if unknown

is_outgoing: bool

True, if the message that was forwarded is outgoing; always false if sender is unknown

message_id: int

Identifier of the message; may be 0 if unknown

sender_id: Union[MessageSenderUser, MessageSenderChat, None]

Identifier of the sender of the message; may be null if unknown or the new message was forwarded not to Saved Messages

sender_name: Optional[str]

Name of the sender of the message if the sender is hidden by their privacy settings

class pytdbot.types.FoundAffiliateProgram(bot_user_id=0, info=None)[source]

Bases: TlObject

Describes a found affiliate program

Parameters:
  • bot_user_id (int) – User identifier of the bot created the program

  • info ("types.AffiliateProgramInfo") – Information about the affiliate program

__init__(bot_user_id=0, info=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FoundAffiliateProgram]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FoundAffiliateProgram']

classmethod getType()[source]
Return type:

Literal['foundAffiliateProgram']

to_dict()[source]
Return type:

dict

bot_user_id: int

User identifier of the bot created the program

info: Optional[AffiliateProgramInfo]

Information about the affiliate program

class pytdbot.types.FoundAffiliatePrograms(total_count=0, programs=None, next_offset='')[source]

Bases: TlObject

Represents a list of found affiliate programs

Parameters:
  • total_count (int) – The total number of found affiliate programs

  • programs (List["types.FoundAffiliateProgram"]) – The list of affiliate programs

  • next_offset (str) – The offset for the next request. If empty, then there are no more results

__init__(total_count=0, programs=None, next_offset='')[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FoundAffiliatePrograms]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FoundAffiliatePrograms']

classmethod getType()[source]
Return type:

Literal['foundAffiliatePrograms']

to_dict()[source]
Return type:

dict

next_offset: Optional[str]

The offset for the next request. If empty, then there are no more results

programs: List[FoundAffiliateProgram]

The list of affiliate programs

total_count: int

The total number of found affiliate programs

class pytdbot.types.FoundChatBoosts(total_count=0, boosts=None, next_offset='')[source]

Bases: TlObject

Contains a list of boosts applied to a chat

Parameters:
  • total_count (int) – Total number of boosts applied to the chat

  • boosts (List["types.ChatBoost"]) – List of boosts

  • next_offset (str) – The offset for the next request. If empty, then there are no more results

__init__(total_count=0, boosts=None, next_offset='')[source]
Parameters:
  • total_count (int)

  • boosts (List[ChatBoost] | None)

  • next_offset (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FoundChatBoosts]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FoundChatBoosts']

classmethod getType()[source]
Return type:

Literal['foundChatBoosts']

to_dict()[source]
Return type:

dict

boosts: List[ChatBoost]

List of boosts

next_offset: Optional[str]

The offset for the next request. If empty, then there are no more results

total_count: int

Total number of boosts applied to the chat

class pytdbot.types.FoundChatMessages(total_count=0, messages=None, next_from_message_id=0)[source]

Bases: TlObject

Contains a list of messages found by a search in a given chat

Parameters:
  • total_count (int) – Approximate total number of messages found; -1 if unknown

  • messages (List["types.Message"]) – List of messages

  • next_from_message_id (int) – The offset for the next request. If 0, there are no more results

__init__(total_count=0, messages=None, next_from_message_id=0)[source]
Parameters:
  • total_count (int)

  • messages (List[Message] | None)

  • next_from_message_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FoundChatMessages]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FoundChatMessages']

classmethod getType()[source]
Return type:

Literal['foundChatMessages']

to_dict()[source]
Return type:

dict

messages: List[Message]

List of messages

next_from_message_id: int

The offset for the next request. If 0, there are no more results

total_count: int

Approximate total number of messages found; -1 if unknown

class pytdbot.types.FoundFileDownloads(total_counts=None, files=None, next_offset='')[source]

Bases: TlObject

Contains a list of downloaded files, found by a search

Parameters:
  • total_counts ("types.DownloadedFileCounts") – Total number of suitable files, ignoring offset

  • files (List["types.FileDownload"]) – The list of files

  • next_offset (str) – The offset for the next request. If empty, then there are no more results

__init__(total_counts=None, files=None, next_offset='')[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FoundFileDownloads]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FoundFileDownloads']

classmethod getType()[source]
Return type:

Literal['foundFileDownloads']

to_dict()[source]
Return type:

dict

files: List[FileDownload]

The list of files

next_offset: Optional[str]

The offset for the next request. If empty, then there are no more results

total_counts: Optional[DownloadedFileCounts]

Total number of suitable files, ignoring offset

class pytdbot.types.FoundMessages(total_count=0, messages=None, next_offset='')[source]

Bases: TlObject

Contains a list of messages found by a search

Parameters:
  • total_count (int) – Approximate total number of messages found; -1 if unknown

  • messages (List["types.Message"]) – List of messages

  • next_offset (str) – The offset for the next request. If empty, then there are no more results

__init__(total_count=0, messages=None, next_offset='')[source]
Parameters:
  • total_count (int)

  • messages (List[Message] | None)

  • next_offset (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FoundMessages]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FoundMessages']

classmethod getType()[source]
Return type:

Literal['foundMessages']

to_dict()[source]
Return type:

dict

messages: List[Message]

List of messages

next_offset: Optional[str]

The offset for the next request. If empty, then there are no more results

total_count: int

Approximate total number of messages found; -1 if unknown

class pytdbot.types.FoundPosition(position=0)[source]

Bases: TlObject

Contains 0-based match position

Parameters:

position (int) – The position of the match

__init__(position=0)[source]
Parameters:

position (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FoundPosition]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FoundPosition']

classmethod getType()[source]
Return type:

Literal['foundPosition']

to_dict()[source]
Return type:

dict

position: int

The position of the match

class pytdbot.types.FoundPositions(total_count=0, positions=None)[source]

Bases: TlObject

Contains 0-based positions of matched objects

Parameters:
  • total_count (int) – Total number of matched objects

  • positions (List[int]) – The positions of the matched objects

__init__(total_count=0, positions=None)[source]
Parameters:
  • total_count (int)

  • positions (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FoundPositions]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FoundPositions']

classmethod getType()[source]
Return type:

Literal['foundPositions']

to_dict()[source]
Return type:

dict

positions: List[int]

The positions of the matched objects

total_count: int

Total number of matched objects

class pytdbot.types.FoundPublicPosts(messages=None, next_offset='', search_limits=None, are_limits_exceeded=False)[source]

Bases: TlObject

Contains a list of messages found by a public post search

Parameters:
  • messages (List["types.Message"]) – List of found public posts

  • next_offset (str) – The offset for the next request. If empty, then there are no more results

  • search_limits ("types.PublicPostSearchLimits") – Updated public post search limits after the query; repeated requests with the same query will be free; may be null if they didn’t change

  • are_limits_exceeded (bool) – True, if the query has failed because search limits are exceeded. In this case search_limits.daily_free_query_count will be equal to 0

__init__(messages=None, next_offset='', search_limits=None, are_limits_exceeded=False)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FoundPublicPosts]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FoundPublicPosts']

classmethod getType()[source]
Return type:

Literal['foundPublicPosts']

to_dict()[source]
Return type:

dict

are_limits_exceeded: bool

True, if the query has failed because search limits are exceeded. In this case search_limits.daily_free_query_count will be equal to 0

messages: List[Message]

List of found public posts

next_offset: Optional[str]

The offset for the next request. If empty, then there are no more results

search_limits: Optional[PublicPostSearchLimits]

Updated public post search limits after the query; repeated requests with the same query will be free; may be null if they didn’t change

class pytdbot.types.FoundStories(total_count=0, stories=None, next_offset='')[source]

Bases: TlObject

Contains a list of stories found by a search

Parameters:
  • total_count (int) – Approximate total number of stories found

  • stories (List["types.Story"]) – List of stories

  • next_offset (str) – The offset for the next request. If empty, then there are no more results

__init__(total_count=0, stories=None, next_offset='')[source]
Parameters:
  • total_count (int)

  • stories (List[Story] | None)

  • next_offset (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FoundStories]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FoundStories']

classmethod getType()[source]
Return type:

Literal['foundStories']

to_dict()[source]
Return type:

dict

next_offset: Optional[str]

The offset for the next request. If empty, then there are no more results

stories: List[Story]

List of stories

total_count: int

Approximate total number of stories found

class pytdbot.types.FoundUsers(user_ids=None, next_offset='')[source]

Bases: TlObject

Represents a list of found users

Parameters:
  • user_ids (List[int]) – Identifiers of the found users

  • next_offset (str) – The offset for the next request. If empty, then there are no more results

__init__(user_ids=None, next_offset='')[source]
Parameters:
  • user_ids (List[int] | None)

  • next_offset (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FoundUsers]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FoundUsers']

classmethod getType()[source]
Return type:

Literal['foundUsers']

to_dict()[source]
Return type:

dict

next_offset: Optional[str]

The offset for the next request. If empty, then there are no more results

user_ids: List[int]

Identifiers of the found users

class pytdbot.types.FoundWebApp(web_app=None, request_write_access=False, skip_confirmation=False)[source]

Bases: TlObject

Contains information about a Web App found by its short name

Parameters:
  • web_app ("types.WebApp") – The Web App

  • request_write_access (bool) – True, if the user must be asked for the permission to the bot to send them messages

  • skip_confirmation (bool) – True, if there is no need to show an ordinary open URL confirmation before opening the Web App. The field must be ignored and confirmation must be shown anyway if the Web App link was hidden

__init__(web_app=None, request_write_access=False, skip_confirmation=False)[source]
Parameters:
  • web_app (WebApp | None)

  • request_write_access (bool)

  • skip_confirmation (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[FoundWebApp]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['FoundWebApp']

classmethod getType()[source]
Return type:

Literal['foundWebApp']

to_dict()[source]
Return type:

dict

request_write_access: bool

True, if the user must be asked for the permission to the bot to send them messages

skip_confirmation: bool

True, if there is no need to show an ordinary open URL confirmation before opening the Web App. The field must be ignored and confirmation must be shown anyway if the Web App link was hidden

web_app: Optional[WebApp]

The Web App

class pytdbot.types.Game(id=0, short_name='', title='', text=None, description='', photo=None, animation=None)[source]

Bases: TlObject

Describes a game. Use getInternalLink with internalLinkTypeGame to share the game

Parameters:
  • id (int) – Unique game identifier

  • short_name (str) – Game short name

  • title (str) – Game title

  • text ("types.FormattedText") – Game text, usually containing scoreboards for a game

  • description (str) – Game description

  • photo ("types.Photo") – Game photo

  • animation ("types.Animation") – Game animation; may be null

__init__(id=0, short_name='', title='', text=None, description='', photo=None, animation=None)[source]
Parameters:
  • id (int)

  • short_name (str)

  • title (str)

  • text (FormattedText | None)

  • description (str)

  • photo (Photo | None)

  • animation (Animation | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Game]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Game']

classmethod getType()[source]
Return type:

Literal['game']

to_dict()[source]
Return type:

dict

animation: Optional[Animation]

Game animation; may be null

description: Optional[str]

Game description

id: int

Unique game identifier

photo: Optional[Photo]

Game photo

short_name: Optional[str]

Game short name

text: Optional[FormattedText]

Game text, usually containing scoreboards for a game

title: Optional[str]

Game title

class pytdbot.types.GameHighScore(position=0, user_id=0, score=0)[source]

Bases: TlObject

Contains one row of the game high score table

Parameters:
  • position (int) – Position in the high score table

  • user_id (int) – User identifier

  • score (int) – User score

__init__(position=0, user_id=0, score=0)[source]
Parameters:
  • position (int)

  • user_id (int)

  • score (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GameHighScore]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GameHighScore']

classmethod getType()[source]
Return type:

Literal['gameHighScore']

to_dict()[source]
Return type:

dict

position: int

Position in the high score table

score: int

User score

user_id: int

User identifier

class pytdbot.types.GameHighScores(scores=None)[source]

Bases: TlObject

Contains a list of game high scores

Parameters:

scores (List["types.GameHighScore"]) – A list of game high scores

__init__(scores=None)[source]
Parameters:

scores (List[GameHighScore] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GameHighScores]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GameHighScores']

classmethod getType()[source]
Return type:

Literal['gameHighScores']

to_dict()[source]
Return type:

dict

scores: List[GameHighScore]

A list of game high scores

class pytdbot.types.Gift(id=0, publisher_chat_id=0, sticker=None, star_count=0, default_sell_star_count=0, upgrade_star_count=0, is_for_birthday=False, is_premium=False, next_send_date=0, user_limits=None, overall_limits=None, first_send_date=0, last_send_date=0)[source]

Bases: TlObject

Describes a gift that can be sent to another user or channel chat

Parameters:
  • id (int) – Unique identifier of the gift

  • publisher_chat_id (int) – Identifier of the chat that published the gift; 0 if none

  • sticker ("types.Sticker") – The sticker representing the gift

  • star_count (int) – Number of Telegram Stars that must be paid for the gift

  • default_sell_star_count (int) – Number of Telegram Stars that can be claimed by the receiver instead of the regular gift by default. If the gift was paid with just bought Telegram Stars, then full value can be claimed

  • upgrade_star_count (int) – Number of Telegram Stars that must be paid to upgrade the gift; 0 if upgrade isn’t possible

  • is_for_birthday (bool) – True, if the gift is a birthday gift

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

  • next_send_date (int) – Point in time (Unix timestamp) when the gift can be sent next time by the current user; can be 0 or a date in the past. If the date is in the future, then call canSendGift to get the reason, why the gift can’t be sent now

  • user_limits ("types.GiftPurchaseLimits") – Number of times the gift can be purchased by the current user; may be null if not limited

  • overall_limits ("types.GiftPurchaseLimits") – Number of times the gift can be purchased all users; may be null if not limited

  • first_send_date (int) – Point in time (Unix timestamp) when the gift was send for the first time; for sold out gifts only

  • last_send_date (int) – Point in time (Unix timestamp) when the gift was send for the last time; for sold out gifts only

__init__(id=0, publisher_chat_id=0, sticker=None, star_count=0, default_sell_star_count=0, upgrade_star_count=0, is_for_birthday=False, is_premium=False, next_send_date=0, user_limits=None, overall_limits=None, first_send_date=0, last_send_date=0)[source]
Parameters:
  • id (int)

  • publisher_chat_id (int)

  • sticker (Sticker | None)

  • star_count (int)

  • default_sell_star_count (int)

  • upgrade_star_count (int)

  • is_for_birthday (bool)

  • is_premium (bool)

  • next_send_date (int)

  • user_limits (GiftPurchaseLimits | None)

  • overall_limits (GiftPurchaseLimits | None)

  • first_send_date (int)

  • last_send_date (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Gift]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Gift']

classmethod getType()[source]
Return type:

Literal['gift']

to_dict()[source]
Return type:

dict

default_sell_star_count: int

Number of Telegram Stars that can be claimed by the receiver instead of the regular gift by default. If the gift was paid with just bought Telegram Stars, then full value can be claimed

first_send_date: int

Point in time (Unix timestamp) when the gift was send for the first time; for sold out gifts only

id: int

Unique identifier of the gift

is_for_birthday: bool

True, if the gift is a birthday gift

is_premium: bool

True, if the gift can be bought only by Telegram Premium subscribers

last_send_date: int

Point in time (Unix timestamp) when the gift was send for the last time; for sold out gifts only

next_send_date: int

Point in time (Unix timestamp) when the gift can be sent next time by the current user; can be 0 or a date in the past. If the date is in the future, then call canSendGift to get the reason, why the gift can’t be sent now

overall_limits: Optional[GiftPurchaseLimits]

Number of times the gift can be purchased all users; may be null if not limited

publisher_chat_id: int

Identifier of the chat that published the gift; 0 if none

star_count: int

Number of Telegram Stars that must be paid for the gift

sticker: Optional[Sticker]

The sticker representing the gift

upgrade_star_count: int

Number of Telegram Stars that must be paid to upgrade the gift; 0 if upgrade isn’t possible

user_limits: Optional[GiftPurchaseLimits]

Number of times the gift can be purchased by the current user; may be null if not limited

class pytdbot.types.GiftChatTheme(gift=None, light_settings=None, dark_settings=None)[source]

Bases: TlObject

Describes a chat theme based on an upgraded gift

Parameters:
  • gift ("types.UpgradedGift") – The gift

  • light_settings ("types.ThemeSettings") – Theme settings for a light chat theme

  • dark_settings ("types.ThemeSettings") – Theme settings for a dark chat theme

__init__(gift=None, light_settings=None, dark_settings=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GiftChatTheme]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GiftChatTheme']

classmethod getType()[source]
Return type:

Literal['giftChatTheme']

to_dict()[source]
Return type:

dict

dark_settings: Optional[ThemeSettings]

Theme settings for a dark chat theme

gift: Optional[UpgradedGift]

The gift

light_settings: Optional[ThemeSettings]

Theme settings for a light chat theme

class pytdbot.types.GiftChatThemes(themes=None, next_offset='')[source]

Bases: TlObject

Contains a list of chat themes based on upgraded gifts

Parameters:
  • themes (List["types.GiftChatTheme"]) – A list of chat themes

  • next_offset (str) – The offset for the next request. If empty, then there are no more results

__init__(themes=None, next_offset='')[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GiftChatThemes]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GiftChatThemes']

classmethod getType()[source]
Return type:

Literal['giftChatThemes']

to_dict()[source]
Return type:

dict

next_offset: Optional[str]

The offset for the next request. If empty, then there are no more results

themes: List[GiftChatTheme]

A list of chat themes

class pytdbot.types.GiftCollection(id=0, name='', icon=None, gift_count=0)[source]

Bases: TlObject

Describes collection of gifts

Parameters:
  • id (int) – Unique identifier of the collection

  • name (str) – Name of the collection

  • icon ("types.Sticker") – Icon of the collection; may be null if none

  • gift_count (int) – Total number of gifts in the collection

__init__(id=0, name='', icon=None, gift_count=0)[source]
Parameters:
  • id (int)

  • name (str)

  • icon (Sticker | None)

  • gift_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GiftCollection]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GiftCollection']

classmethod getType()[source]
Return type:

Literal['giftCollection']

to_dict()[source]
Return type:

dict

gift_count: int

Total number of gifts in the collection

icon: Optional[Sticker]

Icon of the collection; may be null if none

id: int

Unique identifier of the collection

name: Optional[str]

Name of the collection

class pytdbot.types.GiftCollections(collections=None)[source]

Bases: TlObject

Contains a list of gift collections

Parameters:

collections (List["types.GiftCollection"]) – List of gift collections

__init__(collections=None)[source]
Parameters:

collections (List[GiftCollection] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GiftCollections]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GiftCollections']

classmethod getType()[source]
Return type:

Literal['giftCollections']

to_dict()[source]
Return type:

dict

collections: List[GiftCollection]

List of gift collections

class pytdbot.types.GiftForResale(gift=None, received_gift_id='')[source]

Bases: TlObject

Describes a gift available for resale

Parameters:
  • gift ("types.UpgradedGift") – The gift

  • received_gift_id (str) – Unique identifier of the received gift for the current user; only for the gifts owned by the current user

__init__(gift=None, received_gift_id='')[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GiftForResale]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GiftForResale']

classmethod getType()[source]
Return type:

Literal['giftForResale']

to_dict()[source]
Return type:

dict

gift: Optional[UpgradedGift]

The gift

received_gift_id: Optional[str]

Unique identifier of the received gift for the current user; only for the gifts owned by the current user

class pytdbot.types.GiftForResaleOrder[source]

Bases: object

Describes order in which upgraded gifts for resale will be sorted

class pytdbot.types.GiftForResaleOrderNumber[source]

Bases: TlObject, GiftForResaleOrder

The gifts will be sorted by their number from the smallest to the largest

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GiftForResaleOrderNumber]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GiftForResaleOrder']

classmethod getType()[source]
Return type:

Literal['giftForResaleOrderNumber']

to_dict()[source]
Return type:

dict

class pytdbot.types.GiftForResaleOrderPrice[source]

Bases: TlObject, GiftForResaleOrder

The gifts will be sorted by their price from the lowest to the highest

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GiftForResaleOrderPrice]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GiftForResaleOrder']

classmethod getType()[source]
Return type:

Literal['giftForResaleOrderPrice']

to_dict()[source]
Return type:

dict

class pytdbot.types.GiftForResaleOrderPriceChangeDate[source]

Bases: TlObject, GiftForResaleOrder

The gifts will be sorted by the last date when their price was changed from the newest to the oldest

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GiftForResaleOrderPriceChangeDate]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GiftForResaleOrder']

classmethod getType()[source]
Return type:

Literal['giftForResaleOrderPriceChangeDate']

to_dict()[source]
Return type:

dict

class pytdbot.types.GiftPurchaseLimits(total_count=0, remaining_count=0)[source]

Bases: TlObject

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

Parameters:
  • total_count (int) – The maximum number of times the gifts can be purchased

  • remaining_count (int) – Number of remaining times the gift can be purchased

__init__(total_count=0, remaining_count=0)[source]
Parameters:
  • total_count (int)

  • remaining_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GiftPurchaseLimits]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GiftPurchaseLimits']

classmethod getType()[source]
Return type:

Literal['giftPurchaseLimits']

to_dict()[source]
Return type:

dict

remaining_count: int

Number of remaining times the gift can be purchased

total_count: int

The maximum number of times the gifts can be purchased

class pytdbot.types.GiftResaleParameters(star_count=0, toncoin_cent_count=0, toncoin_only=False)[source]

Bases: TlObject

Describes parameters of a unique gift available for resale

Parameters:
  • star_count (int) – Resale price of the gift in Telegram Stars

  • toncoin_cent_count (int) – Resale price of the gift in 1/100 of Toncoin

  • toncoin_only (bool) – True, if the gift can be bought only using Toncoins

__init__(star_count=0, toncoin_cent_count=0, toncoin_only=False)[source]
Parameters:
  • star_count (int)

  • toncoin_cent_count (int)

  • toncoin_only (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GiftResaleParameters]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GiftResaleParameters']

classmethod getType()[source]
Return type:

Literal['giftResaleParameters']

to_dict()[source]
Return type:

dict

star_count: int

Resale price of the gift in Telegram Stars

toncoin_cent_count: int

Resale price of the gift in 1/100 of Toncoin

toncoin_only: bool

True, if the gift can be bought only using Toncoins

class pytdbot.types.GiftResalePrice[source]

Bases: object

Describes price of a resold gift

class pytdbot.types.GiftResalePriceStar(star_count=0)[source]

Bases: TlObject, GiftResalePrice

Describes price of a resold gift in Telegram Stars

Parameters:

star_count (int) – The amount of Telegram Stars expected to be paid for the gift. Must be in range getOption("gift_resale_star_count_min")-getOption("gift_resale_star_count_max") for gifts put for resale

__init__(star_count=0)[source]
Parameters:

star_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GiftResalePriceStar]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GiftResalePrice']

classmethod getType()[source]
Return type:

Literal['giftResalePriceStar']

to_dict()[source]
Return type:

dict

star_count: int

The amount of Telegram Stars expected to be paid for the gift. Must be in range getOption("gift_resale_star_count_min")-getOption("gift_resale_star_count_max") for gifts put for resale

class pytdbot.types.GiftResalePriceTon(toncoin_cent_count=0)[source]

Bases: TlObject, GiftResalePrice

Describes price of a resold gift in Toncoins

Parameters:

toncoin_cent_count (int) – The amount of 1/100 of Toncoin expected to be paid for the gift. Must be in range getOption("gift_resale_toncoin_cent_count_min")-getOption("gift_resale_toncoin_cent_count_max")

__init__(toncoin_cent_count=0)[source]
Parameters:

toncoin_cent_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GiftResalePriceTon]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GiftResalePrice']

classmethod getType()[source]
Return type:

Literal['giftResalePriceTon']

to_dict()[source]
Return type:

dict

toncoin_cent_count: int

The amount of 1/100 of Toncoin expected to be paid for the gift. Must be in range getOption("gift_resale_toncoin_cent_count_min")-getOption("gift_resale_toncoin_cent_count_max")

class pytdbot.types.GiftResaleResult[source]

Bases: object

Describes result of sending a resold gift

class pytdbot.types.GiftResaleResultOk[source]

Bases: TlObject, GiftResaleResult

Operation was successfully completed

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GiftResaleResultOk]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GiftResaleResult']

classmethod getType()[source]
Return type:

Literal['giftResaleResultOk']

to_dict()[source]
Return type:

dict

class pytdbot.types.GiftResaleResultPriceIncreased(price=None)[source]

Bases: TlObject, GiftResaleResult

Operation has failed, because price has increased. If the price has decreased, then the buying will succeed anyway

Parameters:

price ("types.GiftResalePrice") – New price for the gift

__init__(price=None)[source]
Parameters:

price (GiftResalePrice | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GiftResaleResultPriceIncreased]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GiftResaleResult']

classmethod getType()[source]
Return type:

Literal['giftResaleResultPriceIncreased']

to_dict()[source]
Return type:

dict

price: Union[GiftResalePriceStar, GiftResalePriceTon, None]

New price for the gift

class pytdbot.types.GiftSettings(show_gift_button=False, accepted_gift_types=None)[source]

Bases: TlObject

Contains settings for gift receiving for a user

Parameters:
  • show_gift_button (bool) – True, if a button for sending a gift to the user or by the user must always be shown in the input field

  • accepted_gift_types ("types.AcceptedGiftTypes") – Types of gifts accepted by the user; for Telegram Premium users only

__init__(show_gift_button=False, accepted_gift_types=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GiftSettings]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GiftSettings']

classmethod getType()[source]
Return type:

Literal['giftSettings']

to_dict()[source]
Return type:

dict

accepted_gift_types: Optional[AcceptedGiftTypes]

Types of gifts accepted by the user; for Telegram Premium users only

show_gift_button: bool

True, if a button for sending a gift to the user or by the user must always be shown in the input field

class pytdbot.types.GiftUpgradePreview(models=None, symbols=None, backdrops=None)[source]

Bases: TlObject

Contains examples of possible upgraded gifts for the given regular gift

Parameters:
  • models (List["types.UpgradedGiftModel"]) – Examples of possible models that can be chosen for the gift after upgrade

  • symbols (List["types.UpgradedGiftSymbol"]) – Examples of possible symbols that can be chosen for the gift after upgrade

  • backdrops (List["types.UpgradedGiftBackdrop"]) – Examples of possible backdrops that can be chosen for the gift after upgrade

__init__(models=None, symbols=None, backdrops=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GiftUpgradePreview]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GiftUpgradePreview']

classmethod getType()[source]
Return type:

Literal['giftUpgradePreview']

to_dict()[source]
Return type:

dict

backdrops: List[UpgradedGiftBackdrop]

Examples of possible backdrops that can be chosen for the gift after upgrade

models: List[UpgradedGiftModel]

Examples of possible models that can be chosen for the gift after upgrade

symbols: List[UpgradedGiftSymbol]

Examples of possible symbols that can be chosen for the gift after upgrade

class pytdbot.types.GiftsForResale(total_count=0, gifts=None, models=None, symbols=None, backdrops=None, next_offset='')[source]

Bases: TlObject

Describes gifts available for resale

Parameters:
  • total_count (int) – Total number of gifts found

  • gifts (List["types.GiftForResale"]) – The gifts

  • models (List["types.UpgradedGiftModelCount"]) – Available models; for searchGiftsForResale requests without offset and attributes only

  • symbols (List["types.UpgradedGiftSymbolCount"]) – Available symbols; for searchGiftsForResale requests without offset and attributes only

  • backdrops (List["types.UpgradedGiftBackdropCount"]) – Available backdrops; for searchGiftsForResale requests without offset and attributes only

  • next_offset (str) – The offset for the next request. If empty, then there are no more results

__init__(total_count=0, gifts=None, models=None, symbols=None, backdrops=None, next_offset='')[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GiftsForResale]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GiftsForResale']

classmethod getType()[source]
Return type:

Literal['giftsForResale']

to_dict()[source]
Return type:

dict

backdrops: List[UpgradedGiftBackdropCount]

Available backdrops; for searchGiftsForResale requests without offset and attributes only

gifts: List[GiftForResale]

The gifts

models: List[UpgradedGiftModelCount]

Available models; for searchGiftsForResale requests without offset and attributes only

next_offset: Optional[str]

The offset for the next request. If empty, then there are no more results

symbols: List[UpgradedGiftSymbolCount]

Available symbols; for searchGiftsForResale requests without offset and attributes only

total_count: int

Total number of gifts found

class pytdbot.types.GiveawayInfo[source]

Bases: object

Contains information about a giveaway

class pytdbot.types.GiveawayInfoCompleted(creation_date=0, actual_winners_selection_date=0, was_refunded=False, is_winner=False, winner_count=0, activation_count=0, gift_code='', won_star_count=0)[source]

Bases: TlObject, GiveawayInfo

Describes a completed giveaway

Parameters:
  • creation_date (int) – Point in time (Unix timestamp) when the giveaway was created

  • actual_winners_selection_date (int) – Point in time (Unix timestamp) when the winners were selected. May be bigger than winners selection date specified in parameters of the giveaway

  • was_refunded (bool) – True, if the giveaway was canceled and was fully refunded

  • is_winner (bool) – True, if the current user is a winner of the giveaway

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

  • activation_count (int) – Number of winners, which activated their gift codes; for Telegram Premium giveaways only

  • gift_code (str) – Telegram Premium gift code that was received by the current user; empty if the user isn’t a winner in the giveaway or the giveaway isn’t a Telegram Premium giveaway

  • won_star_count (int) – The amount of Telegram Stars won by the current user; 0 if the user isn’t a winner in the giveaway or the giveaway isn’t a Telegram Star giveaway

__init__(creation_date=0, actual_winners_selection_date=0, was_refunded=False, is_winner=False, winner_count=0, activation_count=0, gift_code='', won_star_count=0)[source]
Parameters:
  • creation_date (int)

  • actual_winners_selection_date (int)

  • was_refunded (bool)

  • is_winner (bool)

  • winner_count (int)

  • activation_count (int)

  • gift_code (str)

  • won_star_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GiveawayInfoCompleted]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GiveawayInfo']

classmethod getType()[source]
Return type:

Literal['giveawayInfoCompleted']

to_dict()[source]
Return type:

dict

activation_count: int

Number of winners, which activated their gift codes; for Telegram Premium giveaways only

actual_winners_selection_date: int

Point in time (Unix timestamp) when the winners were selected. May be bigger than winners selection date specified in parameters of the giveaway

creation_date: int

Point in time (Unix timestamp) when the giveaway was created

gift_code: Optional[str]

Telegram Premium gift code that was received by the current user; empty if the user isn’t a winner in the giveaway or the giveaway isn’t a Telegram Premium giveaway

is_winner: bool

True, if the current user is a winner of the giveaway

was_refunded: bool

True, if the giveaway was canceled and was fully refunded

winner_count: int

Number of winners in the giveaway

won_star_count: int

The amount of Telegram Stars won by the current user; 0 if the user isn’t a winner in the giveaway or the giveaway isn’t a Telegram Star giveaway

class pytdbot.types.GiveawayInfoOngoing(creation_date=0, status=None, is_ended=False)[source]

Bases: TlObject, GiveawayInfo

Describes an ongoing giveaway

Parameters:
  • creation_date (int) – Point in time (Unix timestamp) when the giveaway was created

  • status ("types.GiveawayParticipantStatus") – Status of the current user in the giveaway

  • is_ended (bool) – True, if the giveaway has ended and results are being prepared

__init__(creation_date=0, status=None, is_ended=False)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GiveawayInfoOngoing]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GiveawayInfo']

classmethod getType()[source]
Return type:

Literal['giveawayInfoOngoing']

to_dict()[source]
Return type:

dict

creation_date: int

Point in time (Unix timestamp) when the giveaway was created

is_ended: bool

True, if the giveaway has ended and results are being prepared

status: Union[GiveawayParticipantStatusEligible, GiveawayParticipantStatusParticipating, GiveawayParticipantStatusAlreadyWasMember, GiveawayParticipantStatusAdministrator, GiveawayParticipantStatusDisallowedCountry, None]

Status of the current user in the giveaway

class pytdbot.types.GiveawayParameters(boosted_chat_id=0, additional_chat_ids=None, winners_selection_date=0, only_new_members=False, has_public_winners=False, country_codes=None, prize_description='')[source]

Bases: TlObject

Describes parameters of a giveaway

Parameters:
  • boosted_chat_id (int) – Identifier of the supergroup or channel chat, which will be automatically boosted by the winners of the giveaway for duration of the Telegram Premium subscription, or for the specified time. If the chat is a channel, then can_post_messages administrator right is required in the channel, otherwise, the user must be an administrator in the supergroup

  • additional_chat_ids (List[int]) – Identifiers of other supergroup or channel chats that must be subscribed by the users to be eligible for the giveaway. There can be up to getOption("giveaway_additional_chat_count_max") additional chats

  • winners_selection_date (int) – Point in time (Unix timestamp) when the giveaway is expected to be performed; must be 60-getOption("giveaway_duration_max") seconds in the future in scheduled giveaways

  • only_new_members (bool) – True, if only new members of the chats will be eligible for the giveaway

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

  • country_codes (List[str]) – The list of two-letter ISO 3166-1 alpha-2 codes of countries, users from which will be eligible for the giveaway. If empty, then all users can participate in the giveaway. There can be up to getOption("giveaway_country_count_max") chosen countries. Users with phone number that was bought at https://fragment.com can participate in any giveaway and the country code "FT" must not be specified in the list

  • prize_description (str) – Additional description of the giveaway prize; 0-128 characters

__init__(boosted_chat_id=0, additional_chat_ids=None, winners_selection_date=0, only_new_members=False, has_public_winners=False, country_codes=None, prize_description='')[source]
Parameters:
  • boosted_chat_id (int)

  • additional_chat_ids (List[int] | None)

  • winners_selection_date (int)

  • only_new_members (bool)

  • has_public_winners (bool)

  • country_codes (List[str] | None)

  • prize_description (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GiveawayParameters]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GiveawayParameters']

classmethod getType()[source]
Return type:

Literal['giveawayParameters']

to_dict()[source]
Return type:

dict

additional_chat_ids: List[int]

Identifiers of other supergroup or channel chats that must be subscribed by the users to be eligible for the giveaway. There can be up to getOption("giveaway_additional_chat_count_max") additional chats

boosted_chat_id: int

Identifier of the supergroup or channel chat, which will be automatically boosted by the winners of the giveaway for duration of the Telegram Premium subscription, or for the specified time. If the chat is a channel, then can_post_messages administrator right is required in the channel, otherwise, the user must be an administrator in the supergroup

country_codes: List[str]

//fragment.com can participate in any giveaway and the country code "FT" must not be specified in the list

Type:

The list of two-letter ISO 3166-1 alpha-2 codes of countries, users from which will be eligible for the giveaway. If empty, then all users can participate in the giveaway. There can be up to getOption(“giveaway_country_count_max”) chosen countries. Users with phone number that was bought at https

has_public_winners: bool

True, if the list of winners of the giveaway will be available to everyone

only_new_members: bool

True, if only new members of the chats will be eligible for the giveaway

prize_description: Optional[str]

Additional description of the giveaway prize; 0-128 characters

winners_selection_date: int

Point in time (Unix timestamp) when the giveaway is expected to be performed; must be 60-getOption("giveaway_duration_max") seconds in the future in scheduled giveaways

class pytdbot.types.GiveawayParticipantStatus[source]

Bases: object

Contains information about status of a user in a giveaway

class pytdbot.types.GiveawayParticipantStatusAdministrator(chat_id=0)[source]

Bases: TlObject, GiveawayParticipantStatus

The user can’t participate in the giveaway, because they are an administrator in one of the chats that created the giveaway

Parameters:

chat_id (int) – Identifier of the chat administered by the user

__init__(chat_id=0)[source]
Parameters:

chat_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GiveawayParticipantStatusAdministrator]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GiveawayParticipantStatus']

classmethod getType()[source]
Return type:

Literal['giveawayParticipantStatusAdministrator']

to_dict()[source]
Return type:

dict

chat_id: int

Identifier of the chat administered by the user

class pytdbot.types.GiveawayParticipantStatusAlreadyWasMember(joined_chat_date=0)[source]

Bases: TlObject, GiveawayParticipantStatus

The user can’t participate in the giveaway, because they have already been member of the chat

Parameters:

joined_chat_date (int) – Point in time (Unix timestamp) when the user joined the chat

__init__(joined_chat_date=0)[source]
Parameters:

joined_chat_date (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GiveawayParticipantStatusAlreadyWasMember]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GiveawayParticipantStatus']

classmethod getType()[source]
Return type:

Literal['giveawayParticipantStatusAlreadyWasMember']

to_dict()[source]
Return type:

dict

joined_chat_date: int

Point in time (Unix timestamp) when the user joined the chat

class pytdbot.types.GiveawayParticipantStatusDisallowedCountry(user_country_code='')[source]

Bases: TlObject, GiveawayParticipantStatus

The user can’t participate in the giveaway, because they phone number is from a disallowed country

Parameters:

user_country_code (str) – A two-letter ISO 3166-1 alpha-2 country code of the user’s country

__init__(user_country_code='')[source]
Parameters:

user_country_code (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GiveawayParticipantStatusDisallowedCountry]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GiveawayParticipantStatus']

classmethod getType()[source]
Return type:

Literal['giveawayParticipantStatusDisallowedCountry']

to_dict()[source]
Return type:

dict

user_country_code: Optional[str]

A two-letter ISO 3166-1 alpha-2 country code of the user’s country

class pytdbot.types.GiveawayParticipantStatusEligible[source]

Bases: TlObject, GiveawayParticipantStatus

The user is eligible for the giveaway

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GiveawayParticipantStatusEligible]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GiveawayParticipantStatus']

classmethod getType()[source]
Return type:

Literal['giveawayParticipantStatusEligible']

to_dict()[source]
Return type:

dict

class pytdbot.types.GiveawayParticipantStatusParticipating[source]

Bases: TlObject, GiveawayParticipantStatus

The user participates in the giveaway

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GiveawayParticipantStatusParticipating]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GiveawayParticipantStatus']

classmethod getType()[source]
Return type:

Literal['giveawayParticipantStatusParticipating']

to_dict()[source]
Return type:

dict

class pytdbot.types.GiveawayPrize[source]

Bases: object

Contains information about a giveaway prize

class pytdbot.types.GiveawayPrizePremium(month_count=0)[source]

Bases: TlObject, GiveawayPrize

The giveaway sends Telegram Premium subscriptions to the winners

Parameters:

month_count (int) – Number of months the Telegram Premium subscription will be active after code activation

__init__(month_count=0)[source]
Parameters:

month_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GiveawayPrizePremium]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GiveawayPrize']

classmethod getType()[source]
Return type:

Literal['giveawayPrizePremium']

to_dict()[source]
Return type:

dict

month_count: int

Number of months the Telegram Premium subscription will be active after code activation

class pytdbot.types.GiveawayPrizeStars(star_count=0)[source]

Bases: TlObject, GiveawayPrize

The giveaway sends Telegram Stars to the winners

Parameters:

star_count (int) – Number of Telegram Stars that will be shared by all winners

__init__(star_count=0)[source]
Parameters:

star_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GiveawayPrizeStars]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GiveawayPrize']

classmethod getType()[source]
Return type:

Literal['giveawayPrizeStars']

to_dict()[source]
Return type:

dict

star_count: int

Number of Telegram Stars that will be shared by all winners

class pytdbot.types.GroupCall(id=0, title='', invite_link='', scheduled_start_date=0, enabled_start_notification=False, is_active=False, is_video_chat=False, is_rtmp_stream=False, is_joined=False, need_rejoin=False, is_owned=False, can_be_managed=False, participant_count=0, has_hidden_listeners=False, loaded_all_participants=False, recent_speakers=None, is_my_video_enabled=False, is_my_video_paused=False, can_enable_video=False, mute_new_participants=False, can_toggle_mute_new_participants=False, record_duration=0, is_video_recorded=False, duration=0)[source]

Bases: TlObject

Describes a group call

Parameters:
  • id (int) – Group call identifier

  • title (str) – Group call title; for video chats only

  • invite_link (str) – Invite link for the group call; for group calls that aren’t bound to a chat. For video chats call getVideoChatInviteLink to get the link

  • scheduled_start_date (int) – Point in time (Unix timestamp) when the group call is expected to be started by an administrator; 0 if it is already active or was ended; for video chats only

  • enabled_start_notification (bool) – True, if the group call is scheduled and the current user will receive a notification when the group call starts; for video chats only

  • is_active (bool) – True, if the call is active

  • is_video_chat (bool) – True, if the call is bound to a chat

  • is_rtmp_stream (bool) – True, if the call is an RTMP stream instead of an ordinary video chat; for video chats only

  • is_joined (bool) – True, if the call is joined

  • need_rejoin (bool) – True, if user was kicked from the call because of network loss and the call needs to be rejoined

  • is_owned (bool) – True, if the user is the owner of the call and can end the call, change volume level of other users, or ban users there; for group calls that aren’t bound to a chat

  • can_be_managed (bool) – True, if the current user can manage the group call; for video chats only

  • participant_count (int) – Number of participants in the group call

  • has_hidden_listeners (bool) – True, if group call participants, which are muted, aren’t returned in participant list; for video chats only

  • loaded_all_participants (bool) – True, if all group call participants are loaded

  • recent_speakers (List["types.GroupCallRecentSpeaker"]) – At most 3 recently speaking users in the group call

  • is_my_video_enabled (bool) – True, if the current user’s video is enabled

  • is_my_video_paused (bool) – True, if the current user’s video is paused

  • can_enable_video (bool) – True, if the current user can broadcast video or share screen

  • mute_new_participants (bool) – True, if only group call administrators can unmute new participants; for video chats only

  • can_toggle_mute_new_participants (bool) – True, if the current user can enable or disable mute_new_participants setting; for video chats only

  • record_duration (int) – Duration of the ongoing group call recording, in seconds; 0 if none. An updateGroupCall update is not triggered when value of this field changes, but the same recording goes on

  • is_video_recorded (bool) – True, if a video file is being recorded for the call

  • duration (int) – Call duration, in seconds; for ended calls only

__init__(id=0, title='', invite_link='', scheduled_start_date=0, enabled_start_notification=False, is_active=False, is_video_chat=False, is_rtmp_stream=False, is_joined=False, need_rejoin=False, is_owned=False, can_be_managed=False, participant_count=0, has_hidden_listeners=False, loaded_all_participants=False, recent_speakers=None, is_my_video_enabled=False, is_my_video_paused=False, can_enable_video=False, mute_new_participants=False, can_toggle_mute_new_participants=False, record_duration=0, is_video_recorded=False, duration=0)[source]
Parameters:
  • id (int)

  • title (str)

  • invite_link (str)

  • scheduled_start_date (int)

  • enabled_start_notification (bool)

  • is_active (bool)

  • is_video_chat (bool)

  • is_rtmp_stream (bool)

  • is_joined (bool)

  • need_rejoin (bool)

  • is_owned (bool)

  • can_be_managed (bool)

  • participant_count (int)

  • has_hidden_listeners (bool)

  • loaded_all_participants (bool)

  • recent_speakers (List[GroupCallRecentSpeaker] | None)

  • is_my_video_enabled (bool)

  • is_my_video_paused (bool)

  • can_enable_video (bool)

  • mute_new_participants (bool)

  • can_toggle_mute_new_participants (bool)

  • record_duration (int)

  • is_video_recorded (bool)

  • duration (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GroupCall]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GroupCall']

classmethod getType()[source]
Return type:

Literal['groupCall']

to_dict()[source]
Return type:

dict

can_be_managed: bool

True, if the current user can manage the group call; for video chats only

can_enable_video: bool

True, if the current user can broadcast video or share screen

can_toggle_mute_new_participants: bool

True, if the current user can enable or disable mute_new_participants setting; for video chats only

duration: int

Call duration, in seconds; for ended calls only

enabled_start_notification: bool

True, if the group call is scheduled and the current user will receive a notification when the group call starts; for video chats only

has_hidden_listeners: bool

True, if group call participants, which are muted, aren’t returned in participant list; for video chats only

id: int

Group call identifier

invite_link: Optional[str]

Invite link for the group call; for group calls that aren’t bound to a chat. For video chats call getVideoChatInviteLink to get the link

is_active: bool

True, if the call is active

is_joined: bool

True, if the call is joined

is_my_video_enabled: bool

True, if the current user’s video is enabled

is_my_video_paused: bool

True, if the current user’s video is paused

is_owned: bool

True, if the user is the owner of the call and can end the call, change volume level of other users, or ban users there; for group calls that aren’t bound to a chat

is_rtmp_stream: bool

True, if the call is an RTMP stream instead of an ordinary video chat; for video chats only

is_video_chat: bool

True, if the call is bound to a chat

is_video_recorded: bool

True, if a video file is being recorded for the call

loaded_all_participants: bool

True, if all group call participants are loaded

mute_new_participants: bool

True, if only group call administrators can unmute new participants; for video chats only

need_rejoin: bool

True, if user was kicked from the call because of network loss and the call needs to be rejoined

participant_count: int

Number of participants in the group call

recent_speakers: List[GroupCallRecentSpeaker]

At most 3 recently speaking users in the group call

record_duration: int

Duration of the ongoing group call recording, in seconds; 0 if none. An updateGroupCall update is not triggered when value of this field changes, but the same recording goes on

scheduled_start_date: int

Point in time (Unix timestamp) when the group call is expected to be started by an administrator; 0 if it is already active or was ended; for video chats only

title: Optional[str]

Group call title; for video chats only

class pytdbot.types.GroupCallDataChannel[source]

Bases: object

Describes data channel for a group call

class pytdbot.types.GroupCallDataChannelMain[source]

Bases: TlObject, GroupCallDataChannel

The main data channel for audio and video data

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GroupCallDataChannelMain]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GroupCallDataChannel']

classmethod getType()[source]
Return type:

Literal['groupCallDataChannelMain']

to_dict()[source]
Return type:

dict

class pytdbot.types.GroupCallDataChannelScreenSharing[source]

Bases: TlObject, GroupCallDataChannel

The data channel for screen sharing

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GroupCallDataChannelScreenSharing]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GroupCallDataChannel']

classmethod getType()[source]
Return type:

Literal['groupCallDataChannelScreenSharing']

to_dict()[source]
Return type:

dict

class pytdbot.types.GroupCallId(id=0)[source]

Bases: TlObject

Contains the group call identifier

Parameters:

id (int) – Group call identifier

__init__(id=0)[source]
Parameters:

id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GroupCallId]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GroupCallId']

classmethod getType()[source]
Return type:

Literal['groupCallId']

to_dict()[source]
Return type:

dict

id: int

Group call identifier

class pytdbot.types.GroupCallInfo(group_call_id=0, join_payload='')[source]

Bases: TlObject

Contains information about a just created or just joined group call

Parameters:
  • group_call_id (int) – Identifier of the group call

  • join_payload (str) – Join response payload for tgcalls; empty if the call isn’t joined

__init__(group_call_id=0, join_payload='')[source]
Parameters:
  • group_call_id (int)

  • join_payload (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GroupCallInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GroupCallInfo']

classmethod getType()[source]
Return type:

Literal['groupCallInfo']

to_dict()[source]
Return type:

dict

group_call_id: int

Identifier of the group call

join_payload: Optional[str]

Join response payload for tgcalls; empty if the call isn’t joined

class pytdbot.types.GroupCallJoinParameters(audio_source_id=0, payload='', is_muted=False, is_my_video_enabled=False)[source]

Bases: TlObject

Describes parameters used to join a group call

Parameters:
  • audio_source_id (int) – Audio channel synchronization source identifier; received from tgcalls

  • payload (str) – Group call join payload; received from tgcalls

  • is_muted (bool) – Pass true to join the call with muted microphone

  • is_my_video_enabled (bool) – Pass true if the user’s video is enabled

__init__(audio_source_id=0, payload='', is_muted=False, is_my_video_enabled=False)[source]
Parameters:
  • audio_source_id (int)

  • payload (str)

  • is_muted (bool)

  • is_my_video_enabled (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GroupCallJoinParameters]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GroupCallJoinParameters']

classmethod getType()[source]
Return type:

Literal['groupCallJoinParameters']

to_dict()[source]
Return type:

dict

audio_source_id: int

Audio channel synchronization source identifier; received from tgcalls

is_muted: bool

Pass true to join the call with muted microphone

is_my_video_enabled: bool

Pass true if the user’s video is enabled

payload: Optional[str]

Group call join payload; received from tgcalls

class pytdbot.types.GroupCallParticipant(participant_id=None, audio_source_id=0, screen_sharing_audio_source_id=0, video_info=None, screen_sharing_video_info=None, bio='', is_current_user=False, is_speaking=False, is_hand_raised=False, can_be_muted_for_all_users=False, can_be_unmuted_for_all_users=False, can_be_muted_for_current_user=False, can_be_unmuted_for_current_user=False, is_muted_for_all_users=False, is_muted_for_current_user=False, can_unmute_self=False, volume_level=0, order='')[source]

Bases: TlObject

Represents a group call participant

Parameters:
  • participant_id ("types.MessageSender") – Identifier of the group call participant

  • audio_source_id (int) – User’s audio channel synchronization source identifier

  • screen_sharing_audio_source_id (int) – User’s screen sharing audio channel synchronization source identifier

  • video_info ("types.GroupCallParticipantVideoInfo") – Information about user’s video channel; may be null if there is no active video

  • screen_sharing_video_info ("types.GroupCallParticipantVideoInfo") – Information about user’s screen sharing video channel; may be null if there is no active screen sharing video

  • bio (str) – The participant user’s bio or the participant chat’s description

  • is_current_user (bool) – True, if the participant is the current user

  • is_speaking (bool) – True, if the participant is speaking as set by setGroupCallParticipantIsSpeaking

  • is_hand_raised (bool) – True, if the participant hand is raised

  • can_be_muted_for_all_users (bool) – True, if the current user can mute the participant for all other group call participants

  • can_be_unmuted_for_all_users (bool) – True, if the current user can allow the participant to unmute themselves or unmute the participant (if the participant is the current user)

  • can_be_muted_for_current_user (bool) – True, if the current user can mute the participant only for self

  • can_be_unmuted_for_current_user (bool) – True, if the current user can unmute the participant for self

  • is_muted_for_all_users (bool) – True, if the participant is muted for all users

  • is_muted_for_current_user (bool) – True, if the participant is muted for the current user

  • can_unmute_self (bool) – True, if the participant is muted for all users, but can unmute themselves

  • volume_level (int) – Participant’s volume level; 1-20000 in hundreds of percents

  • order (str) – User’s order in the group call participant list. Orders must be compared lexicographically. The bigger is order, the higher is user in the list. If order is empty, the user must be removed from the participant list

__init__(participant_id=None, audio_source_id=0, screen_sharing_audio_source_id=0, video_info=None, screen_sharing_video_info=None, bio='', is_current_user=False, is_speaking=False, is_hand_raised=False, can_be_muted_for_all_users=False, can_be_unmuted_for_all_users=False, can_be_muted_for_current_user=False, can_be_unmuted_for_current_user=False, is_muted_for_all_users=False, is_muted_for_current_user=False, can_unmute_self=False, volume_level=0, order='')[source]
Parameters:
  • participant_id (MessageSender | None)

  • audio_source_id (int)

  • screen_sharing_audio_source_id (int)

  • video_info (GroupCallParticipantVideoInfo | None)

  • screen_sharing_video_info (GroupCallParticipantVideoInfo | None)

  • bio (str)

  • is_current_user (bool)

  • is_speaking (bool)

  • is_hand_raised (bool)

  • can_be_muted_for_all_users (bool)

  • can_be_unmuted_for_all_users (bool)

  • can_be_muted_for_current_user (bool)

  • can_be_unmuted_for_current_user (bool)

  • is_muted_for_all_users (bool)

  • is_muted_for_current_user (bool)

  • can_unmute_self (bool)

  • volume_level (int)

  • order (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GroupCallParticipant]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GroupCallParticipant']

classmethod getType()[source]
Return type:

Literal['groupCallParticipant']

to_dict()[source]
Return type:

dict

audio_source_id: int

User’s audio channel synchronization source identifier

bio: Optional[str]

The participant user’s bio or the participant chat’s description

can_be_muted_for_all_users: bool

True, if the current user can mute the participant for all other group call participants

can_be_muted_for_current_user: bool

True, if the current user can mute the participant only for self

can_be_unmuted_for_all_users: bool

True, if the current user can allow the participant to unmute themselves or unmute the participant (if the participant is the current user)

can_be_unmuted_for_current_user: bool

True, if the current user can unmute the participant for self

can_unmute_self: bool

True, if the participant is muted for all users, but can unmute themselves

is_current_user: bool

True, if the participant is the current user

is_hand_raised: bool

True, if the participant hand is raised

is_muted_for_all_users: bool

True, if the participant is muted for all users

is_muted_for_current_user: bool

True, if the participant is muted for the current user

is_speaking: bool

True, if the participant is speaking as set by setGroupCallParticipantIsSpeaking

order: Optional[str]

User’s order in the group call participant list. Orders must be compared lexicographically. The bigger is order, the higher is user in the list. If order is empty, the user must be removed from the participant list

participant_id: Union[MessageSenderUser, MessageSenderChat, None]

Identifier of the group call participant

screen_sharing_audio_source_id: int

User’s screen sharing audio channel synchronization source identifier

screen_sharing_video_info: Optional[GroupCallParticipantVideoInfo]

Information about user’s screen sharing video channel; may be null if there is no active screen sharing video

video_info: Optional[GroupCallParticipantVideoInfo]

Information about user’s video channel; may be null if there is no active video

volume_level: int

Participant’s volume level; 1-20000 in hundreds of percents

class pytdbot.types.GroupCallParticipantVideoInfo(source_groups=None, endpoint_id='', is_paused=False)[source]

Bases: TlObject

Contains information about a group call participant’s video channel

Parameters:
  • source_groups (List["types.GroupCallVideoSourceGroup"]) – List of synchronization source groups of the video

  • endpoint_id (str) – Video channel endpoint identifier

  • is_paused (bool) – True, if the video is paused. This flag needs to be ignored, if new video frames are received

__init__(source_groups=None, endpoint_id='', is_paused=False)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GroupCallParticipantVideoInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GroupCallParticipantVideoInfo']

classmethod getType()[source]
Return type:

Literal['groupCallParticipantVideoInfo']

to_dict()[source]
Return type:

dict

endpoint_id: Optional[str]

Video channel endpoint identifier

is_paused: bool

True, if the video is paused. This flag needs to be ignored, if new video frames are received

source_groups: List[GroupCallVideoSourceGroup]

List of synchronization source groups of the video

class pytdbot.types.GroupCallParticipants(total_count=0, participant_ids=None)[source]

Bases: TlObject

Contains identifiers of group call participants

Parameters:
  • total_count (int) – Total number of group call participants

  • participant_ids (List["types.MessageSender"]) – Identifiers of the participants

__init__(total_count=0, participant_ids=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GroupCallParticipants]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GroupCallParticipants']

classmethod getType()[source]
Return type:

Literal['groupCallParticipants']

to_dict()[source]
Return type:

dict

participant_ids: List[MessageSender]

Identifiers of the participants

total_count: int

Total number of group call participants

class pytdbot.types.GroupCallRecentSpeaker(participant_id=None, is_speaking=False)[source]

Bases: TlObject

Describes a recently speaking participant in a group call

Parameters:
  • participant_id ("types.MessageSender") – Group call participant identifier

  • is_speaking (bool) – True, is the user has spoken recently

__init__(participant_id=None, is_speaking=False)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GroupCallRecentSpeaker]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GroupCallRecentSpeaker']

classmethod getType()[source]
Return type:

Literal['groupCallRecentSpeaker']

to_dict()[source]
Return type:

dict

is_speaking: bool

True, is the user has spoken recently

participant_id: Union[MessageSenderUser, MessageSenderChat, None]

Group call participant identifier

class pytdbot.types.GroupCallVideoQuality[source]

Bases: object

Describes the quality of a group call video

class pytdbot.types.GroupCallVideoQualityFull[source]

Bases: TlObject, GroupCallVideoQuality

The best available video quality

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GroupCallVideoQualityFull]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GroupCallVideoQuality']

classmethod getType()[source]
Return type:

Literal['groupCallVideoQualityFull']

to_dict()[source]
Return type:

dict

class pytdbot.types.GroupCallVideoQualityMedium[source]

Bases: TlObject, GroupCallVideoQuality

The medium video quality

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GroupCallVideoQualityMedium]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GroupCallVideoQuality']

classmethod getType()[source]
Return type:

Literal['groupCallVideoQualityMedium']

to_dict()[source]
Return type:

dict

class pytdbot.types.GroupCallVideoQualityThumbnail[source]

Bases: TlObject, GroupCallVideoQuality

The worst available video quality

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GroupCallVideoQualityThumbnail]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GroupCallVideoQuality']

classmethod getType()[source]
Return type:

Literal['groupCallVideoQualityThumbnail']

to_dict()[source]
Return type:

dict

class pytdbot.types.GroupCallVideoSourceGroup(semantics='', source_ids=None)[source]

Bases: TlObject

Describes a group of video synchronization source identifiers

Parameters:
  • semantics (str) – The semantics of sources, one of "SIM" or "FID"

  • source_ids (List[int]) – The list of synchronization source identifiers

__init__(semantics='', source_ids=None)[source]
Parameters:
  • semantics (str)

  • source_ids (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[GroupCallVideoSourceGroup]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['GroupCallVideoSourceGroup']

classmethod getType()[source]
Return type:

Literal['groupCallVideoSourceGroup']

to_dict()[source]
Return type:

dict

semantics: Optional[str]

The semantics of sources, one of "SIM" or "FID"

source_ids: List[int]

The list of synchronization source identifiers

class pytdbot.types.Hashtags(hashtags=None)[source]

Bases: TlObject

Contains a list of hashtags

Parameters:

hashtags (List[str]) – A list of hashtags

__init__(hashtags=None)[source]
Parameters:

hashtags (List[str] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Hashtags]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Hashtags']

classmethod getType()[source]
Return type:

Literal['hashtags']

to_dict()[source]
Return type:

dict

hashtags: List[str]

A list of hashtags

class pytdbot.types.HttpUrl(url='')[source]

Bases: TlObject

Contains an HTTP URL

Parameters:

url (str) – The URL

__init__(url='')[source]
Parameters:

url (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[HttpUrl]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['HttpUrl']

classmethod getType()[source]
Return type:

Literal['httpUrl']

to_dict()[source]
Return type:

dict

url: Optional[str]

The URL

class pytdbot.types.IdentityDocument(number='', expiration_date=None, front_side=None, reverse_side=None, selfie=None, translation=None)[source]

Bases: TlObject

An identity document

Parameters:
  • number (str) – Document number; 1-24 characters

  • expiration_date ("types.Date") – Document expiration date; may be null if not applicable

  • front_side ("types.DatedFile") – Front side of the document

  • reverse_side ("types.DatedFile") – Reverse side of the document; only for driver license and identity card; may be null

  • selfie ("types.DatedFile") – Selfie with the document; may be null

  • translation (List["types.DatedFile"]) – List of files containing a certified English translation of the document

__init__(number='', expiration_date=None, front_side=None, reverse_side=None, selfie=None, translation=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[IdentityDocument]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['IdentityDocument']

classmethod getType()[source]
Return type:

Literal['identityDocument']

to_dict()[source]
Return type:

dict

expiration_date: Optional[Date]

Document expiration date; may be null if not applicable

front_side: Optional[DatedFile]

Front side of the document

number: Optional[str]

Document number; 1-24 characters

reverse_side: Optional[DatedFile]

Reverse side of the document; only for driver license and identity card; may be null

selfie: Optional[DatedFile]

Selfie with the document; may be null

translation: List[DatedFile]

List of files containing a certified English translation of the document

class pytdbot.types.ImportedContacts(user_ids=None, importer_count=None)[source]

Bases: TlObject

Represents the result of an importContacts request

Parameters:
  • user_ids (List[int]) – User identifiers of the imported contacts in the same order as they were specified in the request; 0 if the contact is not yet a registered user

  • importer_count (List[int]) – The number of users that imported the corresponding contact; 0 for already registered users or if unavailable

__init__(user_ids=None, importer_count=None)[source]
Parameters:
  • user_ids (List[int] | None)

  • importer_count (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ImportedContacts]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ImportedContacts']

classmethod getType()[source]
Return type:

Literal['importedContacts']

to_dict()[source]
Return type:

dict

importer_count: List[int]

The number of users that imported the corresponding contact; 0 for already registered users or if unavailable

user_ids: List[int]

User identifiers of the imported contacts in the same order as they were specified in the request; 0 if the contact is not yet a registered user

class pytdbot.types.InlineKeyboardButton(text='', type=None)[source]

Bases: TlObject

Represents a single button in an inline keyboard

Parameters:
  • text (str) – Text of the button

  • type ("types.InlineKeyboardButtonType") – Type of the button

__init__(text='', type=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InlineKeyboardButton]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InlineKeyboardButton']

classmethod getType()[source]
Return type:

Literal['inlineKeyboardButton']

to_dict()[source]
Return type:

dict

text: Optional[str]

Text of the button

type: Union[InlineKeyboardButtonTypeUrl, InlineKeyboardButtonTypeLoginUrl, InlineKeyboardButtonTypeWebApp, InlineKeyboardButtonTypeCallback, InlineKeyboardButtonTypeCallbackWithPassword, InlineKeyboardButtonTypeCallbackGame, InlineKeyboardButtonTypeSwitchInline, InlineKeyboardButtonTypeBuy, InlineKeyboardButtonTypeUser, InlineKeyboardButtonTypeCopyText, None]

Type of the button

class pytdbot.types.InlineKeyboardButtonType[source]

Bases: object

Describes the type of inline keyboard button

class pytdbot.types.InlineKeyboardButtonTypeBuy[source]

Bases: TlObject, InlineKeyboardButtonType

A button to buy something. This button must be in the first column and row of the keyboard and can be attached only to a message with content of the type messageInvoice

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InlineKeyboardButtonTypeBuy]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InlineKeyboardButtonType']

classmethod getType()[source]
Return type:

Literal['inlineKeyboardButtonTypeBuy']

to_dict()[source]
Return type:

dict

class pytdbot.types.InlineKeyboardButtonTypeCallback(data=b'')[source]

Bases: TlObject, InlineKeyboardButtonType

A button that sends a callback query to a bot

Parameters:

data (bytes) – Data to be sent to the bot via a callback query

__init__(data=b'')[source]
Parameters:

data (bytes)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InlineKeyboardButtonTypeCallback]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InlineKeyboardButtonType']

classmethod getType()[source]
Return type:

Literal['inlineKeyboardButtonTypeCallback']

to_dict()[source]
Return type:

dict

data: Optional[bytes]

Data to be sent to the bot via a callback query

class pytdbot.types.InlineKeyboardButtonTypeCallbackGame[source]

Bases: TlObject, InlineKeyboardButtonType

A button with a game that sends a callback query to a bot. This button must be in the first column and row of the keyboard and can be attached only to a message with content of the type messageGame

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InlineKeyboardButtonTypeCallbackGame]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InlineKeyboardButtonType']

classmethod getType()[source]
Return type:

Literal['inlineKeyboardButtonTypeCallbackGame']

to_dict()[source]
Return type:

dict

class pytdbot.types.InlineKeyboardButtonTypeCallbackWithPassword(data=b'')[source]

Bases: TlObject, InlineKeyboardButtonType

A button that asks for the 2-step verification password of the current user and then sends a callback query to a bot

Parameters:

data (bytes) – Data to be sent to the bot via a callback query

__init__(data=b'')[source]
Parameters:

data (bytes)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InlineKeyboardButtonTypeCallbackWithPassword]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InlineKeyboardButtonType']

classmethod getType()[source]
Return type:

Literal['inlineKeyboardButtonTypeCallbackWithPassword']

to_dict()[source]
Return type:

dict

data: Optional[bytes]

Data to be sent to the bot via a callback query

class pytdbot.types.InlineKeyboardButtonTypeCopyText(text='')[source]

Bases: TlObject, InlineKeyboardButtonType

A button that copies specified text to clipboard

Parameters:

text (str) – The text to copy to clipboard

__init__(text='')[source]
Parameters:

text (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InlineKeyboardButtonTypeCopyText]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InlineKeyboardButtonType']

classmethod getType()[source]
Return type:

Literal['inlineKeyboardButtonTypeCopyText']

to_dict()[source]
Return type:

dict

text: Optional[str]

The text to copy to clipboard

class pytdbot.types.InlineKeyboardButtonTypeLoginUrl(url='', id=0, forward_text='')[source]

Bases: TlObject, InlineKeyboardButtonType

A button that opens a specified URL and automatically authorize the current user by calling getLoginUrlInfo

Parameters:
  • url (str) – An HTTP URL to pass to getLoginUrlInfo

  • id (int) – Unique button identifier

  • forward_text (str) – If non-empty, new text of the button in forwarded messages

__init__(url='', id=0, forward_text='')[source]
Parameters:
  • url (str)

  • id (int)

  • forward_text (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InlineKeyboardButtonTypeLoginUrl]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InlineKeyboardButtonType']

classmethod getType()[source]
Return type:

Literal['inlineKeyboardButtonTypeLoginUrl']

to_dict()[source]
Return type:

dict

forward_text: Optional[str]

If non-empty, new text of the button in forwarded messages

id: int

Unique button identifier

url: Optional[str]

An HTTP URL to pass to getLoginUrlInfo

class pytdbot.types.InlineKeyboardButtonTypeSwitchInline(query='', target_chat=None)[source]

Bases: TlObject, InlineKeyboardButtonType

A button that forces an inline query to the bot to be inserted in the input field

Parameters:
  • query (str) – Inline query to be sent to the bot

  • target_chat ("types.TargetChat") – Target chat from which to send the inline query

__init__(query='', target_chat=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InlineKeyboardButtonTypeSwitchInline]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InlineKeyboardButtonType']

classmethod getType()[source]
Return type:

Literal['inlineKeyboardButtonTypeSwitchInline']

to_dict()[source]
Return type:

dict

query: Optional[str]

Inline query to be sent to the bot

target_chat: Union[TargetChatCurrent, TargetChatChosen, TargetChatInternalLink, None]

Target chat from which to send the inline query

class pytdbot.types.InlineKeyboardButtonTypeUrl(url='')[source]

Bases: TlObject, InlineKeyboardButtonType

A button that opens a specified URL

Parameters:

url (str) – HTTP or tg:// URL to open. If the link is of the type internalLinkTypeWebApp, then the button must be marked as a Web App button

__init__(url='')[source]
Parameters:

url (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InlineKeyboardButtonTypeUrl]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InlineKeyboardButtonType']

classmethod getType()[source]
Return type:

Literal['inlineKeyboardButtonTypeUrl']

to_dict()[source]
Return type:

dict

url: Optional[str]

// URL to open. If the link is of the type internalLinkTypeWebApp, then the button must be marked as a Web App button

Type:

HTTP or tg

class pytdbot.types.InlineKeyboardButtonTypeUser(user_id=0)[source]

Bases: TlObject, InlineKeyboardButtonType

A button with a user reference to be handled in the same way as textEntityTypeMentionName entities

Parameters:

user_id (int) – User identifier

__init__(user_id=0)[source]
Parameters:

user_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InlineKeyboardButtonTypeUser]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InlineKeyboardButtonType']

classmethod getType()[source]
Return type:

Literal['inlineKeyboardButtonTypeUser']

to_dict()[source]
Return type:

dict

user_id: int

User identifier

class pytdbot.types.InlineKeyboardButtonTypeWebApp(url='')[source]

Bases: TlObject, InlineKeyboardButtonType

A button that opens a Web App by calling openWebApp

Parameters:

url (str) – An HTTP URL to pass to openWebApp

__init__(url='')[source]
Parameters:

url (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InlineKeyboardButtonTypeWebApp]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InlineKeyboardButtonType']

classmethod getType()[source]
Return type:

Literal['inlineKeyboardButtonTypeWebApp']

to_dict()[source]
Return type:

dict

url: Optional[str]

An HTTP URL to pass to openWebApp

class pytdbot.types.InlineQueryResult[source]

Bases: object

Represents a single result of an inline query

class pytdbot.types.InlineQueryResultAnimation(id='', animation=None, title='')[source]

Bases: TlObject, InlineQueryResult

Represents an animation file

Parameters:
  • id (str) – Unique identifier of the query result

  • animation ("types.Animation") – Animation file

  • title (str) – Animation title

__init__(id='', animation=None, title='')[source]
Parameters:
  • id (str)

  • animation (Animation | None)

  • title (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InlineQueryResultAnimation]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InlineQueryResult']

classmethod getType()[source]
Return type:

Literal['inlineQueryResultAnimation']

to_dict()[source]
Return type:

dict

animation: Optional[Animation]

Animation file

id: Optional[str]

Unique identifier of the query result

title: Optional[str]

Animation title

class pytdbot.types.InlineQueryResultArticle(id='', url='', title='', description='', thumbnail=None)[source]

Bases: TlObject, InlineQueryResult

Represents a link to an article or web page

Parameters:
  • id (str) – Unique identifier of the query result

  • url (str) – URL of the result, if it exists

  • title (str) – Title of the result

  • description (str) – A short description of the result

  • thumbnail ("types.Thumbnail") – Result thumbnail in JPEG format; may be null

__init__(id='', url='', title='', description='', thumbnail=None)[source]
Parameters:
  • id (str)

  • url (str)

  • title (str)

  • description (str)

  • thumbnail (Thumbnail | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InlineQueryResultArticle]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InlineQueryResult']

classmethod getType()[source]
Return type:

Literal['inlineQueryResultArticle']

to_dict()[source]
Return type:

dict

description: Optional[str]

A short description of the result

id: Optional[str]

Unique identifier of the query result

thumbnail: Optional[Thumbnail]

Result thumbnail in JPEG format; may be null

title: Optional[str]

Title of the result

url: Optional[str]

URL of the result, if it exists

class pytdbot.types.InlineQueryResultAudio(id='', audio=None)[source]

Bases: TlObject, InlineQueryResult

Represents an audio file

Parameters:
  • id (str) – Unique identifier of the query result

  • audio ("types.Audio") – Audio file

__init__(id='', audio=None)[source]
Parameters:
  • id (str)

  • audio (Audio | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InlineQueryResultAudio]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InlineQueryResult']

classmethod getType()[source]
Return type:

Literal['inlineQueryResultAudio']

to_dict()[source]
Return type:

dict

audio: Optional[Audio]

Audio file

id: Optional[str]

Unique identifier of the query result

class pytdbot.types.InlineQueryResultContact(id='', contact=None, thumbnail=None)[source]

Bases: TlObject, InlineQueryResult

Represents a user contact

Parameters:
  • id (str) – Unique identifier of the query result

  • contact ("types.Contact") – A user contact

  • thumbnail ("types.Thumbnail") – Result thumbnail in JPEG format; may be null

__init__(id='', contact=None, thumbnail=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InlineQueryResultContact]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InlineQueryResult']

classmethod getType()[source]
Return type:

Literal['inlineQueryResultContact']

to_dict()[source]
Return type:

dict

contact: Optional[Contact]

A user contact

id: Optional[str]

Unique identifier of the query result

thumbnail: Optional[Thumbnail]

Result thumbnail in JPEG format; may be null

class pytdbot.types.InlineQueryResultDocument(id='', document=None, title='', description='')[source]

Bases: TlObject, InlineQueryResult

Represents a document

Parameters:
  • id (str) – Unique identifier of the query result

  • document ("types.Document") – Document

  • title (str) – Document title

  • description (str) – Document description

__init__(id='', document=None, title='', description='')[source]
Parameters:
  • id (str)

  • document (Document | None)

  • title (str)

  • description (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InlineQueryResultDocument]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InlineQueryResult']

classmethod getType()[source]
Return type:

Literal['inlineQueryResultDocument']

to_dict()[source]
Return type:

dict

description: Optional[str]

Document description

document: Optional[Document]

Document

id: Optional[str]

Unique identifier of the query result

title: Optional[str]

Document title

class pytdbot.types.InlineQueryResultGame(id='', game=None)[source]

Bases: TlObject, InlineQueryResult

Represents information about a game

Parameters:
  • id (str) – Unique identifier of the query result

  • game ("types.Game") – Game result

__init__(id='', game=None)[source]
Parameters:
  • id (str)

  • game (Game | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InlineQueryResultGame]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InlineQueryResult']

classmethod getType()[source]
Return type:

Literal['inlineQueryResultGame']

to_dict()[source]
Return type:

dict

game: Optional[Game]

Game result

id: Optional[str]

Unique identifier of the query result

class pytdbot.types.InlineQueryResultLocation(id='', location=None, title='', thumbnail=None)[source]

Bases: TlObject, InlineQueryResult

Represents a point on the map

Parameters:
  • id (str) – Unique identifier of the query result

  • location ("types.Location") – Location result

  • title (str) – Title of the result

  • thumbnail ("types.Thumbnail") – Result thumbnail in JPEG format; may be null

__init__(id='', location=None, title='', thumbnail=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InlineQueryResultLocation]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InlineQueryResult']

classmethod getType()[source]
Return type:

Literal['inlineQueryResultLocation']

to_dict()[source]
Return type:

dict

id: Optional[str]

Unique identifier of the query result

location: Optional[Location]

Location result

thumbnail: Optional[Thumbnail]

Result thumbnail in JPEG format; may be null

title: Optional[str]

Title of the result

class pytdbot.types.InlineQueryResultPhoto(id='', photo=None, title='', description='')[source]

Bases: TlObject, InlineQueryResult

Represents a photo

Parameters:
  • id (str) – Unique identifier of the query result

  • photo ("types.Photo") – Photo

  • title (str) – Title of the result, if known

  • description (str) – A short description of the result, if known

__init__(id='', photo=None, title='', description='')[source]
Parameters:
  • id (str)

  • photo (Photo | None)

  • title (str)

  • description (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InlineQueryResultPhoto]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InlineQueryResult']

classmethod getType()[source]
Return type:

Literal['inlineQueryResultPhoto']

to_dict()[source]
Return type:

dict

description: Optional[str]

A short description of the result, if known

id: Optional[str]

Unique identifier of the query result

photo: Optional[Photo]

Photo

title: Optional[str]

Title of the result, if known

class pytdbot.types.InlineQueryResultSticker(id='', sticker=None)[source]

Bases: TlObject, InlineQueryResult

Represents a sticker

Parameters:
  • id (str) – Unique identifier of the query result

  • sticker ("types.Sticker") – Sticker

__init__(id='', sticker=None)[source]
Parameters:
  • id (str)

  • sticker (Sticker | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InlineQueryResultSticker]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InlineQueryResult']

classmethod getType()[source]
Return type:

Literal['inlineQueryResultSticker']

to_dict()[source]
Return type:

dict

id: Optional[str]

Unique identifier of the query result

sticker: Optional[Sticker]

Sticker

class pytdbot.types.InlineQueryResultVenue(id='', venue=None, thumbnail=None)[source]

Bases: TlObject, InlineQueryResult

Represents information about a venue

Parameters:
  • id (str) – Unique identifier of the query result

  • venue ("types.Venue") – Venue result

  • thumbnail ("types.Thumbnail") – Result thumbnail in JPEG format; may be null

__init__(id='', venue=None, thumbnail=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InlineQueryResultVenue]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InlineQueryResult']

classmethod getType()[source]
Return type:

Literal['inlineQueryResultVenue']

to_dict()[source]
Return type:

dict

id: Optional[str]

Unique identifier of the query result

thumbnail: Optional[Thumbnail]

Result thumbnail in JPEG format; may be null

venue: Optional[Venue]

Venue result

class pytdbot.types.InlineQueryResultVideo(id='', video=None, title='', description='')[source]

Bases: TlObject, InlineQueryResult

Represents a video

Parameters:
  • id (str) – Unique identifier of the query result

  • video ("types.Video") – Video

  • title (str) – Title of the video

  • description (str) – Description of the video

__init__(id='', video=None, title='', description='')[source]
Parameters:
  • id (str)

  • video (Video | None)

  • title (str)

  • description (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InlineQueryResultVideo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InlineQueryResult']

classmethod getType()[source]
Return type:

Literal['inlineQueryResultVideo']

to_dict()[source]
Return type:

dict

description: Optional[str]

Description of the video

id: Optional[str]

Unique identifier of the query result

title: Optional[str]

Title of the video

video: Optional[Video]

Video

class pytdbot.types.InlineQueryResultVoiceNote(id='', voice_note=None, title='')[source]

Bases: TlObject, InlineQueryResult

Represents a voice note

Parameters:
  • id (str) – Unique identifier of the query result

  • voice_note ("types.VoiceNote") – Voice note

  • title (str) – Title of the voice note

__init__(id='', voice_note=None, title='')[source]
Parameters:
  • id (str)

  • voice_note (VoiceNote | None)

  • title (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InlineQueryResultVoiceNote]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InlineQueryResult']

classmethod getType()[source]
Return type:

Literal['inlineQueryResultVoiceNote']

to_dict()[source]
Return type:

dict

id: Optional[str]

Unique identifier of the query result

title: Optional[str]

Title of the voice note

voice_note: Optional[VoiceNote]

Voice note

class pytdbot.types.InlineQueryResults(inline_query_id=0, button=None, results=None, next_offset='')[source]

Bases: TlObject

Represents the results of the inline query. Use sendInlineQueryResultMessage to send the result of the query

Parameters:
  • inline_query_id (int) – Unique identifier of the inline query

  • button ("types.InlineQueryResultsButton") – Button to be shown above inline query results; may be null

  • results (List["types.InlineQueryResult"]) – Results of the query

  • next_offset (str) – The offset for the next request. If empty, then there are no more results

__init__(inline_query_id=0, button=None, results=None, next_offset='')[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InlineQueryResults]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InlineQueryResults']

classmethod getType()[source]
Return type:

Literal['inlineQueryResults']

to_dict()[source]
Return type:

dict

button: Optional[InlineQueryResultsButton]

Button to be shown above inline query results; may be null

inline_query_id: int

Unique identifier of the inline query

next_offset: Optional[str]

The offset for the next request. If empty, then there are no more results

results: List[InlineQueryResult]

Results of the query

class pytdbot.types.InlineQueryResultsButton(text='', type=None)[source]

Bases: TlObject

Represents a button to be shown above inline query results

Parameters:
  • text (str) – The text of the button

  • type ("types.InlineQueryResultsButtonType") – Type of the button

__init__(text='', type=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InlineQueryResultsButton]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InlineQueryResultsButton']

classmethod getType()[source]
Return type:

Literal['inlineQueryResultsButton']

to_dict()[source]
Return type:

dict

text: Optional[str]

The text of the button

type: Union[InlineQueryResultsButtonTypeStartBot, InlineQueryResultsButtonTypeWebApp, None]

Type of the button

class pytdbot.types.InlineQueryResultsButtonType[source]

Bases: object

Represents type of button in results of inline query

class pytdbot.types.InlineQueryResultsButtonTypeStartBot(parameter='')[source]

Bases: TlObject, InlineQueryResultsButtonType

Describes the button that opens a private chat with the bot and sends a start message to the bot with the given parameter

Parameters:

parameter (str) – The parameter for the bot start message

__init__(parameter='')[source]
Parameters:

parameter (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InlineQueryResultsButtonTypeStartBot]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InlineQueryResultsButtonType']

classmethod getType()[source]
Return type:

Literal['inlineQueryResultsButtonTypeStartBot']

to_dict()[source]
Return type:

dict

parameter: Optional[str]

The parameter for the bot start message

class pytdbot.types.InlineQueryResultsButtonTypeWebApp(url='')[source]

Bases: TlObject, InlineQueryResultsButtonType

Describes the button that opens a Web App by calling getWebAppUrl

Parameters:

url (str) – An HTTP URL to pass to getWebAppUrl

__init__(url='')[source]
Parameters:

url (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InlineQueryResultsButtonTypeWebApp]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InlineQueryResultsButtonType']

classmethod getType()[source]
Return type:

Literal['inlineQueryResultsButtonTypeWebApp']

to_dict()[source]
Return type:

dict

url: Optional[str]

An HTTP URL to pass to getWebAppUrl

class pytdbot.types.InputBackground[source]

Bases: object

Contains information about background to set

class pytdbot.types.InputBackgroundLocal(background=None)[source]

Bases: TlObject, InputBackground

A background from a local file

Parameters:

background ("types.InputFile") – Background file to use. Only inputFileLocal and inputFileGenerated are supported. The file must be in JPEG format for wallpapers and in PNG format for patterns

__init__(background=None)[source]
Parameters:

background (InputFile | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputBackgroundLocal]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputBackground']

classmethod getType()[source]
Return type:

Literal['inputBackgroundLocal']

to_dict()[source]
Return type:

dict

background: Union[InputFileId, InputFileRemote, InputFileLocal, InputFileGenerated, None]

Background file to use. Only inputFileLocal and inputFileGenerated are supported. The file must be in JPEG format for wallpapers and in PNG format for patterns

class pytdbot.types.InputBackgroundPrevious(message_id=0)[source]

Bases: TlObject, InputBackground

A background previously set in the chat; for chat backgrounds only

Parameters:

message_id (int) – Identifier of the message with the background

__init__(message_id=0)[source]
Parameters:

message_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputBackgroundPrevious]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputBackground']

classmethod getType()[source]
Return type:

Literal['inputBackgroundPrevious']

to_dict()[source]
Return type:

dict

message_id: int

Identifier of the message with the background

class pytdbot.types.InputBackgroundRemote(background_id=0)[source]

Bases: TlObject, InputBackground

A background from the server

Parameters:

background_id (int) – The background identifier

__init__(background_id=0)[source]
Parameters:

background_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputBackgroundRemote]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputBackground']

classmethod getType()[source]
Return type:

Literal['inputBackgroundRemote']

to_dict()[source]
Return type:

dict

background_id: int

The background identifier

class pytdbot.types.InputBusinessChatLink(text=None, title='')[source]

Bases: TlObject

Describes a business chat link to create or edit

Parameters:
  • text ("types.FormattedText") – Message draft text that will be added to the input field

  • title (str) – Link title

__init__(text=None, title='')[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputBusinessChatLink]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputBusinessChatLink']

classmethod getType()[source]
Return type:

Literal['inputBusinessChatLink']

to_dict()[source]
Return type:

dict

text: Optional[FormattedText]

Message draft text that will be added to the input field

title: Optional[str]

Link title

class pytdbot.types.InputBusinessStartPage(title='', message='', sticker=None)[source]

Bases: TlObject

Describes settings for a business account start page to set

Parameters:
  • title (str) – Title text of the start page; 0-getOption("business_start_page_title_length_max") characters

  • message (str) – Message text of the start page; 0-getOption("business_start_page_message_length_max") characters

  • sticker ("types.InputFile") – Greeting sticker of the start page; pass null if none. The sticker must belong to a sticker set and must not be a custom emoji

__init__(title='', message='', sticker=None)[source]
Parameters:
  • title (str)

  • message (str)

  • sticker (InputFile | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputBusinessStartPage]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputBusinessStartPage']

classmethod getType()[source]
Return type:

Literal['inputBusinessStartPage']

to_dict()[source]
Return type:

dict

message: Optional[str]

Message text of the start page; 0-getOption("business_start_page_message_length_max") characters

sticker: Union[InputFileId, InputFileRemote, InputFileLocal, InputFileGenerated, None]

Greeting sticker of the start page; pass null if none. The sticker must belong to a sticker set and must not be a custom emoji

title: Optional[str]

Title text of the start page; 0-getOption("business_start_page_title_length_max") characters

class pytdbot.types.InputChatPhoto[source]

Bases: object

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

class pytdbot.types.InputChatPhotoAnimation(animation=None, main_frame_timestamp=0.0)[source]

Bases: TlObject, InputChatPhoto

An animation in MPEG4 format; must be square, at most 10 seconds long, have width between 160 and 1280 and be at most 2MB in size

Parameters:
  • animation ("types.InputFile") – Animation to be set as profile photo. Only inputFileLocal and inputFileGenerated are allowed

  • main_frame_timestamp (float) – Timestamp of the frame, which will be used as static chat photo

__init__(animation=None, main_frame_timestamp=0.0)[source]
Parameters:
  • animation (InputFile | None)

  • main_frame_timestamp (float)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputChatPhotoAnimation]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputChatPhoto']

classmethod getType()[source]
Return type:

Literal['inputChatPhotoAnimation']

to_dict()[source]
Return type:

dict

animation: Union[InputFileId, InputFileRemote, InputFileLocal, InputFileGenerated, None]

Animation to be set as profile photo. Only inputFileLocal and inputFileGenerated are allowed

main_frame_timestamp: float

Timestamp of the frame, which will be used as static chat photo

class pytdbot.types.InputChatPhotoPrevious(chat_photo_id=0)[source]

Bases: TlObject, InputChatPhoto

A previously used profile photo of the current user

Parameters:

chat_photo_id (int) – Identifier of the current user’s profile photo to reuse

__init__(chat_photo_id=0)[source]
Parameters:

chat_photo_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputChatPhotoPrevious]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputChatPhoto']

classmethod getType()[source]
Return type:

Literal['inputChatPhotoPrevious']

to_dict()[source]
Return type:

dict

chat_photo_id: int

Identifier of the current user’s profile photo to reuse

class pytdbot.types.InputChatPhotoStatic(photo=None)[source]

Bases: TlObject, InputChatPhoto

A static photo in JPEG format

Parameters:

photo ("types.InputFile") – Photo to be set as profile photo. Only inputFileLocal and inputFileGenerated are allowed

__init__(photo=None)[source]
Parameters:

photo (InputFile | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputChatPhotoStatic]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputChatPhoto']

classmethod getType()[source]
Return type:

Literal['inputChatPhotoStatic']

to_dict()[source]
Return type:

dict

photo: Union[InputFileId, InputFileRemote, InputFileLocal, InputFileGenerated, None]

Photo to be set as profile photo. Only inputFileLocal and inputFileGenerated are allowed

class pytdbot.types.InputChatPhotoSticker(sticker=None)[source]

Bases: TlObject, InputChatPhoto

A sticker on a custom background

Parameters:

sticker ("types.ChatPhotoSticker") – Information about the sticker

__init__(sticker=None)[source]
Parameters:

sticker (ChatPhotoSticker | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputChatPhotoSticker]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputChatPhoto']

classmethod getType()[source]
Return type:

Literal['inputChatPhotoSticker']

to_dict()[source]
Return type:

dict

sticker: Optional[ChatPhotoSticker]

Information about the sticker

class pytdbot.types.InputChatTheme[source]

Bases: object

Describes a chat theme to set

class pytdbot.types.InputChatThemeEmoji(name='')[source]

Bases: TlObject, InputChatTheme

A theme based on an emoji

Parameters:

name (str) – Name of the theme

__init__(name='')[source]
Parameters:

name (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputChatThemeEmoji]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputChatTheme']

classmethod getType()[source]
Return type:

Literal['inputChatThemeEmoji']

to_dict()[source]
Return type:

dict

name: Optional[str]

Name of the theme

class pytdbot.types.InputChatThemeGift(name='')[source]

Bases: TlObject, InputChatTheme

A theme based on an upgraded gift

Parameters:

name (str) – Name of the upgraded gift. A gift can be used only in one chat in a time. When the same gift is used in another chat, theme in the previous chat is reset to default

__init__(name='')[source]
Parameters:

name (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputChatThemeGift]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputChatTheme']

classmethod getType()[source]
Return type:

Literal['inputChatThemeGift']

to_dict()[source]
Return type:

dict

name: Optional[str]

Name of the upgraded gift. A gift can be used only in one chat in a time. When the same gift is used in another chat, theme in the previous chat is reset to default

class pytdbot.types.InputChecklist(title=None, tasks=None, others_can_add_tasks=False, others_can_mark_tasks_as_done=False)[source]

Bases: TlObject

Describes a checklist to be sent

Parameters:
  • title ("types.FormattedText") – Title of the checklist; 1-getOption("checklist_title_length_max") characters. May contain only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities

  • tasks (List["types.InputChecklistTask"]) – List of tasks in the checklist; 1-getOption("checklist_task_count_max") tasks

  • others_can_add_tasks (bool) – True, if other users can add tasks to the list

  • others_can_mark_tasks_as_done (bool) – True, if other users can mark tasks as done or not done

__init__(title=None, tasks=None, others_can_add_tasks=False, others_can_mark_tasks_as_done=False)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputChecklist]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputChecklist']

classmethod getType()[source]
Return type:

Literal['inputChecklist']

to_dict()[source]
Return type:

dict

others_can_add_tasks: bool

True, if other users can add tasks to the list

others_can_mark_tasks_as_done: bool

True, if other users can mark tasks as done or not done

tasks: List[InputChecklistTask]

List of tasks in the checklist; 1-getOption("checklist_task_count_max") tasks

title: Optional[FormattedText]

Title of the checklist; 1-getOption("checklist_title_length_max") characters. May contain only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities

class pytdbot.types.InputChecklistTask(id=0, text=None)[source]

Bases: TlObject

Describes a task in a checklist to be sent

Parameters:
  • id (int) – Unique identifier of the task; must be positive

  • text ("types.FormattedText") – Text of the task; 1-getOption("checklist_task_text_length_max") characters without line feeds. May contain only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities

__init__(id=0, text=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputChecklistTask]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputChecklistTask']

classmethod getType()[source]
Return type:

Literal['inputChecklistTask']

to_dict()[source]
Return type:

dict

id: int

Unique identifier of the task; must be positive

text: Optional[FormattedText]

Text of the task; 1-getOption("checklist_task_text_length_max") characters without line feeds. May contain only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities

class pytdbot.types.InputCredentials[source]

Bases: object

Contains information about the payment method chosen by the user

class pytdbot.types.InputCredentialsApplePay(data='')[source]

Bases: TlObject, InputCredentials

Applies if a user enters new credentials using Apple Pay

Parameters:

data (str) – JSON-encoded data with the credential identifier

__init__(data='')[source]
Parameters:

data (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputCredentialsApplePay]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputCredentials']

classmethod getType()[source]
Return type:

Literal['inputCredentialsApplePay']

to_dict()[source]
Return type:

dict

data: Optional[str]

JSON-encoded data with the credential identifier

class pytdbot.types.InputCredentialsGooglePay(data='')[source]

Bases: TlObject, InputCredentials

Applies if a user enters new credentials using Google Pay

Parameters:

data (str) – JSON-encoded data with the credential identifier

__init__(data='')[source]
Parameters:

data (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputCredentialsGooglePay]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputCredentials']

classmethod getType()[source]
Return type:

Literal['inputCredentialsGooglePay']

to_dict()[source]
Return type:

dict

data: Optional[str]

JSON-encoded data with the credential identifier

class pytdbot.types.InputCredentialsNew(data='', allow_save=False)[source]

Bases: TlObject, InputCredentials

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

Parameters:
  • data (str) – JSON-encoded data with the credential identifier from the payment provider

  • allow_save (bool) – True, if the credential identifier can be saved on the server side

__init__(data='', allow_save=False)[source]
Parameters:
  • data (str)

  • allow_save (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputCredentialsNew]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputCredentials']

classmethod getType()[source]
Return type:

Literal['inputCredentialsNew']

to_dict()[source]
Return type:

dict

allow_save: bool

True, if the credential identifier can be saved on the server side

data: Optional[str]

JSON-encoded data with the credential identifier from the payment provider

class pytdbot.types.InputCredentialsSaved(saved_credentials_id='')[source]

Bases: TlObject, InputCredentials

Applies if a user chooses some previously saved payment credentials. To use their previously saved credentials, the user must have a valid temporary password

Parameters:

saved_credentials_id (str) – Identifier of the saved credentials

__init__(saved_credentials_id='')[source]
Parameters:

saved_credentials_id (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputCredentialsSaved]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputCredentials']

classmethod getType()[source]
Return type:

Literal['inputCredentialsSaved']

to_dict()[source]
Return type:

dict

saved_credentials_id: Optional[str]

Identifier of the saved credentials

class pytdbot.types.InputFile[source]

Bases: object

Points to a file

class pytdbot.types.InputFileGenerated(original_path='', conversion='', expected_size=0)[source]

Bases: TlObject, InputFile

A file generated by the application. The application must handle updates updateFileGenerationStart and updateFileGenerationStop to generate the file when asked by TDLib

Parameters:
  • original_path (str) – Local path to a file from which the file is generated. The path doesn’t have to be a valid path and is used by TDLib only to detect name and MIME type of the generated file

  • conversion (str) – String specifying the conversion applied to the original file; must be persistent across application restarts. Conversions beginning with ‘#’ are reserved for internal TDLib usage

  • expected_size (int) – Expected size of the generated file, in bytes; pass 0 if unknown

__init__(original_path='', conversion='', expected_size=0)[source]
Parameters:
  • original_path (str)

  • conversion (str)

  • expected_size (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputFileGenerated]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputFile']

classmethod getType()[source]
Return type:

Literal['inputFileGenerated']

to_dict()[source]
Return type:

dict

conversion: Optional[str]

String specifying the conversion applied to the original file; must be persistent across application restarts. Conversions beginning with ‘#’ are reserved for internal TDLib usage

expected_size: int

Expected size of the generated file, in bytes; pass 0 if unknown

original_path: Optional[str]

Local path to a file from which the file is generated. The path doesn’t have to be a valid path and is used by TDLib only to detect name and MIME type of the generated file

class pytdbot.types.InputFileId(id=0)[source]

Bases: TlObject, InputFile

A file defined by its unique identifier

Parameters:

id (int) – Unique file identifier

__init__(id=0)[source]
Parameters:

id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputFileId]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputFile']

classmethod getType()[source]
Return type:

Literal['inputFileId']

to_dict()[source]
Return type:

dict

id: int

Unique file identifier

class pytdbot.types.InputFileLocal(path='')[source]

Bases: TlObject, InputFile

A file defined by a local path

Parameters:

path (str) – Local path to the file

__init__(path='')[source]
Parameters:

path (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputFileLocal]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputFile']

classmethod getType()[source]
Return type:

Literal['inputFileLocal']

to_dict()[source]
Return type:

dict

path: Optional[str]

Local path to the file

class pytdbot.types.InputFileRemote(id='')[source]

Bases: TlObject, InputFile

A file defined by its remote identifier. The remote identifier is guaranteed to be usable only if the corresponding file is still accessible to the user and known to TDLib. For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the application

Parameters:

id (str) – Remote file identifier

__init__(id='')[source]
Parameters:

id (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputFileRemote]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputFile']

classmethod getType()[source]
Return type:

Literal['inputFileRemote']

to_dict()[source]
Return type:

dict

id: Optional[str]

Remote file identifier

class pytdbot.types.InputGroupCall[source]

Bases: object

Describes a non-joined group call that isn’t bound to a chat

class pytdbot.types.InputGroupCallLink(link='')[source]

Bases: TlObject, InputGroupCall

The group call is accessible through a link

Parameters:

link (str) – The link for the group call

__init__(link='')[source]
Parameters:

link (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputGroupCallLink]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputGroupCall']

classmethod getType()[source]
Return type:

Literal['inputGroupCallLink']

to_dict()[source]
Return type:

dict

link: Optional[str]

The link for the group call

class pytdbot.types.InputGroupCallMessage(chat_id=0, message_id=0)[source]

Bases: TlObject, InputGroupCall

The group call is accessible through a message of the type messageGroupCall

Parameters:
  • chat_id (int) – Identifier of the chat with the message

  • message_id (int) – Identifier of the message of the type messageGroupCall

__init__(chat_id=0, message_id=0)[source]
Parameters:
  • chat_id (int)

  • message_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputGroupCallMessage]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputGroupCall']

classmethod getType()[source]
Return type:

Literal['inputGroupCallMessage']

to_dict()[source]
Return type:

dict

chat_id: int

Identifier of the chat with the message

message_id: int

Identifier of the message of the type messageGroupCall

class pytdbot.types.InputIdentityDocument(number='', expiration_date=None, front_side=None, reverse_side=None, selfie=None, translation=None)[source]

Bases: TlObject

An identity document to be saved to Telegram Passport

Parameters:
  • number (str) – Document number; 1-24 characters

  • expiration_date ("types.Date") – Document expiration date; pass null if not applicable

  • front_side ("types.InputFile") – Front side of the document

  • reverse_side ("types.InputFile") – Reverse side of the document; only for driver license and identity card; pass null otherwise

  • selfie ("types.InputFile") – Selfie with the document; pass null if unavailable

  • translation (List["types.InputFile"]) – List of files containing a certified English translation of the document

__init__(number='', expiration_date=None, front_side=None, reverse_side=None, selfie=None, translation=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputIdentityDocument]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputIdentityDocument']

classmethod getType()[source]
Return type:

Literal['inputIdentityDocument']

to_dict()[source]
Return type:

dict

expiration_date: Optional[Date]

Document expiration date; pass null if not applicable

front_side: Union[InputFileId, InputFileRemote, InputFileLocal, InputFileGenerated, None]

Front side of the document

number: Optional[str]

Document number; 1-24 characters

reverse_side: Union[InputFileId, InputFileRemote, InputFileLocal, InputFileGenerated, None]

Reverse side of the document; only for driver license and identity card; pass null otherwise

selfie: Union[InputFileId, InputFileRemote, InputFileLocal, InputFileGenerated, None]

Selfie with the document; pass null if unavailable

translation: List[InputFile]

List of files containing a certified English translation of the document

class pytdbot.types.InputInlineQueryResult[source]

Bases: object

Represents a single result of an inline query; for bots only

class pytdbot.types.InputInlineQueryResultAnimation(id='', title='', thumbnail_url='', thumbnail_mime_type='', video_url='', video_mime_type='', video_duration=0, video_width=0, video_height=0, reply_markup=None, input_message_content=None)[source]

Bases: TlObject, InputInlineQueryResult

Represents a link to an animated GIF or an animated (i.e., without sound) H.264/MPEG-4 AVC video

Parameters:
  • id (str) – Unique identifier of the query result

  • title (str) – Title of the query result

  • thumbnail_url (str) – URL of the result thumbnail (JPEG, GIF, or MPEG4), if it exists

  • thumbnail_mime_type (str) – MIME type of the video thumbnail. If non-empty, must be one of "image/jpeg", "image/gif" and "video/mp4"

  • video_url (str) – The URL of the video file (file size must not exceed 1MB)

  • video_mime_type (str) – MIME type of the video file. Must be one of "image/gif" and "video/mp4"

  • video_duration (int) – Duration of the video, in seconds

  • video_width (int) – Width of the video

  • video_height (int) – Height of the video

  • reply_markup ("types.ReplyMarkup") – The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null

  • input_message_content ("types.InputMessageContent") – The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageAnimation, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact

__init__(id='', title='', thumbnail_url='', thumbnail_mime_type='', video_url='', video_mime_type='', video_duration=0, video_width=0, video_height=0, reply_markup=None, input_message_content=None)[source]
Parameters:
  • id (str)

  • title (str)

  • thumbnail_url (str)

  • thumbnail_mime_type (str)

  • video_url (str)

  • video_mime_type (str)

  • video_duration (int)

  • video_width (int)

  • video_height (int)

  • reply_markup (ReplyMarkup | None)

  • input_message_content (InputMessageContent | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputInlineQueryResultAnimation]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputInlineQueryResult']

classmethod getType()[source]
Return type:

Literal['inputInlineQueryResultAnimation']

to_dict()[source]
Return type:

dict

id: Optional[str]

Unique identifier of the query result

input_message_content: Union[InputMessageText, InputMessageAnimation, InputMessageAudio, InputMessageDocument, InputMessagePaidMedia, InputMessagePhoto, InputMessageSticker, InputMessageVideo, InputMessageVideoNote, InputMessageVoiceNote, InputMessageLocation, InputMessageVenue, InputMessageContact, InputMessageDice, InputMessageGame, InputMessageInvoice, InputMessagePoll, InputMessageStory, InputMessageChecklist, InputMessageForwarded, None]

inputMessageText, inputMessageAnimation, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact

Type:

The content of the message to be sent. Must be one of the following types

reply_markup: Union[ReplyMarkupRemoveKeyboard, ReplyMarkupForceReply, ReplyMarkupShowKeyboard, ReplyMarkupInlineKeyboard, None]

The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null

thumbnail_mime_type: Optional[str]

MIME type of the video thumbnail. If non-empty, must be one of "image/jpeg", "image/gif" and "video/mp4"

thumbnail_url: Optional[str]

URL of the result thumbnail (JPEG, GIF, or MPEG4), if it exists

title: Optional[str]

Title of the query result

video_duration: int

Duration of the video, in seconds

video_height: int

Height of the video

video_mime_type: Optional[str]

MIME type of the video file. Must be one of "image/gif" and "video/mp4"

video_url: Optional[str]

The URL of the video file (file size must not exceed 1MB)

video_width: int

Width of the video

class pytdbot.types.InputInlineQueryResultArticle(id='', url='', title='', description='', thumbnail_url='', thumbnail_width=0, thumbnail_height=0, reply_markup=None, input_message_content=None)[source]

Bases: TlObject, InputInlineQueryResult

Represents a link to an article or web page

Parameters:
  • id (str) – Unique identifier of the query result

  • url (str) – URL of the result, if it exists

  • title (str) – Title of the result

  • description (str) – A short description of the result

  • thumbnail_url (str) – URL of the result thumbnail, if it exists

  • thumbnail_width (int) – Thumbnail width, if known

  • thumbnail_height (int) – Thumbnail height, if known

  • reply_markup ("types.ReplyMarkup") – The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null

  • input_message_content ("types.InputMessageContent") – The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact

__init__(id='', url='', title='', description='', thumbnail_url='', thumbnail_width=0, thumbnail_height=0, reply_markup=None, input_message_content=None)[source]
Parameters:
  • id (str)

  • url (str)

  • title (str)

  • description (str)

  • thumbnail_url (str)

  • thumbnail_width (int)

  • thumbnail_height (int)

  • reply_markup (ReplyMarkup | None)

  • input_message_content (InputMessageContent | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputInlineQueryResultArticle]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputInlineQueryResult']

classmethod getType()[source]
Return type:

Literal['inputInlineQueryResultArticle']

to_dict()[source]
Return type:

dict

description: Optional[str]

A short description of the result

id: Optional[str]

Unique identifier of the query result

input_message_content: Union[InputMessageText, InputMessageAnimation, InputMessageAudio, InputMessageDocument, InputMessagePaidMedia, InputMessagePhoto, InputMessageSticker, InputMessageVideo, InputMessageVideoNote, InputMessageVoiceNote, InputMessageLocation, InputMessageVenue, InputMessageContact, InputMessageDice, InputMessageGame, InputMessageInvoice, InputMessagePoll, InputMessageStory, InputMessageChecklist, InputMessageForwarded, None]

inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact

Type:

The content of the message to be sent. Must be one of the following types

reply_markup: Union[ReplyMarkupRemoveKeyboard, ReplyMarkupForceReply, ReplyMarkupShowKeyboard, ReplyMarkupInlineKeyboard, None]

The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null

thumbnail_height: int

Thumbnail height, if known

thumbnail_url: Optional[str]

URL of the result thumbnail, if it exists

thumbnail_width: int

Thumbnail width, if known

title: Optional[str]

Title of the result

url: Optional[str]

URL of the result, if it exists

class pytdbot.types.InputInlineQueryResultAudio(id='', title='', performer='', audio_url='', audio_duration=0, reply_markup=None, input_message_content=None)[source]

Bases: TlObject, InputInlineQueryResult

Represents a link to an MP3 audio file

Parameters:
  • id (str) – Unique identifier of the query result

  • title (str) – Title of the audio file

  • performer (str) – Performer of the audio file

  • audio_url (str) – The URL of the audio file

  • audio_duration (int) – Audio file duration, in seconds

  • reply_markup ("types.ReplyMarkup") – The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null

  • input_message_content ("types.InputMessageContent") – The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageAudio, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact

__init__(id='', title='', performer='', audio_url='', audio_duration=0, reply_markup=None, input_message_content=None)[source]
Parameters:
  • id (str)

  • title (str)

  • performer (str)

  • audio_url (str)

  • audio_duration (int)

  • reply_markup (ReplyMarkup | None)

  • input_message_content (InputMessageContent | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputInlineQueryResultAudio]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputInlineQueryResult']

classmethod getType()[source]
Return type:

Literal['inputInlineQueryResultAudio']

to_dict()[source]
Return type:

dict

audio_duration: int

Audio file duration, in seconds

audio_url: Optional[str]

The URL of the audio file

id: Optional[str]

Unique identifier of the query result

input_message_content: Union[InputMessageText, InputMessageAnimation, InputMessageAudio, InputMessageDocument, InputMessagePaidMedia, InputMessagePhoto, InputMessageSticker, InputMessageVideo, InputMessageVideoNote, InputMessageVoiceNote, InputMessageLocation, InputMessageVenue, InputMessageContact, InputMessageDice, InputMessageGame, InputMessageInvoice, InputMessagePoll, InputMessageStory, InputMessageChecklist, InputMessageForwarded, None]

inputMessageText, inputMessageAudio, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact

Type:

The content of the message to be sent. Must be one of the following types

performer: Optional[str]

Performer of the audio file

reply_markup: Union[ReplyMarkupRemoveKeyboard, ReplyMarkupForceReply, ReplyMarkupShowKeyboard, ReplyMarkupInlineKeyboard, None]

The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null

title: Optional[str]

Title of the audio file

class pytdbot.types.InputInlineQueryResultContact(id='', contact=None, thumbnail_url='', thumbnail_width=0, thumbnail_height=0, reply_markup=None, input_message_content=None)[source]

Bases: TlObject, InputInlineQueryResult

Represents a user contact

Parameters:
  • id (str) – Unique identifier of the query result

  • contact ("types.Contact") – User contact

  • thumbnail_url (str) – URL of the result thumbnail, if it exists

  • thumbnail_width (int) – Thumbnail width, if known

  • thumbnail_height (int) – Thumbnail height, if known

  • reply_markup ("types.ReplyMarkup") – The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null

  • input_message_content ("types.InputMessageContent") – The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact

__init__(id='', contact=None, thumbnail_url='', thumbnail_width=0, thumbnail_height=0, reply_markup=None, input_message_content=None)[source]
Parameters:
  • id (str)

  • contact (Contact | None)

  • thumbnail_url (str)

  • thumbnail_width (int)

  • thumbnail_height (int)

  • reply_markup (ReplyMarkup | None)

  • input_message_content (InputMessageContent | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputInlineQueryResultContact]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputInlineQueryResult']

classmethod getType()[source]
Return type:

Literal['inputInlineQueryResultContact']

to_dict()[source]
Return type:

dict

contact: Optional[Contact]

User contact

id: Optional[str]

Unique identifier of the query result

input_message_content: Union[InputMessageText, InputMessageAnimation, InputMessageAudio, InputMessageDocument, InputMessagePaidMedia, InputMessagePhoto, InputMessageSticker, InputMessageVideo, InputMessageVideoNote, InputMessageVoiceNote, InputMessageLocation, InputMessageVenue, InputMessageContact, InputMessageDice, InputMessageGame, InputMessageInvoice, InputMessagePoll, InputMessageStory, InputMessageChecklist, InputMessageForwarded, None]

inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact

Type:

The content of the message to be sent. Must be one of the following types

reply_markup: Union[ReplyMarkupRemoveKeyboard, ReplyMarkupForceReply, ReplyMarkupShowKeyboard, ReplyMarkupInlineKeyboard, None]

The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null

thumbnail_height: int

Thumbnail height, if known

thumbnail_url: Optional[str]

URL of the result thumbnail, if it exists

thumbnail_width: int

Thumbnail width, if known

class pytdbot.types.InputInlineQueryResultDocument(id='', title='', description='', document_url='', mime_type='', thumbnail_url='', thumbnail_width=0, thumbnail_height=0, reply_markup=None, input_message_content=None)[source]

Bases: TlObject, InputInlineQueryResult

Represents a link to a file

Parameters:
  • id (str) – Unique identifier of the query result

  • title (str) – Title of the resulting file

  • description (str) – Short description of the result, if known

  • document_url (str) – URL of the file

  • mime_type (str) – MIME type of the file content; only "application/pdf" and "application/zip" are currently allowed

  • thumbnail_url (str) – The URL of the file thumbnail, if it exists

  • thumbnail_width (int) – Width of the thumbnail

  • thumbnail_height (int) – Height of the thumbnail

  • reply_markup ("types.ReplyMarkup") – The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null

  • input_message_content ("types.InputMessageContent") – The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageDocument, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact

__init__(id='', title='', description='', document_url='', mime_type='', thumbnail_url='', thumbnail_width=0, thumbnail_height=0, reply_markup=None, input_message_content=None)[source]
Parameters:
  • id (str)

  • title (str)

  • description (str)

  • document_url (str)

  • mime_type (str)

  • thumbnail_url (str)

  • thumbnail_width (int)

  • thumbnail_height (int)

  • reply_markup (ReplyMarkup | None)

  • input_message_content (InputMessageContent | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputInlineQueryResultDocument]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputInlineQueryResult']

classmethod getType()[source]
Return type:

Literal['inputInlineQueryResultDocument']

to_dict()[source]
Return type:

dict

description: Optional[str]

Short description of the result, if known

document_url: Optional[str]

URL of the file

id: Optional[str]

Unique identifier of the query result

input_message_content: Union[InputMessageText, InputMessageAnimation, InputMessageAudio, InputMessageDocument, InputMessagePaidMedia, InputMessagePhoto, InputMessageSticker, InputMessageVideo, InputMessageVideoNote, InputMessageVoiceNote, InputMessageLocation, InputMessageVenue, InputMessageContact, InputMessageDice, InputMessageGame, InputMessageInvoice, InputMessagePoll, InputMessageStory, InputMessageChecklist, InputMessageForwarded, None]

inputMessageText, inputMessageDocument, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact

Type:

The content of the message to be sent. Must be one of the following types

mime_type: Optional[str]

MIME type of the file content; only "application/pdf" and "application/zip" are currently allowed

reply_markup: Union[ReplyMarkupRemoveKeyboard, ReplyMarkupForceReply, ReplyMarkupShowKeyboard, ReplyMarkupInlineKeyboard, None]

The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null

thumbnail_height: int

Height of the thumbnail

thumbnail_url: Optional[str]

The URL of the file thumbnail, if it exists

thumbnail_width: int

Width of the thumbnail

title: Optional[str]

Title of the resulting file

class pytdbot.types.InputInlineQueryResultGame(id='', game_short_name='', reply_markup=None)[source]

Bases: TlObject, InputInlineQueryResult

Represents a game

Parameters:
  • id (str) – Unique identifier of the query result

  • game_short_name (str) – Short name of the game

  • reply_markup ("types.ReplyMarkup") – The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null

__init__(id='', game_short_name='', reply_markup=None)[source]
Parameters:
  • id (str)

  • game_short_name (str)

  • reply_markup (ReplyMarkup | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputInlineQueryResultGame]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputInlineQueryResult']

classmethod getType()[source]
Return type:

Literal['inputInlineQueryResultGame']

to_dict()[source]
Return type:

dict

game_short_name: Optional[str]

Short name of the game

id: Optional[str]

Unique identifier of the query result

reply_markup: Union[ReplyMarkupRemoveKeyboard, ReplyMarkupForceReply, ReplyMarkupShowKeyboard, ReplyMarkupInlineKeyboard, None]

The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null

class pytdbot.types.InputInlineQueryResultLocation(id='', location=None, live_period=0, title='', thumbnail_url='', thumbnail_width=0, thumbnail_height=0, reply_markup=None, input_message_content=None)[source]

Bases: TlObject, InputInlineQueryResult

Represents a point on the map

Parameters:
  • id (str) – Unique identifier of the query result

  • location ("types.Location") – Location result

  • live_period (int) – Amount of time relative to the message sent time until the location can be updated, in seconds

  • title (str) – Title of the result

  • thumbnail_url (str) – URL of the result thumbnail, if it exists

  • thumbnail_width (int) – Thumbnail width, if known

  • thumbnail_height (int) – Thumbnail height, if known

  • reply_markup ("types.ReplyMarkup") – The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null

  • input_message_content ("types.InputMessageContent") – The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact

__init__(id='', location=None, live_period=0, title='', thumbnail_url='', thumbnail_width=0, thumbnail_height=0, reply_markup=None, input_message_content=None)[source]
Parameters:
  • id (str)

  • location (Location | None)

  • live_period (int)

  • title (str)

  • thumbnail_url (str)

  • thumbnail_width (int)

  • thumbnail_height (int)

  • reply_markup (ReplyMarkup | None)

  • input_message_content (InputMessageContent | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputInlineQueryResultLocation]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputInlineQueryResult']

classmethod getType()[source]
Return type:

Literal['inputInlineQueryResultLocation']

to_dict()[source]
Return type:

dict

id: Optional[str]

Unique identifier of the query result

input_message_content: Union[InputMessageText, InputMessageAnimation, InputMessageAudio, InputMessageDocument, InputMessagePaidMedia, InputMessagePhoto, InputMessageSticker, InputMessageVideo, InputMessageVideoNote, InputMessageVoiceNote, InputMessageLocation, InputMessageVenue, InputMessageContact, InputMessageDice, InputMessageGame, InputMessageInvoice, InputMessagePoll, InputMessageStory, InputMessageChecklist, InputMessageForwarded, None]

inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact

Type:

The content of the message to be sent. Must be one of the following types

live_period: int

Amount of time relative to the message sent time until the location can be updated, in seconds

location: Optional[Location]

Location result

reply_markup: Union[ReplyMarkupRemoveKeyboard, ReplyMarkupForceReply, ReplyMarkupShowKeyboard, ReplyMarkupInlineKeyboard, None]

The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null

thumbnail_height: int

Thumbnail height, if known

thumbnail_url: Optional[str]

URL of the result thumbnail, if it exists

thumbnail_width: int

Thumbnail width, if known

title: Optional[str]

Title of the result

class pytdbot.types.InputInlineQueryResultPhoto(id='', title='', description='', thumbnail_url='', photo_url='', photo_width=0, photo_height=0, reply_markup=None, input_message_content=None)[source]

Bases: TlObject, InputInlineQueryResult

Represents link to a JPEG image

Parameters:
  • id (str) – Unique identifier of the query result

  • title (str) – Title of the result, if known

  • description (str) – A short description of the result, if known

  • thumbnail_url (str) – URL of the photo thumbnail, if it exists

  • photo_url (str) – The URL of the JPEG photo (photo size must not exceed 5MB)

  • photo_width (int) – Width of the photo

  • photo_height (int) – Height of the photo

  • reply_markup ("types.ReplyMarkup") – The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null

  • input_message_content ("types.InputMessageContent") – The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessagePhoto, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact

__init__(id='', title='', description='', thumbnail_url='', photo_url='', photo_width=0, photo_height=0, reply_markup=None, input_message_content=None)[source]
Parameters:
  • id (str)

  • title (str)

  • description (str)

  • thumbnail_url (str)

  • photo_url (str)

  • photo_width (int)

  • photo_height (int)

  • reply_markup (ReplyMarkup | None)

  • input_message_content (InputMessageContent | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputInlineQueryResultPhoto]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputInlineQueryResult']

classmethod getType()[source]
Return type:

Literal['inputInlineQueryResultPhoto']

to_dict()[source]
Return type:

dict

description: Optional[str]

A short description of the result, if known

id: Optional[str]

Unique identifier of the query result

input_message_content: Union[InputMessageText, InputMessageAnimation, InputMessageAudio, InputMessageDocument, InputMessagePaidMedia, InputMessagePhoto, InputMessageSticker, InputMessageVideo, InputMessageVideoNote, InputMessageVoiceNote, InputMessageLocation, InputMessageVenue, InputMessageContact, InputMessageDice, InputMessageGame, InputMessageInvoice, InputMessagePoll, InputMessageStory, InputMessageChecklist, InputMessageForwarded, None]

inputMessageText, inputMessagePhoto, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact

Type:

The content of the message to be sent. Must be one of the following types

photo_height: int

Height of the photo

photo_url: Optional[str]

The URL of the JPEG photo (photo size must not exceed 5MB)

photo_width: int

Width of the photo

reply_markup: Union[ReplyMarkupRemoveKeyboard, ReplyMarkupForceReply, ReplyMarkupShowKeyboard, ReplyMarkupInlineKeyboard, None]

The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null

thumbnail_url: Optional[str]

URL of the photo thumbnail, if it exists

title: Optional[str]

Title of the result, if known

class pytdbot.types.InputInlineQueryResultSticker(id='', thumbnail_url='', sticker_url='', sticker_width=0, sticker_height=0, reply_markup=None, input_message_content=None)[source]

Bases: TlObject, InputInlineQueryResult

Represents a link to a WEBP, TGS, or WEBM sticker

Parameters:
  • id (str) – Unique identifier of the query result

  • thumbnail_url (str) – URL of the sticker thumbnail, if it exists

  • sticker_url (str) – The URL of the WEBP, TGS, or WEBM sticker (sticker file size must not exceed 5MB)

  • sticker_width (int) – Width of the sticker

  • sticker_height (int) – Height of the sticker

  • reply_markup ("types.ReplyMarkup") – The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null

  • input_message_content ("types.InputMessageContent") – The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageSticker, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact

__init__(id='', thumbnail_url='', sticker_url='', sticker_width=0, sticker_height=0, reply_markup=None, input_message_content=None)[source]
Parameters:
  • id (str)

  • thumbnail_url (str)

  • sticker_url (str)

  • sticker_width (int)

  • sticker_height (int)

  • reply_markup (ReplyMarkup | None)

  • input_message_content (InputMessageContent | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputInlineQueryResultSticker]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputInlineQueryResult']

classmethod getType()[source]
Return type:

Literal['inputInlineQueryResultSticker']

to_dict()[source]
Return type:

dict

id: Optional[str]

Unique identifier of the query result

input_message_content: Union[InputMessageText, InputMessageAnimation, InputMessageAudio, InputMessageDocument, InputMessagePaidMedia, InputMessagePhoto, InputMessageSticker, InputMessageVideo, InputMessageVideoNote, InputMessageVoiceNote, InputMessageLocation, InputMessageVenue, InputMessageContact, InputMessageDice, InputMessageGame, InputMessageInvoice, InputMessagePoll, InputMessageStory, InputMessageChecklist, InputMessageForwarded, None]

inputMessageText, inputMessageSticker, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact

Type:

The content of the message to be sent. Must be one of the following types

reply_markup: Union[ReplyMarkupRemoveKeyboard, ReplyMarkupForceReply, ReplyMarkupShowKeyboard, ReplyMarkupInlineKeyboard, None]

The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null

sticker_height: int

Height of the sticker

sticker_url: Optional[str]

The URL of the WEBP, TGS, or WEBM sticker (sticker file size must not exceed 5MB)

sticker_width: int

Width of the sticker

thumbnail_url: Optional[str]

URL of the sticker thumbnail, if it exists

class pytdbot.types.InputInlineQueryResultVenue(id='', venue=None, thumbnail_url='', thumbnail_width=0, thumbnail_height=0, reply_markup=None, input_message_content=None)[source]

Bases: TlObject, InputInlineQueryResult

Represents information about a venue

Parameters:
  • id (str) – Unique identifier of the query result

  • venue ("types.Venue") – Venue result

  • thumbnail_url (str) – URL of the result thumbnail, if it exists

  • thumbnail_width (int) – Thumbnail width, if known

  • thumbnail_height (int) – Thumbnail height, if known

  • reply_markup ("types.ReplyMarkup") – The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null

  • input_message_content ("types.InputMessageContent") – The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact

__init__(id='', venue=None, thumbnail_url='', thumbnail_width=0, thumbnail_height=0, reply_markup=None, input_message_content=None)[source]
Parameters:
  • id (str)

  • venue (Venue | None)

  • thumbnail_url (str)

  • thumbnail_width (int)

  • thumbnail_height (int)

  • reply_markup (ReplyMarkup | None)

  • input_message_content (InputMessageContent | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputInlineQueryResultVenue]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputInlineQueryResult']

classmethod getType()[source]
Return type:

Literal['inputInlineQueryResultVenue']

to_dict()[source]
Return type:

dict

id: Optional[str]

Unique identifier of the query result

input_message_content: Union[InputMessageText, InputMessageAnimation, InputMessageAudio, InputMessageDocument, InputMessagePaidMedia, InputMessagePhoto, InputMessageSticker, InputMessageVideo, InputMessageVideoNote, InputMessageVoiceNote, InputMessageLocation, InputMessageVenue, InputMessageContact, InputMessageDice, InputMessageGame, InputMessageInvoice, InputMessagePoll, InputMessageStory, InputMessageChecklist, InputMessageForwarded, None]

inputMessageText, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact

Type:

The content of the message to be sent. Must be one of the following types

reply_markup: Union[ReplyMarkupRemoveKeyboard, ReplyMarkupForceReply, ReplyMarkupShowKeyboard, ReplyMarkupInlineKeyboard, None]

The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null

thumbnail_height: int

Thumbnail height, if known

thumbnail_url: Optional[str]

URL of the result thumbnail, if it exists

thumbnail_width: int

Thumbnail width, if known

venue: Optional[Venue]

Venue result

class pytdbot.types.InputInlineQueryResultVideo(id='', title='', description='', thumbnail_url='', video_url='', mime_type='', video_width=0, video_height=0, video_duration=0, reply_markup=None, input_message_content=None)[source]

Bases: TlObject, InputInlineQueryResult

Represents a link to a page containing an embedded video player or a video file

Parameters:
  • id (str) – Unique identifier of the query result

  • title (str) – Title of the result

  • description (str) – A short description of the result, if known

  • thumbnail_url (str) – The URL of the video thumbnail (JPEG), if it exists

  • video_url (str) – URL of the embedded video player or video file

  • mime_type (str) – MIME type of the content of the video URL, only "text/html" or "video/mp4" are currently supported

  • video_width (int) – Width of the video

  • video_height (int) – Height of the video

  • video_duration (int) – Video duration, in seconds

  • reply_markup ("types.ReplyMarkup") – The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null

  • input_message_content ("types.InputMessageContent") – The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageVideo, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact

__init__(id='', title='', description='', thumbnail_url='', video_url='', mime_type='', video_width=0, video_height=0, video_duration=0, reply_markup=None, input_message_content=None)[source]
Parameters:
  • id (str)

  • title (str)

  • description (str)

  • thumbnail_url (str)

  • video_url (str)

  • mime_type (str)

  • video_width (int)

  • video_height (int)

  • video_duration (int)

  • reply_markup (ReplyMarkup | None)

  • input_message_content (InputMessageContent | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputInlineQueryResultVideo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputInlineQueryResult']

classmethod getType()[source]
Return type:

Literal['inputInlineQueryResultVideo']

to_dict()[source]
Return type:

dict

description: Optional[str]

A short description of the result, if known

id: Optional[str]

Unique identifier of the query result

input_message_content: Union[InputMessageText, InputMessageAnimation, InputMessageAudio, InputMessageDocument, InputMessagePaidMedia, InputMessagePhoto, InputMessageSticker, InputMessageVideo, InputMessageVideoNote, InputMessageVoiceNote, InputMessageLocation, InputMessageVenue, InputMessageContact, InputMessageDice, InputMessageGame, InputMessageInvoice, InputMessagePoll, InputMessageStory, InputMessageChecklist, InputMessageForwarded, None]

inputMessageText, inputMessageVideo, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact

Type:

The content of the message to be sent. Must be one of the following types

mime_type: Optional[str]

MIME type of the content of the video URL, only "text/html" or "video/mp4" are currently supported

reply_markup: Union[ReplyMarkupRemoveKeyboard, ReplyMarkupForceReply, ReplyMarkupShowKeyboard, ReplyMarkupInlineKeyboard, None]

The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null

thumbnail_url: Optional[str]

The URL of the video thumbnail (JPEG), if it exists

title: Optional[str]

Title of the result

video_duration: int

Video duration, in seconds

video_height: int

Height of the video

video_url: Optional[str]

URL of the embedded video player or video file

video_width: int

Width of the video

class pytdbot.types.InputInlineQueryResultVoiceNote(id='', title='', voice_note_url='', voice_note_duration=0, reply_markup=None, input_message_content=None)[source]

Bases: TlObject, InputInlineQueryResult

Represents a link to an opus-encoded audio file within an OGG container, single channel audio

Parameters:
  • id (str) – Unique identifier of the query result

  • title (str) – Title of the voice note

  • voice_note_url (str) – The URL of the voice note file

  • voice_note_duration (int) – Duration of the voice note, in seconds

  • reply_markup ("types.ReplyMarkup") – The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null

  • input_message_content ("types.InputMessageContent") – The content of the message to be sent. Must be one of the following types: inputMessageText, inputMessageVoiceNote, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact

__init__(id='', title='', voice_note_url='', voice_note_duration=0, reply_markup=None, input_message_content=None)[source]
Parameters:
  • id (str)

  • title (str)

  • voice_note_url (str)

  • voice_note_duration (int)

  • reply_markup (ReplyMarkup | None)

  • input_message_content (InputMessageContent | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputInlineQueryResultVoiceNote]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputInlineQueryResult']

classmethod getType()[source]
Return type:

Literal['inputInlineQueryResultVoiceNote']

to_dict()[source]
Return type:

dict

id: Optional[str]

Unique identifier of the query result

input_message_content: Union[InputMessageText, InputMessageAnimation, InputMessageAudio, InputMessageDocument, InputMessagePaidMedia, InputMessagePhoto, InputMessageSticker, InputMessageVideo, InputMessageVideoNote, InputMessageVoiceNote, InputMessageLocation, InputMessageVenue, InputMessageContact, InputMessageDice, InputMessageGame, InputMessageInvoice, InputMessagePoll, InputMessageStory, InputMessageChecklist, InputMessageForwarded, None]

inputMessageText, inputMessageVoiceNote, inputMessageInvoice, inputMessageLocation, inputMessageVenue or inputMessageContact

Type:

The content of the message to be sent. Must be one of the following types

reply_markup: Union[ReplyMarkupRemoveKeyboard, ReplyMarkupForceReply, ReplyMarkupShowKeyboard, ReplyMarkupInlineKeyboard, None]

The message reply markup; pass null if none. Must be of type replyMarkupInlineKeyboard or null

title: Optional[str]

Title of the voice note

voice_note_duration: int

Duration of the voice note, in seconds

voice_note_url: Optional[str]

The URL of the voice note file

class pytdbot.types.InputInvoice[source]

Bases: object

Describes an invoice to process

class pytdbot.types.InputInvoiceMessage(chat_id=0, message_id=0)[source]

Bases: TlObject, InputInvoice

An invoice from a message of the type messageInvoice or paid media purchase from messagePaidMedia

Parameters:
  • chat_id (int) – Chat identifier of the message

  • message_id (int) – Message identifier. Use messageProperties.can_be_paid to check whether the message can be used in the method

__init__(chat_id=0, message_id=0)[source]
Parameters:
  • chat_id (int)

  • message_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputInvoiceMessage]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputInvoice']

classmethod getType()[source]
Return type:

Literal['inputInvoiceMessage']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier of the message

message_id: int

Message identifier. Use messageProperties.can_be_paid to check whether the message can be used in the method

class pytdbot.types.InputInvoiceName(name='')[source]

Bases: TlObject, InputInvoice

An invoice from a link of the type internalLinkTypeInvoice

Parameters:

name (str) – Name of the invoice

__init__(name='')[source]
Parameters:

name (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputInvoiceName]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputInvoice']

classmethod getType()[source]
Return type:

Literal['inputInvoiceName']

to_dict()[source]
Return type:

dict

name: Optional[str]

Name of the invoice

class pytdbot.types.InputInvoiceTelegram(purpose=None)[source]

Bases: TlObject, InputInvoice

An invoice for a payment toward Telegram; must not be used in the in-store apps

Parameters:

purpose ("types.TelegramPaymentPurpose") – Transaction purpose

__init__(purpose=None)[source]
Parameters:

purpose (TelegramPaymentPurpose | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputInvoiceTelegram]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputInvoice']

classmethod getType()[source]
Return type:

Literal['inputInvoiceTelegram']

to_dict()[source]
Return type:

dict

purpose: Union[TelegramPaymentPurposePremiumGift, TelegramPaymentPurposePremiumGiftCodes, TelegramPaymentPurposePremiumGiveaway, TelegramPaymentPurposeStars, TelegramPaymentPurposeGiftedStars, TelegramPaymentPurposeStarGiveaway, TelegramPaymentPurposeJoinChat, None]

Transaction purpose

class pytdbot.types.InputMessageAnimation(animation=None, thumbnail=None, added_sticker_file_ids=None, duration=0, width=0, height=0, caption=None, show_caption_above_media=False, has_spoiler=False)[source]

Bases: TlObject, InputMessageContent

An animation message (GIF-style).

Parameters:
  • animation ("types.InputFile") – Animation file to be sent

  • thumbnail ("types.InputThumbnail") – Animation thumbnail; pass null to skip thumbnail uploading

  • added_sticker_file_ids (List[int]) – File identifiers of the stickers added to the animation, if applicable

  • duration (int) – Duration of the animation, in seconds

  • width (int) – Width of the animation; may be replaced by the server

  • height (int) – Height of the animation; may be replaced by the server

  • caption ("types.FormattedText") – Animation caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters

  • show_caption_above_media (bool) – True, if the caption must be shown above the animation; otherwise, the caption must be shown below the animation; not supported in secret chats

  • has_spoiler (bool) – True, if the animation preview must be covered by a spoiler animation; not supported in secret chats

__init__(animation=None, thumbnail=None, added_sticker_file_ids=None, duration=0, width=0, height=0, caption=None, show_caption_above_media=False, has_spoiler=False)[source]
Parameters:
  • animation (InputFile | None)

  • thumbnail (InputThumbnail | None)

  • added_sticker_file_ids (List[int] | None)

  • duration (int)

  • width (int)

  • height (int)

  • caption (FormattedText | None)

  • show_caption_above_media (bool)

  • has_spoiler (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputMessageAnimation]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputMessageContent']

classmethod getType()[source]
Return type:

Literal['inputMessageAnimation']

to_dict()[source]
Return type:

dict

added_sticker_file_ids: List[int]

File identifiers of the stickers added to the animation, if applicable

animation: Union[InputFileId, InputFileRemote, InputFileLocal, InputFileGenerated, None]

Animation file to be sent

caption: Optional[FormattedText]

Animation caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters

duration: int

Duration of the animation, in seconds

has_spoiler: bool

True, if the animation preview must be covered by a spoiler animation; not supported in secret chats

height: int

Height of the animation; may be replaced by the server

show_caption_above_media: bool

True, if the caption must be shown above the animation; otherwise, the caption must be shown below the animation; not supported in secret chats

thumbnail: Optional[InputThumbnail]

Animation thumbnail; pass null to skip thumbnail uploading

width: int

Width of the animation; may be replaced by the server

class pytdbot.types.InputMessageAudio(audio=None, album_cover_thumbnail=None, duration=0, title='', performer='', caption=None)[source]

Bases: TlObject, InputMessageContent

An audio message

Parameters:
  • audio ("types.InputFile") – Audio file to be sent

  • album_cover_thumbnail ("types.InputThumbnail") – Thumbnail of the cover for the album; pass null to skip thumbnail uploading

  • duration (int) – Duration of the audio, in seconds; may be replaced by the server

  • title (str) – Title of the audio; 0-64 characters; may be replaced by the server

  • performer (str) – Performer of the audio; 0-64 characters, may be replaced by the server

  • caption ("types.FormattedText") – Audio caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters

__init__(audio=None, album_cover_thumbnail=None, duration=0, title='', performer='', caption=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputMessageAudio]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputMessageContent']

classmethod getType()[source]
Return type:

Literal['inputMessageAudio']

to_dict()[source]
Return type:

dict

album_cover_thumbnail: Optional[InputThumbnail]

Thumbnail of the cover for the album; pass null to skip thumbnail uploading

audio: Union[InputFileId, InputFileRemote, InputFileLocal, InputFileGenerated, None]

Audio file to be sent

caption: Optional[FormattedText]

Audio caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters

duration: int

Duration of the audio, in seconds; may be replaced by the server

performer: Optional[str]

Performer of the audio; 0-64 characters, may be replaced by the server

title: Optional[str]

Title of the audio; 0-64 characters; may be replaced by the server

class pytdbot.types.InputMessageChecklist(checklist=None)[source]

Bases: TlObject, InputMessageContent

A message with a checklist. Checklists can’t be sent to secret chats, channel chats and channel direct messages chats; for Telegram Premium users only

Parameters:

checklist ("types.InputChecklist") – The checklist to send

__init__(checklist=None)[source]
Parameters:

checklist (InputChecklist | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputMessageChecklist]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputMessageContent']

classmethod getType()[source]
Return type:

Literal['inputMessageChecklist']

to_dict()[source]
Return type:

dict

checklist: Optional[InputChecklist]

The checklist to send

class pytdbot.types.InputMessageContact(contact=None)[source]

Bases: TlObject, InputMessageContent

A message containing a user contact

Parameters:

contact ("types.Contact") – Contact to send

__init__(contact=None)[source]
Parameters:

contact (Contact | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputMessageContact]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputMessageContent']

classmethod getType()[source]
Return type:

Literal['inputMessageContact']

to_dict()[source]
Return type:

dict

contact: Optional[Contact]

Contact to send

class pytdbot.types.InputMessageContent[source]

Bases: object

The content of a message to send

class pytdbot.types.InputMessageDice(emoji='', clear_draft=False)[source]

Bases: TlObject, InputMessageContent

A dice message

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

  • clear_draft (bool) – True, if the chat message draft must be deleted

__init__(emoji='', clear_draft=False)[source]
Parameters:
  • emoji (str)

  • clear_draft (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputMessageDice]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputMessageContent']

classmethod getType()[source]
Return type:

Literal['inputMessageDice']

to_dict()[source]
Return type:

dict

clear_draft: bool

True, if the chat message draft must be deleted

emoji: Optional[str]

Emoji on which the dice throw animation is based

class pytdbot.types.InputMessageDocument(document=None, thumbnail=None, disable_content_type_detection=False, caption=None)[source]

Bases: TlObject, InputMessageContent

A document message (general file)

Parameters:
  • document ("types.InputFile") – Document to be sent

  • thumbnail ("types.InputThumbnail") – Document thumbnail; pass null to skip thumbnail uploading

  • disable_content_type_detection (bool) – Pass true to disable automatic file type detection and send the document as a file. Always true for files sent to secret chats

  • caption ("types.FormattedText") – Document caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters

__init__(document=None, thumbnail=None, disable_content_type_detection=False, caption=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputMessageDocument]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputMessageContent']

classmethod getType()[source]
Return type:

Literal['inputMessageDocument']

to_dict()[source]
Return type:

dict

caption: Optional[FormattedText]

Document caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters

disable_content_type_detection: bool

Pass true to disable automatic file type detection and send the document as a file. Always true for files sent to secret chats

document: Union[InputFileId, InputFileRemote, InputFileLocal, InputFileGenerated, None]

Document to be sent

thumbnail: Optional[InputThumbnail]

Document thumbnail; pass null to skip thumbnail uploading

class pytdbot.types.InputMessageForwarded(from_chat_id=0, message_id=0, in_game_share=False, replace_video_start_timestamp=False, new_video_start_timestamp=0, copy_options=None)[source]

Bases: TlObject, InputMessageContent

A forwarded message

Parameters:
  • from_chat_id (int) – Identifier for the chat this forwarded message came from

  • message_id (int) – Identifier of the message to forward. A message can be forwarded only if messageProperties.can_be_forwarded

  • in_game_share (bool) – Pass true if a game message is being shared from a launched game; applies only to game messages

  • replace_video_start_timestamp (bool) – Pass true to replace video start timestamp in the forwarded message

  • new_video_start_timestamp (int) – The new video start timestamp; ignored if replace_video_start_timestamp == false

  • copy_options ("types.MessageCopyOptions") – Options to be used to copy content of the message without reference to the original sender; pass null to forward the message as usual

__init__(from_chat_id=0, message_id=0, in_game_share=False, replace_video_start_timestamp=False, new_video_start_timestamp=0, copy_options=None)[source]
Parameters:
  • from_chat_id (int)

  • message_id (int)

  • in_game_share (bool)

  • replace_video_start_timestamp (bool)

  • new_video_start_timestamp (int)

  • copy_options (MessageCopyOptions | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputMessageForwarded]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputMessageContent']

classmethod getType()[source]
Return type:

Literal['inputMessageForwarded']

to_dict()[source]
Return type:

dict

copy_options: Optional[MessageCopyOptions]

Options to be used to copy content of the message without reference to the original sender; pass null to forward the message as usual

from_chat_id: int

Identifier for the chat this forwarded message came from

in_game_share: bool

Pass true if a game message is being shared from a launched game; applies only to game messages

message_id: int

Identifier of the message to forward. A message can be forwarded only if messageProperties.can_be_forwarded

new_video_start_timestamp: int

The new video start timestamp; ignored if replace_video_start_timestamp == false

replace_video_start_timestamp: bool

Pass true to replace video start timestamp in the forwarded message

class pytdbot.types.InputMessageGame(bot_user_id=0, game_short_name='')[source]

Bases: TlObject, InputMessageContent

A message with a game; not supported for channels or secret chats

Parameters:
  • bot_user_id (int) – User identifier of the bot that owns the game

  • game_short_name (str) – Short name of the game

__init__(bot_user_id=0, game_short_name='')[source]
Parameters:
  • bot_user_id (int)

  • game_short_name (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputMessageGame]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputMessageContent']

classmethod getType()[source]
Return type:

Literal['inputMessageGame']

to_dict()[source]
Return type:

dict

bot_user_id: int

User identifier of the bot that owns the game

game_short_name: Optional[str]

Short name of the game

class pytdbot.types.InputMessageInvoice(invoice=None, title='', description='', photo_url='', photo_size=0, photo_width=0, photo_height=0, payload=b'', provider_token='', provider_data='', start_parameter='', paid_media=None, paid_media_caption=None)[source]

Bases: TlObject, InputMessageContent

A message with an invoice; can be used only by bots

Parameters:
  • invoice ("types.Invoice") – Invoice

  • title (str) – Product title; 1-32 characters

  • description (str) – Product description; 0-255 characters

  • photo_url (str) – Product photo URL; optional

  • photo_size (int) – Product photo size

  • photo_width (int) – Product photo width

  • photo_height (int) – Product photo height

  • payload (bytes) – The invoice payload

  • provider_token (str) – Payment provider token; may be empty for payments in Telegram Stars

  • provider_data (str) – JSON-encoded data about the invoice, which will be shared with the payment provider

  • start_parameter (str) – Unique invoice bot deep link parameter for the generation of this invoice. If empty, it would be possible to pay directly from forwards of the invoice message

  • paid_media ("types.InputPaidMedia") – The content of paid media attached to the invoice; pass null if none

  • paid_media_caption ("types.FormattedText") – Paid media caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters

__init__(invoice=None, title='', description='', photo_url='', photo_size=0, photo_width=0, photo_height=0, payload=b'', provider_token='', provider_data='', start_parameter='', paid_media=None, paid_media_caption=None)[source]
Parameters:
  • invoice (Invoice | None)

  • title (str)

  • description (str)

  • photo_url (str)

  • photo_size (int)

  • photo_width (int)

  • photo_height (int)

  • payload (bytes)

  • provider_token (str)

  • provider_data (str)

  • start_parameter (str)

  • paid_media (InputPaidMedia | None)

  • paid_media_caption (FormattedText | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputMessageInvoice]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputMessageContent']

classmethod getType()[source]
Return type:

Literal['inputMessageInvoice']

to_dict()[source]
Return type:

dict

description: Optional[str]

Product description; 0-255 characters

invoice: Optional[Invoice]

Invoice

paid_media: Optional[InputPaidMedia]

The content of paid media attached to the invoice; pass null if none

paid_media_caption: Optional[FormattedText]

Paid media caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters

payload: Optional[bytes]

The invoice payload

photo_height: int

Product photo height

photo_size: int

Product photo size

photo_url: Optional[str]

Product photo URL; optional

photo_width: int

Product photo width

provider_data: Optional[str]

JSON-encoded data about the invoice, which will be shared with the payment provider

provider_token: Optional[str]

Payment provider token; may be empty for payments in Telegram Stars

start_parameter: Optional[str]

Unique invoice bot deep link parameter for the generation of this invoice. If empty, it would be possible to pay directly from forwards of the invoice message

title: Optional[str]

Product title; 1-32 characters

class pytdbot.types.InputMessageLocation(location=None, live_period=0, heading=0, proximity_alert_radius=0)[source]

Bases: TlObject, InputMessageContent

A message with a location

Parameters:
  • location ("types.Location") – Location to be sent

  • live_period (int) – Period for which the location can be updated, in seconds; must be between 60 and 86400 for a temporary live location, 0x7FFFFFFF for permanent live location, and 0 otherwise

  • heading (int) – For live locations, a direction in which the location moves, in degrees; 1-360. Pass 0 if unknown

  • proximity_alert_radius (int) – For live locations, a maximum distance to another chat member for proximity alerts, in meters (0-100000). Pass 0 if the notification is disabled. Can’t be enabled in channels and Saved Messages

__init__(location=None, live_period=0, heading=0, proximity_alert_radius=0)[source]
Parameters:
  • location (Location | None)

  • live_period (int)

  • heading (int)

  • proximity_alert_radius (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputMessageLocation]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputMessageContent']

classmethod getType()[source]
Return type:

Literal['inputMessageLocation']

to_dict()[source]
Return type:

dict

heading: int

For live locations, a direction in which the location moves, in degrees; 1-360. Pass 0 if unknown

live_period: int

Period for which the location can be updated, in seconds; must be between 60 and 86400 for a temporary live location, 0x7FFFFFFF for permanent live location, and 0 otherwise

location: Optional[Location]

Location to be sent

proximity_alert_radius: int

For live locations, a maximum distance to another chat member for proximity alerts, in meters (0-100000). Pass 0 if the notification is disabled. Can’t be enabled in channels and Saved Messages

class pytdbot.types.InputMessagePaidMedia(star_count=0, paid_media=None, caption=None, show_caption_above_media=False, payload='')[source]

Bases: TlObject, InputMessageContent

A message with paid media; can be used only in channel chats with supergroupFullInfo.has_paid_media_allowed

Parameters:
  • star_count (int) – The number of Telegram Stars that must be paid to see the media; 1-getOption("paid_media_message_star_count_max")

  • paid_media (List["types.InputPaidMedia"]) – The content of the paid media

  • caption ("types.FormattedText") – Message caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters

  • show_caption_above_media (bool) – True, if the caption must be shown above the media; otherwise, the caption must be shown below the media; not supported in secret chats

  • payload (str) – Bot-provided data for the paid media; bots only

__init__(star_count=0, paid_media=None, caption=None, show_caption_above_media=False, payload='')[source]
Parameters:
  • star_count (int)

  • paid_media (List[InputPaidMedia] | None)

  • caption (FormattedText | None)

  • show_caption_above_media (bool)

  • payload (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputMessagePaidMedia]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputMessageContent']

classmethod getType()[source]
Return type:

Literal['inputMessagePaidMedia']

to_dict()[source]
Return type:

dict

caption: Optional[FormattedText]

Message caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters

paid_media: List[InputPaidMedia]

The content of the paid media

payload: Optional[str]

Bot-provided data for the paid media; bots only

show_caption_above_media: bool

True, if the caption must be shown above the media; otherwise, the caption must be shown below the media; not supported in secret chats

star_count: int

The number of Telegram Stars that must be paid to see the media; 1-getOption("paid_media_message_star_count_max")

class pytdbot.types.InputMessagePhoto(photo=None, thumbnail=None, added_sticker_file_ids=None, width=0, height=0, caption=None, show_caption_above_media=False, self_destruct_type=None, has_spoiler=False)[source]

Bases: TlObject, InputMessageContent

A photo message

Parameters:
  • photo ("types.InputFile") – Photo to send. The photo must be at most 10 MB in size. The photo’s width and height must not exceed 10000 in total. Width and height ratio must be at most 20

  • thumbnail ("types.InputThumbnail") – Photo thumbnail to be sent; pass null to skip thumbnail uploading. The thumbnail is sent to the other party only in secret chats

  • added_sticker_file_ids (List[int]) – File identifiers of the stickers added to the photo, if applicable

  • width (int) – Photo width

  • height (int) – Photo height

  • caption ("types.FormattedText") – Photo caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters

  • show_caption_above_media (bool) – True, if the caption must be shown above the photo; otherwise, the caption must be shown below the photo; not supported in secret chats

  • self_destruct_type ("types.MessageSelfDestructType") – Photo self-destruct type; pass null if none; private chats only

  • has_spoiler (bool) – True, if the photo preview must be covered by a spoiler animation; not supported in secret chats

__init__(photo=None, thumbnail=None, added_sticker_file_ids=None, width=0, height=0, caption=None, show_caption_above_media=False, self_destruct_type=None, has_spoiler=False)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputMessagePhoto]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputMessageContent']

classmethod getType()[source]
Return type:

Literal['inputMessagePhoto']

to_dict()[source]
Return type:

dict

added_sticker_file_ids: List[int]

File identifiers of the stickers added to the photo, if applicable

caption: Optional[FormattedText]

Photo caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters

has_spoiler: bool

True, if the photo preview must be covered by a spoiler animation; not supported in secret chats

height: int

Photo height

photo: Union[InputFileId, InputFileRemote, InputFileLocal, InputFileGenerated, None]

Photo to send. The photo must be at most 10 MB in size. The photo’s width and height must not exceed 10000 in total. Width and height ratio must be at most 20

self_destruct_type: Union[MessageSelfDestructTypeTimer, MessageSelfDestructTypeImmediately, None]

Photo self-destruct type; pass null if none; private chats only

show_caption_above_media: bool

True, if the caption must be shown above the photo; otherwise, the caption must be shown below the photo; not supported in secret chats

thumbnail: Optional[InputThumbnail]

Photo thumbnail to be sent; pass null to skip thumbnail uploading. The thumbnail is sent to the other party only in secret chats

width: int

Photo width

class pytdbot.types.InputMessagePoll(question=None, options=None, is_anonymous=False, type=None, open_period=0, close_date=0, is_closed=False)[source]

Bases: TlObject, InputMessageContent

A message with a poll. Polls can’t be sent to secret chats and channel direct messages chats. Polls can be sent to a private chat only if the chat is a chat with a bot or the Saved Messages chat

Parameters:
  • question ("types.FormattedText") – Poll question; 1-255 characters (up to 300 characters for bots). Only custom emoji entities are allowed to be added and only by Premium users

  • options (List["types.FormattedText"]) – List of poll answer options, 2-getOption("poll_answer_count_max") strings 1-100 characters each. Only custom emoji entities are allowed to be added and only by Premium users

  • is_anonymous (bool) – True, if the poll voters are anonymous. Non-anonymous polls can’t be sent or forwarded to channels

  • type ("types.PollType") – Type of the poll

  • open_period (int) – Amount of time the poll will be active after creation, in seconds; for bots only

  • close_date (int) – Point in time (Unix timestamp) when the poll will automatically be closed; for bots only

  • is_closed (bool) – True, if the poll needs to be sent already closed; for bots only

__init__(question=None, options=None, is_anonymous=False, type=None, open_period=0, close_date=0, is_closed=False)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputMessagePoll]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputMessageContent']

classmethod getType()[source]
Return type:

Literal['inputMessagePoll']

to_dict()[source]
Return type:

dict

close_date: int

Point in time (Unix timestamp) when the poll will automatically be closed; for bots only

is_anonymous: bool

True, if the poll voters are anonymous. Non-anonymous polls can’t be sent or forwarded to channels

is_closed: bool

True, if the poll needs to be sent already closed; for bots only

open_period: int

Amount of time the poll will be active after creation, in seconds; for bots only

options: List[FormattedText]

List of poll answer options, 2-getOption("poll_answer_count_max") strings 1-100 characters each. Only custom emoji entities are allowed to be added and only by Premium users

question: Optional[FormattedText]

Poll question; 1-255 characters (up to 300 characters for bots). Only custom emoji entities are allowed to be added and only by Premium users

type: Union[PollTypeRegular, PollTypeQuiz, None]

Type of the poll

class pytdbot.types.InputMessageReplyTo[source]

Bases: object

Contains information about the message or the story to be replied

class pytdbot.types.InputMessageReplyToExternalMessage(chat_id=0, message_id=0, quote=None, checklist_task_id=0)[source]

Bases: TlObject, InputMessageReplyTo

Describes a message to be replied that is from a different chat or a forum topic; not supported in secret chats

Parameters:
  • chat_id (int) – The identifier of the chat to which the message to be replied belongs

  • message_id (int) – The identifier of the message to be replied in the specified chat. A message can be replied in another chat or forum topic only if messageProperties.can_be_replied_in_another_chat

  • quote ("types.InputTextQuote") – Quote from the message to be replied; pass null if none

  • checklist_task_id (int) – Identifier of the checklist task in the message to be replied; pass 0 to reply to the whole message

__init__(chat_id=0, message_id=0, quote=None, checklist_task_id=0)[source]
Parameters:
  • chat_id (int)

  • message_id (int)

  • quote (InputTextQuote | None)

  • checklist_task_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputMessageReplyToExternalMessage]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputMessageReplyTo']

classmethod getType()[source]
Return type:

Literal['inputMessageReplyToExternalMessage']

to_dict()[source]
Return type:

dict

chat_id: int

The identifier of the chat to which the message to be replied belongs

checklist_task_id: int

Identifier of the checklist task in the message to be replied; pass 0 to reply to the whole message

message_id: int

The identifier of the message to be replied in the specified chat. A message can be replied in another chat or forum topic only if messageProperties.can_be_replied_in_another_chat

quote: Optional[InputTextQuote]

Quote from the message to be replied; pass null if none

class pytdbot.types.InputMessageReplyToMessage(message_id=0, quote=None, checklist_task_id=0)[source]

Bases: TlObject, InputMessageReplyTo

Describes a message to be replied in the same chat and forum topic

Parameters:
  • message_id (int) – The identifier of the message to be replied in the same chat and forum topic. A message can be replied in the same chat and forum topic only if messageProperties.can_be_replied

  • quote ("types.InputTextQuote") – Quote from the message to be replied; pass null if none. Must always be null for replies in secret chats

  • checklist_task_id (int) – Identifier of the checklist task in the message to be replied; pass 0 to reply to the whole message

__init__(message_id=0, quote=None, checklist_task_id=0)[source]
Parameters:
  • message_id (int)

  • quote (InputTextQuote | None)

  • checklist_task_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputMessageReplyToMessage]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputMessageReplyTo']

classmethod getType()[source]
Return type:

Literal['inputMessageReplyToMessage']

to_dict()[source]
Return type:

dict

checklist_task_id: int

Identifier of the checklist task in the message to be replied; pass 0 to reply to the whole message

message_id: int

The identifier of the message to be replied in the same chat and forum topic. A message can be replied in the same chat and forum topic only if messageProperties.can_be_replied

quote: Optional[InputTextQuote]

Quote from the message to be replied; pass null if none. Must always be null for replies in secret chats

class pytdbot.types.InputMessageReplyToStory(story_poster_chat_id=0, story_id=0)[source]

Bases: TlObject, InputMessageReplyTo

Describes a story to be replied

Parameters:
  • story_poster_chat_id (int) – The identifier of the poster of the story. Currently, stories can be replied only in the chat that posted the story; channel stories can’t be replied

  • story_id (int) – The identifier of the story

__init__(story_poster_chat_id=0, story_id=0)[source]
Parameters:
  • story_poster_chat_id (int)

  • story_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputMessageReplyToStory]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputMessageReplyTo']

classmethod getType()[source]
Return type:

Literal['inputMessageReplyToStory']

to_dict()[source]
Return type:

dict

story_id: int

The identifier of the story

story_poster_chat_id: int

The identifier of the poster of the story. Currently, stories can be replied only in the chat that posted the story; channel stories can’t be replied

class pytdbot.types.InputMessageSticker(sticker=None, thumbnail=None, width=0, height=0, emoji='')[source]

Bases: TlObject, InputMessageContent

A sticker message

Parameters:
  • sticker ("types.InputFile") – Sticker to be sent

  • thumbnail ("types.InputThumbnail") – Sticker thumbnail; pass null to skip thumbnail uploading

  • width (int) – Sticker width

  • height (int) – Sticker height

  • emoji (str) – Emoji used to choose the sticker

__init__(sticker=None, thumbnail=None, width=0, height=0, emoji='')[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputMessageSticker]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputMessageContent']

classmethod getType()[source]
Return type:

Literal['inputMessageSticker']

to_dict()[source]
Return type:

dict

emoji: Optional[str]

Emoji used to choose the sticker

height: int

Sticker height

sticker: Union[InputFileId, InputFileRemote, InputFileLocal, InputFileGenerated, None]

Sticker to be sent

thumbnail: Optional[InputThumbnail]

Sticker thumbnail; pass null to skip thumbnail uploading

width: int

Sticker width

class pytdbot.types.InputMessageStory(story_poster_chat_id=0, story_id=0)[source]

Bases: TlObject, InputMessageContent

A message with a forwarded story. Stories can’t be forwarded to secret chats. A story can be forwarded only if story.can_be_forwarded

Parameters:
  • story_poster_chat_id (int) – Identifier of the chat that posted the story

  • story_id (int) – Story identifier

__init__(story_poster_chat_id=0, story_id=0)[source]
Parameters:
  • story_poster_chat_id (int)

  • story_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputMessageStory]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputMessageContent']

classmethod getType()[source]
Return type:

Literal['inputMessageStory']

to_dict()[source]
Return type:

dict

story_id: int

Story identifier

story_poster_chat_id: int

Identifier of the chat that posted the story

class pytdbot.types.InputMessageText(text=None, link_preview_options=None, clear_draft=False)[source]

Bases: TlObject, InputMessageContent

A text message

Parameters:
  • text ("types.FormattedText") – Formatted text to be sent; 0-getOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, ExpandableBlockQuote, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually

  • link_preview_options ("types.LinkPreviewOptions") – Options to be used for generation of a link preview; may be null if none; pass null to use default link preview options

  • clear_draft (bool) – True, if a chat message draft must be deleted

__init__(text=None, link_preview_options=None, clear_draft=False)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputMessageText]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputMessageContent']

classmethod getType()[source]
Return type:

Literal['inputMessageText']

to_dict()[source]
Return type:

dict

clear_draft: bool

True, if a chat message draft must be deleted

link_preview_options: Optional[LinkPreviewOptions]

Options to be used for generation of a link preview; may be null if none; pass null to use default link preview options

text: Optional[FormattedText]

Formatted text to be sent; 0-getOption("message_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, ExpandableBlockQuote, Code, Pre, PreCode, TextUrl and MentionName entities are allowed to be specified manually

class pytdbot.types.InputMessageVenue(venue=None)[source]

Bases: TlObject, InputMessageContent

A message with information about a venue

Parameters:

venue ("types.Venue") – Venue to send

__init__(venue=None)[source]
Parameters:

venue (Venue | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputMessageVenue]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputMessageContent']

classmethod getType()[source]
Return type:

Literal['inputMessageVenue']

to_dict()[source]
Return type:

dict

venue: Optional[Venue]

Venue to send

class pytdbot.types.InputMessageVideo(video=None, thumbnail=None, cover=None, start_timestamp=0, added_sticker_file_ids=None, duration=0, width=0, height=0, supports_streaming=False, caption=None, show_caption_above_media=False, self_destruct_type=None, has_spoiler=False)[source]

Bases: TlObject, InputMessageContent

A video message

Parameters:
  • video ("types.InputFile") – Video to be sent. The video is expected to be re-encoded to MPEG4 format with H.264 codec by the sender

  • thumbnail ("types.InputThumbnail") – Video thumbnail; pass null to skip thumbnail uploading

  • cover ("types.InputFile") – Cover of the video; pass null to skip cover uploading; not supported in secret chats and for self-destructing messages

  • start_timestamp (int) – Timestamp from which the video playing must start, in seconds

  • added_sticker_file_ids (List[int]) – File identifiers of the stickers added to the video, if applicable

  • duration (int) – Duration of the video, in seconds

  • width (int) – Video width

  • height (int) – Video height

  • supports_streaming (bool) – True, if the video is expected to be streamed

  • caption ("types.FormattedText") – Video caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters

  • show_caption_above_media (bool) – True, if the caption must be shown above the video; otherwise, the caption must be shown below the video; not supported in secret chats

  • self_destruct_type ("types.MessageSelfDestructType") – Video self-destruct type; pass null if none; private chats only

  • has_spoiler (bool) – True, if the video preview must be covered by a spoiler animation; not supported in secret chats

__init__(video=None, thumbnail=None, cover=None, start_timestamp=0, added_sticker_file_ids=None, duration=0, width=0, height=0, supports_streaming=False, caption=None, show_caption_above_media=False, self_destruct_type=None, has_spoiler=False)[source]
Parameters:
  • video (InputFile | None)

  • thumbnail (InputThumbnail | None)

  • cover (InputFile | None)

  • start_timestamp (int)

  • added_sticker_file_ids (List[int] | None)

  • duration (int)

  • width (int)

  • height (int)

  • supports_streaming (bool)

  • caption (FormattedText | None)

  • show_caption_above_media (bool)

  • self_destruct_type (MessageSelfDestructType | None)

  • has_spoiler (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputMessageVideo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputMessageContent']

classmethod getType()[source]
Return type:

Literal['inputMessageVideo']

to_dict()[source]
Return type:

dict

added_sticker_file_ids: List[int]

File identifiers of the stickers added to the video, if applicable

caption: Optional[FormattedText]

Video caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters

cover: Union[InputFileId, InputFileRemote, InputFileLocal, InputFileGenerated, None]

Cover of the video; pass null to skip cover uploading; not supported in secret chats and for self-destructing messages

duration: int

Duration of the video, in seconds

has_spoiler: bool

True, if the video preview must be covered by a spoiler animation; not supported in secret chats

height: int

Video height

self_destruct_type: Union[MessageSelfDestructTypeTimer, MessageSelfDestructTypeImmediately, None]

Video self-destruct type; pass null if none; private chats only

show_caption_above_media: bool

True, if the caption must be shown above the video; otherwise, the caption must be shown below the video; not supported in secret chats

start_timestamp: int

Timestamp from which the video playing must start, in seconds

supports_streaming: bool

True, if the video is expected to be streamed

thumbnail: Optional[InputThumbnail]

Video thumbnail; pass null to skip thumbnail uploading

video: Union[InputFileId, InputFileRemote, InputFileLocal, InputFileGenerated, None]

Video to be sent. The video is expected to be re-encoded to MPEG4 format with H.264 codec by the sender

width: int

Video width

class pytdbot.types.InputMessageVideoNote(video_note=None, thumbnail=None, duration=0, length=0, self_destruct_type=None)[source]

Bases: TlObject, InputMessageContent

A video note message

Parameters:
  • video_note ("types.InputFile") – Video note to be sent. The video is expected to be encoded to MPEG4 format with H.264 codec and have no data outside of the visible circle

  • thumbnail ("types.InputThumbnail") – Video thumbnail; may be null if empty; pass null to skip thumbnail uploading

  • duration (int) – Duration of the video, in seconds; 0-60

  • length (int) – Video width and height; must be positive and not greater than 640

  • self_destruct_type ("types.MessageSelfDestructType") – Video note self-destruct type; may be null if none; pass null if none; private chats only

__init__(video_note=None, thumbnail=None, duration=0, length=0, self_destruct_type=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputMessageVideoNote]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputMessageContent']

classmethod getType()[source]
Return type:

Literal['inputMessageVideoNote']

to_dict()[source]
Return type:

dict

duration: int

Duration of the video, in seconds; 0-60

length: int

Video width and height; must be positive and not greater than 640

self_destruct_type: Union[MessageSelfDestructTypeTimer, MessageSelfDestructTypeImmediately, None]

Video note self-destruct type; may be null if none; pass null if none; private chats only

thumbnail: Optional[InputThumbnail]

Video thumbnail; may be null if empty; pass null to skip thumbnail uploading

video_note: Union[InputFileId, InputFileRemote, InputFileLocal, InputFileGenerated, None]

Video note to be sent. The video is expected to be encoded to MPEG4 format with H.264 codec and have no data outside of the visible circle

class pytdbot.types.InputMessageVoiceNote(voice_note=None, duration=0, waveform=b'', caption=None, self_destruct_type=None)[source]

Bases: TlObject, InputMessageContent

A voice note message

Parameters:
  • voice_note ("types.InputFile") – Voice note to be sent. The voice note must be encoded with the Opus codec and stored inside an OGG container with a single audio channel, or be in MP3 or M4A format as regular audio

  • duration (int) – Duration of the voice note, in seconds

  • waveform (bytes) – Waveform representation of the voice note in 5-bit format

  • caption ("types.FormattedText") – Voice note caption; may be null if empty; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters

  • self_destruct_type ("types.MessageSelfDestructType") – Voice note self-destruct type; may be null if none; pass null if none; private chats only

__init__(voice_note=None, duration=0, waveform=b'', caption=None, self_destruct_type=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputMessageVoiceNote]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputMessageContent']

classmethod getType()[source]
Return type:

Literal['inputMessageVoiceNote']

to_dict()[source]
Return type:

dict

caption: Optional[FormattedText]

Voice note caption; may be null if empty; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters

duration: int

Duration of the voice note, in seconds

self_destruct_type: Union[MessageSelfDestructTypeTimer, MessageSelfDestructTypeImmediately, None]

Voice note self-destruct type; may be null if none; pass null if none; private chats only

voice_note: Union[InputFileId, InputFileRemote, InputFileLocal, InputFileGenerated, None]

Voice note to be sent. The voice note must be encoded with the Opus codec and stored inside an OGG container with a single audio channel, or be in MP3 or M4A format as regular audio

waveform: Optional[bytes]

Waveform representation of the voice note in 5-bit format

class pytdbot.types.InputPaidMedia(type=None, media=None, thumbnail=None, added_sticker_file_ids=None, width=0, height=0)[source]

Bases: TlObject

Describes a paid media to be sent

Parameters:
  • type ("types.InputPaidMediaType") – Type of the media

  • media ("types.InputFile") – Photo or video to be sent

  • thumbnail ("types.InputThumbnail") – Media thumbnail; pass null to skip thumbnail uploading

  • added_sticker_file_ids (List[int]) – File identifiers of the stickers added to the media, if applicable

  • width (int) – Media width

  • height (int) – Media height

__init__(type=None, media=None, thumbnail=None, added_sticker_file_ids=None, width=0, height=0)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputPaidMedia]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputPaidMedia']

classmethod getType()[source]
Return type:

Literal['inputPaidMedia']

to_dict()[source]
Return type:

dict

added_sticker_file_ids: List[int]

File identifiers of the stickers added to the media, if applicable

height: int

Media height

media: Union[InputFileId, InputFileRemote, InputFileLocal, InputFileGenerated, None]

Photo or video to be sent

thumbnail: Optional[InputThumbnail]

Media thumbnail; pass null to skip thumbnail uploading

type: Union[InputPaidMediaTypePhoto, InputPaidMediaTypeVideo, None]

Type of the media

width: int

Media width

class pytdbot.types.InputPaidMediaType[source]

Bases: object

Describes type of paid media to sent

class pytdbot.types.InputPaidMediaTypePhoto[source]

Bases: TlObject, InputPaidMediaType

The media is a photo. The photo must be at most 10 MB in size. The photo’s width and height must not exceed 10000 in total. Width and height ratio must be at most 20

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputPaidMediaTypePhoto]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputPaidMediaType']

classmethod getType()[source]
Return type:

Literal['inputPaidMediaTypePhoto']

to_dict()[source]
Return type:

dict

class pytdbot.types.InputPaidMediaTypeVideo(cover=None, start_timestamp=0, duration=0, supports_streaming=False)[source]

Bases: TlObject, InputPaidMediaType

The media is a video

Parameters:
  • cover ("types.InputFile") – Cover of the video; pass null to skip cover uploading

  • start_timestamp (int) – Timestamp from which the video playing must start, in seconds

  • duration (int) – Duration of the video, in seconds

  • supports_streaming (bool) – True, if the video is expected to be streamed

__init__(cover=None, start_timestamp=0, duration=0, supports_streaming=False)[source]
Parameters:
  • cover (InputFile | None)

  • start_timestamp (int)

  • duration (int)

  • supports_streaming (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputPaidMediaTypeVideo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputPaidMediaType']

classmethod getType()[source]
Return type:

Literal['inputPaidMediaTypeVideo']

to_dict()[source]
Return type:

dict

cover: Union[InputFileId, InputFileRemote, InputFileLocal, InputFileGenerated, None]

Cover of the video; pass null to skip cover uploading

duration: int

Duration of the video, in seconds

start_timestamp: int

Timestamp from which the video playing must start, in seconds

supports_streaming: bool

True, if the video is expected to be streamed

class pytdbot.types.InputPassportElement[source]

Bases: object

Contains information about a Telegram Passport element to be saved

class pytdbot.types.InputPassportElementAddress(address=None)[source]

Bases: TlObject, InputPassportElement

A Telegram Passport element to be saved containing the user’s address

Parameters:

address ("types.Address") – The address to be saved

__init__(address=None)[source]
Parameters:

address (Address | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputPassportElementAddress]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputPassportElement']

classmethod getType()[source]
Return type:

Literal['inputPassportElementAddress']

to_dict()[source]
Return type:

dict

address: Optional[Address]

The address to be saved

class pytdbot.types.InputPassportElementBankStatement(bank_statement=None)[source]

Bases: TlObject, InputPassportElement

A Telegram Passport element to be saved containing the user’s bank statement

Parameters:

bank_statement ("types.InputPersonalDocument") – The bank statement to be saved

__init__(bank_statement=None)[source]
Parameters:

bank_statement (InputPersonalDocument | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputPassportElementBankStatement]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputPassportElement']

classmethod getType()[source]
Return type:

Literal['inputPassportElementBankStatement']

to_dict()[source]
Return type:

dict

bank_statement: Optional[InputPersonalDocument]

The bank statement to be saved

class pytdbot.types.InputPassportElementDriverLicense(driver_license=None)[source]

Bases: TlObject, InputPassportElement

A Telegram Passport element to be saved containing the user’s driver license

Parameters:

driver_license ("types.InputIdentityDocument") – The driver license to be saved

__init__(driver_license=None)[source]
Parameters:

driver_license (InputIdentityDocument | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputPassportElementDriverLicense]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputPassportElement']

classmethod getType()[source]
Return type:

Literal['inputPassportElementDriverLicense']

to_dict()[source]
Return type:

dict

driver_license: Optional[InputIdentityDocument]

The driver license to be saved

class pytdbot.types.InputPassportElementEmailAddress(email_address='')[source]

Bases: TlObject, InputPassportElement

A Telegram Passport element to be saved containing the user’s email address

Parameters:

email_address (str) – The email address to be saved

__init__(email_address='')[source]
Parameters:

email_address (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputPassportElementEmailAddress]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputPassportElement']

classmethod getType()[source]
Return type:

Literal['inputPassportElementEmailAddress']

to_dict()[source]
Return type:

dict

email_address: Optional[str]

The email address to be saved

class pytdbot.types.InputPassportElementError(type=None, message='', source=None)[source]

Bases: TlObject

Contains the description of an error in a Telegram Passport element; for bots only

Parameters:
  • type ("types.PassportElementType") – Type of Telegram Passport element that has the error

  • message (str) – Error message

  • source ("types.InputPassportElementErrorSource") – Error source

__init__(type=None, message='', source=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputPassportElementError]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputPassportElementError']

classmethod getType()[source]
Return type:

Literal['inputPassportElementError']

to_dict()[source]
Return type:

dict

message: Optional[str]

Error message

source: Union[InputPassportElementErrorSourceUnspecified, InputPassportElementErrorSourceDataField, InputPassportElementErrorSourceFrontSide, InputPassportElementErrorSourceReverseSide, InputPassportElementErrorSourceSelfie, InputPassportElementErrorSourceTranslationFile, InputPassportElementErrorSourceTranslationFiles, InputPassportElementErrorSourceFile, InputPassportElementErrorSourceFiles, None]

Error source

type: Union[PassportElementTypePersonalDetails, PassportElementTypePassport, PassportElementTypeDriverLicense, PassportElementTypeIdentityCard, PassportElementTypeInternalPassport, PassportElementTypeAddress, PassportElementTypeUtilityBill, PassportElementTypeBankStatement, PassportElementTypeRentalAgreement, PassportElementTypePassportRegistration, PassportElementTypeTemporaryRegistration, PassportElementTypePhoneNumber, PassportElementTypeEmailAddress, None]

Type of Telegram Passport element that has the error

class pytdbot.types.InputPassportElementErrorSource[source]

Bases: object

Contains the description of an error in a Telegram Passport element; for bots only

class pytdbot.types.InputPassportElementErrorSourceDataField(field_name='', data_hash=b'')[source]

Bases: TlObject, InputPassportElementErrorSource

A data field contains an error. The error is considered resolved when the field’s value changes

Parameters:
  • field_name (str) – Field name

  • data_hash (bytes) – Current data hash

__init__(field_name='', data_hash=b'')[source]
Parameters:
  • field_name (str)

  • data_hash (bytes)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputPassportElementErrorSourceDataField]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputPassportElementErrorSource']

classmethod getType()[source]
Return type:

Literal['inputPassportElementErrorSourceDataField']

to_dict()[source]
Return type:

dict

data_hash: Optional[bytes]

Current data hash

field_name: Optional[str]

Field name

class pytdbot.types.InputPassportElementErrorSourceFile(file_hash=b'')[source]

Bases: TlObject, InputPassportElementErrorSource

The file contains an error. The error is considered resolved when the file changes

Parameters:

file_hash (bytes) – Current hash of the file which has the error

__init__(file_hash=b'')[source]
Parameters:

file_hash (bytes)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputPassportElementErrorSourceFile]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputPassportElementErrorSource']

classmethod getType()[source]
Return type:

Literal['inputPassportElementErrorSourceFile']

to_dict()[source]
Return type:

dict

file_hash: Optional[bytes]

Current hash of the file which has the error

class pytdbot.types.InputPassportElementErrorSourceFiles(file_hashes=None)[source]

Bases: TlObject, InputPassportElementErrorSource

The list of attached files contains an error. The error is considered resolved when the file list changes

Parameters:

file_hashes (List[bytes]) – Current hashes of all attached files

__init__(file_hashes=None)[source]
Parameters:

file_hashes (List[bytes] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputPassportElementErrorSourceFiles]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputPassportElementErrorSource']

classmethod getType()[source]
Return type:

Literal['inputPassportElementErrorSourceFiles']

to_dict()[source]
Return type:

dict

file_hashes: List[bytes]

Current hashes of all attached files

class pytdbot.types.InputPassportElementErrorSourceFrontSide(file_hash=b'')[source]

Bases: TlObject, InputPassportElementErrorSource

The front side of the document contains an error. The error is considered resolved when the file with the front side of the document changes

Parameters:

file_hash (bytes) – Current hash of the file containing the front side

__init__(file_hash=b'')[source]
Parameters:

file_hash (bytes)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputPassportElementErrorSourceFrontSide]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputPassportElementErrorSource']

classmethod getType()[source]
Return type:

Literal['inputPassportElementErrorSourceFrontSide']

to_dict()[source]
Return type:

dict

file_hash: Optional[bytes]

Current hash of the file containing the front side

class pytdbot.types.InputPassportElementErrorSourceReverseSide(file_hash=b'')[source]

Bases: TlObject, InputPassportElementErrorSource

The reverse side of the document contains an error. The error is considered resolved when the file with the reverse side of the document changes

Parameters:

file_hash (bytes) – Current hash of the file containing the reverse side

__init__(file_hash=b'')[source]
Parameters:

file_hash (bytes)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputPassportElementErrorSourceReverseSide]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputPassportElementErrorSource']

classmethod getType()[source]
Return type:

Literal['inputPassportElementErrorSourceReverseSide']

to_dict()[source]
Return type:

dict

file_hash: Optional[bytes]

Current hash of the file containing the reverse side

class pytdbot.types.InputPassportElementErrorSourceSelfie(file_hash=b'')[source]

Bases: TlObject, InputPassportElementErrorSource

The selfie contains an error. The error is considered resolved when the file with the selfie changes

Parameters:

file_hash (bytes) – Current hash of the file containing the selfie

__init__(file_hash=b'')[source]
Parameters:

file_hash (bytes)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputPassportElementErrorSourceSelfie]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputPassportElementErrorSource']

classmethod getType()[source]
Return type:

Literal['inputPassportElementErrorSourceSelfie']

to_dict()[source]
Return type:

dict

file_hash: Optional[bytes]

Current hash of the file containing the selfie

class pytdbot.types.InputPassportElementErrorSourceTranslationFile(file_hash=b'')[source]

Bases: TlObject, InputPassportElementErrorSource

One of the files containing the translation of the document contains an error. The error is considered resolved when the file with the translation changes

Parameters:

file_hash (bytes) – Current hash of the file containing the translation

__init__(file_hash=b'')[source]
Parameters:

file_hash (bytes)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputPassportElementErrorSourceTranslationFile]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputPassportElementErrorSource']

classmethod getType()[source]
Return type:

Literal['inputPassportElementErrorSourceTranslationFile']

to_dict()[source]
Return type:

dict

file_hash: Optional[bytes]

Current hash of the file containing the translation

class pytdbot.types.InputPassportElementErrorSourceTranslationFiles(file_hashes=None)[source]

Bases: TlObject, InputPassportElementErrorSource

The translation of the document contains an error. The error is considered resolved when the list of files changes

Parameters:

file_hashes (List[bytes]) – Current hashes of all files with the translation

__init__(file_hashes=None)[source]
Parameters:

file_hashes (List[bytes] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputPassportElementErrorSourceTranslationFiles]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputPassportElementErrorSource']

classmethod getType()[source]
Return type:

Literal['inputPassportElementErrorSourceTranslationFiles']

to_dict()[source]
Return type:

dict

file_hashes: List[bytes]

Current hashes of all files with the translation

class pytdbot.types.InputPassportElementErrorSourceUnspecified(element_hash=b'')[source]

Bases: TlObject, InputPassportElementErrorSource

The element contains an error in an unspecified place. The error will be considered resolved when new data is added

Parameters:

element_hash (bytes) – Current hash of the entire element

__init__(element_hash=b'')[source]
Parameters:

element_hash (bytes)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputPassportElementErrorSourceUnspecified]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputPassportElementErrorSource']

classmethod getType()[source]
Return type:

Literal['inputPassportElementErrorSourceUnspecified']

to_dict()[source]
Return type:

dict

element_hash: Optional[bytes]

Current hash of the entire element

class pytdbot.types.InputPassportElementIdentityCard(identity_card=None)[source]

Bases: TlObject, InputPassportElement

A Telegram Passport element to be saved containing the user’s identity card

Parameters:

identity_card ("types.InputIdentityDocument") – The identity card to be saved

__init__(identity_card=None)[source]
Parameters:

identity_card (InputIdentityDocument | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputPassportElementIdentityCard]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputPassportElement']

classmethod getType()[source]
Return type:

Literal['inputPassportElementIdentityCard']

to_dict()[source]
Return type:

dict

identity_card: Optional[InputIdentityDocument]

The identity card to be saved

class pytdbot.types.InputPassportElementInternalPassport(internal_passport=None)[source]

Bases: TlObject, InputPassportElement

A Telegram Passport element to be saved containing the user’s internal passport

Parameters:

internal_passport ("types.InputIdentityDocument") – The internal passport to be saved

__init__(internal_passport=None)[source]
Parameters:

internal_passport (InputIdentityDocument | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputPassportElementInternalPassport]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputPassportElement']

classmethod getType()[source]
Return type:

Literal['inputPassportElementInternalPassport']

to_dict()[source]
Return type:

dict

internal_passport: Optional[InputIdentityDocument]

The internal passport to be saved

class pytdbot.types.InputPassportElementPassport(passport=None)[source]

Bases: TlObject, InputPassportElement

A Telegram Passport element to be saved containing the user’s passport

Parameters:

passport ("types.InputIdentityDocument") – The passport to be saved

__init__(passport=None)[source]
Parameters:

passport (InputIdentityDocument | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputPassportElementPassport]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputPassportElement']

classmethod getType()[source]
Return type:

Literal['inputPassportElementPassport']

to_dict()[source]
Return type:

dict

passport: Optional[InputIdentityDocument]

The passport to be saved

class pytdbot.types.InputPassportElementPassportRegistration(passport_registration=None)[source]

Bases: TlObject, InputPassportElement

A Telegram Passport element to be saved containing the user’s passport registration

Parameters:

passport_registration ("types.InputPersonalDocument") – The passport registration page to be saved

__init__(passport_registration=None)[source]
Parameters:

passport_registration (InputPersonalDocument | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputPassportElementPassportRegistration]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputPassportElement']

classmethod getType()[source]
Return type:

Literal['inputPassportElementPassportRegistration']

to_dict()[source]
Return type:

dict

passport_registration: Optional[InputPersonalDocument]

The passport registration page to be saved

class pytdbot.types.InputPassportElementPersonalDetails(personal_details=None)[source]

Bases: TlObject, InputPassportElement

A Telegram Passport element to be saved containing the user’s personal details

Parameters:

personal_details ("types.PersonalDetails") – Personal details of the user

__init__(personal_details=None)[source]
Parameters:

personal_details (PersonalDetails | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputPassportElementPersonalDetails]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputPassportElement']

classmethod getType()[source]
Return type:

Literal['inputPassportElementPersonalDetails']

to_dict()[source]
Return type:

dict

personal_details: Optional[PersonalDetails]

Personal details of the user

class pytdbot.types.InputPassportElementPhoneNumber(phone_number='')[source]

Bases: TlObject, InputPassportElement

A Telegram Passport element to be saved containing the user’s phone number

Parameters:

phone_number (str) – The phone number to be saved

__init__(phone_number='')[source]
Parameters:

phone_number (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputPassportElementPhoneNumber]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputPassportElement']

classmethod getType()[source]
Return type:

Literal['inputPassportElementPhoneNumber']

to_dict()[source]
Return type:

dict

phone_number: Optional[str]

The phone number to be saved

class pytdbot.types.InputPassportElementRentalAgreement(rental_agreement=None)[source]

Bases: TlObject, InputPassportElement

A Telegram Passport element to be saved containing the user’s rental agreement

Parameters:

rental_agreement ("types.InputPersonalDocument") – The rental agreement to be saved

__init__(rental_agreement=None)[source]
Parameters:

rental_agreement (InputPersonalDocument | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputPassportElementRentalAgreement]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputPassportElement']

classmethod getType()[source]
Return type:

Literal['inputPassportElementRentalAgreement']

to_dict()[source]
Return type:

dict

rental_agreement: Optional[InputPersonalDocument]

The rental agreement to be saved

class pytdbot.types.InputPassportElementTemporaryRegistration(temporary_registration=None)[source]

Bases: TlObject, InputPassportElement

A Telegram Passport element to be saved containing the user’s temporary registration

Parameters:

temporary_registration ("types.InputPersonalDocument") – The temporary registration document to be saved

__init__(temporary_registration=None)[source]
Parameters:

temporary_registration (InputPersonalDocument | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputPassportElementTemporaryRegistration]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputPassportElement']

classmethod getType()[source]
Return type:

Literal['inputPassportElementTemporaryRegistration']

to_dict()[source]
Return type:

dict

temporary_registration: Optional[InputPersonalDocument]

The temporary registration document to be saved

class pytdbot.types.InputPassportElementUtilityBill(utility_bill=None)[source]

Bases: TlObject, InputPassportElement

A Telegram Passport element to be saved containing the user’s utility bill

Parameters:

utility_bill ("types.InputPersonalDocument") – The utility bill to be saved

__init__(utility_bill=None)[source]
Parameters:

utility_bill (InputPersonalDocument | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputPassportElementUtilityBill]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputPassportElement']

classmethod getType()[source]
Return type:

Literal['inputPassportElementUtilityBill']

to_dict()[source]
Return type:

dict

utility_bill: Optional[InputPersonalDocument]

The utility bill to be saved

class pytdbot.types.InputPersonalDocument(files=None, translation=None)[source]

Bases: TlObject

A personal document to be saved to Telegram Passport

Parameters:
  • files (List["types.InputFile"]) – List of files containing the pages of the document

  • translation (List["types.InputFile"]) – List of files containing a certified English translation of the document

__init__(files=None, translation=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputPersonalDocument]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputPersonalDocument']

classmethod getType()[source]
Return type:

Literal['inputPersonalDocument']

to_dict()[source]
Return type:

dict

files: List[InputFile]

List of files containing the pages of the document

translation: List[InputFile]

List of files containing a certified English translation of the document

class pytdbot.types.InputSticker(sticker=None, format=None, emojis='', mask_position=None, keywords=None)[source]

Bases: TlObject

A sticker to be added to a sticker set

Parameters:
  • sticker ("types.InputFile") – File with the sticker; must fit in a 512x512 square. For WEBP stickers the file must be in WEBP or PNG format, which will be converted to WEBP server-side. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements

  • format ("types.StickerFormat") – Format of the sticker

  • emojis (str) – String with 1-20 emoji corresponding to the sticker

  • mask_position ("types.MaskPosition") – Position where the mask is placed; pass null if not specified

  • keywords (List[str]) – List of up to 20 keywords with total length up to 64 characters, which can be used to find the sticker

__init__(sticker=None, format=None, emojis='', mask_position=None, keywords=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputSticker]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputSticker']

classmethod getType()[source]
Return type:

Literal['inputSticker']

to_dict()[source]
Return type:

dict

emojis: Optional[str]

String with 1-20 emoji corresponding to the sticker

format: Union[StickerFormatWebp, StickerFormatTgs, StickerFormatWebm, None]

Format of the sticker

keywords: List[str]

List of up to 20 keywords with total length up to 64 characters, which can be used to find the sticker

mask_position: Optional[MaskPosition]

Position where the mask is placed; pass null if not specified

sticker: Union[InputFileId, InputFileRemote, InputFileLocal, InputFileGenerated, None]

//core.telegram.org/animated_stickers#technical-requirements for technical requirements

Type:

File with the sticker; must fit in a 512x512 square. For WEBP stickers the file must be in WEBP or PNG format, which will be converted to WEBP server-side. See https

class pytdbot.types.InputStoryArea(position=None, type=None)[source]

Bases: TlObject

Describes a clickable rectangle area on a story media to be added

Parameters:
  • position ("types.StoryAreaPosition") – Position of the area

  • type ("types.InputStoryAreaType") – Type of the area

__init__(position=None, type=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputStoryArea]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputStoryArea']

classmethod getType()[source]
Return type:

Literal['inputStoryArea']

to_dict()[source]
Return type:

dict

position: Optional[StoryAreaPosition]

Position of the area

type: Union[InputStoryAreaTypeLocation, InputStoryAreaTypeFoundVenue, InputStoryAreaTypePreviousVenue, InputStoryAreaTypeSuggestedReaction, InputStoryAreaTypeMessage, InputStoryAreaTypeLink, InputStoryAreaTypeWeather, InputStoryAreaTypeUpgradedGift, None]

Type of the area

class pytdbot.types.InputStoryAreaType[source]

Bases: object

Describes type of clickable area on a story media to be added

class pytdbot.types.InputStoryAreaTypeFoundVenue(query_id=0, result_id='')[source]

Bases: TlObject, InputStoryAreaType

An area pointing to a venue found by the bot getOption("venue_search_bot_username")

Parameters:
  • query_id (int) – Identifier of the inline query, used to found the venue

  • result_id (str) – Identifier of the inline query result

__init__(query_id=0, result_id='')[source]
Parameters:
  • query_id (int)

  • result_id (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputStoryAreaTypeFoundVenue]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputStoryAreaType']

classmethod getType()[source]
Return type:

Literal['inputStoryAreaTypeFoundVenue']

to_dict()[source]
Return type:

dict

query_id: int

Identifier of the inline query, used to found the venue

result_id: Optional[str]

Identifier of the inline query result

class pytdbot.types.InputStoryAreaTypeLink(url='')[source]

Bases: TlObject, InputStoryAreaType

An area pointing to a HTTP or tg:// link

Parameters:

url (str) – HTTP or tg:// URL to be opened when the area is clicked

__init__(url='')[source]
Parameters:

url (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputStoryAreaTypeLink]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputStoryAreaType']

classmethod getType()[source]
Return type:

Literal['inputStoryAreaTypeLink']

to_dict()[source]
Return type:

dict

url: Optional[str]

// URL to be opened when the area is clicked

Type:

HTTP or tg

class pytdbot.types.InputStoryAreaTypeLocation(location=None, address=None)[source]

Bases: TlObject, InputStoryAreaType

An area pointing to a location

Parameters:
  • location ("types.Location") – The location

  • address ("types.LocationAddress") – Address of the location; pass null if unknown

__init__(location=None, address=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputStoryAreaTypeLocation]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputStoryAreaType']

classmethod getType()[source]
Return type:

Literal['inputStoryAreaTypeLocation']

to_dict()[source]
Return type:

dict

address: Optional[LocationAddress]

Address of the location; pass null if unknown

location: Optional[Location]

The location

class pytdbot.types.InputStoryAreaTypeMessage(chat_id=0, message_id=0)[source]

Bases: TlObject, InputStoryAreaType

An area pointing to a message

Parameters:
  • chat_id (int) – Identifier of the chat with the message. Currently, the chat must be a supergroup or a channel chat

  • message_id (int) – Identifier of the message. Use messageProperties.can_be_shared_in_story to check whether the message is suitable

__init__(chat_id=0, message_id=0)[source]
Parameters:
  • chat_id (int)

  • message_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputStoryAreaTypeMessage]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputStoryAreaType']

classmethod getType()[source]
Return type:

Literal['inputStoryAreaTypeMessage']

to_dict()[source]
Return type:

dict

chat_id: int

Identifier of the chat with the message. Currently, the chat must be a supergroup or a channel chat

message_id: int

Identifier of the message. Use messageProperties.can_be_shared_in_story to check whether the message is suitable

class pytdbot.types.InputStoryAreaTypePreviousVenue(venue_provider='', venue_id='')[source]

Bases: TlObject, InputStoryAreaType

An area pointing to a venue already added to the story

Parameters:
  • venue_provider (str) – Provider of the venue

  • venue_id (str) – Identifier of the venue in the provider database

__init__(venue_provider='', venue_id='')[source]
Parameters:
  • venue_provider (str)

  • venue_id (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputStoryAreaTypePreviousVenue]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputStoryAreaType']

classmethod getType()[source]
Return type:

Literal['inputStoryAreaTypePreviousVenue']

to_dict()[source]
Return type:

dict

venue_id: Optional[str]

Identifier of the venue in the provider database

venue_provider: Optional[str]

Provider of the venue

class pytdbot.types.InputStoryAreaTypeSuggestedReaction(reaction_type=None, is_dark=False, is_flipped=False)[source]

Bases: TlObject, InputStoryAreaType

An area pointing to a suggested reaction

Parameters:
  • reaction_type ("types.ReactionType") – Type of the reaction

  • is_dark (bool) – True, if reaction has a dark background

  • is_flipped (bool) – True, if reaction corner is flipped

__init__(reaction_type=None, is_dark=False, is_flipped=False)[source]
Parameters:
  • reaction_type (ReactionType | None)

  • is_dark (bool)

  • is_flipped (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputStoryAreaTypeSuggestedReaction]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputStoryAreaType']

classmethod getType()[source]
Return type:

Literal['inputStoryAreaTypeSuggestedReaction']

to_dict()[source]
Return type:

dict

is_dark: bool

True, if reaction has a dark background

is_flipped: bool

True, if reaction corner is flipped

reaction_type: Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid, None]

Type of the reaction

class pytdbot.types.InputStoryAreaTypeUpgradedGift(gift_name='')[source]

Bases: TlObject, InputStoryAreaType

An area with an upgraded gift

Parameters:

gift_name (str) – Unique name of the upgraded gift

__init__(gift_name='')[source]
Parameters:

gift_name (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputStoryAreaTypeUpgradedGift]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputStoryAreaType']

classmethod getType()[source]
Return type:

Literal['inputStoryAreaTypeUpgradedGift']

to_dict()[source]
Return type:

dict

gift_name: Optional[str]

Unique name of the upgraded gift

class pytdbot.types.InputStoryAreaTypeWeather(temperature=0.0, emoji='', background_color=0)[source]

Bases: TlObject, InputStoryAreaType

An area with information about weather

Parameters:
  • 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

__init__(temperature=0.0, emoji='', background_color=0)[source]
Parameters:
  • temperature (float)

  • emoji (str)

  • background_color (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputStoryAreaTypeWeather]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputStoryAreaType']

classmethod getType()[source]
Return type:

Literal['inputStoryAreaTypeWeather']

to_dict()[source]
Return type:

dict

background_color: int

A color of the area background in the ARGB format

emoji: Optional[str]

Emoji representing the weather

temperature: float

Temperature, in degree Celsius

class pytdbot.types.InputStoryAreas(areas=None)[source]

Bases: TlObject

Contains a list of story areas to be added

Parameters:

areas (List["types.InputStoryArea"]) – List of input story areas. Currently, a story can have up to 10 inputStoryAreaTypeLocation, inputStoryAreaTypeFoundVenue, and inputStoryAreaTypePreviousVenue areas, up to getOption("story_suggested_reaction_area_count_max") inputStoryAreaTypeSuggestedReaction areas, up to 1 inputStoryAreaTypeMessage area, up to getOption("story_link_area_count_max") inputStoryAreaTypeLink areas if the current user is a Telegram Premium user, up to 3 inputStoryAreaTypeWeather areas, and up to 1 inputStoryAreaTypeUpgradedGift area

__init__(areas=None)[source]
Parameters:

areas (List[InputStoryArea] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputStoryAreas]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputStoryAreas']

classmethod getType()[source]
Return type:

Literal['inputStoryAreas']

to_dict()[source]
Return type:

dict

areas: List[InputStoryArea]

List of input story areas. Currently, a story can have up to 10 inputStoryAreaTypeLocation, inputStoryAreaTypeFoundVenue, and inputStoryAreaTypePreviousVenue areas, up to getOption("story_suggested_reaction_area_count_max") inputStoryAreaTypeSuggestedReaction areas, up to 1 inputStoryAreaTypeMessage area, up to getOption("story_link_area_count_max") inputStoryAreaTypeLink areas if the current user is a Telegram Premium user, up to 3 inputStoryAreaTypeWeather areas, and up to 1 inputStoryAreaTypeUpgradedGift area

class pytdbot.types.InputStoryContent[source]

Bases: object

The content of a story to post

class pytdbot.types.InputStoryContentPhoto(photo=None, added_sticker_file_ids=None)[source]

Bases: TlObject, InputStoryContent

A photo story

Parameters:
  • photo ("types.InputFile") – Photo to send. The photo must be at most 10 MB in size. The photo size must be 1080x1920

  • added_sticker_file_ids (List[int]) – File identifiers of the stickers added to the photo, if applicable

__init__(photo=None, added_sticker_file_ids=None)[source]
Parameters:
  • photo (InputFile | None)

  • added_sticker_file_ids (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputStoryContentPhoto]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputStoryContent']

classmethod getType()[source]
Return type:

Literal['inputStoryContentPhoto']

to_dict()[source]
Return type:

dict

added_sticker_file_ids: List[int]

File identifiers of the stickers added to the photo, if applicable

photo: Union[InputFileId, InputFileRemote, InputFileLocal, InputFileGenerated, None]

Photo to send. The photo must be at most 10 MB in size. The photo size must be 1080x1920

class pytdbot.types.InputStoryContentVideo(video=None, added_sticker_file_ids=None, duration=0.0, cover_frame_timestamp=0.0, is_animation=False)[source]

Bases: TlObject, InputStoryContent

A video story

Parameters:
  • video ("types.InputFile") – Video to be sent. The video size must be 720x1280. The video must be streamable and stored in MPEG4 format, after encoding with H.265 codec and key frames added each second

  • added_sticker_file_ids (List[int]) – File identifiers of the stickers added to the video, if applicable

  • duration (float) – Precise duration of the video, in seconds; 0-60

  • cover_frame_timestamp (float) – Timestamp of the frame, which will be used as video thumbnail

  • is_animation (bool) – True, if the video has no sound

__init__(video=None, added_sticker_file_ids=None, duration=0.0, cover_frame_timestamp=0.0, is_animation=False)[source]
Parameters:
  • video (InputFile | None)

  • added_sticker_file_ids (List[int] | None)

  • duration (float)

  • cover_frame_timestamp (float)

  • is_animation (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputStoryContentVideo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputStoryContent']

classmethod getType()[source]
Return type:

Literal['inputStoryContentVideo']

to_dict()[source]
Return type:

dict

added_sticker_file_ids: List[int]

File identifiers of the stickers added to the video, if applicable

cover_frame_timestamp: float

Timestamp of the frame, which will be used as video thumbnail

duration: float

Precise duration of the video, in seconds; 0-60

is_animation: bool

True, if the video has no sound

video: Union[InputFileId, InputFileRemote, InputFileLocal, InputFileGenerated, None]

Video to be sent. The video size must be 720x1280. The video must be streamable and stored in MPEG4 format, after encoding with H.265 codec and key frames added each second

class pytdbot.types.InputSuggestedPostInfo(price=None, send_date=0)[source]

Bases: TlObject

Contains information about a post to suggest

Parameters:
  • price ("types.SuggestedPostPrice") – Price of the suggested post; pass null to suggest a post without payment. If the current user isn’t an administrator of the channel direct messages chat and has no enough funds to pay for the post, then the error "BALANCE_TOO_LOW" will be returned immediately

  • send_date (int) – Point in time (Unix timestamp) when the post is expected to be published; pass 0 if the date isn’t restricted. If specified, then the date must be getOption("suggested_post_send_delay_min")-getOption("suggested_post_send_delay_max") seconds in the future

__init__(price=None, send_date=0)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputSuggestedPostInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputSuggestedPostInfo']

classmethod getType()[source]
Return type:

Literal['inputSuggestedPostInfo']

to_dict()[source]
Return type:

dict

price: Union[SuggestedPostPriceStar, SuggestedPostPriceTon, None]

Price of the suggested post; pass null to suggest a post without payment. If the current user isn’t an administrator of the channel direct messages chat and has no enough funds to pay for the post, then the error "BALANCE_TOO_LOW" will be returned immediately

send_date: int

Point in time (Unix timestamp) when the post is expected to be published; pass 0 if the date isn’t restricted. If specified, then the date must be getOption("suggested_post_send_delay_min")-getOption("suggested_post_send_delay_max") seconds in the future

class pytdbot.types.InputTextQuote(text=None, position=0)[source]

Bases: TlObject

Describes manually chosen quote from another message

Parameters:
  • text ("types.FormattedText") – Text of the quote; 0-getOption("message_reply_quote_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed to be kept and must be kept in the quote

  • position (int) – Quote position in the original message in UTF-16 code units

__init__(text=None, position=0)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputTextQuote]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputTextQuote']

classmethod getType()[source]
Return type:

Literal['inputTextQuote']

to_dict()[source]
Return type:

dict

position: int

Quote position in the original message in UTF-16 code units

text: Optional[FormattedText]

Text of the quote; 0-getOption("message_reply_quote_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed to be kept and must be kept in the quote

class pytdbot.types.InputThumbnail(thumbnail=None, width=0, height=0)[source]

Bases: TlObject

A thumbnail to be sent along with a file; must be in JPEG or WEBP format for stickers, and less than 200 KB in size

Parameters:
  • thumbnail ("types.InputFile") – Thumbnail file to send. Sending thumbnails by file_id is currently not supported

  • width (int) – Thumbnail width, usually shouldn’t exceed 320. Use 0 if unknown

  • height (int) – Thumbnail height, usually shouldn’t exceed 320. Use 0 if unknown

__init__(thumbnail=None, width=0, height=0)[source]
Parameters:
  • thumbnail (InputFile | None)

  • width (int)

  • height (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InputThumbnail]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InputThumbnail']

classmethod getType()[source]
Return type:

Literal['inputThumbnail']

to_dict()[source]
Return type:

dict

height: int

Thumbnail height, usually shouldn’t exceed 320. Use 0 if unknown

thumbnail: Union[InputFileId, InputFileRemote, InputFileLocal, InputFileGenerated, None]

Thumbnail file to send. Sending thumbnails by file_id is currently not supported

width: int

Thumbnail width, usually shouldn’t exceed 320. Use 0 if unknown

class pytdbot.types.InternalLinkType[source]

Bases: object

Describes an internal https://t.me or tg: link, which must be processed by the application in a special way

class pytdbot.types.InternalLinkTypeActiveSessions[source]

Bases: TlObject, InternalLinkType

The link is a link to the Devices section of the application. Use getActiveSessions to get the list of active sessions and show them to the user

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeActiveSessions]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeActiveSessions']

to_dict()[source]
Return type:

dict

class pytdbot.types.InternalLinkTypeAttachmentMenuBot(target_chat=None, bot_username='', url='')[source]

Bases: TlObject, InternalLinkType

The link is a link to an attachment menu bot to be opened in the specified or a chosen chat. Process given target_chat to open the chat. Then, call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. Then, use getAttachmentMenuBot to receive information about the bot. If the bot isn’t added to attachment menu, then show a disclaimer about Mini Apps being third-party applications, ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. If the attachment menu bot can’t be used in the opened chat, show an error to the user. If the bot is added to attachment menu and can be used in the chat, then use openWebApp with the given URL

Parameters:
  • target_chat ("types.TargetChat") – Target chat to be opened

  • bot_username (str) – Username of the bot

  • url (str) – URL to be passed to openWebApp

__init__(target_chat=None, bot_username='', url='')[source]
Parameters:
  • target_chat (TargetChat | None)

  • bot_username (str)

  • url (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeAttachmentMenuBot]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeAttachmentMenuBot']

to_dict()[source]
Return type:

dict

bot_username: Optional[str]

Username of the bot

target_chat: Union[TargetChatCurrent, TargetChatChosen, TargetChatInternalLink, None]

Target chat to be opened

url: Optional[str]

URL to be passed to openWebApp

class pytdbot.types.InternalLinkTypeAuthenticationCode(code='')[source]

Bases: TlObject, InternalLinkType

The link contains an authentication code. Call checkAuthenticationCode with the code if the current authorization state is authorizationStateWaitCode

Parameters:

code (str) – The authentication code

__init__(code='')[source]
Parameters:

code (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeAuthenticationCode]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeAuthenticationCode']

to_dict()[source]
Return type:

dict

code: Optional[str]

The authentication code

class pytdbot.types.InternalLinkTypeBackground(background_name='')[source]

Bases: TlObject, InternalLinkType

The link is a link to a background. Call searchBackground with the given background name to process the link. If background is found and the user wants to apply it, then call setDefaultBackground

Parameters:

background_name (str) – Name of the background

__init__(background_name='')[source]
Parameters:

background_name (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeBackground]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeBackground']

to_dict()[source]
Return type:

dict

background_name: Optional[str]

Name of the background

class pytdbot.types.InternalLinkTypeBotAddToChannel(bot_username='', administrator_rights=None)[source]

Bases: TlObject, InternalLinkType

The link is a link to a Telegram bot, which is expected to be added to a channel chat as an administrator. Call searchPublicChat with the given bot username and check that the user is a bot, ask the current user to select a channel chat to add the bot to as an administrator. Then, call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, check that the current user can edit its administrator rights and combine received rights with the requested administrator rights. Then, show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed rights

Parameters:
  • bot_username (str) – Username of the bot

  • administrator_rights ("types.ChatAdministratorRights") – Expected administrator rights for the bot

__init__(bot_username='', administrator_rights=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeBotAddToChannel]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeBotAddToChannel']

to_dict()[source]
Return type:

dict

administrator_rights: Optional[ChatAdministratorRights]

Expected administrator rights for the bot

bot_username: Optional[str]

Username of the bot

class pytdbot.types.InternalLinkTypeBotStart(bot_username='', start_parameter='', autostart=False)[source]

Bases: TlObject, InternalLinkType

The link is a link to a chat with a Telegram bot. Call searchPublicChat with the given bot username, check that the user is a bot, show START button in the chat with the bot, and then call sendBotStartMessage with the given start parameter after the button is pressed

Parameters:
  • bot_username (str) – Username of the bot

  • start_parameter (str) – The parameter to be passed to sendBotStartMessage

  • autostart (bool) – True, if sendBotStartMessage must be called automatically without showing the START button

__init__(bot_username='', start_parameter='', autostart=False)[source]
Parameters:
  • bot_username (str)

  • start_parameter (str)

  • autostart (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeBotStart]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeBotStart']

to_dict()[source]
Return type:

dict

autostart: bool

True, if sendBotStartMessage must be called automatically without showing the START button

bot_username: Optional[str]

Username of the bot

start_parameter: Optional[str]

The parameter to be passed to sendBotStartMessage

class pytdbot.types.InternalLinkTypeBotStartInGroup(bot_username='', start_parameter='', administrator_rights=None)[source]

Bases: TlObject, InternalLinkType

The link is a link to a Telegram bot, which is expected to be added to a group chat. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to groups, ask the current user to select a basic group or a supergroup chat to add the bot to, taking into account that bots can be added to a public supergroup only by administrators of the supergroup. If administrator rights are provided by the link, call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator, check that the current user can edit its administrator rights, combine received rights with the requested administrator rights, show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed administrator rights. Before call to setChatMemberStatus it may be required to upgrade the chosen basic group chat to a supergroup chat. Then, if start_parameter isn’t empty, call sendBotStartMessage with the given start parameter and the chosen chat; otherwise, just send /start message with bot’s username added to the chat

Parameters:
  • bot_username (str) – Username of the bot

  • start_parameter (str) – The parameter to be passed to sendBotStartMessage

  • administrator_rights ("types.ChatAdministratorRights") – Expected administrator rights for the bot; may be null

__init__(bot_username='', start_parameter='', administrator_rights=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeBotStartInGroup]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeBotStartInGroup']

to_dict()[source]
Return type:

dict

administrator_rights: Optional[ChatAdministratorRights]

Expected administrator rights for the bot; may be null

bot_username: Optional[str]

Username of the bot

start_parameter: Optional[str]

The parameter to be passed to sendBotStartMessage

class pytdbot.types.InternalLinkTypeBusinessChat(link_name='')[source]

Bases: TlObject, InternalLinkType

The link is a link to a business chat. Use getBusinessChatLinkInfo with the provided link name to get information about the link, then open received private chat and replace chat draft with the provided text

Parameters:

link_name (str) – Name of the link

__init__(link_name='')[source]
Parameters:

link_name (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeBusinessChat]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeBusinessChat']

to_dict()[source]
Return type:

dict

link_name: Optional[str]

Name of the link

class pytdbot.types.InternalLinkTypeBuyStars(star_count=0, purpose='')[source]

Bases: TlObject, InternalLinkType

The link is a link to the Telegram Star purchase section of the application

Parameters:
  • star_count (int) – The number of Telegram Stars that must be owned by the user

  • purpose (str) – Purpose of Telegram Star purchase. Arbitrary string specified by the server, for example, "subs" if the Telegram Stars are required to extend channel subscriptions

__init__(star_count=0, purpose='')[source]
Parameters:
  • star_count (int)

  • purpose (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeBuyStars]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeBuyStars']

to_dict()[source]
Return type:

dict

purpose: Optional[str]

Purpose of Telegram Star purchase. Arbitrary string specified by the server, for example, "subs" if the Telegram Stars are required to extend channel subscriptions

star_count: int

The number of Telegram Stars that must be owned by the user

class pytdbot.types.InternalLinkTypeChangePhoneNumber[source]

Bases: TlObject, InternalLinkType

The link is a link to the change phone number section of the application

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeChangePhoneNumber]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeChangePhoneNumber']

to_dict()[source]
Return type:

dict

class pytdbot.types.InternalLinkTypeChatAffiliateProgram(username='', referrer='')[source]

Bases: TlObject, InternalLinkType

The link is an affiliate program link. Call searchChatAffiliateProgram with the given username and referrer to process the link

Parameters:
  • username (str) – Username to be passed to searchChatAffiliateProgram

  • referrer (str) – Referrer to be passed to searchChatAffiliateProgram

__init__(username='', referrer='')[source]
Parameters:
  • username (str)

  • referrer (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeChatAffiliateProgram]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeChatAffiliateProgram']

to_dict()[source]
Return type:

dict

referrer: Optional[str]

Referrer to be passed to searchChatAffiliateProgram

username: Optional[str]

Username to be passed to searchChatAffiliateProgram

class pytdbot.types.InternalLinkTypeChatBoost(url='')[source]

Bases: TlObject, InternalLinkType

The link is a link to boost a Telegram chat. Call getChatBoostLinkInfo with the given URL to process the link. If the chat is found, then call getChatBoostStatus and getAvailableChatBoostSlots to get the current boost status and check whether the chat can be boosted. If the user wants to boost the chat and the chat can be boosted, then call boostChat

Parameters:

url (str) – URL to be passed to getChatBoostLinkInfo

__init__(url='')[source]
Parameters:

url (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeChatBoost]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeChatBoost']

to_dict()[source]
Return type:

dict

url: Optional[str]

URL to be passed to getChatBoostLinkInfo

class pytdbot.types.InternalLinkTypeChatFolderInvite(invite_link='')[source]

Bases: TlObject, InternalLinkType

The link is an invite link to a chat folder. Call checkChatFolderInviteLink with the given invite link to process the link. If the link is valid and the user wants to join the chat folder, then call addChatFolderByInviteLink

Parameters:

invite_link (str) – Internal representation of the invite link

__init__(invite_link='')[source]
Parameters:

invite_link (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeChatFolderInvite]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeChatFolderInvite']

to_dict()[source]
Return type:

dict

invite_link: Optional[str]

Internal representation of the invite link

class pytdbot.types.InternalLinkTypeChatFolderSettings[source]

Bases: TlObject, InternalLinkType

The link is a link to the folder section of the application settings

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeChatFolderSettings]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeChatFolderSettings']

to_dict()[source]
Return type:

dict

class pytdbot.types.InternalLinkTypeChatInvite(invite_link='')[source]

Bases: TlObject, InternalLinkType

The link is a chat invite link. Call checkChatInviteLink with the given invite link to process the link. If the link is valid and the user wants to join the chat, then call joinChatByInviteLink

Parameters:

invite_link (str) – Internal representation of the invite link

__init__(invite_link='')[source]
Parameters:

invite_link (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeChatInvite]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeChatInvite']

to_dict()[source]
Return type:

dict

invite_link: Optional[str]

Internal representation of the invite link

class pytdbot.types.InternalLinkTypeDefaultMessageAutoDeleteTimerSettings[source]

Bases: TlObject, InternalLinkType

The link is a link to the default message auto-delete timer settings section of the application settings

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeDefaultMessageAutoDeleteTimerSettings]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeDefaultMessageAutoDeleteTimerSettings']

to_dict()[source]
Return type:

dict

class pytdbot.types.InternalLinkTypeDirectMessagesChat(channel_username='')[source]

Bases: TlObject, InternalLinkType

The link is a link to a channel direct messages chat by username of the channel. Call searchPublicChat with the given chat username to process the link. If the chat is found and is channel, open the direct messages chat of the channel

Parameters:

channel_username (str) – Username of the channel

__init__(channel_username='')[source]
Parameters:

channel_username (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeDirectMessagesChat]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeDirectMessagesChat']

to_dict()[source]
Return type:

dict

channel_username: Optional[str]

Username of the channel

class pytdbot.types.InternalLinkTypeEditProfileSettings[source]

Bases: TlObject, InternalLinkType

The link is a link to the edit profile section of the application settings

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeEditProfileSettings]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeEditProfileSettings']

to_dict()[source]
Return type:

dict

class pytdbot.types.InternalLinkTypeGame(bot_username='', game_short_name='')[source]

Bases: TlObject, InternalLinkType

The link is a link to a game. Call searchPublicChat with the given bot username, check that the user is a bot, ask the current user to select a chat to send the game, and then call sendMessage with inputMessageGame

Parameters:
  • bot_username (str) – Username of the bot that owns the game

  • game_short_name (str) – Short name of the game

__init__(bot_username='', game_short_name='')[source]
Parameters:
  • bot_username (str)

  • game_short_name (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeGame]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeGame']

to_dict()[source]
Return type:

dict

bot_username: Optional[str]

Username of the bot that owns the game

game_short_name: Optional[str]

Short name of the game

class pytdbot.types.InternalLinkTypeGiftCollection(gift_owner_username='', collection_id=0)[source]

Bases: TlObject, InternalLinkType

The link is a link to a gift collection. Call searchPublicChat with the given username, then call getReceivedGifts with the received gift owner identifier and the given collection identifier, then show the collection if received

Parameters:
  • gift_owner_username (str) – Username of the owner of the gift collection

  • collection_id (int) – Gift collection identifier

__init__(gift_owner_username='', collection_id=0)[source]
Parameters:
  • gift_owner_username (str)

  • collection_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeGiftCollection]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeGiftCollection']

to_dict()[source]
Return type:

dict

collection_id: int

Gift collection identifier

gift_owner_username: Optional[str]

Username of the owner of the gift collection

class pytdbot.types.InternalLinkTypeGroupCall(invite_link='')[source]

Bases: TlObject, InternalLinkType

The link is a link to a group call that isn’t bound to a chat. Use getGroupCallParticipants to get the list of group call participants and show them on the join group call screen. Call joinGroupCall with the given invite_link to join the call

Parameters:

invite_link (str) – Internal representation of the invite link

__init__(invite_link='')[source]
Parameters:

invite_link (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeGroupCall]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeGroupCall']

to_dict()[source]
Return type:

dict

invite_link: Optional[str]

Internal representation of the invite link

class pytdbot.types.InternalLinkTypeInstantView(url='', fallback_url='')[source]

Bases: TlObject, InternalLinkType

The link must be opened in an Instant View. Call getWebPageInstantView with the given URL to process the link. If Instant View is found, then show it, otherwise, open the fallback URL in an external browser

Parameters:
  • url (str) – URL to be passed to getWebPageInstantView

  • fallback_url (str) – An URL to open if getWebPageInstantView fails

__init__(url='', fallback_url='')[source]
Parameters:
  • url (str)

  • fallback_url (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeInstantView]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeInstantView']

to_dict()[source]
Return type:

dict

fallback_url: Optional[str]

An URL to open if getWebPageInstantView fails

url: Optional[str]

URL to be passed to getWebPageInstantView

class pytdbot.types.InternalLinkTypeInvoice(invoice_name='')[source]

Bases: TlObject, InternalLinkType

The link is a link to an invoice. Call getPaymentForm with the given invoice name to process the link

Parameters:

invoice_name (str) – Name of the invoice

__init__(invoice_name='')[source]
Parameters:

invoice_name (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeInvoice]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeInvoice']

to_dict()[source]
Return type:

dict

invoice_name: Optional[str]

Name of the invoice

class pytdbot.types.InternalLinkTypeLanguagePack(language_pack_id='')[source]

Bases: TlObject, InternalLinkType

The link is a link to a language pack. Call getLanguagePackInfo with the given language pack identifier to process the link. If the language pack is found and the user wants to apply it, then call setOption for the option "language_pack_id"

Parameters:

language_pack_id (str) – Language pack identifier

__init__(language_pack_id='')[source]
Parameters:

language_pack_id (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeLanguagePack]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeLanguagePack']

to_dict()[source]
Return type:

dict

language_pack_id: Optional[str]

Language pack identifier

class pytdbot.types.InternalLinkTypeLanguageSettings[source]

Bases: TlObject, InternalLinkType

The link is a link to the language section of the application settings

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeLanguageSettings]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeLanguageSettings']

to_dict()[source]
Return type:

dict

class pytdbot.types.InternalLinkTypeMainWebApp(bot_username='', start_parameter='', mode=None)[source]

Bases: TlObject, InternalLinkType

The link is a link to the main Web App of a bot. Call searchPublicChat with the given bot username, check that the user is a bot and has the main Web App. If the bot can be added to attachment menu, then use getAttachmentMenuBot to receive information about the bot, then if the bot isn’t added to side menu, show a disclaimer about Mini Apps being third-party applications, ask the user to accept their Terms of service and confirm adding the bot to side and attachment menu, then if the user accepts the terms and confirms adding, use toggleBotIsAddedToAttachmentMenu to add the bot. Then, use getMainWebApp with the given start parameter and mode and open the returned URL as a Web App

Parameters:
  • bot_username (str) – Username of the bot

  • start_parameter (str) – Start parameter to be passed to getMainWebApp

  • mode ("types.WebAppOpenMode") – The mode to be passed to getMainWebApp

__init__(bot_username='', start_parameter='', mode=None)[source]
Parameters:
  • bot_username (str)

  • start_parameter (str)

  • mode (WebAppOpenMode | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeMainWebApp]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeMainWebApp']

to_dict()[source]
Return type:

dict

bot_username: Optional[str]

Username of the bot

mode: Union[WebAppOpenModeCompact, WebAppOpenModeFullSize, WebAppOpenModeFullScreen, None]

The mode to be passed to getMainWebApp

start_parameter: Optional[str]

Start parameter to be passed to getMainWebApp

class pytdbot.types.InternalLinkTypeMessage(url='')[source]

Bases: TlObject, InternalLinkType

The link is a link to a Telegram message or a forum topic. Call getMessageLinkInfo with the given URL to process the link, and then open received forum topic or chat and show the message there

Parameters:

url (str) – URL to be passed to getMessageLinkInfo

__init__(url='')[source]
Parameters:

url (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeMessage]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeMessage']

to_dict()[source]
Return type:

dict

url: Optional[str]

URL to be passed to getMessageLinkInfo

class pytdbot.types.InternalLinkTypeMessageDraft(text=None, contains_link=False)[source]

Bases: TlObject, InternalLinkType

The link contains a message draft text. A share screen needs to be shown to the user, then the chosen chat must be opened and the text is added to the input field

Parameters:
  • text ("types.FormattedText") – Message draft text

  • contains_link (bool) – True, if the first line of the text contains a link. If true, the input field needs to be focused and the text after the link must be selected

__init__(text=None, contains_link=False)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeMessageDraft]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeMessageDraft']

to_dict()[source]
Return type:

dict

contains_link: bool

True, if the first line of the text contains a link. If true, the input field needs to be focused and the text after the link must be selected

text: Optional[FormattedText]

Message draft text

class pytdbot.types.InternalLinkTypeMyStars[source]

Bases: TlObject, InternalLinkType

The link is a link to the screen with information about Telegram Star balance and transactions of the current user

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeMyStars]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeMyStars']

to_dict()[source]
Return type:

dict

class pytdbot.types.InternalLinkTypeMyToncoins[source]

Bases: TlObject, InternalLinkType

The link is a link to the screen with information about Toncoin balance and transactions of the current user

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeMyToncoins]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeMyToncoins']

to_dict()[source]
Return type:

dict

class pytdbot.types.InternalLinkTypePassportDataRequest(bot_user_id=0, scope='', public_key='', nonce='', callback_url='')[source]

Bases: TlObject, InternalLinkType

The link contains a request of Telegram passport data. Call getPassportAuthorizationForm with the given parameters to process the link if the link was received from outside of the application; otherwise, ignore it

Parameters:
  • bot_user_id (int) – User identifier of the service’s bot; the corresponding user may be unknown yet

  • scope (str) – Telegram Passport element types requested by the service

  • public_key (str) – Service’s public key

  • nonce (str) – Unique request identifier provided by the service

  • callback_url (str) – An HTTP URL to open once the request is finished, canceled, or failed with the parameters tg_passport=success, tg_passport=cancel, or tg_passport=error&error=... respectively. If empty, then onActivityResult method must be used to return response on Android, or the link tgbot{bot_user_id}://passport/success or tgbot{bot_user_id}://passport/cancel must be opened otherwise

__init__(bot_user_id=0, scope='', public_key='', nonce='', callback_url='')[source]
Parameters:
  • bot_user_id (int)

  • scope (str)

  • public_key (str)

  • nonce (str)

  • callback_url (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypePassportDataRequest]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypePassportDataRequest']

to_dict()[source]
Return type:

dict

bot_user_id: int

User identifier of the service’s bot; the corresponding user may be unknown yet

callback_url: Optional[str]

//passport/success or tgbot{bot_user_id}://passport/cancel must be opened otherwise

Type:

An HTTP URL to open once the request is finished, canceled, or failed with the parameters tg_passport=success, tg_passport=cancel, or tg_passport=error&error=… respectively. If empty, then onActivityResult method must be used to return response on Android, or the link tgbot{bot_user_id}

nonce: Optional[str]

Unique request identifier provided by the service

public_key: Optional[str]

Service’s public key

scope: Optional[str]

Telegram Passport element types requested by the service

class pytdbot.types.InternalLinkTypePhoneNumberConfirmation(hash='', phone_number='')[source]

Bases: TlObject, InternalLinkType

The link can be used to confirm ownership of a phone number to prevent account deletion. Call sendPhoneNumberCode with the given phone number and with phoneNumberCodeTypeConfirmOwnership with the given hash to process the link. If succeeded, call checkPhoneNumberCode to check entered by the user code, or resendPhoneNumberCode to resend it

Parameters:
  • hash (str) – Hash value from the link

  • phone_number (str) – Phone number value from the link

__init__(hash='', phone_number='')[source]
Parameters:
  • hash (str)

  • phone_number (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypePhoneNumberConfirmation]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypePhoneNumberConfirmation']

to_dict()[source]
Return type:

dict

hash: Optional[str]

Hash value from the link

phone_number: Optional[str]

Phone number value from the link

class pytdbot.types.InternalLinkTypePremiumFeatures(referrer='')[source]

Bases: TlObject, InternalLinkType

The link is a link to the Premium features screen of the application from which the user can subscribe to Telegram Premium. Call getPremiumFeatures with the given referrer to process the link

Parameters:

referrer (str) – Referrer specified in the link

__init__(referrer='')[source]
Parameters:

referrer (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypePremiumFeatures]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypePremiumFeatures']

to_dict()[source]
Return type:

dict

referrer: Optional[str]

Referrer specified in the link

class pytdbot.types.InternalLinkTypePremiumGift(referrer='')[source]

Bases: TlObject, InternalLinkType

The link is a link to the screen for gifting Telegram Premium subscriptions to friends via inputInvoiceTelegram with telegramPaymentPurposePremiumGift payments or in-store purchases

Parameters:

referrer (str) – Referrer specified in the link

__init__(referrer='')[source]
Parameters:

referrer (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypePremiumGift]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypePremiumGift']

to_dict()[source]
Return type:

dict

referrer: Optional[str]

Referrer specified in the link

class pytdbot.types.InternalLinkTypePremiumGiftCode(code='')[source]

Bases: TlObject, InternalLinkType

The link is a link with a Telegram Premium gift code. Call checkPremiumGiftCode with the given code to process the link. If the code is valid and the user wants to apply it, then call applyPremiumGiftCode

Parameters:

code (str) – The Telegram Premium gift code

__init__(code='')[source]
Parameters:

code (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypePremiumGiftCode]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypePremiumGiftCode']

to_dict()[source]
Return type:

dict

code: Optional[str]

The Telegram Premium gift code

class pytdbot.types.InternalLinkTypePrivacyAndSecuritySettings[source]

Bases: TlObject, InternalLinkType

The link is a link to the privacy and security section of the application settings

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypePrivacyAndSecuritySettings]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypePrivacyAndSecuritySettings']

to_dict()[source]
Return type:

dict

class pytdbot.types.InternalLinkTypeProxy(server='', port=0, type=None)[source]

Bases: TlObject, InternalLinkType

The link is a link to a proxy. Call addProxy with the given parameters to process the link and add the proxy

Parameters:
  • server (str) – Proxy server domain or IP address

  • port (int) – Proxy server port

  • type ("types.ProxyType") – Type of the proxy

__init__(server='', port=0, type=None)[source]
Parameters:
  • server (str)

  • port (int)

  • type (ProxyType | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeProxy]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeProxy']

to_dict()[source]
Return type:

dict

port: int

Proxy server port

server: Optional[str]

Proxy server domain or IP address

type: Union[ProxyTypeSocks5, ProxyTypeHttp, ProxyTypeMtproto, None]

Type of the proxy

class pytdbot.types.InternalLinkTypePublicChat(chat_username='', draft_text='', open_profile=False)[source]

Bases: TlObject, InternalLinkType

The link is a link to a chat by its username. Call searchPublicChat with the given chat username to process the link. If the chat is found, open its profile information screen or the chat itself. If draft text isn’t empty and the chat is a private chat with a regular user, then put the draft text in the input field

Parameters:
  • chat_username (str) – Username of the chat

  • draft_text (str) – Draft text for message to send in the chat

  • open_profile (bool) – True, if chat profile information screen must be opened; otherwise, the chat itself must be opened

__init__(chat_username='', draft_text='', open_profile=False)[source]
Parameters:
  • chat_username (str)

  • draft_text (str)

  • open_profile (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypePublicChat]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypePublicChat']

to_dict()[source]
Return type:

dict

chat_username: Optional[str]

Username of the chat

draft_text: Optional[str]

Draft text for message to send in the chat

open_profile: bool

True, if chat profile information screen must be opened; otherwise, the chat itself must be opened

class pytdbot.types.InternalLinkTypeQrCodeAuthentication[source]

Bases: TlObject, InternalLinkType

The link can be used to login the current user on another device, but it must be scanned from QR-code using in-app camera. An alert similar to "This code can be used to allow someone to log in to your Telegram account. To confirm Telegram login, please go to Settings > Devices > Scan QR and scan the code" needs to be shown

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeQrCodeAuthentication]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeQrCodeAuthentication']

to_dict()[source]
Return type:

dict

class pytdbot.types.InternalLinkTypeRestorePurchases[source]

Bases: TlObject, InternalLinkType

The link forces restore of App Store purchases when opened. For official iOS application only

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeRestorePurchases]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeRestorePurchases']

to_dict()[source]
Return type:

dict

class pytdbot.types.InternalLinkTypeSettings[source]

Bases: TlObject, InternalLinkType

The link is a link to application settings

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeSettings]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeSettings']

to_dict()[source]
Return type:

dict

class pytdbot.types.InternalLinkTypeStickerSet(sticker_set_name='', expect_custom_emoji=False)[source]

Bases: TlObject, InternalLinkType

The link is a link to a sticker set. Call searchStickerSet with the given sticker set name to process the link and show the sticker set. If the sticker set is found and the user wants to add it, then call changeStickerSet

Parameters:
  • sticker_set_name (str) – Name of the sticker set

  • expect_custom_emoji (bool) – True, if the sticker set is expected to contain custom emoji

__init__(sticker_set_name='', expect_custom_emoji=False)[source]
Parameters:
  • sticker_set_name (str)

  • expect_custom_emoji (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeStickerSet]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeStickerSet']

to_dict()[source]
Return type:

dict

expect_custom_emoji: bool

True, if the sticker set is expected to contain custom emoji

sticker_set_name: Optional[str]

Name of the sticker set

class pytdbot.types.InternalLinkTypeStory(story_poster_username='', story_id=0)[source]

Bases: TlObject, InternalLinkType

The link is a link to a story. Call searchPublicChat with the given poster username, then call getStory with the received chat identifier and the given story identifier, then show the story if received

Parameters:
  • story_poster_username (str) – Username of the poster of the story

  • story_id (int) – Story identifier

__init__(story_poster_username='', story_id=0)[source]
Parameters:
  • story_poster_username (str)

  • story_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeStory]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeStory']

to_dict()[source]
Return type:

dict

story_id: int

Story identifier

story_poster_username: Optional[str]

Username of the poster of the story

class pytdbot.types.InternalLinkTypeStoryAlbum(story_album_owner_username='', story_album_id=0)[source]

Bases: TlObject, InternalLinkType

The link is a link to an album of stories. Call searchPublicChat with the given username, then call getStoryAlbumStories with the received chat identifier and the given story album identifier, then show the story album if received

Parameters:
  • story_album_owner_username (str) – Username of the owner of the story album

  • story_album_id (int) – Story album identifier

__init__(story_album_owner_username='', story_album_id=0)[source]
Parameters:
  • story_album_owner_username (str)

  • story_album_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeStoryAlbum]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeStoryAlbum']

to_dict()[source]
Return type:

dict

story_album_id: int

Story album identifier

story_album_owner_username: Optional[str]

Username of the owner of the story album

class pytdbot.types.InternalLinkTypeTheme(theme_name='')[source]

Bases: TlObject, InternalLinkType

The link is a link to a cloud theme. TDLib has no theme support yet

Parameters:

theme_name (str) – Name of the theme

__init__(theme_name='')[source]
Parameters:

theme_name (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeTheme]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeTheme']

to_dict()[source]
Return type:

dict

theme_name: Optional[str]

Name of the theme

class pytdbot.types.InternalLinkTypeThemeSettings[source]

Bases: TlObject, InternalLinkType

The link is a link to the theme section of the application settings

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeThemeSettings]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeThemeSettings']

to_dict()[source]
Return type:

dict

class pytdbot.types.InternalLinkTypeUnknownDeepLink(link='')[source]

Bases: TlObject, InternalLinkType

The link is an unknown tg: link. Call getDeepLinkInfo to process the link

Parameters:

link (str) – Link to be passed to getDeepLinkInfo

__init__(link='')[source]
Parameters:

link (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeUnknownDeepLink]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeUnknownDeepLink']

to_dict()[source]
Return type:

dict

link: Optional[str]

Link to be passed to getDeepLinkInfo

class pytdbot.types.InternalLinkTypeUnsupportedProxy[source]

Bases: TlObject, InternalLinkType

The link is a link to an unsupported proxy. An alert can be shown to the user

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeUnsupportedProxy]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeUnsupportedProxy']

to_dict()[source]
Return type:

dict

class pytdbot.types.InternalLinkTypeUpgradedGift(name='')[source]

Bases: TlObject, InternalLinkType

The link is a link to an upgraded gift. Call getUpgradedGift with the given name to process the link

Parameters:

name (str) – Name of the unique gift

__init__(name='')[source]
Parameters:

name (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeUpgradedGift]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeUpgradedGift']

to_dict()[source]
Return type:

dict

name: Optional[str]

Name of the unique gift

class pytdbot.types.InternalLinkTypeUserPhoneNumber(phone_number='', draft_text='', open_profile=False)[source]

Bases: TlObject, InternalLinkType

The link is a link to a user by its phone number. Call searchUserByPhoneNumber with the given phone number to process the link. If the user is found, then call createPrivateChat and open user’s profile information screen or the chat itself. If draft text isn’t empty, then put the draft text in the input field

Parameters:
  • phone_number (str) – Phone number of the user

  • draft_text (str) – Draft text for message to send in the chat

  • open_profile (bool) – True, if user’s profile information screen must be opened; otherwise, the chat itself must be opened

__init__(phone_number='', draft_text='', open_profile=False)[source]
Parameters:
  • phone_number (str)

  • draft_text (str)

  • open_profile (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeUserPhoneNumber]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeUserPhoneNumber']

to_dict()[source]
Return type:

dict

draft_text: Optional[str]

Draft text for message to send in the chat

open_profile: bool

True, if user’s profile information screen must be opened; otherwise, the chat itself must be opened

phone_number: Optional[str]

Phone number of the user

class pytdbot.types.InternalLinkTypeUserToken(token='')[source]

Bases: TlObject, InternalLinkType

The link is a link to a user by a temporary token. Call searchUserByToken with the given token to process the link. If the user is found, then call createPrivateChat and open the chat

Parameters:

token (str) – The token

__init__(token='')[source]
Parameters:

token (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeUserToken]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeUserToken']

to_dict()[source]
Return type:

dict

token: Optional[str]

The token

class pytdbot.types.InternalLinkTypeVideoChat(chat_username='', invite_hash='', is_live_stream=False)[source]

Bases: TlObject, InternalLinkType

The link is a link to a video chat. Call searchPublicChat with the given chat username, and then joinVideoChat with the given invite hash to process the link

Parameters:
  • chat_username (str) – Username of the chat with the video chat

  • invite_hash (str) – If non-empty, invite hash to be used to join the video chat without being muted by administrators

  • is_live_stream (bool) – True, if the video chat is expected to be a live stream in a channel or a broadcast group

__init__(chat_username='', invite_hash='', is_live_stream=False)[source]
Parameters:
  • chat_username (str)

  • invite_hash (str)

  • is_live_stream (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeVideoChat]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeVideoChat']

to_dict()[source]
Return type:

dict

chat_username: Optional[str]

Username of the chat with the video chat

invite_hash: Optional[str]

If non-empty, invite hash to be used to join the video chat without being muted by administrators

is_live_stream: bool

True, if the video chat is expected to be a live stream in a channel or a broadcast group

class pytdbot.types.InternalLinkTypeWebApp(bot_username='', web_app_short_name='', start_parameter='', mode=None)[source]

Bases: TlObject, InternalLinkType

The link is a link to a Web App. Call searchPublicChat with the given bot username, check that the user is a bot. If the bot is restricted for the current user, then show an error message. Otherwise, call searchWebApp with the received bot and the given web_app_short_name. Process received foundWebApp by showing a confirmation dialog if needed. If the bot can be added to attachment or side menu, but isn’t added yet, then show a disclaimer about Mini Apps being third-party applications instead of the dialog and ask the user to accept their Terms of service. If the user accept the terms and confirms adding, then use toggleBotIsAddedToAttachmentMenu to add the bot. Then, call getWebAppLinkUrl and open the returned URL as a Web App

Parameters:
  • bot_username (str) – Username of the bot that owns the Web App

  • web_app_short_name (str) – Short name of the Web App

  • start_parameter (str) – Start parameter to be passed to getWebAppLinkUrl

  • mode ("types.WebAppOpenMode") – The mode in which the Web App must be opened

__init__(bot_username='', web_app_short_name='', start_parameter='', mode=None)[source]
Parameters:
  • bot_username (str)

  • web_app_short_name (str)

  • start_parameter (str)

  • mode (WebAppOpenMode | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InternalLinkTypeWebApp]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InternalLinkType']

classmethod getType()[source]
Return type:

Literal['internalLinkTypeWebApp']

to_dict()[source]
Return type:

dict

bot_username: Optional[str]

Username of the bot that owns the Web App

mode: Union[WebAppOpenModeCompact, WebAppOpenModeFullSize, WebAppOpenModeFullScreen, None]

The mode in which the Web App must be opened

start_parameter: Optional[str]

Start parameter to be passed to getWebAppLinkUrl

web_app_short_name: Optional[str]

Short name of the Web App

class pytdbot.types.InviteGroupCallParticipantResult[source]

Bases: object

Describes result of group call participant invitation

class pytdbot.types.InviteGroupCallParticipantResultSuccess(chat_id=0, message_id=0)[source]

Bases: TlObject, InviteGroupCallParticipantResult

The user was invited and a service message of the type messageGroupCall was sent which can be used in declineGroupCallInvitation to cancel the invitation

Parameters:
  • chat_id (int) – Identifier of the chat with the invitation message

  • message_id (int) – Identifier of the message

__init__(chat_id=0, message_id=0)[source]
Parameters:
  • chat_id (int)

  • message_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InviteGroupCallParticipantResultSuccess]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InviteGroupCallParticipantResult']

classmethod getType()[source]
Return type:

Literal['inviteGroupCallParticipantResultSuccess']

to_dict()[source]
Return type:

dict

chat_id: int

Identifier of the chat with the invitation message

message_id: int

Identifier of the message

class pytdbot.types.InviteGroupCallParticipantResultUserAlreadyParticipant[source]

Bases: TlObject, InviteGroupCallParticipantResult

The user can’t be invited because they are already a participant of the call

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InviteGroupCallParticipantResultUserAlreadyParticipant]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InviteGroupCallParticipantResult']

classmethod getType()[source]
Return type:

Literal['inviteGroupCallParticipantResultUserAlreadyParticipant']

to_dict()[source]
Return type:

dict

class pytdbot.types.InviteGroupCallParticipantResultUserPrivacyRestricted[source]

Bases: TlObject, InviteGroupCallParticipantResult

The user can’t be invited due to their privacy settings

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InviteGroupCallParticipantResultUserPrivacyRestricted]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InviteGroupCallParticipantResult']

classmethod getType()[source]
Return type:

Literal['inviteGroupCallParticipantResultUserPrivacyRestricted']

to_dict()[source]
Return type:

dict

class pytdbot.types.InviteGroupCallParticipantResultUserWasBanned[source]

Bases: TlObject, InviteGroupCallParticipantResult

The user can’t be invited because they were banned by the owner of the call and can be invited back only by the owner of the group call

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InviteGroupCallParticipantResultUserWasBanned]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InviteGroupCallParticipantResult']

classmethod getType()[source]
Return type:

Literal['inviteGroupCallParticipantResultUserWasBanned']

to_dict()[source]
Return type:

dict

class pytdbot.types.InviteLinkChatType[source]

Bases: object

Describes the type of chat to which points an invite link

class pytdbot.types.InviteLinkChatTypeBasicGroup[source]

Bases: TlObject, InviteLinkChatType

The link is an invite link for a basic group

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InviteLinkChatTypeBasicGroup]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InviteLinkChatType']

classmethod getType()[source]
Return type:

Literal['inviteLinkChatTypeBasicGroup']

to_dict()[source]
Return type:

dict

class pytdbot.types.InviteLinkChatTypeChannel[source]

Bases: TlObject, InviteLinkChatType

The link is an invite link for a channel

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InviteLinkChatTypeChannel]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InviteLinkChatType']

classmethod getType()[source]
Return type:

Literal['inviteLinkChatTypeChannel']

to_dict()[source]
Return type:

dict

class pytdbot.types.InviteLinkChatTypeSupergroup[source]

Bases: TlObject, InviteLinkChatType

The link is an invite link for a supergroup

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[InviteLinkChatTypeSupergroup]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['InviteLinkChatType']

classmethod getType()[source]
Return type:

Literal['inviteLinkChatTypeSupergroup']

to_dict()[source]
Return type:

dict

class pytdbot.types.Invoice(currency='', price_parts=None, subscription_period=0, max_tip_amount=0, suggested_tip_amounts=None, recurring_payment_terms_of_service_url='', terms_of_service_url='', is_test=False, need_name=False, need_phone_number=False, need_email_address=False, need_shipping_address=False, send_phone_number_to_provider=False, send_email_address_to_provider=False, is_flexible=False)[source]

Bases: TlObject

Product invoice

Parameters:
  • currency (str) – ISO 4217 currency code

  • price_parts (List["types.LabeledPricePart"]) – A list of objects used to calculate the total price of the product

  • subscription_period (int) – The number of seconds between consecutive Telegram Star debiting for subscription invoices; 0 if the invoice doesn’t create subscription

  • max_tip_amount (int) – The maximum allowed amount of tip in the smallest units of the currency

  • suggested_tip_amounts (List[int]) – Suggested amounts of tip in the smallest units of the currency

  • recurring_payment_terms_of_service_url (str) – An HTTP URL with terms of service for recurring payments. If non-empty, the invoice payment will result in recurring payments and the user must accept the terms of service before allowed to pay

  • terms_of_service_url (str) – An HTTP URL with terms of service for non-recurring payments. If non-empty, then the user must accept the terms of service before allowed to pay

  • is_test (bool) – True, if the payment is a test payment

  • need_name (bool) – True, if the user’s name is needed for payment

  • need_phone_number (bool) – True, if the user’s phone number is needed for payment

  • need_email_address (bool) – True, if the user’s email address is needed for payment

  • need_shipping_address (bool) – True, if the user’s shipping address is needed for payment

  • send_phone_number_to_provider (bool) – True, if the user’s phone number will be sent to the provider

  • send_email_address_to_provider (bool) – True, if the user’s email address will be sent to the provider

  • is_flexible (bool) – True, if the total price depends on the shipping method

__init__(currency='', price_parts=None, subscription_period=0, max_tip_amount=0, suggested_tip_amounts=None, recurring_payment_terms_of_service_url='', terms_of_service_url='', is_test=False, need_name=False, need_phone_number=False, need_email_address=False, need_shipping_address=False, send_phone_number_to_provider=False, send_email_address_to_provider=False, is_flexible=False)[source]
Parameters:
  • currency (str)

  • price_parts (List[LabeledPricePart] | None)

  • subscription_period (int)

  • max_tip_amount (int)

  • suggested_tip_amounts (List[int] | None)

  • recurring_payment_terms_of_service_url (str)

  • terms_of_service_url (str)

  • is_test (bool)

  • need_name (bool)

  • need_phone_number (bool)

  • need_email_address (bool)

  • need_shipping_address (bool)

  • send_phone_number_to_provider (bool)

  • send_email_address_to_provider (bool)

  • is_flexible (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Invoice]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Invoice']

classmethod getType()[source]
Return type:

Literal['invoice']

to_dict()[source]
Return type:

dict

currency: Optional[str]

ISO 4217 currency code

is_flexible: bool

True, if the total price depends on the shipping method

is_test: bool

True, if the payment is a test payment

max_tip_amount: int

The maximum allowed amount of tip in the smallest units of the currency

need_email_address: bool

True, if the user’s email address is needed for payment

need_name: bool

True, if the user’s name is needed for payment

need_phone_number: bool

True, if the user’s phone number is needed for payment

need_shipping_address: bool

True, if the user’s shipping address is needed for payment

price_parts: List[LabeledPricePart]

A list of objects used to calculate the total price of the product

recurring_payment_terms_of_service_url: Optional[str]

An HTTP URL with terms of service for recurring payments. If non-empty, the invoice payment will result in recurring payments and the user must accept the terms of service before allowed to pay

send_email_address_to_provider: bool

True, if the user’s email address will be sent to the provider

send_phone_number_to_provider: bool

True, if the user’s phone number will be sent to the provider

subscription_period: int

The number of seconds between consecutive Telegram Star debiting for subscription invoices; 0 if the invoice doesn’t create subscription

suggested_tip_amounts: List[int]

Suggested amounts of tip in the smallest units of the currency

terms_of_service_url: Optional[str]

An HTTP URL with terms of service for non-recurring payments. If non-empty, then the user must accept the terms of service before allowed to pay

class pytdbot.types.JsonObjectMember(key='', value=None)[source]

Bases: TlObject

Represents one member of a JSON object

Parameters:
  • key (str) – Member’s key

  • value ("types.JsonValue") – Member’s value

__init__(key='', value=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[JsonObjectMember]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['JsonObjectMember']

classmethod getType()[source]
Return type:

Literal['jsonObjectMember']

to_dict()[source]
Return type:

dict

key: Optional[str]

Member’s key

value: Union[JsonValueNull, JsonValueBoolean, JsonValueNumber, JsonValueString, JsonValueArray, JsonValueObject, None]

Member’s value

class pytdbot.types.JsonValue[source]

Bases: object

Represents a JSON value

class pytdbot.types.JsonValueArray(values=None)[source]

Bases: TlObject, JsonValue

Represents a JSON array

Parameters:

values (List["types.JsonValue"]) – The list of array elements

__init__(values=None)[source]
Parameters:

values (List[JsonValue] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[JsonValueArray]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['JsonValue']

classmethod getType()[source]
Return type:

Literal['jsonValueArray']

to_dict()[source]
Return type:

dict

values: List[JsonValue]

The list of array elements

class pytdbot.types.JsonValueBoolean(value=False)[source]

Bases: TlObject, JsonValue

Represents a boolean JSON value

Parameters:

value (bool) – The value

__init__(value=False)[source]
Parameters:

value (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[JsonValueBoolean]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['JsonValue']

classmethod getType()[source]
Return type:

Literal['jsonValueBoolean']

to_dict()[source]
Return type:

dict

value: bool

The value

class pytdbot.types.JsonValueNull[source]

Bases: TlObject, JsonValue

Represents a null JSON value

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[JsonValueNull]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['JsonValue']

classmethod getType()[source]
Return type:

Literal['jsonValueNull']

to_dict()[source]
Return type:

dict

class pytdbot.types.JsonValueNumber(value=0.0)[source]

Bases: TlObject, JsonValue

Represents a numeric JSON value

Parameters:

value (float) – The value

__init__(value=0.0)[source]
Parameters:

value (float)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[JsonValueNumber]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['JsonValue']

classmethod getType()[source]
Return type:

Literal['jsonValueNumber']

to_dict()[source]
Return type:

dict

value: float

The value

class pytdbot.types.JsonValueObject(members=None)[source]

Bases: TlObject, JsonValue

Represents a JSON object

Parameters:

members (List["types.JsonObjectMember"]) – The list of object members

__init__(members=None)[source]
Parameters:

members (List[JsonObjectMember] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[JsonValueObject]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['JsonValue']

classmethod getType()[source]
Return type:

Literal['jsonValueObject']

to_dict()[source]
Return type:

dict

members: List[JsonObjectMember]

The list of object members

class pytdbot.types.JsonValueString(value='')[source]

Bases: TlObject, JsonValue

Represents a string JSON value

Parameters:

value (str) – The value

__init__(value='')[source]
Parameters:

value (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[JsonValueString]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['JsonValue']

classmethod getType()[source]
Return type:

Literal['jsonValueString']

to_dict()[source]
Return type:

dict

value: Optional[str]

The value

class pytdbot.types.KeyboardButton(text='', type=None)[source]

Bases: TlObject

Represents a single button in a bot keyboard

Parameters:
  • text (str) – Text of the button

  • type ("types.KeyboardButtonType") – Type of the button

__init__(text='', type=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[KeyboardButton]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['KeyboardButton']

classmethod getType()[source]
Return type:

Literal['keyboardButton']

to_dict()[source]
Return type:

dict

text: Optional[str]

Text of the button

type: Union[KeyboardButtonTypeText, KeyboardButtonTypeRequestPhoneNumber, KeyboardButtonTypeRequestLocation, KeyboardButtonTypeRequestPoll, KeyboardButtonTypeRequestUsers, KeyboardButtonTypeRequestChat, KeyboardButtonTypeWebApp, None]

Type of the button

class pytdbot.types.KeyboardButtonType[source]

Bases: object

Describes a keyboard button type

class pytdbot.types.KeyboardButtonTypeRequestChat(id=0, chat_is_channel=False, restrict_chat_is_forum=False, chat_is_forum=False, restrict_chat_has_username=False, chat_has_username=False, chat_is_created=False, user_administrator_rights=None, bot_administrator_rights=None, bot_is_member=False, request_title=False, request_username=False, request_photo=False)[source]

Bases: TlObject, KeyboardButtonType

A button that requests a chat to be shared by the current user; available only in private chats. Use the method shareChatWithBot to complete the request

Parameters:
  • id (int) – Unique button identifier

  • chat_is_channel (bool) – True, if the chat must be a channel; otherwise, a basic group or a supergroup chat is shared

  • restrict_chat_is_forum (bool) – True, if the chat must or must not be a forum supergroup

  • chat_is_forum (bool) – True, if the chat must be a forum supergroup; otherwise, the chat must not be a forum supergroup. Ignored if restrict_chat_is_forum is false

  • restrict_chat_has_username (bool) – True, if the chat must or must not have a username

  • chat_has_username (bool) – True, if the chat must have a username; otherwise, the chat must not have a username. Ignored if restrict_chat_has_username is false

  • chat_is_created (bool) – True, if the chat must be created by the current user

  • user_administrator_rights ("types.ChatAdministratorRights") – Expected user administrator rights in the chat; may be null if they aren’t restricted

  • bot_administrator_rights ("types.ChatAdministratorRights") – Expected bot administrator rights in the chat; may be null if they aren’t restricted

  • bot_is_member (bool) – True, if the bot must be a member of the chat; for basic group and supergroup chats only

  • request_title (bool) – Pass true to request title of the chat; bots only

  • request_username (bool) – Pass true to request username of the chat; bots only

  • request_photo (bool) – Pass true to request photo of the chat; bots only

__init__(id=0, chat_is_channel=False, restrict_chat_is_forum=False, chat_is_forum=False, restrict_chat_has_username=False, chat_has_username=False, chat_is_created=False, user_administrator_rights=None, bot_administrator_rights=None, bot_is_member=False, request_title=False, request_username=False, request_photo=False)[source]
Parameters:
  • id (int)

  • chat_is_channel (bool)

  • restrict_chat_is_forum (bool)

  • chat_is_forum (bool)

  • restrict_chat_has_username (bool)

  • chat_has_username (bool)

  • chat_is_created (bool)

  • user_administrator_rights (ChatAdministratorRights | None)

  • bot_administrator_rights (ChatAdministratorRights | None)

  • bot_is_member (bool)

  • request_title (bool)

  • request_username (bool)

  • request_photo (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[KeyboardButtonTypeRequestChat]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['KeyboardButtonType']

classmethod getType()[source]
Return type:

Literal['keyboardButtonTypeRequestChat']

to_dict()[source]
Return type:

dict

bot_administrator_rights: Optional[ChatAdministratorRights]

Expected bot administrator rights in the chat; may be null if they aren’t restricted

bot_is_member: bool

True, if the bot must be a member of the chat; for basic group and supergroup chats only

chat_has_username: bool

True, if the chat must have a username; otherwise, the chat must not have a username. Ignored if restrict_chat_has_username is false

chat_is_channel: bool

True, if the chat must be a channel; otherwise, a basic group or a supergroup chat is shared

chat_is_created: bool

True, if the chat must be created by the current user

chat_is_forum: bool

True, if the chat must be a forum supergroup; otherwise, the chat must not be a forum supergroup. Ignored if restrict_chat_is_forum is false

id: int

Unique button identifier

request_photo: bool

Pass true to request photo of the chat; bots only

request_title: bool

Pass true to request title of the chat; bots only

request_username: bool

Pass true to request username of the chat; bots only

restrict_chat_has_username: bool

True, if the chat must or must not have a username

restrict_chat_is_forum: bool

True, if the chat must or must not be a forum supergroup

user_administrator_rights: Optional[ChatAdministratorRights]

Expected user administrator rights in the chat; may be null if they aren’t restricted

class pytdbot.types.KeyboardButtonTypeRequestLocation[source]

Bases: TlObject, KeyboardButtonType

A button that sends the user’s location when pressed; available only in private chats

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[KeyboardButtonTypeRequestLocation]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['KeyboardButtonType']

classmethod getType()[source]
Return type:

Literal['keyboardButtonTypeRequestLocation']

to_dict()[source]
Return type:

dict

class pytdbot.types.KeyboardButtonTypeRequestPhoneNumber[source]

Bases: TlObject, KeyboardButtonType

A button that sends the user’s phone number when pressed; available only in private chats

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[KeyboardButtonTypeRequestPhoneNumber]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['KeyboardButtonType']

classmethod getType()[source]
Return type:

Literal['keyboardButtonTypeRequestPhoneNumber']

to_dict()[source]
Return type:

dict

class pytdbot.types.KeyboardButtonTypeRequestPoll(force_regular=False, force_quiz=False)[source]

Bases: TlObject, KeyboardButtonType

A button that allows the user to create and send a poll when pressed; available only in private chats

Parameters:
  • force_regular (bool) – If true, only regular polls must be allowed to create

  • force_quiz (bool) – If true, only polls in quiz mode must be allowed to create

__init__(force_regular=False, force_quiz=False)[source]
Parameters:
  • force_regular (bool)

  • force_quiz (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[KeyboardButtonTypeRequestPoll]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['KeyboardButtonType']

classmethod getType()[source]
Return type:

Literal['keyboardButtonTypeRequestPoll']

to_dict()[source]
Return type:

dict

force_quiz: bool

If true, only polls in quiz mode must be allowed to create

force_regular: bool

If true, only regular polls must be allowed to create

class pytdbot.types.KeyboardButtonTypeRequestUsers(id=0, restrict_user_is_bot=False, user_is_bot=False, restrict_user_is_premium=False, user_is_premium=False, max_quantity=0, request_name=False, request_username=False, request_photo=False)[source]

Bases: TlObject, KeyboardButtonType

A button that requests users to be shared by the current user; available only in private chats. Use the method shareUsersWithBot to complete the request

Parameters:
  • id (int) – Unique button identifier

  • restrict_user_is_bot (bool) – True, if the shared users must or must not be bots

  • user_is_bot (bool) – True, if the shared users must be bots; otherwise, the shared users must not be bots. Ignored if restrict_user_is_bot is false

  • restrict_user_is_premium (bool) – True, if the shared users must or must not be Telegram Premium users

  • user_is_premium (bool) – True, if the shared users must be Telegram Premium users; otherwise, the shared users must not be Telegram Premium users. Ignored if restrict_user_is_premium is false

  • max_quantity (int) – The maximum number of users to share

  • request_name (bool) – Pass true to request name of the users; bots only

  • request_username (bool) – Pass true to request username of the users; bots only

  • request_photo (bool) – Pass true to request photo of the users; bots only

__init__(id=0, restrict_user_is_bot=False, user_is_bot=False, restrict_user_is_premium=False, user_is_premium=False, max_quantity=0, request_name=False, request_username=False, request_photo=False)[source]
Parameters:
  • id (int)

  • restrict_user_is_bot (bool)

  • user_is_bot (bool)

  • restrict_user_is_premium (bool)

  • user_is_premium (bool)

  • max_quantity (int)

  • request_name (bool)

  • request_username (bool)

  • request_photo (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[KeyboardButtonTypeRequestUsers]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['KeyboardButtonType']

classmethod getType()[source]
Return type:

Literal['keyboardButtonTypeRequestUsers']

to_dict()[source]
Return type:

dict

id: int

Unique button identifier

max_quantity: int

The maximum number of users to share

request_name: bool

Pass true to request name of the users; bots only

request_photo: bool

Pass true to request photo of the users; bots only

request_username: bool

Pass true to request username of the users; bots only

restrict_user_is_bot: bool

True, if the shared users must or must not be bots

restrict_user_is_premium: bool

True, if the shared users must or must not be Telegram Premium users

user_is_bot: bool

True, if the shared users must be bots; otherwise, the shared users must not be bots. Ignored if restrict_user_is_bot is false

user_is_premium: bool

True, if the shared users must be Telegram Premium users; otherwise, the shared users must not be Telegram Premium users. Ignored if restrict_user_is_premium is false

class pytdbot.types.KeyboardButtonTypeText[source]

Bases: TlObject, KeyboardButtonType

A simple button, with text that must be sent when the button is pressed

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[KeyboardButtonTypeText]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['KeyboardButtonType']

classmethod getType()[source]
Return type:

Literal['keyboardButtonTypeText']

to_dict()[source]
Return type:

dict

class pytdbot.types.KeyboardButtonTypeWebApp(url='')[source]

Bases: TlObject, KeyboardButtonType

A button that opens a Web App by calling getWebAppUrl

Parameters:

url (str) – An HTTP URL to pass to getWebAppUrl

__init__(url='')[source]
Parameters:

url (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[KeyboardButtonTypeWebApp]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['KeyboardButtonType']

classmethod getType()[source]
Return type:

Literal['keyboardButtonTypeWebApp']

to_dict()[source]
Return type:

dict

url: Optional[str]

An HTTP URL to pass to getWebAppUrl

class pytdbot.types.LabeledPricePart(label='', amount=0)[source]

Bases: TlObject

Portion of the price of a product (e.g., "delivery cost", "tax amount")

Parameters:
  • label (str) – Label for this portion of the product price

  • amount (int) – Currency amount in the smallest units of the currency

__init__(label='', amount=0)[source]
Parameters:
  • label (str)

  • amount (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LabeledPricePart]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LabeledPricePart']

classmethod getType()[source]
Return type:

Literal['labeledPricePart']

to_dict()[source]
Return type:

dict

amount: int

Currency amount in the smallest units of the currency

label: Optional[str]

Label for this portion of the product price

class pytdbot.types.LanguagePackInfo(id='', base_language_pack_id='', name='', native_name='', plural_code='', is_official=False, is_rtl=False, is_beta=False, is_installed=False, total_string_count=0, translated_string_count=0, local_string_count=0, translation_url='')[source]

Bases: TlObject

Contains information about a language pack

Parameters:
  • id (str) – Unique language pack identifier

  • base_language_pack_id (str) – Identifier of a base language pack; may be empty. If a string is missed in the language pack, then it must be fetched from base language pack. Unsupported in custom language packs

  • name (str) – Language name

  • native_name (str) – Name of the language in that language

  • plural_code (str) – A language code to be used to apply plural forms. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more information

  • is_official (bool) – True, if the language pack is official

  • is_rtl (bool) – True, if the language pack strings are RTL

  • is_beta (bool) – True, if the language pack is a beta language pack

  • is_installed (bool) – True, if the language pack is installed by the current user

  • total_string_count (int) – Total number of non-deleted strings from the language pack

  • translated_string_count (int) – Total number of translated strings from the language pack

  • local_string_count (int) – Total number of non-deleted strings from the language pack available locally

  • translation_url (str) – Link to language translation interface; empty for custom local language packs

__init__(id='', base_language_pack_id='', name='', native_name='', plural_code='', is_official=False, is_rtl=False, is_beta=False, is_installed=False, total_string_count=0, translated_string_count=0, local_string_count=0, translation_url='')[source]
Parameters:
  • id (str)

  • base_language_pack_id (str)

  • name (str)

  • native_name (str)

  • plural_code (str)

  • is_official (bool)

  • is_rtl (bool)

  • is_beta (bool)

  • is_installed (bool)

  • total_string_count (int)

  • translated_string_count (int)

  • local_string_count (int)

  • translation_url (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LanguagePackInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LanguagePackInfo']

classmethod getType()[source]
Return type:

Literal['languagePackInfo']

to_dict()[source]
Return type:

dict

base_language_pack_id: Optional[str]

Identifier of a base language pack; may be empty. If a string is missed in the language pack, then it must be fetched from base language pack. Unsupported in custom language packs

id: Optional[str]

Unique language pack identifier

is_beta: bool

True, if the language pack is a beta language pack

is_installed: bool

True, if the language pack is installed by the current user

is_official: bool

True, if the language pack is official

is_rtl: bool

True, if the language pack strings are RTL

local_string_count: int

Total number of non-deleted strings from the language pack available locally

name: Optional[str]

Language name

native_name: Optional[str]

Name of the language in that language

plural_code: Optional[str]

//www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more information

Type:

A language code to be used to apply plural forms. See https

total_string_count: int

Total number of non-deleted strings from the language pack

translated_string_count: int

Total number of translated strings from the language pack

translation_url: Optional[str]

Link to language translation interface; empty for custom local language packs

class pytdbot.types.LanguagePackString(key='', value=None)[source]

Bases: TlObject

Represents one language pack string

Parameters:
  • key (str) – String key

  • value ("types.LanguagePackStringValue") – String value; pass null if the string needs to be taken from the built-in English language pack

__init__(key='', value=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LanguagePackString]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LanguagePackString']

classmethod getType()[source]
Return type:

Literal['languagePackString']

to_dict()[source]
Return type:

dict

key: Optional[str]

String key

value: Union[LanguagePackStringValueOrdinary, LanguagePackStringValuePluralized, LanguagePackStringValueDeleted, None]

String value; pass null if the string needs to be taken from the built-in English language pack

class pytdbot.types.LanguagePackStringValue[source]

Bases: object

Represents the value of a string in a language pack

class pytdbot.types.LanguagePackStringValueDeleted[source]

Bases: TlObject, LanguagePackStringValue

A deleted language pack string, the value must be taken from the built-in English language pack

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LanguagePackStringValueDeleted]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LanguagePackStringValue']

classmethod getType()[source]
Return type:

Literal['languagePackStringValueDeleted']

to_dict()[source]
Return type:

dict

class pytdbot.types.LanguagePackStringValueOrdinary(value='')[source]

Bases: TlObject, LanguagePackStringValue

An ordinary language pack string

Parameters:

value (str) – String value

__init__(value='')[source]
Parameters:

value (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LanguagePackStringValueOrdinary]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LanguagePackStringValue']

classmethod getType()[source]
Return type:

Literal['languagePackStringValueOrdinary']

to_dict()[source]
Return type:

dict

value: Optional[str]

String value

class pytdbot.types.LanguagePackStringValuePluralized(zero_value='', one_value='', two_value='', few_value='', many_value='', other_value='')[source]

Bases: TlObject, LanguagePackStringValue

A language pack string which has different forms based on the number of some object it mentions. See https://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html for more information

Parameters:
  • zero_value (str) – Value for zero objects

  • one_value (str) – Value for one object

  • two_value (str) – Value for two objects

  • few_value (str) – Value for few objects

  • many_value (str) – Value for many objects

  • other_value (str) – Default value

__init__(zero_value='', one_value='', two_value='', few_value='', many_value='', other_value='')[source]
Parameters:
  • zero_value (str)

  • one_value (str)

  • two_value (str)

  • few_value (str)

  • many_value (str)

  • other_value (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LanguagePackStringValuePluralized]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LanguagePackStringValue']

classmethod getType()[source]
Return type:

Literal['languagePackStringValuePluralized']

to_dict()[source]
Return type:

dict

few_value: Optional[str]

Value for few objects

many_value: Optional[str]

Value for many objects

one_value: Optional[str]

Value for one object

other_value: Optional[str]

Default value

two_value: Optional[str]

Value for two objects

zero_value: Optional[str]

Value for zero objects

class pytdbot.types.LanguagePackStrings(strings=None)[source]

Bases: TlObject

Contains a list of language pack strings

Parameters:

strings (List["types.LanguagePackString"]) – A list of language pack strings

__init__(strings=None)[source]
Parameters:

strings (List[LanguagePackString] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LanguagePackStrings]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LanguagePackStrings']

classmethod getType()[source]
Return type:

Literal['languagePackStrings']

to_dict()[source]
Return type:

dict

strings: List[LanguagePackString]

A list of language pack strings

class pytdbot.types.LinkPreview(url='', display_url='', site_name='', title='', description=None, author='', type=None, has_large_media=False, show_large_media=False, show_media_above_description=False, skip_confirmation=False, show_above_text=False, instant_view_version=0)[source]

Bases: TlObject

Describes a link preview

Parameters:
  • url (str) – Original URL of the link

  • display_url (str) – URL to display

  • site_name (str) – Short name of the site (e.g., Google Docs, App Store)

  • title (str) – Title of the content

  • description ("types.FormattedText") – Description of the content

  • author (str) – Author of the content

  • type ("types.LinkPreviewType") – Type of the link preview

  • has_large_media (bool) – True, if size of media in the preview can be changed

  • show_large_media (bool) – True, if large media preview must be shown; otherwise, the media preview must be shown small and only the first frame must be shown for videos

  • show_media_above_description (bool) – True, if media must be shown above link preview description; otherwise, the media must be shown below the description

  • skip_confirmation (bool) – True, if there is no need to show an ordinary open URL confirmation, when opening the URL from the preview, because the URL is shown in the message text in clear

  • show_above_text (bool) – True, if the link preview must be shown above message text; otherwise, the link preview must be shown below the message text

  • instant_view_version (int) – Version of instant view (currently, can be 1 or 2) for the web page; 0 if none

__init__(url='', display_url='', site_name='', title='', description=None, author='', type=None, has_large_media=False, show_large_media=False, show_media_above_description=False, skip_confirmation=False, show_above_text=False, instant_view_version=0)[source]
Parameters:
  • url (str)

  • display_url (str)

  • site_name (str)

  • title (str)

  • description (FormattedText | None)

  • author (str)

  • type (LinkPreviewType | None)

  • has_large_media (bool)

  • show_large_media (bool)

  • show_media_above_description (bool)

  • skip_confirmation (bool)

  • show_above_text (bool)

  • instant_view_version (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreview]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreview']

classmethod getType()[source]
Return type:

Literal['linkPreview']

to_dict()[source]
Return type:

dict

author: Optional[str]

Author of the content

description: Optional[FormattedText]

Description of the content

display_url: Optional[str]

URL to display

has_large_media: bool

True, if size of media in the preview can be changed

instant_view_version: int

Version of instant view (currently, can be 1 or 2) for the web page; 0 if none

show_above_text: bool

True, if the link preview must be shown above message text; otherwise, the link preview must be shown below the message text

show_large_media: bool

True, if large media preview must be shown; otherwise, the media preview must be shown small and only the first frame must be shown for videos

show_media_above_description: bool

True, if media must be shown above link preview description; otherwise, the media must be shown below the description

site_name: Optional[str]

Short name of the site (e.g., Google Docs, App Store)

skip_confirmation: bool

True, if there is no need to show an ordinary open URL confirmation, when opening the URL from the preview, because the URL is shown in the message text in clear

title: Optional[str]

Title of the content

type: Union[LinkPreviewTypeAlbum, LinkPreviewTypeAnimation, LinkPreviewTypeApp, LinkPreviewTypeArticle, LinkPreviewTypeAudio, LinkPreviewTypeBackground, LinkPreviewTypeChannelBoost, LinkPreviewTypeChat, LinkPreviewTypeDirectMessagesChat, LinkPreviewTypeDocument, LinkPreviewTypeEmbeddedAnimationPlayer, LinkPreviewTypeEmbeddedAudioPlayer, LinkPreviewTypeEmbeddedVideoPlayer, LinkPreviewTypeExternalAudio, LinkPreviewTypeExternalVideo, LinkPreviewTypeGiftCollection, LinkPreviewTypeGroupCall, LinkPreviewTypeInvoice, LinkPreviewTypeMessage, LinkPreviewTypePhoto, LinkPreviewTypePremiumGiftCode, LinkPreviewTypeShareableChatFolder, LinkPreviewTypeSticker, LinkPreviewTypeStickerSet, LinkPreviewTypeStory, LinkPreviewTypeStoryAlbum, LinkPreviewTypeSupergroupBoost, LinkPreviewTypeTheme, LinkPreviewTypeUnsupported, LinkPreviewTypeUpgradedGift, LinkPreviewTypeUser, LinkPreviewTypeVideo, LinkPreviewTypeVideoChat, LinkPreviewTypeVideoNote, LinkPreviewTypeVoiceNote, LinkPreviewTypeWebApp, None]

Type of the link preview

url: Optional[str]

Original URL of the link

class pytdbot.types.LinkPreviewAlbumMedia[source]

Bases: object

Describes a media from a link preview album

class pytdbot.types.LinkPreviewAlbumMediaPhoto(photo=None)[source]

Bases: TlObject, LinkPreviewAlbumMedia

The media is a photo

Parameters:

photo ("types.Photo") – Photo description

__init__(photo=None)[source]
Parameters:

photo (Photo | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewAlbumMediaPhoto]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewAlbumMedia']

classmethod getType()[source]
Return type:

Literal['linkPreviewAlbumMediaPhoto']

to_dict()[source]
Return type:

dict

photo: Optional[Photo]

Photo description

class pytdbot.types.LinkPreviewAlbumMediaVideo(video=None)[source]

Bases: TlObject, LinkPreviewAlbumMedia

The media is a video

Parameters:

video ("types.Video") – Video description

__init__(video=None)[source]
Parameters:

video (Video | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewAlbumMediaVideo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewAlbumMedia']

classmethod getType()[source]
Return type:

Literal['linkPreviewAlbumMediaVideo']

to_dict()[source]
Return type:

dict

video: Optional[Video]

Video description

class pytdbot.types.LinkPreviewOptions(is_disabled=False, url='', force_small_media=False, force_large_media=False, show_above_text=False)[source]

Bases: TlObject

Options to be used for generation of a link preview

Parameters:
  • is_disabled (bool) – True, if link preview must be disabled

  • url (str) – URL to use for link preview. If empty, then the first URL found in the message text will be used

  • force_small_media (bool) – True, if shown media preview must be small; ignored in secret chats or if the URL isn’t explicitly specified

  • force_large_media (bool) – True, if shown media preview must be large; ignored in secret chats or if the URL isn’t explicitly specified

  • show_above_text (bool) – True, if link preview must be shown above message text; otherwise, the link preview will be shown below the message text; ignored in secret chats

__init__(is_disabled=False, url='', force_small_media=False, force_large_media=False, show_above_text=False)[source]
Parameters:
  • is_disabled (bool)

  • url (str)

  • force_small_media (bool)

  • force_large_media (bool)

  • show_above_text (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewOptions]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewOptions']

classmethod getType()[source]
Return type:

Literal['linkPreviewOptions']

to_dict()[source]
Return type:

dict

force_large_media: bool

True, if shown media preview must be large; ignored in secret chats or if the URL isn’t explicitly specified

force_small_media: bool

True, if shown media preview must be small; ignored in secret chats or if the URL isn’t explicitly specified

is_disabled: bool

True, if link preview must be disabled

show_above_text: bool

True, if link preview must be shown above message text; otherwise, the link preview will be shown below the message text; ignored in secret chats

url: Optional[str]

URL to use for link preview. If empty, then the first URL found in the message text will be used

class pytdbot.types.LinkPreviewType[source]

Bases: object

Describes type of link preview

class pytdbot.types.LinkPreviewTypeAlbum(media=None, caption='')[source]

Bases: TlObject, LinkPreviewType

The link is a link to a media album consisting of photos and videos

Parameters:
  • media (List["types.LinkPreviewAlbumMedia"]) – The list of album media

  • caption (str) – Album caption

__init__(media=None, caption='')[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewTypeAlbum]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewType']

classmethod getType()[source]
Return type:

Literal['linkPreviewTypeAlbum']

to_dict()[source]
Return type:

dict

caption: Optional[str]

Album caption

media: List[LinkPreviewAlbumMedia]

The list of album media

class pytdbot.types.LinkPreviewTypeAnimation(animation=None)[source]

Bases: TlObject, LinkPreviewType

The link is a link to an animation

Parameters:

animation ("types.Animation") – The animation

__init__(animation=None)[source]
Parameters:

animation (Animation | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewTypeAnimation]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewType']

classmethod getType()[source]
Return type:

Literal['linkPreviewTypeAnimation']

to_dict()[source]
Return type:

dict

animation: Optional[Animation]

The animation

class pytdbot.types.LinkPreviewTypeApp(photo=None)[source]

Bases: TlObject, LinkPreviewType

The link is a link to an app at App Store or Google Play

Parameters:

photo ("types.Photo") – Photo for the app

__init__(photo=None)[source]
Parameters:

photo (Photo | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewTypeApp]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewType']

classmethod getType()[source]
Return type:

Literal['linkPreviewTypeApp']

to_dict()[source]
Return type:

dict

photo: Optional[Photo]

Photo for the app

class pytdbot.types.LinkPreviewTypeArticle(photo=None)[source]

Bases: TlObject, LinkPreviewType

The link is a link to a web site

Parameters:

photo ("types.Photo") – Article’s main photo; may be null

__init__(photo=None)[source]
Parameters:

photo (Photo | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewTypeArticle]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewType']

classmethod getType()[source]
Return type:

Literal['linkPreviewTypeArticle']

to_dict()[source]
Return type:

dict

photo: Optional[Photo]

Article’s main photo; may be null

class pytdbot.types.LinkPreviewTypeAudio(audio=None)[source]

Bases: TlObject, LinkPreviewType

The link is a link to an audio

Parameters:

audio ("types.Audio") – The audio description

__init__(audio=None)[source]
Parameters:

audio (Audio | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewTypeAudio]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewType']

classmethod getType()[source]
Return type:

Literal['linkPreviewTypeAudio']

to_dict()[source]
Return type:

dict

audio: Optional[Audio]

The audio description

class pytdbot.types.LinkPreviewTypeBackground(document=None, background_type=None)[source]

Bases: TlObject, LinkPreviewType

The link is a link to a background. Link preview title and description are available only for filled backgrounds

Parameters:
  • document ("types.Document") – Document with the background; may be null for filled backgrounds

  • background_type ("types.BackgroundType") – Type of the background; may be null if unknown

__init__(document=None, background_type=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewTypeBackground]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewType']

classmethod getType()[source]
Return type:

Literal['linkPreviewTypeBackground']

to_dict()[source]
Return type:

dict

background_type: Union[BackgroundTypeWallpaper, BackgroundTypePattern, BackgroundTypeFill, BackgroundTypeChatTheme, None]

Type of the background; may be null if unknown

document: Optional[Document]

Document with the background; may be null for filled backgrounds

class pytdbot.types.LinkPreviewTypeChannelBoost(photo=None)[source]

Bases: TlObject, LinkPreviewType

The link is a link to boost a channel chat

Parameters:

photo ("types.ChatPhoto") – Photo of the chat; may be null

__init__(photo=None)[source]
Parameters:

photo (ChatPhoto | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewTypeChannelBoost]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewType']

classmethod getType()[source]
Return type:

Literal['linkPreviewTypeChannelBoost']

to_dict()[source]
Return type:

dict

photo: Optional[ChatPhoto]

Photo of the chat; may be null

class pytdbot.types.LinkPreviewTypeChat(type=None, photo=None, creates_join_request=False)[source]

Bases: TlObject, LinkPreviewType

The link is a link to a chat

Parameters:
  • type ("types.InviteLinkChatType") – Type of the chat

  • photo ("types.ChatPhoto") – Photo of the chat; may be null

  • creates_join_request (bool) – True, if the link only creates join request

__init__(type=None, photo=None, creates_join_request=False)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewTypeChat]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewType']

classmethod getType()[source]
Return type:

Literal['linkPreviewTypeChat']

to_dict()[source]
Return type:

dict

creates_join_request: bool

True, if the link only creates join request

photo: Optional[ChatPhoto]

Photo of the chat; may be null

type: Union[InviteLinkChatTypeBasicGroup, InviteLinkChatTypeSupergroup, InviteLinkChatTypeChannel, None]

Type of the chat

class pytdbot.types.LinkPreviewTypeDirectMessagesChat(photo=None)[source]

Bases: TlObject, LinkPreviewType

The link is a link to a direct messages chat of a channel

Parameters:

photo ("types.ChatPhoto") – Photo of the channel chat; may be null

__init__(photo=None)[source]
Parameters:

photo (ChatPhoto | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewTypeDirectMessagesChat]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewType']

classmethod getType()[source]
Return type:

Literal['linkPreviewTypeDirectMessagesChat']

to_dict()[source]
Return type:

dict

photo: Optional[ChatPhoto]

Photo of the channel chat; may be null

class pytdbot.types.LinkPreviewTypeDocument(document=None)[source]

Bases: TlObject, LinkPreviewType

The link is a link to a general file

Parameters:

document ("types.Document") – The document description

__init__(document=None)[source]
Parameters:

document (Document | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewTypeDocument]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewType']

classmethod getType()[source]
Return type:

Literal['linkPreviewTypeDocument']

to_dict()[source]
Return type:

dict

document: Optional[Document]

The document description

class pytdbot.types.LinkPreviewTypeEmbeddedAnimationPlayer(url='', thumbnail=None, duration=0, width=0, height=0)[source]

Bases: TlObject, LinkPreviewType

The link is a link to an animation player

Parameters:
  • url (str) – URL of the external animation player

  • thumbnail ("types.Photo") – Thumbnail of the animation; may be null if unknown

  • duration (int) – Duration of the animation, in seconds

  • width (int) – Expected width of the embedded player

  • height (int) – Expected height of the embedded player

__init__(url='', thumbnail=None, duration=0, width=0, height=0)[source]
Parameters:
  • url (str)

  • thumbnail (Photo | None)

  • duration (int)

  • width (int)

  • height (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewTypeEmbeddedAnimationPlayer]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewType']

classmethod getType()[source]
Return type:

Literal['linkPreviewTypeEmbeddedAnimationPlayer']

to_dict()[source]
Return type:

dict

duration: int

Duration of the animation, in seconds

height: int

Expected height of the embedded player

thumbnail: Optional[Photo]

Thumbnail of the animation; may be null if unknown

url: Optional[str]

URL of the external animation player

width: int

Expected width of the embedded player

class pytdbot.types.LinkPreviewTypeEmbeddedAudioPlayer(url='', thumbnail=None, duration=0, width=0, height=0)[source]

Bases: TlObject, LinkPreviewType

The link is a link to an audio player

Parameters:
  • url (str) – URL of the external audio player

  • thumbnail ("types.Photo") – Thumbnail of the audio; may be null if unknown

  • duration (int) – Duration of the audio, in seconds

  • width (int) – Expected width of the embedded player

  • height (int) – Expected height of the embedded player

__init__(url='', thumbnail=None, duration=0, width=0, height=0)[source]
Parameters:
  • url (str)

  • thumbnail (Photo | None)

  • duration (int)

  • width (int)

  • height (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewTypeEmbeddedAudioPlayer]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewType']

classmethod getType()[source]
Return type:

Literal['linkPreviewTypeEmbeddedAudioPlayer']

to_dict()[source]
Return type:

dict

duration: int

Duration of the audio, in seconds

height: int

Expected height of the embedded player

thumbnail: Optional[Photo]

Thumbnail of the audio; may be null if unknown

url: Optional[str]

URL of the external audio player

width: int

Expected width of the embedded player

class pytdbot.types.LinkPreviewTypeEmbeddedVideoPlayer(url='', thumbnail=None, duration=0, width=0, height=0)[source]

Bases: TlObject, LinkPreviewType

The link is a link to a video player

Parameters:
  • url (str) – URL of the external video player

  • thumbnail ("types.Photo") – Thumbnail of the video; may be null if unknown

  • duration (int) – Duration of the video, in seconds

  • width (int) – Expected width of the embedded player

  • height (int) – Expected height of the embedded player

__init__(url='', thumbnail=None, duration=0, width=0, height=0)[source]
Parameters:
  • url (str)

  • thumbnail (Photo | None)

  • duration (int)

  • width (int)

  • height (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewTypeEmbeddedVideoPlayer]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewType']

classmethod getType()[source]
Return type:

Literal['linkPreviewTypeEmbeddedVideoPlayer']

to_dict()[source]
Return type:

dict

duration: int

Duration of the video, in seconds

height: int

Expected height of the embedded player

thumbnail: Optional[Photo]

Thumbnail of the video; may be null if unknown

url: Optional[str]

URL of the external video player

width: int

Expected width of the embedded player

class pytdbot.types.LinkPreviewTypeExternalAudio(url='', mime_type='', duration=0)[source]

Bases: TlObject, LinkPreviewType

The link is a link to an audio file

Parameters:
  • url (str) – URL of the audio file

  • mime_type (str) – MIME type of the audio file

  • duration (int) – Duration of the audio, in seconds; 0 if unknown

__init__(url='', mime_type='', duration=0)[source]
Parameters:
  • url (str)

  • mime_type (str)

  • duration (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewTypeExternalAudio]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewType']

classmethod getType()[source]
Return type:

Literal['linkPreviewTypeExternalAudio']

to_dict()[source]
Return type:

dict

duration: int

Duration of the audio, in seconds; 0 if unknown

mime_type: Optional[str]

MIME type of the audio file

url: Optional[str]

URL of the audio file

class pytdbot.types.LinkPreviewTypeExternalVideo(url='', mime_type='', width=0, height=0, duration=0)[source]

Bases: TlObject, LinkPreviewType

The link is a link to a video file

Parameters:
  • url (str) – URL of the video file

  • mime_type (str) – MIME type of the video file

  • width (int) – Expected width of the video preview; 0 if unknown

  • height (int) – Expected height of the video preview; 0 if unknown

  • duration (int) – Duration of the video, in seconds; 0 if unknown

__init__(url='', mime_type='', width=0, height=0, duration=0)[source]
Parameters:
  • url (str)

  • mime_type (str)

  • width (int)

  • height (int)

  • duration (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewTypeExternalVideo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewType']

classmethod getType()[source]
Return type:

Literal['linkPreviewTypeExternalVideo']

to_dict()[source]
Return type:

dict

duration: int

Duration of the video, in seconds; 0 if unknown

height: int

Expected height of the video preview; 0 if unknown

mime_type: Optional[str]

MIME type of the video file

url: Optional[str]

URL of the video file

width: int

Expected width of the video preview; 0 if unknown

class pytdbot.types.LinkPreviewTypeGiftCollection(icons=None)[source]

Bases: TlObject, LinkPreviewType

The link is a link to a gift collection

Parameters:

icons (List["types.Sticker"]) – Icons for some gifts from the collection; may be empty

__init__(icons=None)[source]
Parameters:

icons (List[Sticker] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewTypeGiftCollection]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewType']

classmethod getType()[source]
Return type:

Literal['linkPreviewTypeGiftCollection']

to_dict()[source]
Return type:

dict

icons: List[Sticker]

Icons for some gifts from the collection; may be empty

class pytdbot.types.LinkPreviewTypeGroupCall[source]

Bases: TlObject, LinkPreviewType

The link is a link to a group call that isn’t bound to a chat

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewTypeGroupCall]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewType']

classmethod getType()[source]
Return type:

Literal['linkPreviewTypeGroupCall']

to_dict()[source]
Return type:

dict

class pytdbot.types.LinkPreviewTypeInvoice[source]

Bases: TlObject, LinkPreviewType

The link is a link to an invoice

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewTypeInvoice]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewType']

classmethod getType()[source]
Return type:

Literal['linkPreviewTypeInvoice']

to_dict()[source]
Return type:

dict

class pytdbot.types.LinkPreviewTypeMessage[source]

Bases: TlObject, LinkPreviewType

The link is a link to a text or a poll Telegram message

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewTypeMessage]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewType']

classmethod getType()[source]
Return type:

Literal['linkPreviewTypeMessage']

to_dict()[source]
Return type:

dict

class pytdbot.types.LinkPreviewTypePhoto(photo=None)[source]

Bases: TlObject, LinkPreviewType

The link is a link to a photo

Parameters:

photo ("types.Photo") – The photo

__init__(photo=None)[source]
Parameters:

photo (Photo | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewTypePhoto]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewType']

classmethod getType()[source]
Return type:

Literal['linkPreviewTypePhoto']

to_dict()[source]
Return type:

dict

photo: Optional[Photo]

The photo

class pytdbot.types.LinkPreviewTypePremiumGiftCode[source]

Bases: TlObject, LinkPreviewType

The link is a link to a Telegram Premium gift code

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewTypePremiumGiftCode]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewType']

classmethod getType()[source]
Return type:

Literal['linkPreviewTypePremiumGiftCode']

to_dict()[source]
Return type:

dict

class pytdbot.types.LinkPreviewTypeShareableChatFolder[source]

Bases: TlObject, LinkPreviewType

The link is a link to a shareable chat folder

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewTypeShareableChatFolder]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewType']

classmethod getType()[source]
Return type:

Literal['linkPreviewTypeShareableChatFolder']

to_dict()[source]
Return type:

dict

class pytdbot.types.LinkPreviewTypeSticker(sticker=None)[source]

Bases: TlObject, LinkPreviewType

The link is a link to a sticker

Parameters:

sticker ("types.Sticker") – The sticker. It can be an arbitrary WEBP image and can have dimensions bigger than 512

__init__(sticker=None)[source]
Parameters:

sticker (Sticker | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewTypeSticker]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewType']

classmethod getType()[source]
Return type:

Literal['linkPreviewTypeSticker']

to_dict()[source]
Return type:

dict

sticker: Optional[Sticker]

The sticker. It can be an arbitrary WEBP image and can have dimensions bigger than 512

class pytdbot.types.LinkPreviewTypeStickerSet(stickers=None)[source]

Bases: TlObject, LinkPreviewType

The link is a link to a sticker set

Parameters:

stickers (List["types.Sticker"]) – Up to 4 stickers from the sticker set

__init__(stickers=None)[source]
Parameters:

stickers (List[Sticker] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewTypeStickerSet]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewType']

classmethod getType()[source]
Return type:

Literal['linkPreviewTypeStickerSet']

to_dict()[source]
Return type:

dict

stickers: List[Sticker]

Up to 4 stickers from the sticker set

class pytdbot.types.LinkPreviewTypeStory(story_poster_chat_id=0, story_id=0)[source]

Bases: TlObject, LinkPreviewType

The link is a link to a story. Link preview description is unavailable

Parameters:
  • story_poster_chat_id (int) – The identifier of the chat that posted the story

  • story_id (int) – Story identifier

__init__(story_poster_chat_id=0, story_id=0)[source]
Parameters:
  • story_poster_chat_id (int)

  • story_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewTypeStory]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewType']

classmethod getType()[source]
Return type:

Literal['linkPreviewTypeStory']

to_dict()[source]
Return type:

dict

story_id: int

Story identifier

story_poster_chat_id: int

The identifier of the chat that posted the story

class pytdbot.types.LinkPreviewTypeStoryAlbum(photo_icon=None, video_icon=None)[source]

Bases: TlObject, LinkPreviewType

The link is a link to an album of stories

Parameters:
  • photo_icon ("types.Photo") – Icon of the album; may be null if none

  • video_icon ("types.Video") – Video icon of the album; may be null if none

__init__(photo_icon=None, video_icon=None)[source]
Parameters:
  • photo_icon (Photo | None)

  • video_icon (Video | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewTypeStoryAlbum]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewType']

classmethod getType()[source]
Return type:

Literal['linkPreviewTypeStoryAlbum']

to_dict()[source]
Return type:

dict

photo_icon: Optional[Photo]

Icon of the album; may be null if none

video_icon: Optional[Video]

Video icon of the album; may be null if none

class pytdbot.types.LinkPreviewTypeSupergroupBoost(photo=None)[source]

Bases: TlObject, LinkPreviewType

The link is a link to boost a supergroup chat

Parameters:

photo ("types.ChatPhoto") – Photo of the chat; may be null

__init__(photo=None)[source]
Parameters:

photo (ChatPhoto | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewTypeSupergroupBoost]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewType']

classmethod getType()[source]
Return type:

Literal['linkPreviewTypeSupergroupBoost']

to_dict()[source]
Return type:

dict

photo: Optional[ChatPhoto]

Photo of the chat; may be null

class pytdbot.types.LinkPreviewTypeTheme(documents=None, settings=None)[source]

Bases: TlObject, LinkPreviewType

The link is a link to a cloud theme. TDLib has no theme support yet

Parameters:
  • documents (List["types.Document"]) – The list of files with theme description

  • settings ("types.ThemeSettings") – Settings for the cloud theme; may be null if unknown

__init__(documents=None, settings=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewTypeTheme]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewType']

classmethod getType()[source]
Return type:

Literal['linkPreviewTypeTheme']

to_dict()[source]
Return type:

dict

documents: List[Document]

The list of files with theme description

settings: Optional[ThemeSettings]

Settings for the cloud theme; may be null if unknown

class pytdbot.types.LinkPreviewTypeUnsupported[source]

Bases: TlObject, LinkPreviewType

The link preview type is unsupported yet

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewTypeUnsupported]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewType']

classmethod getType()[source]
Return type:

Literal['linkPreviewTypeUnsupported']

to_dict()[source]
Return type:

dict

class pytdbot.types.LinkPreviewTypeUpgradedGift(gift=None)[source]

Bases: TlObject, LinkPreviewType

The link is a link to an upgraded gift

Parameters:

gift ("types.UpgradedGift") – The gift

__init__(gift=None)[source]
Parameters:

gift (UpgradedGift | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewTypeUpgradedGift]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewType']

classmethod getType()[source]
Return type:

Literal['linkPreviewTypeUpgradedGift']

to_dict()[source]
Return type:

dict

gift: Optional[UpgradedGift]

The gift

class pytdbot.types.LinkPreviewTypeUser(photo=None, is_bot=False)[source]

Bases: TlObject, LinkPreviewType

The link is a link to a user

Parameters:
  • photo ("types.ChatPhoto") – Photo of the user; may be null if none

  • is_bot (bool) – True, if the user is a bot

__init__(photo=None, is_bot=False)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewTypeUser]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewType']

classmethod getType()[source]
Return type:

Literal['linkPreviewTypeUser']

to_dict()[source]
Return type:

dict

is_bot: bool

True, if the user is a bot

photo: Optional[ChatPhoto]

Photo of the user; may be null if none

class pytdbot.types.LinkPreviewTypeVideo(video=None, cover=None, start_timestamp=0)[source]

Bases: TlObject, LinkPreviewType

The link is a link to a video

Parameters:
  • video ("types.Video") – The video description

  • cover ("types.Photo") – Cover of the video; may be null if none

  • start_timestamp (int) – Timestamp from which the video playing must start, in seconds

__init__(video=None, cover=None, start_timestamp=0)[source]
Parameters:
  • video (Video | None)

  • cover (Photo | None)

  • start_timestamp (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewTypeVideo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewType']

classmethod getType()[source]
Return type:

Literal['linkPreviewTypeVideo']

to_dict()[source]
Return type:

dict

cover: Optional[Photo]

Cover of the video; may be null if none

start_timestamp: int

Timestamp from which the video playing must start, in seconds

video: Optional[Video]

The video description

class pytdbot.types.LinkPreviewTypeVideoChat(photo=None, is_live_stream=False, joins_as_speaker=False)[source]

Bases: TlObject, LinkPreviewType

The link is a link to a video chat

Parameters:
  • photo ("types.ChatPhoto") – Photo of the chat with the video chat; may be null if none

  • is_live_stream (bool) – True, if the video chat is expected to be a live stream in a channel or a broadcast group

  • joins_as_speaker (bool) – True, if the user can use the link to join the video chat without being muted by administrators

__init__(photo=None, is_live_stream=False, joins_as_speaker=False)[source]
Parameters:
  • photo (ChatPhoto | None)

  • is_live_stream (bool)

  • joins_as_speaker (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewTypeVideoChat]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewType']

classmethod getType()[source]
Return type:

Literal['linkPreviewTypeVideoChat']

to_dict()[source]
Return type:

dict

is_live_stream: bool

True, if the video chat is expected to be a live stream in a channel or a broadcast group

joins_as_speaker: bool

True, if the user can use the link to join the video chat without being muted by administrators

photo: Optional[ChatPhoto]

Photo of the chat with the video chat; may be null if none

class pytdbot.types.LinkPreviewTypeVideoNote(video_note=None)[source]

Bases: TlObject, LinkPreviewType

The link is a link to a video note message

Parameters:

video_note ("types.VideoNote") – The video note

__init__(video_note=None)[source]
Parameters:

video_note (VideoNote | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewTypeVideoNote]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewType']

classmethod getType()[source]
Return type:

Literal['linkPreviewTypeVideoNote']

to_dict()[source]
Return type:

dict

video_note: Optional[VideoNote]

The video note

class pytdbot.types.LinkPreviewTypeVoiceNote(voice_note=None)[source]

Bases: TlObject, LinkPreviewType

The link is a link to a voice note message

Parameters:

voice_note ("types.VoiceNote") – The voice note

__init__(voice_note=None)[source]
Parameters:

voice_note (VoiceNote | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewTypeVoiceNote]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewType']

classmethod getType()[source]
Return type:

Literal['linkPreviewTypeVoiceNote']

to_dict()[source]
Return type:

dict

voice_note: Optional[VoiceNote]

The voice note

class pytdbot.types.LinkPreviewTypeWebApp(photo=None)[source]

Bases: TlObject, LinkPreviewType

The link is a link to a Web App

Parameters:

photo ("types.Photo") – Web App photo; may be null if none

__init__(photo=None)[source]
Parameters:

photo (Photo | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LinkPreviewTypeWebApp]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LinkPreviewType']

classmethod getType()[source]
Return type:

Literal['linkPreviewTypeWebApp']

to_dict()[source]
Return type:

dict

photo: Optional[Photo]

Web App photo; may be null if none

class pytdbot.types.LocalFile(path='', can_be_downloaded=False, can_be_deleted=False, is_downloading_active=False, is_downloading_completed=False, download_offset=0, downloaded_prefix_size=0, downloaded_size=0)[source]

Bases: TlObject

Represents a local file

Parameters:
  • path (str) – Local path to the locally available file part; may be empty

  • can_be_downloaded (bool) – True, if it is possible to download or generate the file

  • can_be_deleted (bool) – True, if the file can be deleted

  • is_downloading_active (bool) – True, if the file is currently being downloaded (or a local copy is being generated by some other means)

  • is_downloading_completed (bool) – True, if the local copy is fully available

  • download_offset (int) – Download will be started from this offset. downloaded_prefix_size is calculated from this offset

  • downloaded_prefix_size (int) – If is_downloading_completed is false, then only some prefix of the file starting from download_offset is ready to be read. downloaded_prefix_size is the size of that prefix in bytes

  • downloaded_size (int) – Total downloaded file size, in bytes. Can be used only for calculating download progress. The actual file size may be bigger, and some parts of it may contain garbage

__init__(path='', can_be_downloaded=False, can_be_deleted=False, is_downloading_active=False, is_downloading_completed=False, download_offset=0, downloaded_prefix_size=0, downloaded_size=0)[source]
Parameters:
  • path (str)

  • can_be_downloaded (bool)

  • can_be_deleted (bool)

  • is_downloading_active (bool)

  • is_downloading_completed (bool)

  • download_offset (int)

  • downloaded_prefix_size (int)

  • downloaded_size (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LocalFile]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LocalFile']

classmethod getType()[source]
Return type:

Literal['localFile']

to_dict()[source]
Return type:

dict

can_be_deleted: bool

True, if the file can be deleted

can_be_downloaded: bool

True, if it is possible to download or generate the file

download_offset: int

Download will be started from this offset. downloaded_prefix_size is calculated from this offset

downloaded_prefix_size: int

If is_downloading_completed is false, then only some prefix of the file starting from download_offset is ready to be read. downloaded_prefix_size is the size of that prefix in bytes

downloaded_size: int

Total downloaded file size, in bytes. Can be used only for calculating download progress. The actual file size may be bigger, and some parts of it may contain garbage

is_downloading_active: bool

True, if the file is currently being downloaded (or a local copy is being generated by some other means)

is_downloading_completed: bool

True, if the local copy is fully available

path: Optional[str]

Local path to the locally available file part; may be empty

class pytdbot.types.LocalizationTargetInfo(language_packs=None)[source]

Bases: TlObject

Contains information about the current localization target

Parameters:

language_packs (List["types.LanguagePackInfo"]) – List of available language packs for this application

__init__(language_packs=None)[source]
Parameters:

language_packs (List[LanguagePackInfo] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LocalizationTargetInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LocalizationTargetInfo']

classmethod getType()[source]
Return type:

Literal['localizationTargetInfo']

to_dict()[source]
Return type:

dict

language_packs: List[LanguagePackInfo]

List of available language packs for this application

class pytdbot.types.Location(latitude=0.0, longitude=0.0, horizontal_accuracy=0.0)[source]

Bases: TlObject

Describes a location on planet Earth

Parameters:
  • latitude (float) – Latitude of the location in degrees; as defined by the sender

  • longitude (float) – Longitude of the location, in degrees; as defined by the sender

  • horizontal_accuracy (float) – The estimated horizontal accuracy of the location, in meters; as defined by the sender. 0 if unknown

__init__(latitude=0.0, longitude=0.0, horizontal_accuracy=0.0)[source]
Parameters:
  • latitude (float)

  • longitude (float)

  • horizontal_accuracy (float)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Location]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Location']

classmethod getType()[source]
Return type:

Literal['location']

to_dict()[source]
Return type:

dict

horizontal_accuracy: float

The estimated horizontal accuracy of the location, in meters; as defined by the sender. 0 if unknown

latitude: float

Latitude of the location in degrees; as defined by the sender

longitude: float

Longitude of the location, in degrees; as defined by the sender

class pytdbot.types.LocationAddress(country_code='', state='', city='', street='')[source]

Bases: TlObject

Describes an address of a location

Parameters:
  • country_code (str) – A two-letter ISO 3166-1 alpha-2 country code

  • state (str) – State, if applicable; empty if unknown

  • city (str) – City; empty if unknown

  • street (str) – The address; empty if unknown

__init__(country_code='', state='', city='', street='')[source]
Parameters:
  • country_code (str)

  • state (str)

  • city (str)

  • street (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LocationAddress]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LocationAddress']

classmethod getType()[source]
Return type:

Literal['locationAddress']

to_dict()[source]
Return type:

dict

city: Optional[str]

City; empty if unknown

country_code: Optional[str]

A two-letter ISO 3166-1 alpha-2 country code

state: Optional[str]

State, if applicable; empty if unknown

street: Optional[str]

The address; empty if unknown

class pytdbot.types.LogStream[source]

Bases: object

Describes a stream to which TDLib internal log is written

class pytdbot.types.LogStreamDefault[source]

Bases: TlObject, LogStream

The log is written to stderr or an OS specific log

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LogStreamDefault]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LogStream']

classmethod getType()[source]
Return type:

Literal['logStreamDefault']

to_dict()[source]
Return type:

dict

class pytdbot.types.LogStreamEmpty[source]

Bases: TlObject, LogStream

The log is written nowhere

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LogStreamEmpty]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LogStream']

classmethod getType()[source]
Return type:

Literal['logStreamEmpty']

to_dict()[source]
Return type:

dict

class pytdbot.types.LogStreamFile(path='', max_file_size=0, redirect_stderr=False)[source]

Bases: TlObject, LogStream

The log is written to a file

Parameters:
  • path (str) – Path to the file to where the internal TDLib log will be written

  • max_file_size (int) – The maximum size of the file to where the internal TDLib log is written before the file will automatically be rotated, in bytes

  • redirect_stderr (bool) – Pass true to additionally redirect stderr to the log file. Ignored on Windows

__init__(path='', max_file_size=0, redirect_stderr=False)[source]
Parameters:
  • path (str)

  • max_file_size (int)

  • redirect_stderr (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LogStreamFile]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LogStream']

classmethod getType()[source]
Return type:

Literal['logStreamFile']

to_dict()[source]
Return type:

dict

max_file_size: int

The maximum size of the file to where the internal TDLib log is written before the file will automatically be rotated, in bytes

path: Optional[str]

Path to the file to where the internal TDLib log will be written

redirect_stderr: bool

Pass true to additionally redirect stderr to the log file. Ignored on Windows

class pytdbot.types.LogTags(tags=None)[source]

Bases: TlObject

Contains a list of available TDLib internal log tags

Parameters:

tags (List[str]) – List of log tags

__init__(tags=None)[source]
Parameters:

tags (List[str] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LogTags]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LogTags']

classmethod getType()[source]
Return type:

Literal['logTags']

to_dict()[source]
Return type:

dict

tags: List[str]

List of log tags

class pytdbot.types.LogVerbosityLevel(verbosity_level=0)[source]

Bases: TlObject

Contains a TDLib internal log verbosity level

Parameters:

verbosity_level (int) – Log verbosity level

__init__(verbosity_level=0)[source]
Parameters:

verbosity_level (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LogVerbosityLevel]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LogVerbosityLevel']

classmethod getType()[source]
Return type:

Literal['logVerbosityLevel']

to_dict()[source]
Return type:

dict

verbosity_level: int

Log verbosity level

class pytdbot.types.LoginUrlInfo[source]

Bases: object

Contains information about an inline button of type inlineKeyboardButtonTypeLoginUrl

class pytdbot.types.LoginUrlInfoOpen(url='', skip_confirmation=False)[source]

Bases: TlObject, LoginUrlInfo

An HTTP URL needs to be open

Parameters:
  • url (str) – The URL to open

  • skip_confirmation (bool) – True, if there is no need to show an ordinary open URL confirmation

__init__(url='', skip_confirmation=False)[source]
Parameters:
  • url (str)

  • skip_confirmation (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LoginUrlInfoOpen]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LoginUrlInfo']

classmethod getType()[source]
Return type:

Literal['loginUrlInfoOpen']

to_dict()[source]
Return type:

dict

skip_confirmation: bool

True, if there is no need to show an ordinary open URL confirmation

url: Optional[str]

The URL to open

class pytdbot.types.LoginUrlInfoRequestConfirmation(url='', domain='', bot_user_id=0, request_write_access=False)[source]

Bases: TlObject, LoginUrlInfo

An authorization confirmation dialog needs to be shown to the user

Parameters:
  • url (str) – An HTTP URL to be opened

  • domain (str) – A domain of the URL

  • bot_user_id (int) – User identifier of a bot linked with the website

  • request_write_access (bool) – True, if the user must be asked for the permission to the bot to send them messages

__init__(url='', domain='', bot_user_id=0, request_write_access=False)[source]
Parameters:
  • url (str)

  • domain (str)

  • bot_user_id (int)

  • request_write_access (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[LoginUrlInfoRequestConfirmation]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['LoginUrlInfo']

classmethod getType()[source]
Return type:

Literal['loginUrlInfoRequestConfirmation']

to_dict()[source]
Return type:

dict

bot_user_id: int

User identifier of a bot linked with the website

domain: Optional[str]

A domain of the URL

request_write_access: bool

True, if the user must be asked for the permission to the bot to send them messages

url: Optional[str]

An HTTP URL to be opened

class pytdbot.types.MainWebApp(url='', mode=None)[source]

Bases: TlObject

Contains information about the main Web App of a bot

Parameters:
  • url (str) – URL of the Web App to open

  • mode ("types.WebAppOpenMode") – The mode in which the Web App must be opened

__init__(url='', mode=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MainWebApp]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MainWebApp']

classmethod getType()[source]
Return type:

Literal['mainWebApp']

to_dict()[source]
Return type:

dict

mode: Union[WebAppOpenModeCompact, WebAppOpenModeFullSize, WebAppOpenModeFullScreen, None]

The mode in which the Web App must be opened

url: Optional[str]

URL of the Web App to open

class pytdbot.types.MaskPoint[source]

Bases: object

Part of the face, relative to which a mask is placed

class pytdbot.types.MaskPointChin[source]

Bases: TlObject, MaskPoint

The mask is placed relatively to the chin

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MaskPointChin]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MaskPoint']

classmethod getType()[source]
Return type:

Literal['maskPointChin']

to_dict()[source]
Return type:

dict

class pytdbot.types.MaskPointEyes[source]

Bases: TlObject, MaskPoint

The mask is placed relatively to the eyes

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MaskPointEyes]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MaskPoint']

classmethod getType()[source]
Return type:

Literal['maskPointEyes']

to_dict()[source]
Return type:

dict

class pytdbot.types.MaskPointForehead[source]

Bases: TlObject, MaskPoint

The mask is placed relatively to the forehead

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MaskPointForehead]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MaskPoint']

classmethod getType()[source]
Return type:

Literal['maskPointForehead']

to_dict()[source]
Return type:

dict

class pytdbot.types.MaskPointMouth[source]

Bases: TlObject, MaskPoint

The mask is placed relatively to the mouth

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MaskPointMouth]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MaskPoint']

classmethod getType()[source]
Return type:

Literal['maskPointMouth']

to_dict()[source]
Return type:

dict

class pytdbot.types.MaskPosition(point=None, x_shift=0.0, y_shift=0.0, scale=0.0)[source]

Bases: TlObject

Position on a photo where a mask is placed

Parameters:
  • point ("types.MaskPoint") – Part of the face, relative to which the mask is placed

  • x_shift (float) – Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. (For example, -1.0 will place the 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 a doubled size)

__init__(point=None, x_shift=0.0, y_shift=0.0, scale=0.0)[source]
Parameters:
  • point (MaskPoint | None)

  • x_shift (float)

  • y_shift (float)

  • scale (float)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MaskPosition]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MaskPosition']

classmethod getType()[source]
Return type:

Literal['maskPosition']

to_dict()[source]
Return type:

dict

point: Union[MaskPointForehead, MaskPointEyes, MaskPointMouth, MaskPointChin, None]

Part of the face, relative to which the mask is placed

scale: float

Mask scaling coefficient. (For example, 2.0 means a doubled size)

x_shift: float

Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. (For example, -1.0 will place the 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)

class pytdbot.types.Message(id=0, sender_id=None, chat_id=0, sending_state=None, scheduling_state=None, is_outgoing=False, is_pinned=False, is_from_offline=False, can_be_saved=False, has_timestamped_media=False, is_channel_post=False, is_paid_star_suggested_post=False, is_paid_ton_suggested_post=False, contains_unread_mention=False, date=0, edit_date=0, forward_info=None, import_info=None, interaction_info=None, unread_reactions=None, fact_check=None, suggested_post_info=None, reply_to=None, message_thread_id=0, topic_id=None, self_destruct_type=None, self_destruct_in=0.0, auto_delete_in=0.0, via_bot_user_id=0, sender_business_bot_user_id=0, sender_boost_count=0, paid_message_star_count=0, author_signature='', media_album_id=0, effect_id=0, restriction_info=None, content=None, reply_markup=None)[source]

Bases: TlObject, MessageBoundMethods

Describes a message

Parameters:
  • id (int) – Message identifier; unique for the chat to which the message belongs

  • sender_id ("types.MessageSender") – Identifier of the sender of the message

  • chat_id (int) – Chat identifier

  • sending_state ("types.MessageSendingState") – The sending state of the message; may be null if the message isn’t being sent and didn’t fail to be sent

  • scheduling_state ("types.MessageSchedulingState") – The scheduling state of the message; may be null if the message isn’t scheduled

  • is_outgoing (bool) – True, if the message is outgoing

  • is_pinned (bool) – True, if the message is pinned

  • is_from_offline (bool) – True, if the message was sent because of a scheduled action by the message sender, for example, as away, or greeting service message

  • can_be_saved (bool) – True, if content of the message can be saved locally

  • has_timestamped_media (bool) – True, if media timestamp entities refers to a media in this message as opposed to a media in the replied message

  • is_channel_post (bool) – True, if the message is a channel post. All messages to channels are channel posts, all other messages are not channel posts

  • is_paid_star_suggested_post (bool) – True, if the message is a suggested channel post which was paid in Telegram Stars; a warning must be shown if the message is deleted in less than getOption("suggested_post_lifetime_min") seconds after sending

  • is_paid_ton_suggested_post (bool) – True, if the message is a suggested channel post which was paid in Toncoins; a warning must be shown if the message is deleted in less than getOption("suggested_post_lifetime_min") seconds after sending

  • contains_unread_mention (bool) – True, if the message contains an unread mention for the current user

  • date (int) – Point in time (Unix timestamp) when the message was sent; 0 for scheduled messages

  • edit_date (int) – Point in time (Unix timestamp) when the message was last edited; 0 for scheduled messages

  • forward_info ("types.MessageForwardInfo") – Information about the initial message sender; may be null if none or unknown

  • import_info ("types.MessageImportInfo") – Information about the initial message for messages created with importMessages; may be null if the message isn’t imported

  • interaction_info ("types.MessageInteractionInfo") – Information about interactions with the message; may be null if none

  • unread_reactions (List["types.UnreadReaction"]) – Information about unread reactions added to the message

  • fact_check ("types.FactCheck") – Information about fact-check added to the message; may be null if none

  • suggested_post_info ("types.SuggestedPostInfo") – Information about the suggested post; may be null if the message isn’t a suggested post

  • reply_to ("types.MessageReplyTo") – Information about the message or the story this message is replying to; may be null if none

  • message_thread_id (int) – If non-zero, the identifier of the message thread the message belongs to; unique within the chat to which the message belongs

  • topic_id ("types.MessageTopic") – Identifier of the topic within the chat to which the message belongs; may be null if none

  • self_destruct_type ("types.MessageSelfDestructType") – The message’s self-destruct type; may be null if none

  • self_destruct_in (float) – Time left before the message self-destruct timer expires, in seconds; 0 if self-destruction isn’t scheduled yet

  • auto_delete_in (float) – Time left before the message will be automatically deleted by message_auto_delete_time setting of the chat, in seconds; 0 if never

  • via_bot_user_id (int) – If non-zero, the user identifier of the inline bot through which this message was sent

  • sender_business_bot_user_id (int) – If non-zero, the user identifier of the business bot that sent this message

  • sender_boost_count (int) – Number of times the sender of the message boosted the supergroup at the time the message was sent; 0 if none or unknown. For messages sent by the current user, supergroupFullInfo.my_boost_count must be used instead

  • paid_message_star_count (int) – The number of Telegram Stars the sender paid to send the message

  • author_signature (str) – For channel posts and anonymous group messages, optional author signature

  • media_album_id (int) – Unique identifier of an album this message belongs to; 0 if none. Only audios, documents, photos and videos can be grouped together in albums

  • effect_id (int) – Unique identifier of the effect added to the message; 0 if none

  • restriction_info ("types.RestrictionInfo") – Information about the restrictions that must be applied to the message content; may be null if none

  • content ("types.MessageContent") – Content of the message

  • reply_markup ("types.ReplyMarkup") – Reply markup for the message; may be null if none

__init__(id=0, sender_id=None, chat_id=0, sending_state=None, scheduling_state=None, is_outgoing=False, is_pinned=False, is_from_offline=False, can_be_saved=False, has_timestamped_media=False, is_channel_post=False, is_paid_star_suggested_post=False, is_paid_ton_suggested_post=False, contains_unread_mention=False, date=0, edit_date=0, forward_info=None, import_info=None, interaction_info=None, unread_reactions=None, fact_check=None, suggested_post_info=None, reply_to=None, message_thread_id=0, topic_id=None, self_destruct_type=None, self_destruct_in=0.0, auto_delete_in=0.0, via_bot_user_id=0, sender_business_bot_user_id=0, sender_boost_count=0, paid_message_star_count=0, author_signature='', media_album_id=0, effect_id=0, restriction_info=None, content=None, reply_markup=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Message]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Message']

classmethod getType()[source]
Return type:

Literal['message']

to_dict()[source]
Return type:

dict

author_signature: Optional[str]

For channel posts and anonymous group messages, optional author signature

auto_delete_in: float

Time left before the message will be automatically deleted by message_auto_delete_time setting of the chat, in seconds; 0 if never

can_be_saved: bool

True, if content of the message can be saved locally

chat_id: int

Chat identifier

contains_unread_mention: bool

True, if the message contains an unread mention for the current user

content: Union[MessageText, MessageAnimation, MessageAudio, MessageDocument, MessagePaidMedia, MessagePhoto, MessageSticker, MessageVideo, MessageVideoNote, MessageVoiceNote, MessageExpiredPhoto, MessageExpiredVideo, MessageExpiredVideoNote, MessageExpiredVoiceNote, MessageLocation, MessageVenue, MessageContact, MessageAnimatedEmoji, MessageDice, MessageGame, MessagePoll, MessageStory, MessageChecklist, MessageInvoice, MessageCall, MessageGroupCall, MessageVideoChatScheduled, MessageVideoChatStarted, MessageVideoChatEnded, MessageInviteVideoChatParticipants, MessageBasicGroupChatCreate, MessageSupergroupChatCreate, MessageChatChangeTitle, MessageChatChangePhoto, MessageChatDeletePhoto, MessageChatAddMembers, MessageChatJoinByLink, MessageChatJoinByRequest, MessageChatDeleteMember, MessageChatUpgradeTo, MessageChatUpgradeFrom, MessagePinMessage, MessageScreenshotTaken, MessageChatSetBackground, MessageChatSetTheme, MessageChatSetMessageAutoDeleteTime, MessageChatBoost, MessageForumTopicCreated, MessageForumTopicEdited, MessageForumTopicIsClosedToggled, MessageForumTopicIsHiddenToggled, MessageSuggestProfilePhoto, MessageCustomServiceAction, MessageGameScore, MessagePaymentSuccessful, MessagePaymentSuccessfulBot, MessagePaymentRefunded, MessageGiftedPremium, MessagePremiumGiftCode, MessageGiveawayCreated, MessageGiveaway, MessageGiveawayCompleted, MessageGiveawayWinners, MessageGiftedStars, MessageGiftedTon, MessageGiveawayPrizeStars, MessageGift, MessageUpgradedGift, MessageRefundedUpgradedGift, MessagePaidMessagesRefunded, MessagePaidMessagePriceChanged, MessageDirectMessagePriceChanged, MessageChecklistTasksDone, MessageChecklistTasksAdded, MessageSuggestedPostApprovalFailed, MessageSuggestedPostApproved, MessageSuggestedPostDeclined, MessageSuggestedPostPaid, MessageSuggestedPostRefunded, MessageContactRegistered, MessageUsersShared, MessageChatShared, MessageBotWriteAccessAllowed, MessageWebAppDataSent, MessageWebAppDataReceived, MessagePassportDataSent, MessagePassportDataReceived, MessageProximityAlertTriggered, MessageUnsupported, None]

Content of the message

date: int

Point in time (Unix timestamp) when the message was sent; 0 for scheduled messages

edit_date: int

Point in time (Unix timestamp) when the message was last edited; 0 for scheduled messages

effect_id: int

Unique identifier of the effect added to the message; 0 if none

fact_check: Optional[FactCheck]

Information about fact-check added to the message; may be null if none

forward_info: Optional[MessageForwardInfo]

Information about the initial message sender; may be null if none or unknown

has_timestamped_media: bool

True, if media timestamp entities refers to a media in this message as opposed to a media in the replied message

id: int

Message identifier; unique for the chat to which the message belongs

import_info: Optional[MessageImportInfo]

Information about the initial message for messages created with importMessages; may be null if the message isn’t imported

interaction_info: Optional[MessageInteractionInfo]

Information about interactions with the message; may be null if none

is_channel_post: bool

True, if the message is a channel post. All messages to channels are channel posts, all other messages are not channel posts

is_from_offline: bool

True, if the message was sent because of a scheduled action by the message sender, for example, as away, or greeting service message

is_outgoing: bool

True, if the message is outgoing

is_paid_star_suggested_post: bool

True, if the message is a suggested channel post which was paid in Telegram Stars; a warning must be shown if the message is deleted in less than getOption("suggested_post_lifetime_min") seconds after sending

is_paid_ton_suggested_post: bool

True, if the message is a suggested channel post which was paid in Toncoins; a warning must be shown if the message is deleted in less than getOption("suggested_post_lifetime_min") seconds after sending

is_pinned: bool

True, if the message is pinned

media_album_id: int

Unique identifier of an album this message belongs to; 0 if none. Only audios, documents, photos and videos can be grouped together in albums

message_thread_id: int

If non-zero, the identifier of the message thread the message belongs to; unique within the chat to which the message belongs

paid_message_star_count: int

The number of Telegram Stars the sender paid to send the message

reply_markup: Union[ReplyMarkupRemoveKeyboard, ReplyMarkupForceReply, ReplyMarkupShowKeyboard, ReplyMarkupInlineKeyboard, None]

Reply markup for the message; may be null if none

reply_to: Union[MessageReplyToMessage, MessageReplyToStory, None]

Information about the message or the story this message is replying to; may be null if none

restriction_info: Optional[RestrictionInfo]

Information about the restrictions that must be applied to the message content; may be null if none

scheduling_state: Union[MessageSchedulingStateSendAtDate, MessageSchedulingStateSendWhenOnline, MessageSchedulingStateSendWhenVideoProcessed, None]

The scheduling state of the message; may be null if the message isn’t scheduled

self_destruct_in: float

Time left before the message self-destruct timer expires, in seconds; 0 if self-destruction isn’t scheduled yet

self_destruct_type: Union[MessageSelfDestructTypeTimer, MessageSelfDestructTypeImmediately, None]

The message’s self-destruct type; may be null if none

sender_boost_count: int

Number of times the sender of the message boosted the supergroup at the time the message was sent; 0 if none or unknown. For messages sent by the current user, supergroupFullInfo.my_boost_count must be used instead

sender_business_bot_user_id: int

If non-zero, the user identifier of the business bot that sent this message

sender_id: Union[MessageSenderUser, MessageSenderChat, None]

Identifier of the sender of the message

sending_state: Union[MessageSendingStatePending, MessageSendingStateFailed, None]

The sending state of the message; may be null if the message isn’t being sent and didn’t fail to be sent

suggested_post_info: Optional[SuggestedPostInfo]

Information about the suggested post; may be null if the message isn’t a suggested post

topic_id: Union[MessageTopicForum, MessageTopicDirectMessages, MessageTopicSavedMessages, None]

Identifier of the topic within the chat to which the message belongs; may be null if none

unread_reactions: List[UnreadReaction]

Information about unread reactions added to the message

via_bot_user_id: int

If non-zero, the user identifier of the inline bot through which this message was sent

class pytdbot.types.MessageAnimatedEmoji(animated_emoji=None, emoji='')[source]

Bases: TlObject, MessageContent

A message with an animated emoji

Parameters:
  • animated_emoji ("types.AnimatedEmoji") – The animated emoji

  • emoji (str) – The corresponding emoji

__init__(animated_emoji=None, emoji='')[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageAnimatedEmoji]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageAnimatedEmoji']

to_dict()[source]
Return type:

dict

animated_emoji: Optional[AnimatedEmoji]

The animated emoji

emoji: Optional[str]

The corresponding emoji

class pytdbot.types.MessageAnimation(animation=None, caption=None, show_caption_above_media=False, has_spoiler=False, is_secret=False)[source]

Bases: TlObject, MessageContent

An animation message (GIF-style).

Parameters:
  • animation ("types.Animation") – The animation description

  • caption ("types.FormattedText") – Animation caption

  • show_caption_above_media (bool) – True, if the caption must be shown above the animation; otherwise, the caption must be shown below the animation

  • has_spoiler (bool) – True, if the animation preview must be covered by a spoiler animation

  • is_secret (bool) – True, if the animation thumbnail must be blurred and the animation must be shown only while tapped

__init__(animation=None, caption=None, show_caption_above_media=False, has_spoiler=False, is_secret=False)[source]
Parameters:
  • animation (Animation | None)

  • caption (FormattedText | None)

  • show_caption_above_media (bool)

  • has_spoiler (bool)

  • is_secret (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageAnimation]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageAnimation']

to_dict()[source]
Return type:

dict

animation: Optional[Animation]

The animation description

caption: Optional[FormattedText]

Animation caption

has_spoiler: bool

True, if the animation preview must be covered by a spoiler animation

is_secret: bool

True, if the animation thumbnail must be blurred and the animation must be shown only while tapped

show_caption_above_media: bool

True, if the caption must be shown above the animation; otherwise, the caption must be shown below the animation

class pytdbot.types.MessageAudio(audio=None, caption=None)[source]

Bases: TlObject, MessageContent

An audio message

Parameters:
  • audio ("types.Audio") – The audio description

  • caption ("types.FormattedText") – Audio caption

__init__(audio=None, caption=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageAudio]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageAudio']

to_dict()[source]
Return type:

dict

audio: Optional[Audio]

The audio description

caption: Optional[FormattedText]

Audio caption

class pytdbot.types.MessageAutoDeleteTime(time=0)[source]

Bases: TlObject

Contains default auto-delete timer setting for new chats

Parameters:

time (int) – Message auto-delete time, in seconds. If 0, then messages aren’t deleted automatically

__init__(time=0)[source]
Parameters:

time (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageAutoDeleteTime]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageAutoDeleteTime']

classmethod getType()[source]
Return type:

Literal['messageAutoDeleteTime']

to_dict()[source]
Return type:

dict

time: int

Message auto-delete time, in seconds. If 0, then messages aren’t deleted automatically

class pytdbot.types.MessageBasicGroupChatCreate(title='', member_user_ids=None)[source]

Bases: TlObject, MessageContent

A newly created basic group

Parameters:
  • title (str) – Title of the basic group

  • member_user_ids (List[int]) – User identifiers of members in the basic group

__init__(title='', member_user_ids=None)[source]
Parameters:
  • title (str)

  • member_user_ids (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageBasicGroupChatCreate]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageBasicGroupChatCreate']

to_dict()[source]
Return type:

dict

member_user_ids: List[int]

User identifiers of members in the basic group

title: Optional[str]

Title of the basic group

class pytdbot.types.MessageBotWriteAccessAllowed(reason=None)[source]

Bases: TlObject, MessageContent

The user allowed the bot to send messages

Parameters:

reason ("types.BotWriteAccessAllowReason") – The reason why the bot was allowed to write messages

__init__(reason=None)[source]
Parameters:

reason (BotWriteAccessAllowReason | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageBotWriteAccessAllowed]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageBotWriteAccessAllowed']

to_dict()[source]
Return type:

dict

reason: Union[BotWriteAccessAllowReasonConnectedWebsite, BotWriteAccessAllowReasonAddedToAttachmentMenu, BotWriteAccessAllowReasonLaunchedWebApp, BotWriteAccessAllowReasonAcceptedRequest, None]

The reason why the bot was allowed to write messages

class pytdbot.types.MessageCalendar(total_count=0, days=None)[source]

Bases: TlObject

Contains information about found messages, split by days according to the option "utc_time_offset"

Parameters:
  • total_count (int) – Total number of found messages

  • days (List["types.MessageCalendarDay"]) – Information about messages sent

__init__(total_count=0, days=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageCalendar]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageCalendar']

classmethod getType()[source]
Return type:

Literal['messageCalendar']

to_dict()[source]
Return type:

dict

days: List[MessageCalendarDay]

Information about messages sent

total_count: int

Total number of found messages

class pytdbot.types.MessageCalendarDay(total_count=0, message=None)[source]

Bases: TlObject

Contains information about found messages sent on a specific day

Parameters:
  • total_count (int) – Total number of found messages sent on the day

  • message ("types.Message") – First message sent on the day

__init__(total_count=0, message=None)[source]
Parameters:
  • total_count (int)

  • message (Message | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageCalendarDay]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageCalendarDay']

classmethod getType()[source]
Return type:

Literal['messageCalendarDay']

to_dict()[source]
Return type:

dict

message: Optional[Message]

First message sent on the day

total_count: int

Total number of found messages sent on the day

class pytdbot.types.MessageCall(is_video=False, discard_reason=None, duration=0)[source]

Bases: TlObject, MessageContent

A message with information about an ended call

Parameters:
  • is_video (bool) – True, if the call was a video call

  • discard_reason ("types.CallDiscardReason") – Reason why the call was discarded

  • duration (int) – Call duration, in seconds

__init__(is_video=False, discard_reason=None, duration=0)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageCall]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageCall']

to_dict()[source]
Return type:

dict

discard_reason: Union[CallDiscardReasonEmpty, CallDiscardReasonMissed, CallDiscardReasonDeclined, CallDiscardReasonDisconnected, CallDiscardReasonHungUp, CallDiscardReasonUpgradeToGroupCall, None]

Reason why the call was discarded

duration: int

Call duration, in seconds

is_video: bool

True, if the call was a video call

class pytdbot.types.MessageChatAddMembers(member_user_ids=None)[source]

Bases: TlObject, MessageContent

New chat members were added

Parameters:

member_user_ids (List[int]) – User identifiers of the new members

__init__(member_user_ids=None)[source]
Parameters:

member_user_ids (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageChatAddMembers]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageChatAddMembers']

to_dict()[source]
Return type:

dict

member_user_ids: List[int]

User identifiers of the new members

class pytdbot.types.MessageChatBoost(boost_count=0)[source]

Bases: TlObject, MessageContent

The chat was boosted by the sender of the message

Parameters:

boost_count (int) – Number of times the chat was boosted

__init__(boost_count=0)[source]
Parameters:

boost_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageChatBoost]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageChatBoost']

to_dict()[source]
Return type:

dict

boost_count: int

Number of times the chat was boosted

class pytdbot.types.MessageChatChangePhoto(photo=None)[source]

Bases: TlObject, MessageContent

An updated chat photo

Parameters:

photo ("types.ChatPhoto") – New chat photo

__init__(photo=None)[source]
Parameters:

photo (ChatPhoto | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageChatChangePhoto]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageChatChangePhoto']

to_dict()[source]
Return type:

dict

photo: Optional[ChatPhoto]

New chat photo

class pytdbot.types.MessageChatChangeTitle(title='')[source]

Bases: TlObject, MessageContent

An updated chat title

Parameters:

title (str) – New chat title

__init__(title='')[source]
Parameters:

title (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageChatChangeTitle]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageChatChangeTitle']

to_dict()[source]
Return type:

dict

title: Optional[str]

New chat title

class pytdbot.types.MessageChatDeleteMember(user_id=0)[source]

Bases: TlObject, MessageContent

A chat member was deleted

Parameters:

user_id (int) – User identifier of the deleted chat member

__init__(user_id=0)[source]
Parameters:

user_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageChatDeleteMember]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageChatDeleteMember']

to_dict()[source]
Return type:

dict

user_id: int

User identifier of the deleted chat member

class pytdbot.types.MessageChatDeletePhoto[source]

Bases: TlObject, MessageContent

A deleted chat photo

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageChatDeletePhoto]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageChatDeletePhoto']

to_dict()[source]
Return type:

dict

class pytdbot.types.MessageChatJoinByLink[source]

Bases: TlObject, MessageContent

A new member joined the chat via an invite link

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageChatJoinByLink]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageChatJoinByLink']

to_dict()[source]
Return type:

dict

class pytdbot.types.MessageChatJoinByRequest[source]

Bases: TlObject, MessageContent

A new member was accepted to the chat by an administrator

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageChatJoinByRequest]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageChatJoinByRequest']

to_dict()[source]
Return type:

dict

class pytdbot.types.MessageChatSetBackground(old_background_message_id=0, background=None, only_for_self=False)[source]

Bases: TlObject, MessageContent

A new background was set in the chat

Parameters:
  • old_background_message_id (int) – Identifier of the message with a previously set same background; 0 if none. Can be an identifier of a deleted message

  • background ("types.ChatBackground") – The new background

  • only_for_self (bool) – True, if the background was set only for self

__init__(old_background_message_id=0, background=None, only_for_self=False)[source]
Parameters:
  • old_background_message_id (int)

  • background (ChatBackground | None)

  • only_for_self (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageChatSetBackground]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageChatSetBackground']

to_dict()[source]
Return type:

dict

background: Optional[ChatBackground]

The new background

old_background_message_id: int

Identifier of the message with a previously set same background; 0 if none. Can be an identifier of a deleted message

only_for_self: bool

True, if the background was set only for self

class pytdbot.types.MessageChatSetMessageAutoDeleteTime(message_auto_delete_time=0, from_user_id=0)[source]

Bases: TlObject, MessageContent

The auto-delete or self-destruct timer for messages in the chat has been changed

Parameters:
  • message_auto_delete_time (int) – New value auto-delete or self-destruct time, in seconds; 0 if disabled

  • from_user_id (int) – If not 0, a user identifier, which default setting was automatically applied

__init__(message_auto_delete_time=0, from_user_id=0)[source]
Parameters:
  • message_auto_delete_time (int)

  • from_user_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageChatSetMessageAutoDeleteTime]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageChatSetMessageAutoDeleteTime']

to_dict()[source]
Return type:

dict

from_user_id: int

If not 0, a user identifier, which default setting was automatically applied

message_auto_delete_time: int

New value auto-delete or self-destruct time, in seconds; 0 if disabled

class pytdbot.types.MessageChatSetTheme(theme=None)[source]

Bases: TlObject, MessageContent

A theme in the chat has been changed

Parameters:

theme ("types.ChatTheme") – New theme for the chat; may be null if chat theme was reset to the default one

__init__(theme=None)[source]
Parameters:

theme (ChatTheme | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageChatSetTheme]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageChatSetTheme']

to_dict()[source]
Return type:

dict

theme: Union[ChatThemeEmoji, ChatThemeGift, None]

New theme for the chat; may be null if chat theme was reset to the default one

class pytdbot.types.MessageChatShared(chat=None, button_id=0)[source]

Bases: TlObject, MessageContent

The current user shared a chat, which was requested by the bot

Parameters:
  • chat ("types.SharedChat") – The shared chat

  • button_id (int) – Identifier of the keyboard button with the request

__init__(chat=None, button_id=0)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageChatShared]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageChatShared']

to_dict()[source]
Return type:

dict

button_id: int

Identifier of the keyboard button with the request

chat: Optional[SharedChat]

The shared chat

class pytdbot.types.MessageChatUpgradeFrom(title='', basic_group_id=0)[source]

Bases: TlObject, MessageContent

A supergroup has been created from a basic group

Parameters:
  • title (str) – Title of the newly created supergroup

  • basic_group_id (int) – The identifier of the original basic group

__init__(title='', basic_group_id=0)[source]
Parameters:
  • title (str)

  • basic_group_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageChatUpgradeFrom]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageChatUpgradeFrom']

to_dict()[source]
Return type:

dict

basic_group_id: int

The identifier of the original basic group

title: Optional[str]

Title of the newly created supergroup

class pytdbot.types.MessageChatUpgradeTo(supergroup_id=0)[source]

Bases: TlObject, MessageContent

A basic group was upgraded to a supergroup and was deactivated as the result

Parameters:

supergroup_id (int) – Identifier of the supergroup to which the basic group was upgraded

__init__(supergroup_id=0)[source]
Parameters:

supergroup_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageChatUpgradeTo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageChatUpgradeTo']

to_dict()[source]
Return type:

dict

supergroup_id: int

Identifier of the supergroup to which the basic group was upgraded

class pytdbot.types.MessageChecklist(list=None)[source]

Bases: TlObject, MessageContent

A message with a checklist

Parameters:

list ("types.Checklist") – The checklist description

__init__(list=None)[source]
Parameters:

list (Checklist | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageChecklist]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageChecklist']

to_dict()[source]
Return type:

dict

list: Optional[Checklist]

The checklist description

class pytdbot.types.MessageChecklistTasksAdded(checklist_message_id=0, tasks=None)[source]

Bases: TlObject, MessageContent

Some tasks were added to a checklist

Parameters:
  • checklist_message_id (int) – Identifier of the message with the checklist; can be 0 if the message was deleted

  • tasks (List["types.ChecklistTask"]) – List of tasks added to the checklist

__init__(checklist_message_id=0, tasks=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageChecklistTasksAdded]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageChecklistTasksAdded']

to_dict()[source]
Return type:

dict

checklist_message_id: int

Identifier of the message with the checklist; can be 0 if the message was deleted

tasks: List[ChecklistTask]

List of tasks added to the checklist

class pytdbot.types.MessageChecklistTasksDone(checklist_message_id=0, marked_as_done_task_ids=None, marked_as_not_done_task_ids=None)[source]

Bases: TlObject, MessageContent

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

Parameters:
  • checklist_message_id (int) – Identifier of the message with the checklist; can be 0 if the message was deleted

  • marked_as_done_task_ids (List[int]) – Identifiers of tasks that were marked as done

  • marked_as_not_done_task_ids (List[int]) – Identifiers of tasks that were marked as not done

__init__(checklist_message_id=0, marked_as_done_task_ids=None, marked_as_not_done_task_ids=None)[source]
Parameters:
  • checklist_message_id (int)

  • marked_as_done_task_ids (List[int] | None)

  • marked_as_not_done_task_ids (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageChecklistTasksDone]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageChecklistTasksDone']

to_dict()[source]
Return type:

dict

checklist_message_id: int

Identifier of the message with the checklist; can be 0 if the message was deleted

marked_as_done_task_ids: List[int]

Identifiers of tasks that were marked as done

marked_as_not_done_task_ids: List[int]

Identifiers of tasks that were marked as not done

class pytdbot.types.MessageContact(contact=None)[source]

Bases: TlObject, MessageContent

A message with a user contact

Parameters:

contact ("types.Contact") – The contact description

__init__(contact=None)[source]
Parameters:

contact (Contact | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageContact]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageContact']

to_dict()[source]
Return type:

dict

contact: Optional[Contact]

The contact description

class pytdbot.types.MessageContactRegistered[source]

Bases: TlObject, MessageContent

A contact has registered with Telegram

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageContactRegistered]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageContactRegistered']

to_dict()[source]
Return type:

dict

class pytdbot.types.MessageContent[source]

Bases: object

Contains the content of a message

class pytdbot.types.MessageCopyOptions(send_copy=False, replace_caption=False, new_caption=None, new_show_caption_above_media=False)[source]

Bases: TlObject

Options to be used when a message content is copied without reference to the original sender. Service messages, messages with messageInvoice, messagePaidMedia, messageGiveaway, or messageGiveawayWinners content can’t be copied

Parameters:
  • send_copy (bool) – True, if content of the message needs to be copied without reference to the original sender. Always true if the message is forwarded to a secret chat or is local. Use messageProperties.can_be_copied and messageProperties.can_be_copied_to_secret_chat to check whether the message is suitable

  • replace_caption (bool) – True, if media caption of the message copy needs to be replaced. Ignored if send_copy is false

  • new_caption ("types.FormattedText") – New message caption; pass null to copy message without caption. Ignored if replace_caption is false

  • new_show_caption_above_media (bool) – True, if new caption must be shown above the media; otherwise, new caption must be shown below the media; not supported in secret chats. Ignored if replace_caption is false

__init__(send_copy=False, replace_caption=False, new_caption=None, new_show_caption_above_media=False)[source]
Parameters:
  • send_copy (bool)

  • replace_caption (bool)

  • new_caption (FormattedText | None)

  • new_show_caption_above_media (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageCopyOptions]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageCopyOptions']

classmethod getType()[source]
Return type:

Literal['messageCopyOptions']

to_dict()[source]
Return type:

dict

new_caption: Optional[FormattedText]

New message caption; pass null to copy message without caption. Ignored if replace_caption is false

new_show_caption_above_media: bool

True, if new caption must be shown above the media; otherwise, new caption must be shown below the media; not supported in secret chats. Ignored if replace_caption is false

replace_caption: bool

True, if media caption of the message copy needs to be replaced. Ignored if send_copy is false

send_copy: bool

True, if content of the message needs to be copied without reference to the original sender. Always true if the message is forwarded to a secret chat or is local. Use messageProperties.can_be_copied and messageProperties.can_be_copied_to_secret_chat to check whether the message is suitable

class pytdbot.types.MessageCustomServiceAction(text='')[source]

Bases: TlObject, MessageContent

A non-standard action has happened in the chat

Parameters:

text (str) – Message text to be shown in the chat

__init__(text='')[source]
Parameters:

text (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageCustomServiceAction]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageCustomServiceAction']

to_dict()[source]
Return type:

dict

text: Optional[str]

Message text to be shown in the chat

class pytdbot.types.MessageDice(initial_state=None, final_state=None, emoji='', value=0, success_animation_frame_number=0)[source]

Bases: TlObject, MessageContent

A dice message. The dice value is randomly generated by the server

Parameters:
  • initial_state ("types.DiceStickers") – The animated stickers with the initial dice animation; may be null if unknown. The update updateMessageContent will be sent when the sticker became known

  • final_state ("types.DiceStickers") – The animated stickers with the final dice animation; may be null if unknown. The update updateMessageContent will be sent when the sticker became known

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

  • value (int) – The dice value. If the value is 0, the dice don’t have final state yet

  • success_animation_frame_number (int) – Number of frame after which a success animation like a shower of confetti needs to be shown on updateMessageSendSucceeded

__init__(initial_state=None, final_state=None, emoji='', value=0, success_animation_frame_number=0)[source]
Parameters:
  • initial_state (DiceStickers | None)

  • final_state (DiceStickers | None)

  • emoji (str)

  • value (int)

  • success_animation_frame_number (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageDice]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageDice']

to_dict()[source]
Return type:

dict

emoji: Optional[str]

Emoji on which the dice throw animation is based

final_state: Union[DiceStickersRegular, DiceStickersSlotMachine, None]

The animated stickers with the final dice animation; may be null if unknown. The update updateMessageContent will be sent when the sticker became known

initial_state: Union[DiceStickersRegular, DiceStickersSlotMachine, None]

The animated stickers with the initial dice animation; may be null if unknown. The update updateMessageContent will be sent when the sticker became known

success_animation_frame_number: int

Number of frame after which a success animation like a shower of confetti needs to be shown on updateMessageSendSucceeded

value: int

The dice value. If the value is 0, the dice don’t have final state yet

class pytdbot.types.MessageDirectMessagePriceChanged(is_enabled=False, paid_message_star_count=0)[source]

Bases: TlObject, MessageContent

A price for direct messages was changed in the channel chat

Parameters:
  • is_enabled (bool) – True, if direct messages group was enabled for the channel; false otherwise

  • paid_message_star_count (int) – The new number of Telegram Stars that must be paid by non-administrator users of the channel chat for each message sent to the direct messages group; 0 if the direct messages group was disabled or the messages are free

__init__(is_enabled=False, paid_message_star_count=0)[source]
Parameters:
  • is_enabled (bool)

  • paid_message_star_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageDirectMessagePriceChanged]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageDirectMessagePriceChanged']

to_dict()[source]
Return type:

dict

is_enabled: bool

True, if direct messages group was enabled for the channel; false otherwise

paid_message_star_count: int

The new number of Telegram Stars that must be paid by non-administrator users of the channel chat for each message sent to the direct messages group; 0 if the direct messages group was disabled or the messages are free

class pytdbot.types.MessageDocument(document=None, caption=None)[source]

Bases: TlObject, MessageContent

A document message (general file)

Parameters:
  • document ("types.Document") – The document description

  • caption ("types.FormattedText") – Document caption

__init__(document=None, caption=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageDocument]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageDocument']

to_dict()[source]
Return type:

dict

caption: Optional[FormattedText]

Document caption

document: Optional[Document]

The document description

class pytdbot.types.MessageEffect(id=0, static_icon=None, emoji='', is_premium=False, type=None)[source]

Bases: TlObject

Contains information about an effect added to a message

Parameters:
  • id (int) – Unique identifier of the effect

  • static_icon ("types.Sticker") – Static icon for the effect in WEBP format; may be null if none

  • emoji (str) – Emoji corresponding to the effect that can be used if static icon isn’t available

  • is_premium (bool) – True, if Telegram Premium subscription is required to use the effect

  • type ("types.MessageEffectType") – Type of the effect

__init__(id=0, static_icon=None, emoji='', is_premium=False, type=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageEffect]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageEffect']

classmethod getType()[source]
Return type:

Literal['messageEffect']

to_dict()[source]
Return type:

dict

emoji: Optional[str]

Emoji corresponding to the effect that can be used if static icon isn’t available

id: int

Unique identifier of the effect

is_premium: bool

True, if Telegram Premium subscription is required to use the effect

static_icon: Optional[Sticker]

Static icon for the effect in WEBP format; may be null if none

type: Union[MessageEffectTypeEmojiReaction, MessageEffectTypePremiumSticker, None]

Type of the effect

class pytdbot.types.MessageEffectType[source]

Bases: object

Describes type of emoji effect

class pytdbot.types.MessageEffectTypeEmojiReaction(select_animation=None, effect_animation=None)[source]

Bases: TlObject, MessageEffectType

An effect from an emoji reaction

Parameters:
  • select_animation ("types.Sticker") – Select animation for the effect in TGS format

  • effect_animation ("types.Sticker") – Effect animation for the effect in TGS format

__init__(select_animation=None, effect_animation=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageEffectTypeEmojiReaction]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageEffectType']

classmethod getType()[source]
Return type:

Literal['messageEffectTypeEmojiReaction']

to_dict()[source]
Return type:

dict

effect_animation: Optional[Sticker]

Effect animation for the effect in TGS format

select_animation: Optional[Sticker]

Select animation for the effect in TGS format

class pytdbot.types.MessageEffectTypePremiumSticker(sticker=None)[source]

Bases: TlObject, MessageEffectType

An effect from a premium sticker

Parameters:

sticker ("types.Sticker") – The premium sticker. The effect can be found at sticker.full_type.premium_animation

__init__(sticker=None)[source]
Parameters:

sticker (Sticker | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageEffectTypePremiumSticker]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageEffectType']

classmethod getType()[source]
Return type:

Literal['messageEffectTypePremiumSticker']

to_dict()[source]
Return type:

dict

sticker: Optional[Sticker]

The premium sticker. The effect can be found at sticker.full_type.premium_animation

class pytdbot.types.MessageExpiredPhoto[source]

Bases: TlObject, MessageContent

A self-destructed photo message

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageExpiredPhoto]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageExpiredPhoto']

to_dict()[source]
Return type:

dict

class pytdbot.types.MessageExpiredVideo[source]

Bases: TlObject, MessageContent

A self-destructed video message

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageExpiredVideo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageExpiredVideo']

to_dict()[source]
Return type:

dict

class pytdbot.types.MessageExpiredVideoNote[source]

Bases: TlObject, MessageContent

A self-destructed video note message

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageExpiredVideoNote]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageExpiredVideoNote']

to_dict()[source]
Return type:

dict

class pytdbot.types.MessageExpiredVoiceNote[source]

Bases: TlObject, MessageContent

A self-destructed voice note message

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageExpiredVoiceNote]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageExpiredVoiceNote']

to_dict()[source]
Return type:

dict

class pytdbot.types.MessageFileType[source]

Bases: object

Contains information about a file with messages exported from another app

class pytdbot.types.MessageFileTypeGroup(title='')[source]

Bases: TlObject, MessageFileType

The messages were exported from a group chat

Parameters:

title (str) – Title of the group chat; may be empty if unrecognized

__init__(title='')[source]
Parameters:

title (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageFileTypeGroup]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageFileType']

classmethod getType()[source]
Return type:

Literal['messageFileTypeGroup']

to_dict()[source]
Return type:

dict

title: Optional[str]

Title of the group chat; may be empty if unrecognized

class pytdbot.types.MessageFileTypePrivate(name='')[source]

Bases: TlObject, MessageFileType

The messages were exported from a private chat

Parameters:

name (str) – Name of the other party; may be empty if unrecognized

__init__(name='')[source]
Parameters:

name (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageFileTypePrivate]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageFileType']

classmethod getType()[source]
Return type:

Literal['messageFileTypePrivate']

to_dict()[source]
Return type:

dict

name: Optional[str]

Name of the other party; may be empty if unrecognized

class pytdbot.types.MessageFileTypeUnknown[source]

Bases: TlObject, MessageFileType

The messages were exported from a chat of unknown type

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageFileTypeUnknown]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageFileType']

classmethod getType()[source]
Return type:

Literal['messageFileTypeUnknown']

to_dict()[source]
Return type:

dict

class pytdbot.types.MessageForumTopicCreated(name='', icon=None)[source]

Bases: TlObject, MessageContent

A forum topic has been created

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

  • icon ("types.ForumTopicIcon") – Icon of the topic

__init__(name='', icon=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageForumTopicCreated]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageForumTopicCreated']

to_dict()[source]
Return type:

dict

icon: Optional[ForumTopicIcon]

Icon of the topic

name: Optional[str]

Name of the topic

class pytdbot.types.MessageForumTopicEdited(name='', edit_icon_custom_emoji_id=False, icon_custom_emoji_id=0)[source]

Bases: TlObject, MessageContent

A forum topic has been edited

Parameters:
  • name (str) – If non-empty, the new name of the topic

  • edit_icon_custom_emoji_id (bool) – True, if icon’s custom_emoji_id is changed

  • icon_custom_emoji_id (int) – New unique identifier of the custom emoji shown on the topic icon; 0 if none. Must be ignored if edit_icon_custom_emoji_id is false

__init__(name='', edit_icon_custom_emoji_id=False, icon_custom_emoji_id=0)[source]
Parameters:
  • name (str)

  • edit_icon_custom_emoji_id (bool)

  • icon_custom_emoji_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageForumTopicEdited]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageForumTopicEdited']

to_dict()[source]
Return type:

dict

edit_icon_custom_emoji_id: bool

True, if icon’s custom_emoji_id is changed

icon_custom_emoji_id: int

New unique identifier of the custom emoji shown on the topic icon; 0 if none. Must be ignored if edit_icon_custom_emoji_id is false

name: Optional[str]

If non-empty, the new name of the topic

class pytdbot.types.MessageForumTopicIsClosedToggled(is_closed=False)[source]

Bases: TlObject, MessageContent

A forum topic has been closed or opened

Parameters:

is_closed (bool) – True, if the topic was closed; otherwise, the topic was reopened

__init__(is_closed=False)[source]
Parameters:

is_closed (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageForumTopicIsClosedToggled]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageForumTopicIsClosedToggled']

to_dict()[source]
Return type:

dict

is_closed: bool

True, if the topic was closed; otherwise, the topic was reopened

class pytdbot.types.MessageForumTopicIsHiddenToggled(is_hidden=False)[source]

Bases: TlObject, MessageContent

A General forum topic has been hidden or unhidden

Parameters:

is_hidden (bool) – True, if the topic was hidden; otherwise, the topic was unhidden

__init__(is_hidden=False)[source]
Parameters:

is_hidden (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageForumTopicIsHiddenToggled]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageForumTopicIsHiddenToggled']

to_dict()[source]
Return type:

dict

is_hidden: bool

True, if the topic was hidden; otherwise, the topic was unhidden

class pytdbot.types.MessageForwardInfo(origin=None, date=0, source=None, public_service_announcement_type='')[source]

Bases: TlObject

Contains information about a forwarded message

Parameters:
  • origin ("types.MessageOrigin") – Origin of the forwarded message

  • date (int) – Point in time (Unix timestamp) when the message was originally sent

  • source ("types.ForwardSource") – For messages forwarded to the chat with the current user (Saved Messages), to the Replies bot chat, or to the channel’s discussion group, information about the source message from which the message was forwarded last time; may be null for other forwards or if unknown

  • public_service_announcement_type (str) – The type of public service announcement for the forwarded message

__init__(origin=None, date=0, source=None, public_service_announcement_type='')[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageForwardInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageForwardInfo']

classmethod getType()[source]
Return type:

Literal['messageForwardInfo']

to_dict()[source]
Return type:

dict

date: int

Point in time (Unix timestamp) when the message was originally sent

origin: Union[MessageOriginUser, MessageOriginHiddenUser, MessageOriginChat, MessageOriginChannel, None]

Origin of the forwarded message

public_service_announcement_type: Optional[str]

The type of public service announcement for the forwarded message

source: Optional[ForwardSource]

For messages forwarded to the chat with the current user (Saved Messages), to the Replies bot chat, or to the channel’s discussion group, information about the source message from which the message was forwarded last time; may be null for other forwards or if unknown

class pytdbot.types.MessageGame(game=None)[source]

Bases: TlObject, MessageContent

A message with a game

Parameters:

game ("types.Game") – The game description

__init__(game=None)[source]
Parameters:

game (Game | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageGame]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageGame']

to_dict()[source]
Return type:

dict

game: Optional[Game]

The game description

class pytdbot.types.MessageGameScore(game_message_id=0, game_id=0, score=0)[source]

Bases: TlObject, MessageContent

A new high score was achieved in a game

Parameters:
  • game_message_id (int) – Identifier of the message with the game, can be an identifier of a deleted message

  • game_id (int) – Identifier of the game; may be different from the games presented in the message with the game

  • score (int) – New score

__init__(game_message_id=0, game_id=0, score=0)[source]
Parameters:
  • game_message_id (int)

  • game_id (int)

  • score (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageGameScore]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageGameScore']

to_dict()[source]
Return type:

dict

game_id: int

Identifier of the game; may be different from the games presented in the message with the game

game_message_id: int

Identifier of the message with the game, can be an identifier of a deleted message

score: int

New score

class pytdbot.types.MessageGift(gift=None, sender_id=None, receiver_id=None, received_gift_id='', text=None, sell_star_count=0, prepaid_upgrade_star_count=0, is_upgrade_separate=False, is_private=False, is_saved=False, is_prepaid_upgrade=False, can_be_upgraded=False, was_converted=False, was_upgraded=False, was_refunded=False, upgraded_received_gift_id='', prepaid_upgrade_hash='')[source]

Bases: TlObject, MessageContent

A regular gift was received or sent by the current user, or the current user was notified about a channel gift

Parameters:
  • gift ("types.Gift") – The gift

  • sender_id ("types.MessageSender") – Sender of the gift; may be null for outgoing messages about prepaid upgrade of gifts from unknown users

  • receiver_id ("types.MessageSender") – Receiver of the gift

  • received_gift_id (str) – Unique identifier of the received gift for the current user; only for the receiver of the gift

  • text ("types.FormattedText") – Message added to the gift

  • sell_star_count (int) – Number of Telegram Stars that can be claimed by the receiver instead of the regular gift; 0 if the gift can’t be sold by the receiver

  • prepaid_upgrade_star_count (int) – Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift

  • is_upgrade_separate (bool) – True, if the upgrade was bought after the gift was sent. In this case, prepaid upgrade cost must not be added to the gift cost

  • is_private (bool) – 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) – True, if the gift is displayed on the user’s or the channel’s profile page; only for the receiver of the gift

  • is_prepaid_upgrade (bool) – True, if the message is about prepaid upgrade of the gift by another user

  • can_be_upgraded (bool) – True, if the gift can be upgraded to a unique gift; only for the receiver of the gift

  • was_converted (bool) – True, if the gift was converted to Telegram Stars; only for the receiver of the gift

  • was_upgraded (bool) – True, if the gift was upgraded to a unique gift

  • was_refunded (bool) – True, if the gift was refunded and isn’t available anymore

  • upgraded_received_gift_id (str) – Identifier of the corresponding upgraded gift; may be empty if unknown. Use getReceivedGift to get information about the gift

  • prepaid_upgrade_hash (str) – If non-empty, then the user can pay for an upgrade of the gift using buyGiftUpgrade

__init__(gift=None, sender_id=None, receiver_id=None, received_gift_id='', text=None, sell_star_count=0, prepaid_upgrade_star_count=0, is_upgrade_separate=False, is_private=False, is_saved=False, is_prepaid_upgrade=False, can_be_upgraded=False, was_converted=False, was_upgraded=False, was_refunded=False, upgraded_received_gift_id='', prepaid_upgrade_hash='')[source]
Parameters:
  • gift (Gift | None)

  • sender_id (MessageSender | None)

  • receiver_id (MessageSender | None)

  • received_gift_id (str)

  • text (FormattedText | None)

  • sell_star_count (int)

  • prepaid_upgrade_star_count (int)

  • is_upgrade_separate (bool)

  • is_private (bool)

  • is_saved (bool)

  • is_prepaid_upgrade (bool)

  • can_be_upgraded (bool)

  • was_converted (bool)

  • was_upgraded (bool)

  • was_refunded (bool)

  • upgraded_received_gift_id (str)

  • prepaid_upgrade_hash (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageGift]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageGift']

to_dict()[source]
Return type:

dict

can_be_upgraded: bool

True, if the gift can be upgraded to a unique gift; only for the receiver of the gift

gift: Optional[Gift]

The gift

is_prepaid_upgrade: bool

True, if the message is about prepaid upgrade of the gift by another user

is_private: bool

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

True, if the gift is displayed on the user’s or the channel’s profile page; only for the receiver of the gift

is_upgrade_separate: bool

True, if the upgrade was bought after the gift was sent. In this case, prepaid upgrade cost must not be added to the gift cost

prepaid_upgrade_hash: Optional[str]

If non-empty, then the user can pay for an upgrade of the gift using buyGiftUpgrade

prepaid_upgrade_star_count: int

Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift

received_gift_id: Optional[str]

Unique identifier of the received gift for the current user; only for the receiver of the gift

receiver_id: Union[MessageSenderUser, MessageSenderChat, None]

Receiver of the gift

sell_star_count: int

Number of Telegram Stars that can be claimed by the receiver instead of the regular gift; 0 if the gift can’t be sold by the receiver

sender_id: Union[MessageSenderUser, MessageSenderChat, None]

Sender of the gift; may be null for outgoing messages about prepaid upgrade of gifts from unknown users

text: Optional[FormattedText]

Message added to the gift

upgraded_received_gift_id: Optional[str]

Identifier of the corresponding upgraded gift; may be empty if unknown. Use getReceivedGift to get information about the gift

was_converted: bool

True, if the gift was converted to Telegram Stars; only for the receiver of the gift

was_refunded: bool

True, if the gift was refunded and isn’t available anymore

was_upgraded: bool

True, if the gift was upgraded to a unique gift

class pytdbot.types.MessageGiftedPremium(gifter_user_id=0, receiver_user_id=0, text=None, currency='', amount=0, cryptocurrency='', cryptocurrency_amount=0, month_count=0, sticker=None)[source]

Bases: TlObject, MessageContent

Telegram Premium was gifted to a user

Parameters:
  • gifter_user_id (int) – The identifier of a user that gifted Telegram Premium; 0 if the gift was anonymous or is outgoing

  • receiver_user_id (int) – The identifier of a user that received Telegram Premium; 0 if the gift is incoming

  • text ("types.FormattedText") – Message added to the gifted Telegram Premium by the sender

  • currency (str) – Currency for the paid amount

  • amount (int) – The paid amount, in the smallest units of the currency

  • cryptocurrency (str) – Cryptocurrency used to pay for the gift; may be empty if none

  • cryptocurrency_amount (int) – The paid amount, in the smallest units of the cryptocurrency; 0 if none

  • month_count (int) – Number of months the Telegram Premium subscription will be active

  • sticker ("types.Sticker") – A sticker to be shown in the message; may be null if unknown

__init__(gifter_user_id=0, receiver_user_id=0, text=None, currency='', amount=0, cryptocurrency='', cryptocurrency_amount=0, month_count=0, sticker=None)[source]
Parameters:
  • gifter_user_id (int)

  • receiver_user_id (int)

  • text (FormattedText | None)

  • currency (str)

  • amount (int)

  • cryptocurrency (str)

  • cryptocurrency_amount (int)

  • month_count (int)

  • sticker (Sticker | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageGiftedPremium]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageGiftedPremium']

to_dict()[source]
Return type:

dict

amount: int

The paid amount, in the smallest units of the currency

cryptocurrency: Optional[str]

Cryptocurrency used to pay for the gift; may be empty if none

cryptocurrency_amount: int

The paid amount, in the smallest units of the cryptocurrency; 0 if none

currency: Optional[str]

Currency for the paid amount

gifter_user_id: int

The identifier of a user that gifted Telegram Premium; 0 if the gift was anonymous or is outgoing

month_count: int

Number of months the Telegram Premium subscription will be active

receiver_user_id: int

The identifier of a user that received Telegram Premium; 0 if the gift is incoming

sticker: Optional[Sticker]

A sticker to be shown in the message; may be null if unknown

text: Optional[FormattedText]

Message added to the gifted Telegram Premium by the sender

class pytdbot.types.MessageGiftedStars(gifter_user_id=0, receiver_user_id=0, currency='', amount=0, cryptocurrency='', cryptocurrency_amount=0, star_count=0, transaction_id='', sticker=None)[source]

Bases: TlObject, MessageContent

Telegram Stars were gifted to a user

Parameters:
  • gifter_user_id (int) – The identifier of a user that gifted Telegram Stars; 0 if the gift was anonymous or is outgoing

  • receiver_user_id (int) – The identifier of a user that received Telegram Stars; 0 if the gift is incoming

  • currency (str) – Currency for the paid amount

  • amount (int) – The paid amount, in the smallest units of the currency

  • cryptocurrency (str) – Cryptocurrency used to pay for the gift; may be empty if none

  • cryptocurrency_amount (int) – The paid amount, in the smallest units of the cryptocurrency; 0 if none

  • star_count (int) – Number of Telegram Stars that were gifted

  • transaction_id (str) – Identifier of the transaction for Telegram Stars purchase; for receiver only

  • sticker ("types.Sticker") – A sticker to be shown in the message; may be null if unknown

__init__(gifter_user_id=0, receiver_user_id=0, currency='', amount=0, cryptocurrency='', cryptocurrency_amount=0, star_count=0, transaction_id='', sticker=None)[source]
Parameters:
  • gifter_user_id (int)

  • receiver_user_id (int)

  • currency (str)

  • amount (int)

  • cryptocurrency (str)

  • cryptocurrency_amount (int)

  • star_count (int)

  • transaction_id (str)

  • sticker (Sticker | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageGiftedStars]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageGiftedStars']

to_dict()[source]
Return type:

dict

amount: int

The paid amount, in the smallest units of the currency

cryptocurrency: Optional[str]

Cryptocurrency used to pay for the gift; may be empty if none

cryptocurrency_amount: int

The paid amount, in the smallest units of the cryptocurrency; 0 if none

currency: Optional[str]

Currency for the paid amount

gifter_user_id: int

The identifier of a user that gifted Telegram Stars; 0 if the gift was anonymous or is outgoing

receiver_user_id: int

The identifier of a user that received Telegram Stars; 0 if the gift is incoming

star_count: int

Number of Telegram Stars that were gifted

sticker: Optional[Sticker]

A sticker to be shown in the message; may be null if unknown

transaction_id: Optional[str]

Identifier of the transaction for Telegram Stars purchase; for receiver only

class pytdbot.types.MessageGiftedTon(gifter_user_id=0, receiver_user_id=0, ton_amount=0, transaction_id='', sticker=None)[source]

Bases: TlObject, MessageContent

Toncoins were gifted to a user

Parameters:
  • gifter_user_id (int) – The identifier of a user that gifted Toncoins; 0 if the gift was anonymous or is outgoing

  • receiver_user_id (int) – The identifier of a user that received Toncoins; 0 if the gift is incoming

  • ton_amount (int) – The received amount of Toncoins, in the smallest units of the cryptocurrency

  • transaction_id (str) – Identifier of the transaction for Toncoin credit; for receiver only

  • sticker ("types.Sticker") – A sticker to be shown in the message; may be null if unknown

__init__(gifter_user_id=0, receiver_user_id=0, ton_amount=0, transaction_id='', sticker=None)[source]
Parameters:
  • gifter_user_id (int)

  • receiver_user_id (int)

  • ton_amount (int)

  • transaction_id (str)

  • sticker (Sticker | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageGiftedTon]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageGiftedTon']

to_dict()[source]
Return type:

dict

gifter_user_id: int

The identifier of a user that gifted Toncoins; 0 if the gift was anonymous or is outgoing

receiver_user_id: int

The identifier of a user that received Toncoins; 0 if the gift is incoming

sticker: Optional[Sticker]

A sticker to be shown in the message; may be null if unknown

ton_amount: int

The received amount of Toncoins, in the smallest units of the cryptocurrency

transaction_id: Optional[str]

Identifier of the transaction for Toncoin credit; for receiver only

class pytdbot.types.MessageGiveaway(parameters=None, winner_count=0, prize=None, sticker=None)[source]

Bases: TlObject, MessageContent

A giveaway

Parameters:
  • parameters ("types.GiveawayParameters") – Giveaway parameters

  • winner_count (int) – Number of users which will receive Telegram Premium subscription gift codes

  • prize ("types.GiveawayPrize") – Prize of the giveaway

  • sticker ("types.Sticker") – A sticker to be shown in the message; may be null if unknown

__init__(parameters=None, winner_count=0, prize=None, sticker=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageGiveaway]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageGiveaway']

to_dict()[source]
Return type:

dict

parameters: Optional[GiveawayParameters]

Giveaway parameters

prize: Union[GiveawayPrizePremium, GiveawayPrizeStars, None]

Prize of the giveaway

sticker: Optional[Sticker]

A sticker to be shown in the message; may be null if unknown

winner_count: int

Number of users which will receive Telegram Premium subscription gift codes

class pytdbot.types.MessageGiveawayCompleted(giveaway_message_id=0, winner_count=0, is_star_giveaway=False, unclaimed_prize_count=0)[source]

Bases: TlObject, MessageContent

A giveaway without public winners has been completed for the chat

Parameters:
  • giveaway_message_id (int) – Identifier of the message with the giveaway; can be 0 if the message was deleted

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

  • is_star_giveaway (bool) – True, if the giveaway is a Telegram Star giveaway

  • unclaimed_prize_count (int) – Number of undistributed prizes; for Telegram Premium giveaways only

__init__(giveaway_message_id=0, winner_count=0, is_star_giveaway=False, unclaimed_prize_count=0)[source]
Parameters:
  • giveaway_message_id (int)

  • winner_count (int)

  • is_star_giveaway (bool)

  • unclaimed_prize_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageGiveawayCompleted]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageGiveawayCompleted']

to_dict()[source]
Return type:

dict

giveaway_message_id: int

Identifier of the message with the giveaway; can be 0 if the message was deleted

is_star_giveaway: bool

True, if the giveaway is a Telegram Star giveaway

unclaimed_prize_count: int

Number of undistributed prizes; for Telegram Premium giveaways only

winner_count: int

Number of winners in the giveaway

class pytdbot.types.MessageGiveawayCreated(star_count=0)[source]

Bases: TlObject, MessageContent

A giveaway was created for the chat. Use telegramPaymentPurposePremiumGiveaway, storePaymentPurposePremiumGiveaway, telegramPaymentPurposeStarGiveaway, or storePaymentPurposeStarGiveaway to create a giveaway

Parameters:

star_count (int) – Number of Telegram Stars that will be shared by winners of the giveaway; 0 for Telegram Premium giveaways

__init__(star_count=0)[source]
Parameters:

star_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageGiveawayCreated]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageGiveawayCreated']

to_dict()[source]
Return type:

dict

star_count: int

Number of Telegram Stars that will be shared by winners of the giveaway; 0 for Telegram Premium giveaways

class pytdbot.types.MessageGiveawayPrizeStars(star_count=0, transaction_id='', boosted_chat_id=0, giveaway_message_id=0, is_unclaimed=False, sticker=None)[source]

Bases: TlObject, MessageContent

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

Parameters:
  • star_count (int) – Number of Telegram Stars that were received

  • transaction_id (str) – Identifier of the transaction for Telegram Stars credit

  • boosted_chat_id (int) – Identifier of the supergroup or channel chat, which was automatically boosted by the winners of the giveaway

  • giveaway_message_id (int) – Identifier of the message with the giveaway in the boosted chat; can be 0 if the message was deleted

  • is_unclaimed (bool) – True, if the corresponding winner wasn’t chosen and the Telegram Stars were received by the owner of the boosted chat

  • sticker ("types.Sticker") – A sticker to be shown in the message; may be null if unknown

__init__(star_count=0, transaction_id='', boosted_chat_id=0, giveaway_message_id=0, is_unclaimed=False, sticker=None)[source]
Parameters:
  • star_count (int)

  • transaction_id (str)

  • boosted_chat_id (int)

  • giveaway_message_id (int)

  • is_unclaimed (bool)

  • sticker (Sticker | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageGiveawayPrizeStars]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageGiveawayPrizeStars']

to_dict()[source]
Return type:

dict

boosted_chat_id: int

Identifier of the supergroup or channel chat, which was automatically boosted by the winners of the giveaway

giveaway_message_id: int

Identifier of the message with the giveaway in the boosted chat; can be 0 if the message was deleted

is_unclaimed: bool

True, if the corresponding winner wasn’t chosen and the Telegram Stars were received by the owner of the boosted chat

star_count: int

Number of Telegram Stars that were received

sticker: Optional[Sticker]

A sticker to be shown in the message; may be null if unknown

transaction_id: Optional[str]

Identifier of the transaction for Telegram Stars credit

class pytdbot.types.MessageGiveawayWinners(boosted_chat_id=0, giveaway_message_id=0, additional_chat_count=0, actual_winners_selection_date=0, only_new_members=False, was_refunded=False, prize=None, prize_description='', winner_count=0, winner_user_ids=None, unclaimed_prize_count=0)[source]

Bases: TlObject, MessageContent

A giveaway with public winners has been completed for the chat

Parameters:
  • boosted_chat_id (int) – Identifier of the supergroup or channel chat, which was automatically boosted by the winners of the giveaway

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

  • additional_chat_count (int) – Number of other chats that participated in the giveaway

  • actual_winners_selection_date (int) – Point in time (Unix timestamp) when the winners were selected. May be bigger than winners selection date specified in parameters of the giveaway

  • only_new_members (bool) – True, if only new members of the chats were eligible for the giveaway

  • was_refunded (bool) – True, if the giveaway was canceled and was fully refunded

  • prize ("types.GiveawayPrize") – Prize of the giveaway

  • prize_description (str) – Additional description of the giveaway prize

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

  • winner_user_ids (List[int]) – Up to 100 user identifiers of the winners of the giveaway

  • unclaimed_prize_count (int) – Number of undistributed prizes; for Telegram Premium giveaways only

__init__(boosted_chat_id=0, giveaway_message_id=0, additional_chat_count=0, actual_winners_selection_date=0, only_new_members=False, was_refunded=False, prize=None, prize_description='', winner_count=0, winner_user_ids=None, unclaimed_prize_count=0)[source]
Parameters:
  • boosted_chat_id (int)

  • giveaway_message_id (int)

  • additional_chat_count (int)

  • actual_winners_selection_date (int)

  • only_new_members (bool)

  • was_refunded (bool)

  • prize (GiveawayPrize | None)

  • prize_description (str)

  • winner_count (int)

  • winner_user_ids (List[int] | None)

  • unclaimed_prize_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageGiveawayWinners]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageGiveawayWinners']

to_dict()[source]
Return type:

dict

actual_winners_selection_date: int

Point in time (Unix timestamp) when the winners were selected. May be bigger than winners selection date specified in parameters of the giveaway

additional_chat_count: int

Number of other chats that participated in the giveaway

boosted_chat_id: int

Identifier of the supergroup or channel chat, which was automatically boosted by the winners of the giveaway

giveaway_message_id: int

Identifier of the message with the giveaway in the boosted chat

only_new_members: bool

True, if only new members of the chats were eligible for the giveaway

prize: Union[GiveawayPrizePremium, GiveawayPrizeStars, None]

Prize of the giveaway

prize_description: Optional[str]

Additional description of the giveaway prize

unclaimed_prize_count: int

Number of undistributed prizes; for Telegram Premium giveaways only

was_refunded: bool

True, if the giveaway was canceled and was fully refunded

winner_count: int

Total number of winners in the giveaway

winner_user_ids: List[int]

Up to 100 user identifiers of the winners of the giveaway

class pytdbot.types.MessageGroupCall(is_active=False, was_missed=False, is_video=False, duration=0, other_participant_ids=None)[source]

Bases: TlObject, MessageContent

A message with information about a group call not bound to a chat. If the message is incoming, the call isn’t active, isn’t missed, and has no duration, and getOption("can_accept_calls") is true, then incoming call screen must be shown to the user. Use getGroupCallParticipants to show current group call participants on the screen. Use joinGroupCall to accept the call or declineGroupCallInvitation to decline it. If the call become active or missed, then the call screen must be hidden

Parameters:
  • is_active (bool) – True, if the call is active, i.e. the called user joined the call

  • was_missed (bool) – True, if the called user missed or declined the call

  • is_video (bool) – True, if the call is a video call

  • duration (int) – Call duration, in seconds; for left calls only

  • other_participant_ids (List["types.MessageSender"]) – Identifiers of some other call participants

__init__(is_active=False, was_missed=False, is_video=False, duration=0, other_participant_ids=None)[source]
Parameters:
  • is_active (bool)

  • was_missed (bool)

  • is_video (bool)

  • duration (int)

  • other_participant_ids (List[MessageSender] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageGroupCall]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageGroupCall']

to_dict()[source]
Return type:

dict

duration: int

Call duration, in seconds; for left calls only

is_active: bool

True, if the call is active, i.e. the called user joined the call

is_video: bool

True, if the call is a video call

other_participant_ids: List[MessageSender]

Identifiers of some other call participants

was_missed: bool

True, if the called user missed or declined the call

class pytdbot.types.MessageImportInfo(sender_name='', date=0)[source]

Bases: TlObject

Contains information about a message created with importMessages

Parameters:
  • sender_name (str) – Name of the original sender

  • date (int) – Point in time (Unix timestamp) when the message was originally sent

__init__(sender_name='', date=0)[source]
Parameters:
  • sender_name (str)

  • date (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageImportInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageImportInfo']

classmethod getType()[source]
Return type:

Literal['messageImportInfo']

to_dict()[source]
Return type:

dict

date: int

Point in time (Unix timestamp) when the message was originally sent

sender_name: Optional[str]

Name of the original sender

class pytdbot.types.MessageInteractionInfo(view_count=0, forward_count=0, reply_info=None, reactions=None)[source]

Bases: TlObject

Contains information about interactions with a message

Parameters:
  • view_count (int) – Number of times the message was viewed

  • forward_count (int) – Number of times the message was forwarded

  • reply_info ("types.MessageReplyInfo") – Information about direct or indirect replies to the message; may be null. Currently, available only in channels with a discussion supergroup and discussion supergroups for messages, which are not replies itself

  • reactions ("types.MessageReactions") – The list of reactions or tags added to the message; may be null

__init__(view_count=0, forward_count=0, reply_info=None, reactions=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageInteractionInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageInteractionInfo']

classmethod getType()[source]
Return type:

Literal['messageInteractionInfo']

to_dict()[source]
Return type:

dict

forward_count: int

Number of times the message was forwarded

reactions: Optional[MessageReactions]

The list of reactions or tags added to the message; may be null

reply_info: Optional[MessageReplyInfo]

Information about direct or indirect replies to the message; may be null. Currently, available only in channels with a discussion supergroup and discussion supergroups for messages, which are not replies itself

view_count: int

Number of times the message was viewed

class pytdbot.types.MessageInviteVideoChatParticipants(group_call_id=0, user_ids=None)[source]

Bases: TlObject, MessageContent

A message with information about an invitation to a video chat

Parameters:
  • group_call_id (int) – Identifier of the video chat. The video chat can be received through the method getGroupCall

  • user_ids (List[int]) – Invited user identifiers

__init__(group_call_id=0, user_ids=None)[source]
Parameters:
  • group_call_id (int)

  • user_ids (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageInviteVideoChatParticipants]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageInviteVideoChatParticipants']

to_dict()[source]
Return type:

dict

group_call_id: int

Identifier of the video chat. The video chat can be received through the method getGroupCall

user_ids: List[int]

Invited user identifiers

class pytdbot.types.MessageInvoice(product_info=None, currency='', total_amount=0, start_parameter='', is_test=False, need_shipping_address=False, receipt_message_id=0, paid_media=None, paid_media_caption=None)[source]

Bases: TlObject, MessageContent

A message with an invoice from a bot. Use getInternalLink with internalLinkTypeBotStart to share the invoice

Parameters:
  • product_info ("types.ProductInfo") – Information about the product

  • currency (str) – Currency for the product price

  • total_amount (int) – Product total price in the smallest units of the currency

  • start_parameter (str) – Unique invoice bot start_parameter to be passed to getInternalLink

  • is_test (bool) – True, if the invoice is a test invoice

  • need_shipping_address (bool) – True, if the shipping address must be specified

  • receipt_message_id (int) – The identifier of the message with the receipt, after the product has been purchased

  • paid_media ("types.PaidMedia") – Extended media attached to the invoice; may be null if none

  • paid_media_caption ("types.FormattedText") – Extended media caption; may be null if none

__init__(product_info=None, currency='', total_amount=0, start_parameter='', is_test=False, need_shipping_address=False, receipt_message_id=0, paid_media=None, paid_media_caption=None)[source]
Parameters:
  • product_info (ProductInfo | None)

  • currency (str)

  • total_amount (int)

  • start_parameter (str)

  • is_test (bool)

  • need_shipping_address (bool)

  • receipt_message_id (int)

  • paid_media (PaidMedia | None)

  • paid_media_caption (FormattedText | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageInvoice]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageInvoice']

to_dict()[source]
Return type:

dict

currency: Optional[str]

Currency for the product price

is_test: bool

True, if the invoice is a test invoice

need_shipping_address: bool

True, if the shipping address must be specified

paid_media: Union[PaidMediaPreview, PaidMediaPhoto, PaidMediaVideo, PaidMediaUnsupported, None]

Extended media attached to the invoice; may be null if none

paid_media_caption: Optional[FormattedText]

Extended media caption; may be null if none

product_info: Optional[ProductInfo]

Information about the product

receipt_message_id: int

The identifier of the message with the receipt, after the product has been purchased

start_parameter: Optional[str]

Unique invoice bot start_parameter to be passed to getInternalLink

total_amount: int

Product total price in the smallest units of the currency

class pytdbot.types.MessageLink(link='', is_public=False)[source]

Bases: TlObject

Contains an HTTPS link to a message in a supergroup or channel, or a forum topic

Parameters:
  • link (str) – The link

  • is_public (bool) – True, if the link will work for non-members of the chat

__init__(link='', is_public=False)[source]
Parameters:
  • link (str)

  • is_public (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageLink]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageLink']

classmethod getType()[source]
Return type:

Literal['messageLink']

to_dict()[source]
Return type:

dict

is_public: bool

True, if the link will work for non-members of the chat

link: Optional[str]

The link

class pytdbot.types.MessageLinkInfo(is_public=False, chat_id=0, message_thread_id=0, message=None, media_timestamp=0, for_album=False)[source]

Bases: TlObject

Contains information about a link to a message or a forum topic in a chat

Parameters:
  • is_public (bool) – True, if the link is a public link for a message or a forum topic in a chat

  • chat_id (int) – If found, identifier of the chat to which the link points, 0 otherwise

  • message_thread_id (int) – If found, identifier of the message thread in which to open the message, or a forum topic to open if the message is missing

  • message ("types.Message") – If found, the linked message; may be null

  • media_timestamp (int) – Timestamp from which the video/audio/video note/voice note/story playing must start, in seconds; 0 if not specified. The media can be in the message content or in its link preview

  • for_album (bool) – True, if the whole media album to which the message belongs is linked

__init__(is_public=False, chat_id=0, message_thread_id=0, message=None, media_timestamp=0, for_album=False)[source]
Parameters:
  • is_public (bool)

  • chat_id (int)

  • message_thread_id (int)

  • message (Message | None)

  • media_timestamp (int)

  • for_album (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageLinkInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageLinkInfo']

classmethod getType()[source]
Return type:

Literal['messageLinkInfo']

to_dict()[source]
Return type:

dict

chat_id: int

If found, identifier of the chat to which the link points, 0 otherwise

for_album: bool

True, if the whole media album to which the message belongs is linked

is_public: bool

True, if the link is a public link for a message or a forum topic in a chat

media_timestamp: int

Timestamp from which the video/audio/video note/voice note/story playing must start, in seconds; 0 if not specified. The media can be in the message content or in its link preview

message: Optional[Message]

If found, the linked message; may be null

message_thread_id: int

If found, identifier of the message thread in which to open the message, or a forum topic to open if the message is missing

class pytdbot.types.MessageLocation(location=None, live_period=0, expires_in=0, heading=0, proximity_alert_radius=0)[source]

Bases: TlObject, MessageContent

A message with a location

Parameters:
  • location ("types.Location") – The location description

  • live_period (int) – Time relative to the message send date, for which the location can be updated, in seconds; if 0x7FFFFFFF, then location can be updated forever

  • expires_in (int) – Left time for which the location can be updated, in seconds. If 0, then the location can’t be updated anymore. The update updateMessageContent is not sent when this field changes

  • heading (int) – For live locations, a direction in which the location moves, in degrees; 1-360. If 0 the direction is unknown

  • proximity_alert_radius (int) – For live locations, a maximum distance to another chat member for proximity alerts, in meters (0-100000). 0 if the notification is disabled. Available only to the message sender

__init__(location=None, live_period=0, expires_in=0, heading=0, proximity_alert_radius=0)[source]
Parameters:
  • location (Location | None)

  • live_period (int)

  • expires_in (int)

  • heading (int)

  • proximity_alert_radius (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageLocation]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageLocation']

to_dict()[source]
Return type:

dict

expires_in: int

Left time for which the location can be updated, in seconds. If 0, then the location can’t be updated anymore. The update updateMessageContent is not sent when this field changes

heading: int

For live locations, a direction in which the location moves, in degrees; 1-360. If 0 the direction is unknown

live_period: int

Time relative to the message send date, for which the location can be updated, in seconds; if 0x7FFFFFFF, then location can be updated forever

location: Optional[Location]

The location description

proximity_alert_radius: int

For live locations, a maximum distance to another chat member for proximity alerts, in meters (0-100000). 0 if the notification is disabled. Available only to the message sender

class pytdbot.types.MessageOrigin[source]

Bases: object

Contains information about the origin of a message

class pytdbot.types.MessageOriginChannel(chat_id=0, message_id=0, author_signature='')[source]

Bases: TlObject, MessageOrigin

The message was originally a post in a channel

Parameters:
  • chat_id (int) – Identifier of the channel chat to which the message was originally sent

  • message_id (int) – Message identifier of the original message

  • author_signature (str) – Original post author signature

__init__(chat_id=0, message_id=0, author_signature='')[source]
Parameters:
  • chat_id (int)

  • message_id (int)

  • author_signature (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageOriginChannel]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageOrigin']

classmethod getType()[source]
Return type:

Literal['messageOriginChannel']

to_dict()[source]
Return type:

dict

author_signature: Optional[str]

Original post author signature

chat_id: int

Identifier of the channel chat to which the message was originally sent

message_id: int

Message identifier of the original message

class pytdbot.types.MessageOriginChat(sender_chat_id=0, author_signature='')[source]

Bases: TlObject, MessageOrigin

The message was originally sent on behalf of a chat

Parameters:
  • sender_chat_id (int) – Identifier of the chat that originally sent the message

  • author_signature (str) – For messages originally sent by an anonymous chat administrator, original message author signature

__init__(sender_chat_id=0, author_signature='')[source]
Parameters:
  • sender_chat_id (int)

  • author_signature (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageOriginChat]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageOrigin']

classmethod getType()[source]
Return type:

Literal['messageOriginChat']

to_dict()[source]
Return type:

dict

author_signature: Optional[str]

For messages originally sent by an anonymous chat administrator, original message author signature

sender_chat_id: int

Identifier of the chat that originally sent the message

class pytdbot.types.MessageOriginHiddenUser(sender_name='')[source]

Bases: TlObject, MessageOrigin

The message was originally sent by a user, which is hidden by their privacy settings

Parameters:

sender_name (str) – Name of the sender

__init__(sender_name='')[source]
Parameters:

sender_name (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageOriginHiddenUser]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageOrigin']

classmethod getType()[source]
Return type:

Literal['messageOriginHiddenUser']

to_dict()[source]
Return type:

dict

sender_name: Optional[str]

Name of the sender

class pytdbot.types.MessageOriginUser(sender_user_id=0)[source]

Bases: TlObject, MessageOrigin

The message was originally sent by a known user

Parameters:

sender_user_id (int) – Identifier of the user that originally sent the message

__init__(sender_user_id=0)[source]
Parameters:

sender_user_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageOriginUser]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageOrigin']

classmethod getType()[source]
Return type:

Literal['messageOriginUser']

to_dict()[source]
Return type:

dict

sender_user_id: int

Identifier of the user that originally sent the message

class pytdbot.types.MessagePaidMedia(star_count=0, media=None, caption=None, show_caption_above_media=False)[source]

Bases: TlObject, MessageContent

A message with paid media

Parameters:
  • star_count (int) – Number of Telegram Stars needed to buy access to the media in the message

  • media (List["types.PaidMedia"]) – Information about the media

  • caption ("types.FormattedText") – Media caption

  • show_caption_above_media (bool) – True, if the caption must be shown above the media; otherwise, the caption must be shown below the media

__init__(star_count=0, media=None, caption=None, show_caption_above_media=False)[source]
Parameters:
  • star_count (int)

  • media (List[PaidMedia] | None)

  • caption (FormattedText | None)

  • show_caption_above_media (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessagePaidMedia]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messagePaidMedia']

to_dict()[source]
Return type:

dict

caption: Optional[FormattedText]

Media caption

media: List[PaidMedia]

Information about the media

show_caption_above_media: bool

True, if the caption must be shown above the media; otherwise, the caption must be shown below the media

star_count: int

Number of Telegram Stars needed to buy access to the media in the message

class pytdbot.types.MessagePaidMessagePriceChanged(paid_message_star_count=0)[source]

Bases: TlObject, MessageContent

A price for paid messages was changed in the supergroup chat

Parameters:

paid_message_star_count (int) – The new number of Telegram Stars that must be paid by non-administrator users of the supergroup chat for each sent message

__init__(paid_message_star_count=0)[source]
Parameters:

paid_message_star_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessagePaidMessagePriceChanged]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messagePaidMessagePriceChanged']

to_dict()[source]
Return type:

dict

paid_message_star_count: int

The new number of Telegram Stars that must be paid by non-administrator users of the supergroup chat for each sent message

class pytdbot.types.MessagePaidMessagesRefunded(message_count=0, star_count=0)[source]

Bases: TlObject, MessageContent

Paid messages were refunded

Parameters:
  • message_count (int) – The number of refunded messages

  • star_count (int) – The number of refunded Telegram Stars

__init__(message_count=0, star_count=0)[source]
Parameters:
  • message_count (int)

  • star_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessagePaidMessagesRefunded]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messagePaidMessagesRefunded']

to_dict()[source]
Return type:

dict

message_count: int

The number of refunded messages

star_count: int

The number of refunded Telegram Stars

class pytdbot.types.MessagePassportDataReceived(elements=None, credentials=None)[source]

Bases: TlObject, MessageContent

Telegram Passport data has been received; for bots only

Parameters:
  • elements (List["types.EncryptedPassportElement"]) – List of received Telegram Passport elements

  • credentials ("types.EncryptedCredentials") – Encrypted data credentials

__init__(elements=None, credentials=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessagePassportDataReceived]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messagePassportDataReceived']

to_dict()[source]
Return type:

dict

credentials: Optional[EncryptedCredentials]

Encrypted data credentials

elements: List[EncryptedPassportElement]

List of received Telegram Passport elements

class pytdbot.types.MessagePassportDataSent(types=None)[source]

Bases: TlObject, MessageContent

Telegram Passport data has been sent to a bot

Parameters:

types (List["types.PassportElementType"]) – List of Telegram Passport element types sent

__init__(types=None)[source]
Parameters:

types (List[PassportElementType] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessagePassportDataSent]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messagePassportDataSent']

to_dict()[source]
Return type:

dict

types: List[PassportElementType]

List of Telegram Passport element types sent

class pytdbot.types.MessagePaymentRefunded(owner_id=None, currency='', total_amount=0, invoice_payload=b'', telegram_payment_charge_id='', provider_payment_charge_id='')[source]

Bases: TlObject, MessageContent

A payment has been refunded

Parameters:
  • owner_id ("types.MessageSender") – Identifier of the previous owner of the Telegram Stars that refunds them

  • currency (str) – Currency for the price of the product

  • total_amount (int) – Total price for the product, in the smallest units of the currency

  • invoice_payload (bytes) – Invoice payload; only for bots

  • telegram_payment_charge_id (str) – Telegram payment identifier

  • provider_payment_charge_id (str) – Provider payment identifier

__init__(owner_id=None, currency='', total_amount=0, invoice_payload=b'', telegram_payment_charge_id='', provider_payment_charge_id='')[source]
Parameters:
  • owner_id (MessageSender | None)

  • currency (str)

  • total_amount (int)

  • invoice_payload (bytes)

  • telegram_payment_charge_id (str)

  • provider_payment_charge_id (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessagePaymentRefunded]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messagePaymentRefunded']

to_dict()[source]
Return type:

dict

currency: Optional[str]

Currency for the price of the product

invoice_payload: Optional[bytes]

Invoice payload; only for bots

owner_id: Union[MessageSenderUser, MessageSenderChat, None]

Identifier of the previous owner of the Telegram Stars that refunds them

provider_payment_charge_id: Optional[str]

Provider payment identifier

telegram_payment_charge_id: Optional[str]

Telegram payment identifier

total_amount: int

Total price for the product, in the smallest units of the currency

class pytdbot.types.MessagePaymentSuccessful(invoice_chat_id=0, invoice_message_id=0, currency='', total_amount=0, subscription_until_date=0, is_recurring=False, is_first_recurring=False, invoice_name='')[source]

Bases: TlObject, MessageContent

A payment has been sent to a bot or a business account

Parameters:
  • invoice_chat_id (int) – Identifier of the chat, containing the corresponding invoice message

  • invoice_message_id (int) – Identifier of the message with the corresponding invoice; can be 0 or an identifier of a deleted message

  • currency (str) – Currency for the price of the product

  • total_amount (int) – Total price for the product, in the smallest units of the currency

  • subscription_until_date (int) – Point in time (Unix timestamp) when the subscription will expire; 0 if unknown or the payment isn’t recurring

  • is_recurring (bool) – True, if this is a recurring payment

  • is_first_recurring (bool) – True, if this is the first recurring payment

  • invoice_name (str) – Name of the invoice; may be empty if unknown

__init__(invoice_chat_id=0, invoice_message_id=0, currency='', total_amount=0, subscription_until_date=0, is_recurring=False, is_first_recurring=False, invoice_name='')[source]
Parameters:
  • invoice_chat_id (int)

  • invoice_message_id (int)

  • currency (str)

  • total_amount (int)

  • subscription_until_date (int)

  • is_recurring (bool)

  • is_first_recurring (bool)

  • invoice_name (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessagePaymentSuccessful]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messagePaymentSuccessful']

to_dict()[source]
Return type:

dict

currency: Optional[str]

Currency for the price of the product

invoice_chat_id: int

Identifier of the chat, containing the corresponding invoice message

invoice_message_id: int

Identifier of the message with the corresponding invoice; can be 0 or an identifier of a deleted message

invoice_name: Optional[str]

Name of the invoice; may be empty if unknown

is_first_recurring: bool

True, if this is the first recurring payment

is_recurring: bool

True, if this is a recurring payment

subscription_until_date: int

Point in time (Unix timestamp) when the subscription will expire; 0 if unknown or the payment isn’t recurring

total_amount: int

Total price for the product, in the smallest units of the currency

class pytdbot.types.MessagePaymentSuccessfulBot(currency='', total_amount=0, subscription_until_date=0, is_recurring=False, is_first_recurring=False, invoice_payload=b'', shipping_option_id='', order_info=None, telegram_payment_charge_id='', provider_payment_charge_id='')[source]

Bases: TlObject, MessageContent

A payment has been received by the bot or the business account

Parameters:
  • currency (str) – Currency for price of the product

  • total_amount (int) – Total price for the product, in the smallest units of the currency

  • subscription_until_date (int) – Point in time (Unix timestamp) when the subscription will expire; 0 if unknown or the payment isn’t recurring

  • is_recurring (bool) – True, if this is a recurring payment

  • is_first_recurring (bool) – True, if this is the first recurring payment

  • invoice_payload (bytes) – Invoice payload

  • shipping_option_id (str) – Identifier of the shipping option chosen by the user; may be empty if not applicable; for bots only

  • order_info ("types.OrderInfo") – Information about the order; may be null; for bots only

  • telegram_payment_charge_id (str) – Telegram payment identifier

  • provider_payment_charge_id (str) – Provider payment identifier

__init__(currency='', total_amount=0, subscription_until_date=0, is_recurring=False, is_first_recurring=False, invoice_payload=b'', shipping_option_id='', order_info=None, telegram_payment_charge_id='', provider_payment_charge_id='')[source]
Parameters:
  • currency (str)

  • total_amount (int)

  • subscription_until_date (int)

  • is_recurring (bool)

  • is_first_recurring (bool)

  • invoice_payload (bytes)

  • shipping_option_id (str)

  • order_info (OrderInfo | None)

  • telegram_payment_charge_id (str)

  • provider_payment_charge_id (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessagePaymentSuccessfulBot]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messagePaymentSuccessfulBot']

to_dict()[source]
Return type:

dict

currency: Optional[str]

Currency for price of the product

invoice_payload: Optional[bytes]

Invoice payload

is_first_recurring: bool

True, if this is the first recurring payment

is_recurring: bool

True, if this is a recurring payment

order_info: Optional[OrderInfo]

Information about the order; may be null; for bots only

provider_payment_charge_id: Optional[str]

Provider payment identifier

shipping_option_id: Optional[str]

Identifier of the shipping option chosen by the user; may be empty if not applicable; for bots only

subscription_until_date: int

Point in time (Unix timestamp) when the subscription will expire; 0 if unknown or the payment isn’t recurring

telegram_payment_charge_id: Optional[str]

Telegram payment identifier

total_amount: int

Total price for the product, in the smallest units of the currency

class pytdbot.types.MessagePhoto(photo=None, caption=None, show_caption_above_media=False, has_spoiler=False, is_secret=False)[source]

Bases: TlObject, MessageContent

A photo message

Parameters:
  • photo ("types.Photo") – The photo

  • caption ("types.FormattedText") – Photo caption

  • show_caption_above_media (bool) – True, if the caption must be shown above the photo; otherwise, the caption must be shown below the photo

  • has_spoiler (bool) – True, if the photo preview must be covered by a spoiler animation

  • is_secret (bool) – True, if the photo must be blurred and must be shown only while tapped

__init__(photo=None, caption=None, show_caption_above_media=False, has_spoiler=False, is_secret=False)[source]
Parameters:
  • photo (Photo | None)

  • caption (FormattedText | None)

  • show_caption_above_media (bool)

  • has_spoiler (bool)

  • is_secret (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessagePhoto]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messagePhoto']

to_dict()[source]
Return type:

dict

caption: Optional[FormattedText]

Photo caption

has_spoiler: bool

True, if the photo preview must be covered by a spoiler animation

is_secret: bool

True, if the photo must be blurred and must be shown only while tapped

photo: Optional[Photo]

The photo

show_caption_above_media: bool

True, if the caption must be shown above the photo; otherwise, the caption must be shown below the photo

class pytdbot.types.MessagePinMessage(message_id=0)[source]

Bases: TlObject, MessageContent

A message has been pinned

Parameters:

message_id (int) – Identifier of the pinned message, can be an identifier of a deleted message or 0

__init__(message_id=0)[source]
Parameters:

message_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessagePinMessage]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messagePinMessage']

to_dict()[source]
Return type:

dict

message_id: int

Identifier of the pinned message, can be an identifier of a deleted message or 0

class pytdbot.types.MessagePoll(poll=None)[source]

Bases: TlObject, MessageContent

A message with a poll

Parameters:

poll ("types.Poll") – The poll description

__init__(poll=None)[source]
Parameters:

poll (Poll | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessagePoll]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messagePoll']

to_dict()[source]
Return type:

dict

poll: Optional[Poll]

The poll description

class pytdbot.types.MessagePosition(position=0, message_id=0, date=0)[source]

Bases: TlObject

Contains information about a message in a specific position

Parameters:
  • position (int) – 0-based message position in the full list of suitable messages

  • message_id (int) – Message identifier

  • date (int) – Point in time (Unix timestamp) when the message was sent

__init__(position=0, message_id=0, date=0)[source]
Parameters:
  • position (int)

  • message_id (int)

  • date (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessagePosition]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessagePosition']

classmethod getType()[source]
Return type:

Literal['messagePosition']

to_dict()[source]
Return type:

dict

date: int

Point in time (Unix timestamp) when the message was sent

message_id: int

Message identifier

position: int

0-based message position in the full list of suitable messages

class pytdbot.types.MessagePositions(total_count=0, positions=None)[source]

Bases: TlObject

Contains a list of message positions

Parameters:
  • total_count (int) – Total number of messages found

  • positions (List["types.MessagePosition"]) – List of message positions

__init__(total_count=0, positions=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessagePositions]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessagePositions']

classmethod getType()[source]
Return type:

Literal['messagePositions']

to_dict()[source]
Return type:

dict

positions: List[MessagePosition]

List of message positions

total_count: int

Total number of messages found

class pytdbot.types.MessagePremiumGiftCode(creator_id=None, text=None, is_from_giveaway=False, is_unclaimed=False, currency='', amount=0, cryptocurrency='', cryptocurrency_amount=0, month_count=0, sticker=None, code='')[source]

Bases: TlObject, MessageContent

A Telegram Premium gift code was created for the user

Parameters:
  • creator_id ("types.MessageSender") – Identifier of a chat or a user that created the gift code; may be null if unknown

  • text ("types.FormattedText") – Message added to the gift

  • is_from_giveaway (bool) – True, if the gift code was created for a giveaway

  • is_unclaimed (bool) – True, if the winner for the corresponding Telegram Premium subscription wasn’t chosen

  • currency (str) – Currency for the paid amount; empty if unknown

  • amount (int) – The paid amount, in the smallest units of the currency; 0 if unknown

  • cryptocurrency (str) – Cryptocurrency used to pay for the gift; may be empty if none or unknown

  • cryptocurrency_amount (int) – The paid amount, in the smallest units of the cryptocurrency; 0 if unknown

  • month_count (int) – Number of months the Telegram Premium subscription will be active after code activation

  • sticker ("types.Sticker") – A sticker to be shown in the message; may be null if unknown

  • code (str) – The gift code

__init__(creator_id=None, text=None, is_from_giveaway=False, is_unclaimed=False, currency='', amount=0, cryptocurrency='', cryptocurrency_amount=0, month_count=0, sticker=None, code='')[source]
Parameters:
  • creator_id (MessageSender | None)

  • text (FormattedText | None)

  • is_from_giveaway (bool)

  • is_unclaimed (bool)

  • currency (str)

  • amount (int)

  • cryptocurrency (str)

  • cryptocurrency_amount (int)

  • month_count (int)

  • sticker (Sticker | None)

  • code (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessagePremiumGiftCode]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messagePremiumGiftCode']

to_dict()[source]
Return type:

dict

amount: int

The paid amount, in the smallest units of the currency; 0 if unknown

code: Optional[str]

The gift code

creator_id: Union[MessageSenderUser, MessageSenderChat, None]

Identifier of a chat or a user that created the gift code; may be null if unknown

cryptocurrency: Optional[str]

Cryptocurrency used to pay for the gift; may be empty if none or unknown

cryptocurrency_amount: int

The paid amount, in the smallest units of the cryptocurrency; 0 if unknown

currency: Optional[str]

Currency for the paid amount; empty if unknown

is_from_giveaway: bool

True, if the gift code was created for a giveaway

is_unclaimed: bool

True, if the winner for the corresponding Telegram Premium subscription wasn’t chosen

month_count: int

Number of months the Telegram Premium subscription will be active after code activation

sticker: Optional[Sticker]

A sticker to be shown in the message; may be null if unknown

text: Optional[FormattedText]

Message added to the gift

class pytdbot.types.MessageProperties(can_add_offer=False, can_add_tasks=False, can_be_approved=False, can_be_copied=False, can_be_copied_to_secret_chat=False, can_be_declined=False, can_be_deleted_only_for_self=False, can_be_deleted_for_all_users=False, can_be_edited=False, can_be_forwarded=False, can_be_paid=False, can_be_pinned=False, can_be_replied=False, can_be_replied_in_another_chat=False, can_be_saved=False, can_be_shared_in_story=False, can_edit_media=False, can_edit_scheduling_state=False, can_edit_suggested_post_info=False, can_get_author=False, can_get_embedding_code=False, can_get_link=False, can_get_media_timestamp_links=False, can_get_message_thread=False, can_get_read_date=False, can_get_statistics=False, can_get_video_advertisements=False, can_get_viewers=False, can_mark_tasks_as_done=False, can_recognize_speech=False, can_report_chat=False, can_report_reactions=False, can_report_supergroup_spam=False, can_set_fact_check=False, need_show_statistics=False)[source]

Bases: TlObject

Contains properties of a message and describes actions that can be done with the message right now

Parameters:
  • can_add_offer (bool) – True, if an offer can be added to the message using addOffer

  • can_add_tasks (bool) – True, if tasks can be added to the message’s checklist using addChecklistTasks if the current user has Telegram Premium subscription

  • can_be_approved (bool) – True, if the message is a suggested post that can be approved by the user using approveSuggestedPost

  • can_be_copied (bool) – True, if content of the message can be copied using inputMessageForwarded or forwardMessages with copy options

  • can_be_copied_to_secret_chat (bool) – True, if content of the message can be copied to a secret chat using inputMessageForwarded or forwardMessages with copy options

  • can_be_declined (bool) – True, if the message is a suggested post that can be declined by the user using declineSuggestedPost

  • can_be_deleted_only_for_self (bool) – True, if the message can be deleted only for the current user while other users will continue to see it using the method deleteMessages with revoke == false

  • can_be_deleted_for_all_users (bool) – True, if the message can be deleted for all users using the method deleteMessages with revoke == true

  • can_be_edited (bool) – True, if the message can be edited using the methods editMessageText, editMessageCaption, or editMessageReplyMarkup. For live location, poll, and checklist messages this fields shows whether editMessageLiveLocation, stopPoll, or editMessageChecklist respectively can be used with this message

  • can_be_forwarded (bool) – True, if the message can be forwarded using inputMessageForwarded or forwardMessages without copy options

  • can_be_paid (bool) – True, if the message can be paid using inputInvoiceMessage

  • can_be_pinned (bool) – True, if the message can be pinned or unpinned in the chat using pinChatMessage or unpinChatMessage

  • can_be_replied (bool) – True, if the message can be replied in the same chat and forum topic using inputMessageReplyToMessage

  • can_be_replied_in_another_chat (bool) – True, if the message can be replied in another chat or forum topic using inputMessageReplyToExternalMessage

  • can_be_saved (bool) – True, if content of the message can be saved locally

  • can_be_shared_in_story (bool) – True, if the message can be shared in a story using inputStoryAreaTypeMessage

  • can_edit_media (bool) – True, if the message can be edited using the method editMessageMedia

  • can_edit_scheduling_state (bool) – True, if scheduling state of the message can be edited

  • can_edit_suggested_post_info (bool) – True, if another price or post send time can be suggested using addOffer

  • can_get_author (bool) – True, if author of the message sent on behalf of a chat can be received through getMessageAuthor

  • can_get_embedding_code (bool) – True, if code for message embedding can be received using getMessageEmbeddingCode

  • can_get_link (bool) – True, if a link can be generated for the message using getMessageLink

  • can_get_media_timestamp_links (bool) – True, if media timestamp links can be generated for media timestamp entities in the message text, caption or link preview description using getMessageLink

  • can_get_message_thread (bool) – True, if information about the message thread is available through getMessageThread and getMessageThreadHistory

  • can_get_read_date (bool) – True, if read date of the message can be received through getMessageReadDate

  • can_get_statistics (bool) – True, if message statistics are available through getMessageStatistics and message forwards can be received using getMessagePublicForwards

  • can_get_video_advertisements (bool) – True, if advertisements for video of the message can be received though getVideoMessageAdvertisements

  • can_get_viewers (bool) – True, if chat members already viewed the message can be received through getMessageViewers

  • can_mark_tasks_as_done (bool) – True, if tasks can be marked as done or not done in the message’s checklist using markChecklistTasksAsDone if the current user has Telegram Premium subscription

  • can_recognize_speech (bool) – True, if speech can be recognized for the message through recognizeSpeech

  • can_report_chat (bool) – True, if the message can be reported using reportChat

  • can_report_reactions (bool) – True, if reactions on the message can be reported through reportMessageReactions

  • can_report_supergroup_spam (bool) – True, if the message can be reported using reportSupergroupSpam

  • can_set_fact_check (bool) – True, if fact check for the message can be changed through setMessageFactCheck

  • need_show_statistics (bool) – True, if message statistics must be available from context menu of the message

__init__(can_add_offer=False, can_add_tasks=False, can_be_approved=False, can_be_copied=False, can_be_copied_to_secret_chat=False, can_be_declined=False, can_be_deleted_only_for_self=False, can_be_deleted_for_all_users=False, can_be_edited=False, can_be_forwarded=False, can_be_paid=False, can_be_pinned=False, can_be_replied=False, can_be_replied_in_another_chat=False, can_be_saved=False, can_be_shared_in_story=False, can_edit_media=False, can_edit_scheduling_state=False, can_edit_suggested_post_info=False, can_get_author=False, can_get_embedding_code=False, can_get_link=False, can_get_media_timestamp_links=False, can_get_message_thread=False, can_get_read_date=False, can_get_statistics=False, can_get_video_advertisements=False, can_get_viewers=False, can_mark_tasks_as_done=False, can_recognize_speech=False, can_report_chat=False, can_report_reactions=False, can_report_supergroup_spam=False, can_set_fact_check=False, need_show_statistics=False)[source]
Parameters:
  • can_add_offer (bool)

  • can_add_tasks (bool)

  • can_be_approved (bool)

  • can_be_copied (bool)

  • can_be_copied_to_secret_chat (bool)

  • can_be_declined (bool)

  • can_be_deleted_only_for_self (bool)

  • can_be_deleted_for_all_users (bool)

  • can_be_edited (bool)

  • can_be_forwarded (bool)

  • can_be_paid (bool)

  • can_be_pinned (bool)

  • can_be_replied (bool)

  • can_be_replied_in_another_chat (bool)

  • can_be_saved (bool)

  • can_be_shared_in_story (bool)

  • can_edit_media (bool)

  • can_edit_scheduling_state (bool)

  • can_edit_suggested_post_info (bool)

  • can_get_author (bool)

  • can_get_embedding_code (bool)

  • can_get_link (bool)

  • can_get_media_timestamp_links (bool)

  • can_get_message_thread (bool)

  • can_get_read_date (bool)

  • can_get_statistics (bool)

  • can_get_video_advertisements (bool)

  • can_get_viewers (bool)

  • can_mark_tasks_as_done (bool)

  • can_recognize_speech (bool)

  • can_report_chat (bool)

  • can_report_reactions (bool)

  • can_report_supergroup_spam (bool)

  • can_set_fact_check (bool)

  • need_show_statistics (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageProperties]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageProperties']

classmethod getType()[source]
Return type:

Literal['messageProperties']

to_dict()[source]
Return type:

dict

can_add_offer: bool

True, if an offer can be added to the message using addOffer

can_add_tasks: bool

True, if tasks can be added to the message’s checklist using addChecklistTasks if the current user has Telegram Premium subscription

can_be_approved: bool

True, if the message is a suggested post that can be approved by the user using approveSuggestedPost

can_be_copied: bool

True, if content of the message can be copied using inputMessageForwarded or forwardMessages with copy options

can_be_copied_to_secret_chat: bool

True, if content of the message can be copied to a secret chat using inputMessageForwarded or forwardMessages with copy options

can_be_declined: bool

True, if the message is a suggested post that can be declined by the user using declineSuggestedPost

can_be_deleted_for_all_users: bool

True, if the message can be deleted for all users using the method deleteMessages with revoke == true

can_be_deleted_only_for_self: bool

True, if the message can be deleted only for the current user while other users will continue to see it using the method deleteMessages with revoke == false

can_be_edited: bool

True, if the message can be edited using the methods editMessageText, editMessageCaption, or editMessageReplyMarkup. For live location, poll, and checklist messages this fields shows whether editMessageLiveLocation, stopPoll, or editMessageChecklist respectively can be used with this message

can_be_forwarded: bool

True, if the message can be forwarded using inputMessageForwarded or forwardMessages without copy options

can_be_paid: bool

True, if the message can be paid using inputInvoiceMessage

can_be_pinned: bool

True, if the message can be pinned or unpinned in the chat using pinChatMessage or unpinChatMessage

can_be_replied: bool

True, if the message can be replied in the same chat and forum topic using inputMessageReplyToMessage

can_be_replied_in_another_chat: bool

True, if the message can be replied in another chat or forum topic using inputMessageReplyToExternalMessage

can_be_saved: bool

True, if content of the message can be saved locally

can_be_shared_in_story: bool

True, if the message can be shared in a story using inputStoryAreaTypeMessage

can_edit_media: bool

True, if the message can be edited using the method editMessageMedia

can_edit_scheduling_state: bool

True, if scheduling state of the message can be edited

can_edit_suggested_post_info: bool

True, if another price or post send time can be suggested using addOffer

can_get_author: bool

True, if author of the message sent on behalf of a chat can be received through getMessageAuthor

can_get_embedding_code: bool

True, if code for message embedding can be received using getMessageEmbeddingCode

can_get_link: bool

True, if a link can be generated for the message using getMessageLink

can_get_media_timestamp_links: bool

True, if media timestamp links can be generated for media timestamp entities in the message text, caption or link preview description using getMessageLink

can_get_message_thread: bool

True, if information about the message thread is available through getMessageThread and getMessageThreadHistory

can_get_read_date: bool

True, if read date of the message can be received through getMessageReadDate

can_get_statistics: bool

True, if message statistics are available through getMessageStatistics and message forwards can be received using getMessagePublicForwards

can_get_video_advertisements: bool

True, if advertisements for video of the message can be received though getVideoMessageAdvertisements

can_get_viewers: bool

True, if chat members already viewed the message can be received through getMessageViewers

can_mark_tasks_as_done: bool

True, if tasks can be marked as done or not done in the message’s checklist using markChecklistTasksAsDone if the current user has Telegram Premium subscription

can_recognize_speech: bool

True, if speech can be recognized for the message through recognizeSpeech

can_report_chat: bool

True, if the message can be reported using reportChat

can_report_reactions: bool

True, if reactions on the message can be reported through reportMessageReactions

can_report_supergroup_spam: bool

True, if the message can be reported using reportSupergroupSpam

can_set_fact_check: bool

True, if fact check for the message can be changed through setMessageFactCheck

need_show_statistics: bool

True, if message statistics must be available from context menu of the message

class pytdbot.types.MessageProximityAlertTriggered(traveler_id=None, watcher_id=None, distance=0)[source]

Bases: TlObject, MessageContent

A user in the chat came within proximity alert range

Parameters:
  • traveler_id ("types.MessageSender") – The identifier of a user or chat that triggered the proximity alert

  • watcher_id ("types.MessageSender") – The identifier of a user or chat that subscribed for the proximity alert

  • distance (int) – The distance between the users

__init__(traveler_id=None, watcher_id=None, distance=0)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageProximityAlertTriggered]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageProximityAlertTriggered']

to_dict()[source]
Return type:

dict

distance: int

The distance between the users

traveler_id: Union[MessageSenderUser, MessageSenderChat, None]

The identifier of a user or chat that triggered the proximity alert

watcher_id: Union[MessageSenderUser, MessageSenderChat, None]

The identifier of a user or chat that subscribed for the proximity alert

class pytdbot.types.MessageReaction(type=None, total_count=0, is_chosen=False, used_sender_id=None, recent_sender_ids=None)[source]

Bases: TlObject

Contains information about a reaction to a message

Parameters:
  • type ("types.ReactionType") – Type of the reaction

  • total_count (int) – Number of times the reaction was added

  • is_chosen (bool) – True, if the reaction is chosen by the current user

  • used_sender_id ("types.MessageSender") – Identifier of the message sender used by the current user to add the reaction; may be null if unknown or the reaction isn’t chosen

  • recent_sender_ids (List["types.MessageSender"]) – Identifiers of at most 3 recent message senders, added the reaction; available in private, basic group and supergroup chats

__init__(type=None, total_count=0, is_chosen=False, used_sender_id=None, recent_sender_ids=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageReaction]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageReaction']

classmethod getType()[source]
Return type:

Literal['messageReaction']

to_dict()[source]
Return type:

dict

is_chosen: bool

True, if the reaction is chosen by the current user

recent_sender_ids: List[MessageSender]

Identifiers of at most 3 recent message senders, added the reaction; available in private, basic group and supergroup chats

total_count: int

Number of times the reaction was added

type: Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid, None]

Type of the reaction

used_sender_id: Union[MessageSenderUser, MessageSenderChat, None]

Identifier of the message sender used by the current user to add the reaction; may be null if unknown or the reaction isn’t chosen

class pytdbot.types.MessageReactions(reactions=None, are_tags=False, paid_reactors=None, can_get_added_reactions=False)[source]

Bases: TlObject

Contains a list of reactions added to a message

Parameters:
  • reactions (List["types.MessageReaction"]) – List of added reactions

  • are_tags (bool) – True, if the reactions are tags and Telegram Premium users can filter messages by them

  • paid_reactors (List["types.PaidReactor"]) – Information about top users that added the paid reaction

  • can_get_added_reactions (bool) – True, if the list of added reactions is available using getMessageAddedReactions

__init__(reactions=None, are_tags=False, paid_reactors=None, can_get_added_reactions=False)[source]
Parameters:
  • reactions (List[MessageReaction] | None)

  • are_tags (bool)

  • paid_reactors (List[PaidReactor] | None)

  • can_get_added_reactions (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageReactions]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageReactions']

classmethod getType()[source]
Return type:

Literal['messageReactions']

to_dict()[source]
Return type:

dict

are_tags: bool

True, if the reactions are tags and Telegram Premium users can filter messages by them

can_get_added_reactions: bool

True, if the list of added reactions is available using getMessageAddedReactions

paid_reactors: List[PaidReactor]

Information about top users that added the paid reaction

reactions: List[MessageReaction]

List of added reactions

class pytdbot.types.MessageReadDate[source]

Bases: object

Describes read date of a recent outgoing message in a private chat

class pytdbot.types.MessageReadDateMyPrivacyRestricted[source]

Bases: TlObject, MessageReadDate

The read date is unknown due to privacy settings of the current user, but will be known if the user subscribes to Telegram Premium

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageReadDateMyPrivacyRestricted]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageReadDate']

classmethod getType()[source]
Return type:

Literal['messageReadDateMyPrivacyRestricted']

to_dict()[source]
Return type:

dict

class pytdbot.types.MessageReadDateRead(read_date=0)[source]

Bases: TlObject, MessageReadDate

Contains read date of the message

Parameters:

read_date (int) – Point in time (Unix timestamp) when the message was read by the other user

__init__(read_date=0)[source]
Parameters:

read_date (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageReadDateRead]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageReadDate']

classmethod getType()[source]
Return type:

Literal['messageReadDateRead']

to_dict()[source]
Return type:

dict

read_date: int

Point in time (Unix timestamp) when the message was read by the other user

class pytdbot.types.MessageReadDateTooOld[source]

Bases: TlObject, MessageReadDate

The message is too old to get read date

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageReadDateTooOld]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageReadDate']

classmethod getType()[source]
Return type:

Literal['messageReadDateTooOld']

to_dict()[source]
Return type:

dict

class pytdbot.types.MessageReadDateUnread[source]

Bases: TlObject, MessageReadDate

The message is unread yet

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageReadDateUnread]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageReadDate']

classmethod getType()[source]
Return type:

Literal['messageReadDateUnread']

to_dict()[source]
Return type:

dict

class pytdbot.types.MessageReadDateUserPrivacyRestricted[source]

Bases: TlObject, MessageReadDate

The read date is unknown due to privacy settings of the other user

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageReadDateUserPrivacyRestricted]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageReadDate']

classmethod getType()[source]
Return type:

Literal['messageReadDateUserPrivacyRestricted']

to_dict()[source]
Return type:

dict

class pytdbot.types.MessageRefundedUpgradedGift(gift=None, sender_id=None, receiver_id=None, origin=None)[source]

Bases: TlObject, MessageContent

A gift which purchase, upgrade or transfer were refunded

Parameters:
  • gift ("types.Gift") – The gift

  • sender_id ("types.MessageSender") – Sender of the gift

  • receiver_id ("types.MessageSender") – Receiver of the gift

  • origin ("types.UpgradedGiftOrigin") – Origin of the upgraded gift

__init__(gift=None, sender_id=None, receiver_id=None, origin=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageRefundedUpgradedGift]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageRefundedUpgradedGift']

to_dict()[source]
Return type:

dict

gift: Optional[Gift]

The gift

origin: Union[UpgradedGiftOriginUpgrade, UpgradedGiftOriginTransfer, UpgradedGiftOriginResale, UpgradedGiftOriginPrepaidUpgrade, None]

Origin of the upgraded gift

receiver_id: Union[MessageSenderUser, MessageSenderChat, None]

Receiver of the gift

sender_id: Union[MessageSenderUser, MessageSenderChat, None]

Sender of the gift

class pytdbot.types.MessageReplyInfo(reply_count=0, recent_replier_ids=None, last_read_inbox_message_id=0, last_read_outbox_message_id=0, last_message_id=0)[source]

Bases: TlObject

Contains information about replies to a message

Parameters:
  • reply_count (int) – Number of times the message was directly or indirectly replied

  • recent_replier_ids (List["types.MessageSender"]) – Identifiers of at most 3 recent repliers to the message; available in channels with a discussion supergroup. The users and chats are expected to be inaccessible: only their photo and name will be available

  • last_read_inbox_message_id (int) – Identifier of the last read incoming reply to the message

  • last_read_outbox_message_id (int) – Identifier of the last read outgoing reply to the message

  • last_message_id (int) – Identifier of the last reply to the message

__init__(reply_count=0, recent_replier_ids=None, last_read_inbox_message_id=0, last_read_outbox_message_id=0, last_message_id=0)[source]
Parameters:
  • reply_count (int)

  • recent_replier_ids (List[MessageSender] | None)

  • last_read_inbox_message_id (int)

  • last_read_outbox_message_id (int)

  • last_message_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageReplyInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageReplyInfo']

classmethod getType()[source]
Return type:

Literal['messageReplyInfo']

to_dict()[source]
Return type:

dict

last_message_id: int

Identifier of the last reply to the message

last_read_inbox_message_id: int

Identifier of the last read incoming reply to the message

last_read_outbox_message_id: int

Identifier of the last read outgoing reply to the message

recent_replier_ids: List[MessageSender]

only their photo and name will be available

Type:

Identifiers of at most 3 recent repliers to the message; available in channels with a discussion supergroup. The users and chats are expected to be inaccessible

reply_count: int

Number of times the message was directly or indirectly replied

class pytdbot.types.MessageReplyTo[source]

Bases: object

Contains information about the message or the story a message is replying to

class pytdbot.types.MessageReplyToMessage(chat_id=0, message_id=0, quote=None, checklist_task_id=0, origin=None, origin_send_date=0, content=None)[source]

Bases: TlObject, MessageReplyTo

Describes a message replied by a given message

Parameters:
  • chat_id (int) – The identifier of the chat to which the message belongs; may be 0 if the replied message is in unknown chat

  • message_id (int) – The identifier of the message; may be 0 if the replied message is in unknown chat

  • quote ("types.TextQuote") – Chosen quote from the replied message; may be null if none

  • checklist_task_id (int) – Identifier of the checklist task in the original message that was replied; 0 if none

  • origin ("types.MessageOrigin") – Information about origin of the message if the message was from another chat or topic; may be null for messages from the same chat

  • origin_send_date (int) – Point in time (Unix timestamp) when the message was sent if the message was from another chat or topic; 0 for messages from the same chat

  • content ("types.MessageContent") – Media content of the message if the message was from another chat or topic; may be null for messages from the same chat and messages without media. Can be only one of the following types: messageAnimation, messageAudio, messageChecklist, messageContact, messageDice, messageDocument, messageGame, messageGiveaway, messageGiveawayWinners, messageInvoice, messageLocation, messagePaidMedia, messagePhoto, messagePoll, messageSticker, messageStory, messageText (for link preview), messageVenue, messageVideo, messageVideoNote, or messageVoiceNote

__init__(chat_id=0, message_id=0, quote=None, checklist_task_id=0, origin=None, origin_send_date=0, content=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageReplyToMessage]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageReplyTo']

classmethod getType()[source]
Return type:

Literal['messageReplyToMessage']

to_dict()[source]
Return type:

dict

chat_id: int

The identifier of the chat to which the message belongs; may be 0 if the replied message is in unknown chat

checklist_task_id: int

Identifier of the checklist task in the original message that was replied; 0 if none

content: Union[MessageText, MessageAnimation, MessageAudio, MessageDocument, MessagePaidMedia, MessagePhoto, MessageSticker, MessageVideo, MessageVideoNote, MessageVoiceNote, MessageExpiredPhoto, MessageExpiredVideo, MessageExpiredVideoNote, MessageExpiredVoiceNote, MessageLocation, MessageVenue, MessageContact, MessageAnimatedEmoji, MessageDice, MessageGame, MessagePoll, MessageStory, MessageChecklist, MessageInvoice, MessageCall, MessageGroupCall, MessageVideoChatScheduled, MessageVideoChatStarted, MessageVideoChatEnded, MessageInviteVideoChatParticipants, MessageBasicGroupChatCreate, MessageSupergroupChatCreate, MessageChatChangeTitle, MessageChatChangePhoto, MessageChatDeletePhoto, MessageChatAddMembers, MessageChatJoinByLink, MessageChatJoinByRequest, MessageChatDeleteMember, MessageChatUpgradeTo, MessageChatUpgradeFrom, MessagePinMessage, MessageScreenshotTaken, MessageChatSetBackground, MessageChatSetTheme, MessageChatSetMessageAutoDeleteTime, MessageChatBoost, MessageForumTopicCreated, MessageForumTopicEdited, MessageForumTopicIsClosedToggled, MessageForumTopicIsHiddenToggled, MessageSuggestProfilePhoto, MessageCustomServiceAction, MessageGameScore, MessagePaymentSuccessful, MessagePaymentSuccessfulBot, MessagePaymentRefunded, MessageGiftedPremium, MessagePremiumGiftCode, MessageGiveawayCreated, MessageGiveaway, MessageGiveawayCompleted, MessageGiveawayWinners, MessageGiftedStars, MessageGiftedTon, MessageGiveawayPrizeStars, MessageGift, MessageUpgradedGift, MessageRefundedUpgradedGift, MessagePaidMessagesRefunded, MessagePaidMessagePriceChanged, MessageDirectMessagePriceChanged, MessageChecklistTasksDone, MessageChecklistTasksAdded, MessageSuggestedPostApprovalFailed, MessageSuggestedPostApproved, MessageSuggestedPostDeclined, MessageSuggestedPostPaid, MessageSuggestedPostRefunded, MessageContactRegistered, MessageUsersShared, MessageChatShared, MessageBotWriteAccessAllowed, MessageWebAppDataSent, MessageWebAppDataReceived, MessagePassportDataSent, MessagePassportDataReceived, MessageProximityAlertTriggered, MessageUnsupported, None]

messageAnimation, messageAudio, messageChecklist, messageContact, messageDice, messageDocument, messageGame, messageGiveaway, messageGiveawayWinners, messageInvoice, messageLocation, messagePaidMedia, messagePhoto, messagePoll, messageSticker, messageStory, messageText (for link preview), messageVenue, messageVideo, messageVideoNote, or messageVoiceNote

Type:

Media content of the message if the message was from another chat or topic; may be null for messages from the same chat and messages without media. Can be only one of the following types

message_id: int

The identifier of the message; may be 0 if the replied message is in unknown chat

origin: Union[MessageOriginUser, MessageOriginHiddenUser, MessageOriginChat, MessageOriginChannel, None]

Information about origin of the message if the message was from another chat or topic; may be null for messages from the same chat

origin_send_date: int

Point in time (Unix timestamp) when the message was sent if the message was from another chat or topic; 0 for messages from the same chat

quote: Optional[TextQuote]

Chosen quote from the replied message; may be null if none

class pytdbot.types.MessageReplyToStory(story_poster_chat_id=0, story_id=0)[source]

Bases: TlObject, MessageReplyTo

Describes a story replied by a given message

Parameters:
  • story_poster_chat_id (int) – The identifier of the poster of the story

  • story_id (int) – The identifier of the story

__init__(story_poster_chat_id=0, story_id=0)[source]
Parameters:
  • story_poster_chat_id (int)

  • story_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageReplyToStory]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageReplyTo']

classmethod getType()[source]
Return type:

Literal['messageReplyToStory']

to_dict()[source]
Return type:

dict

story_id: int

The identifier of the story

story_poster_chat_id: int

The identifier of the poster of the story

class pytdbot.types.MessageSchedulingState[source]

Bases: object

Contains information about the time when a scheduled message will be sent

class pytdbot.types.MessageSchedulingStateSendAtDate(send_date=0)[source]

Bases: TlObject, MessageSchedulingState

The message will be sent at the specified date

Parameters:

send_date (int) – Point in time (Unix timestamp) when the message will be sent. The date must be within 367 days in the future

__init__(send_date=0)[source]
Parameters:

send_date (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageSchedulingStateSendAtDate]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageSchedulingState']

classmethod getType()[source]
Return type:

Literal['messageSchedulingStateSendAtDate']

to_dict()[source]
Return type:

dict

send_date: int

Point in time (Unix timestamp) when the message will be sent. The date must be within 367 days in the future

class pytdbot.types.MessageSchedulingStateSendWhenOnline[source]

Bases: TlObject, MessageSchedulingState

The message will be sent when the other user is online. Applicable to private chats only and when the exact online status of the other user is known

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageSchedulingStateSendWhenOnline]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageSchedulingState']

classmethod getType()[source]
Return type:

Literal['messageSchedulingStateSendWhenOnline']

to_dict()[source]
Return type:

dict

class pytdbot.types.MessageSchedulingStateSendWhenVideoProcessed(send_date=0)[source]

Bases: TlObject, MessageSchedulingState

The message will be sent when the video in the message is converted and optimized; can be used only by the server

Parameters:

send_date (int) – Approximate point in time (Unix timestamp) when the message is expected to be sent

__init__(send_date=0)[source]
Parameters:

send_date (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageSchedulingStateSendWhenVideoProcessed]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageSchedulingState']

classmethod getType()[source]
Return type:

Literal['messageSchedulingStateSendWhenVideoProcessed']

to_dict()[source]
Return type:

dict

send_date: int

Approximate point in time (Unix timestamp) when the message is expected to be sent

class pytdbot.types.MessageScreenshotTaken[source]

Bases: TlObject, MessageContent

A screenshot of a message in the chat has been taken

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageScreenshotTaken]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageScreenshotTaken']

to_dict()[source]
Return type:

dict

class pytdbot.types.MessageSelfDestructType[source]

Bases: object

Describes when a message will be self-destructed

class pytdbot.types.MessageSelfDestructTypeImmediately[source]

Bases: TlObject, MessageSelfDestructType

The message can be opened only once and will be self-destructed once closed

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageSelfDestructTypeImmediately]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageSelfDestructType']

classmethod getType()[source]
Return type:

Literal['messageSelfDestructTypeImmediately']

to_dict()[source]
Return type:

dict

class pytdbot.types.MessageSelfDestructTypeTimer(self_destruct_time=0)[source]

Bases: TlObject, MessageSelfDestructType

The message will be self-destructed in the specified time after its content was opened

Parameters:

self_destruct_time (int) – The message’s self-destruct time, in seconds; must be between 0 and 60 in private chats

__init__(self_destruct_time=0)[source]
Parameters:

self_destruct_time (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageSelfDestructTypeTimer]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageSelfDestructType']

classmethod getType()[source]
Return type:

Literal['messageSelfDestructTypeTimer']

to_dict()[source]
Return type:

dict

self_destruct_time: int

The message’s self-destruct time, in seconds; must be between 0 and 60 in private chats

class pytdbot.types.MessageSendOptions(direct_messages_chat_topic_id=0, suggested_post_info=None, disable_notification=False, from_background=False, protect_content=False, allow_paid_broadcast=False, paid_message_star_count=0, update_order_of_installed_sticker_sets=False, scheduling_state=None, effect_id=0, sending_id=0, only_preview=False)[source]

Bases: TlObject

Options to be used when a message is sent

Parameters:
  • direct_messages_chat_topic_id (int) – Unique identifier of the topic in a channel direct messages chat administered by the current user; pass 0 if the chat isn’t a channel direct messages chat administered by the current user

  • suggested_post_info ("types.InputSuggestedPostInfo") – Information about the suggested post; pass null if none. For messages to channel direct messages chat only. Applicable only to sendMessage and addOffer

  • disable_notification (bool) – Pass true to disable notification for the message

  • from_background (bool) – Pass true if the message is sent from the background

  • protect_content (bool) – Pass true if the content of the message must be protected from forwarding and saving; for bots only

  • allow_paid_broadcast (bool) – Pass true to allow the message to ignore regular broadcast limits for a small fee; for bots only

  • paid_message_star_count (int) – The number of Telegram Stars the user agreed to pay to send the messages

  • update_order_of_installed_sticker_sets (bool) – Pass true if the user explicitly chosen a sticker or a custom emoji from an installed sticker set; applicable only to sendMessage and sendMessageAlbum

  • scheduling_state ("types.MessageSchedulingState") – Message scheduling state; pass null to send message immediately. Messages sent to a secret chat, to a chat with paid messages, to a channel direct messages chat, live location messages and self-destructing messages can’t be scheduled

  • effect_id (int) – Identifier of the effect to apply to the message; pass 0 if none; applicable only to sendMessage and sendMessageAlbum in private chats

  • sending_id (int) – Non-persistent identifier, which will be returned back in messageSendingStatePending object and can be used to match sent messages and corresponding updateNewMessage updates

  • only_preview (bool) – Pass true to get a fake message instead of actually sending them

__init__(direct_messages_chat_topic_id=0, suggested_post_info=None, disable_notification=False, from_background=False, protect_content=False, allow_paid_broadcast=False, paid_message_star_count=0, update_order_of_installed_sticker_sets=False, scheduling_state=None, effect_id=0, sending_id=0, only_preview=False)[source]
Parameters:
  • direct_messages_chat_topic_id (int)

  • suggested_post_info (InputSuggestedPostInfo | None)

  • disable_notification (bool)

  • from_background (bool)

  • protect_content (bool)

  • allow_paid_broadcast (bool)

  • paid_message_star_count (int)

  • update_order_of_installed_sticker_sets (bool)

  • scheduling_state (MessageSchedulingState | None)

  • effect_id (int)

  • sending_id (int)

  • only_preview (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageSendOptions]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageSendOptions']

classmethod getType()[source]
Return type:

Literal['messageSendOptions']

to_dict()[source]
Return type:

dict

allow_paid_broadcast: bool

Pass true to allow the message to ignore regular broadcast limits for a small fee; for bots only

direct_messages_chat_topic_id: int

Unique identifier of the topic in a channel direct messages chat administered by the current user; pass 0 if the chat isn’t a channel direct messages chat administered by the current user

disable_notification: bool

Pass true to disable notification for the message

effect_id: int

Identifier of the effect to apply to the message; pass 0 if none; applicable only to sendMessage and sendMessageAlbum in private chats

from_background: bool

Pass true if the message is sent from the background

only_preview: bool

Pass true to get a fake message instead of actually sending them

paid_message_star_count: int

The number of Telegram Stars the user agreed to pay to send the messages

protect_content: bool

Pass true if the content of the message must be protected from forwarding and saving; for bots only

scheduling_state: Union[MessageSchedulingStateSendAtDate, MessageSchedulingStateSendWhenOnline, MessageSchedulingStateSendWhenVideoProcessed, None]

Message scheduling state; pass null to send message immediately. Messages sent to a secret chat, to a chat with paid messages, to a channel direct messages chat, live location messages and self-destructing messages can’t be scheduled

sending_id: int

Non-persistent identifier, which will be returned back in messageSendingStatePending object and can be used to match sent messages and corresponding updateNewMessage updates

suggested_post_info: Optional[InputSuggestedPostInfo]

Information about the suggested post; pass null if none. For messages to channel direct messages chat only. Applicable only to sendMessage and addOffer

update_order_of_installed_sticker_sets: bool

Pass true if the user explicitly chosen a sticker or a custom emoji from an installed sticker set; applicable only to sendMessage and sendMessageAlbum

class pytdbot.types.MessageSender[source]

Bases: MessageSenderBoundMethods

Contains information about the sender of a message

class pytdbot.types.MessageSenderChat(chat_id=0)[source]

Bases: TlObject, MessageSender

The message was sent on behalf of a chat

Parameters:

chat_id (int) – Identifier of the chat that sent the message

__init__(chat_id=0)[source]
Parameters:

chat_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageSenderChat]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageSender']

classmethod getType()[source]
Return type:

Literal['messageSenderChat']

to_dict()[source]
Return type:

dict

chat_id: int

Identifier of the chat that sent the message

class pytdbot.types.MessageSenderUser(user_id=0)[source]

Bases: TlObject, MessageSender

The message was sent by a known user

Parameters:

user_id (int) – Identifier of the user that sent the message

__init__(user_id=0)[source]
Parameters:

user_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageSenderUser]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageSender']

classmethod getType()[source]
Return type:

Literal['messageSenderUser']

to_dict()[source]
Return type:

dict

user_id: int

Identifier of the user that sent the message

class pytdbot.types.MessageSenders(total_count=0, senders=None)[source]

Bases: TlObject

Represents a list of message senders

Parameters:
  • total_count (int) – Approximate total number of messages senders found

  • senders (List["types.MessageSender"]) – List of message senders

__init__(total_count=0, senders=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageSenders]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageSenders']

classmethod getType()[source]
Return type:

Literal['messageSenders']

to_dict()[source]
Return type:

dict

senders: List[MessageSender]

List of message senders

total_count: int

Approximate total number of messages senders found

class pytdbot.types.MessageSendingState[source]

Bases: object

Contains information about the sending state of the message

class pytdbot.types.MessageSendingStateFailed(error=None, can_retry=False, need_another_sender=False, need_another_reply_quote=False, need_drop_reply=False, required_paid_message_star_count=0, retry_after=0.0)[source]

Bases: TlObject, MessageSendingState

The message failed to be sent

Parameters:
  • error ("types.Error") – The cause of the message sending failure

  • can_retry (bool) – True, if the message can be re-sent using resendMessages or readdQuickReplyShortcutMessages

  • need_another_sender (bool) – True, if the message can be re-sent only on behalf of a different sender

  • need_another_reply_quote (bool) – True, if the message can be re-sent only if another quote is chosen in the message that is replied by the given message

  • need_drop_reply (bool) – True, if the message can be re-sent only if the message to be replied is removed. This will be done automatically by resendMessages

  • required_paid_message_star_count (int) – The number of Telegram Stars that must be paid to send the message; 0 if the current amount is correct

  • retry_after (float) – Time left before the message can be re-sent, in seconds. No update is sent when this field changes

__init__(error=None, can_retry=False, need_another_sender=False, need_another_reply_quote=False, need_drop_reply=False, required_paid_message_star_count=0, retry_after=0.0)[source]
Parameters:
  • error (Error | None)

  • can_retry (bool)

  • need_another_sender (bool)

  • need_another_reply_quote (bool)

  • need_drop_reply (bool)

  • required_paid_message_star_count (int)

  • retry_after (float)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageSendingStateFailed]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageSendingState']

classmethod getType()[source]
Return type:

Literal['messageSendingStateFailed']

to_dict()[source]
Return type:

dict

can_retry: bool

True, if the message can be re-sent using resendMessages or readdQuickReplyShortcutMessages

error: Optional[Error]

The cause of the message sending failure

need_another_reply_quote: bool

True, if the message can be re-sent only if another quote is chosen in the message that is replied by the given message

need_another_sender: bool

True, if the message can be re-sent only on behalf of a different sender

need_drop_reply: bool

True, if the message can be re-sent only if the message to be replied is removed. This will be done automatically by resendMessages

required_paid_message_star_count: int

The number of Telegram Stars that must be paid to send the message; 0 if the current amount is correct

retry_after: float

Time left before the message can be re-sent, in seconds. No update is sent when this field changes

class pytdbot.types.MessageSendingStatePending(sending_id=0)[source]

Bases: TlObject, MessageSendingState

The message is being sent now, but has not yet been delivered to the server

Parameters:

sending_id (int) – Non-persistent message sending identifier, specified by the application

__init__(sending_id=0)[source]
Parameters:

sending_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageSendingStatePending]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageSendingState']

classmethod getType()[source]
Return type:

Literal['messageSendingStatePending']

to_dict()[source]
Return type:

dict

sending_id: int

Non-persistent message sending identifier, specified by the application

class pytdbot.types.MessageSource[source]

Bases: object

Describes source of a message

class pytdbot.types.MessageSourceChatEventLog[source]

Bases: TlObject, MessageSource

The message is from a chat event log

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageSourceChatEventLog]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageSource']

classmethod getType()[source]
Return type:

Literal['messageSourceChatEventLog']

to_dict()[source]
Return type:

dict

class pytdbot.types.MessageSourceChatHistory[source]

Bases: TlObject, MessageSource

The message is from a chat history

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageSourceChatHistory]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageSource']

classmethod getType()[source]
Return type:

Literal['messageSourceChatHistory']

to_dict()[source]
Return type:

dict

class pytdbot.types.MessageSourceChatList[source]

Bases: TlObject, MessageSource

The message is from a chat list or a forum topic list

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageSourceChatList]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageSource']

classmethod getType()[source]
Return type:

Literal['messageSourceChatList']

to_dict()[source]
Return type:

dict

class pytdbot.types.MessageSourceDirectMessagesChatTopicHistory[source]

Bases: TlObject, MessageSource

The message is from history of a topic in a channel direct messages chat administered by the current user

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageSourceDirectMessagesChatTopicHistory]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageSource']

classmethod getType()[source]
Return type:

Literal['messageSourceDirectMessagesChatTopicHistory']

to_dict()[source]
Return type:

dict

class pytdbot.types.MessageSourceForumTopicHistory[source]

Bases: TlObject, MessageSource

The message is from history of a forum topic

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageSourceForumTopicHistory]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageSource']

classmethod getType()[source]
Return type:

Literal['messageSourceForumTopicHistory']

to_dict()[source]
Return type:

dict

class pytdbot.types.MessageSourceHistoryPreview[source]

Bases: TlObject, MessageSource

The message is from chat, message thread or forum topic history preview

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageSourceHistoryPreview]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageSource']

classmethod getType()[source]
Return type:

Literal['messageSourceHistoryPreview']

to_dict()[source]
Return type:

dict

class pytdbot.types.MessageSourceMessageThreadHistory[source]

Bases: TlObject, MessageSource

The message is from history of a message thread

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageSourceMessageThreadHistory]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageSource']

classmethod getType()[source]
Return type:

Literal['messageSourceMessageThreadHistory']

to_dict()[source]
Return type:

dict

class pytdbot.types.MessageSourceNotification[source]

Bases: TlObject, MessageSource

The message is from a notification

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageSourceNotification]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageSource']

classmethod getType()[source]
Return type:

Literal['messageSourceNotification']

to_dict()[source]
Return type:

dict

class pytdbot.types.MessageSourceOther[source]

Bases: TlObject, MessageSource

The message is from some other source

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageSourceOther]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageSource']

classmethod getType()[source]
Return type:

Literal['messageSourceOther']

to_dict()[source]
Return type:

dict

class pytdbot.types.MessageSourceScreenshot[source]

Bases: TlObject, MessageSource

The message was screenshotted; the source must be used only if the message content was visible during the screenshot

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageSourceScreenshot]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageSource']

classmethod getType()[source]
Return type:

Literal['messageSourceScreenshot']

to_dict()[source]
Return type:

dict

class pytdbot.types.MessageSourceSearch[source]

Bases: TlObject, MessageSource

The message is from search results, including file downloads, local file list, outgoing document messages, calendar

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageSourceSearch]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageSource']

classmethod getType()[source]
Return type:

Literal['messageSourceSearch']

to_dict()[source]
Return type:

dict

class pytdbot.types.MessageStatistics(message_interaction_graph=None, message_reaction_graph=None)[source]

Bases: TlObject

A detailed statistics about a message

Parameters:
  • message_interaction_graph ("types.StatisticalGraph") – A graph containing number of message views and shares

  • message_reaction_graph ("types.StatisticalGraph") – A graph containing number of message reactions

__init__(message_interaction_graph=None, message_reaction_graph=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageStatistics]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageStatistics']

classmethod getType()[source]
Return type:

Literal['messageStatistics']

to_dict()[source]
Return type:

dict

message_interaction_graph: Union[StatisticalGraphData, StatisticalGraphAsync, StatisticalGraphError, None]

A graph containing number of message views and shares

message_reaction_graph: Union[StatisticalGraphData, StatisticalGraphAsync, StatisticalGraphError, None]

A graph containing number of message reactions

class pytdbot.types.MessageSticker(sticker=None, is_premium=False)[source]

Bases: TlObject, MessageContent

A sticker message

Parameters:
  • sticker ("types.Sticker") – The sticker description

  • is_premium (bool) – True, if premium animation of the sticker must be played

__init__(sticker=None, is_premium=False)[source]
Parameters:
  • sticker (Sticker | None)

  • is_premium (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageSticker]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageSticker']

to_dict()[source]
Return type:

dict

is_premium: bool

True, if premium animation of the sticker must be played

sticker: Optional[Sticker]

The sticker description

class pytdbot.types.MessageStory(story_poster_chat_id=0, story_id=0, via_mention=False)[source]

Bases: TlObject, MessageContent

A message with a forwarded story

Parameters:
  • story_poster_chat_id (int) – Identifier of the chat that posted the story

  • story_id (int) – Story identifier

  • via_mention (bool) – True, if the story was automatically forwarded because of a mention of the user

__init__(story_poster_chat_id=0, story_id=0, via_mention=False)[source]
Parameters:
  • story_poster_chat_id (int)

  • story_id (int)

  • via_mention (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageStory]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageStory']

to_dict()[source]
Return type:

dict

story_id: int

Story identifier

story_poster_chat_id: int

Identifier of the chat that posted the story

via_mention: bool

True, if the story was automatically forwarded because of a mention of the user

class pytdbot.types.MessageSuggestProfilePhoto(photo=None)[source]

Bases: TlObject, MessageContent

A profile photo was suggested to a user in a private chat

Parameters:

photo ("types.ChatPhoto") – The suggested chat photo. Use the method setProfilePhoto with inputChatPhotoPrevious to apply the photo

__init__(photo=None)[source]
Parameters:

photo (ChatPhoto | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageSuggestProfilePhoto]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageSuggestProfilePhoto']

to_dict()[source]
Return type:

dict

photo: Optional[ChatPhoto]

The suggested chat photo. Use the method setProfilePhoto with inputChatPhotoPrevious to apply the photo

class pytdbot.types.MessageSuggestedPostApprovalFailed(suggested_post_message_id=0, price=None)[source]

Bases: TlObject, MessageContent

Approval of suggested post has failed, because the user which proposed the post had no enough funds

Parameters:
  • suggested_post_message_id (int) – Identifier of the message with the suggested post; can be 0 if the message was deleted

  • price ("types.SuggestedPostPrice") – Price of the suggested post

__init__(suggested_post_message_id=0, price=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageSuggestedPostApprovalFailed]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageSuggestedPostApprovalFailed']

to_dict()[source]
Return type:

dict

price: Union[SuggestedPostPriceStar, SuggestedPostPriceTon, None]

Price of the suggested post

suggested_post_message_id: int

Identifier of the message with the suggested post; can be 0 if the message was deleted

class pytdbot.types.MessageSuggestedPostApproved(suggested_post_message_id=0, price=None, send_date=0)[source]

Bases: TlObject, MessageContent

A suggested post was approved

Parameters:
  • suggested_post_message_id (int) – Identifier of the message with the suggested post; can be 0 if the message was deleted

  • price ("types.SuggestedPostPrice") – Price of the suggested post; may be null if the post is non-paid

  • send_date (int) – Point in time (Unix timestamp) when the post is expected to be published

__init__(suggested_post_message_id=0, price=None, send_date=0)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageSuggestedPostApproved]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageSuggestedPostApproved']

to_dict()[source]
Return type:

dict

price: Union[SuggestedPostPriceStar, SuggestedPostPriceTon, None]

Price of the suggested post; may be null if the post is non-paid

send_date: int

Point in time (Unix timestamp) when the post is expected to be published

suggested_post_message_id: int

Identifier of the message with the suggested post; can be 0 if the message was deleted

class pytdbot.types.MessageSuggestedPostDeclined(suggested_post_message_id=0, comment='')[source]

Bases: TlObject, MessageContent

A suggested post was declined

Parameters:
  • suggested_post_message_id (int) – Identifier of the message with the suggested post; can be 0 if the message was deleted

  • comment (str) – Comment added by administrator of the channel when the post was declined

__init__(suggested_post_message_id=0, comment='')[source]
Parameters:
  • suggested_post_message_id (int)

  • comment (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageSuggestedPostDeclined]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageSuggestedPostDeclined']

to_dict()[source]
Return type:

dict

comment: Optional[str]

Comment added by administrator of the channel when the post was declined

suggested_post_message_id: int

Identifier of the message with the suggested post; can be 0 if the message was deleted

class pytdbot.types.MessageSuggestedPostPaid(suggested_post_message_id=0, star_amount=None, ton_amount=0)[source]

Bases: TlObject, MessageContent

A suggested post was published for getOption("suggested_post_lifetime_min") seconds and payment for the post was received

Parameters:
  • suggested_post_message_id (int) – Identifier of the message with the suggested post; can be 0 if the message was deleted

  • star_amount ("types.StarAmount") – The amount of received Telegram Stars

  • ton_amount (int) – The amount of received Toncoins; in the smallest units of the cryptocurrency

__init__(suggested_post_message_id=0, star_amount=None, ton_amount=0)[source]
Parameters:
  • suggested_post_message_id (int)

  • star_amount (StarAmount | None)

  • ton_amount (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageSuggestedPostPaid]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageSuggestedPostPaid']

to_dict()[source]
Return type:

dict

star_amount: Optional[StarAmount]

The amount of received Telegram Stars

suggested_post_message_id: int

Identifier of the message with the suggested post; can be 0 if the message was deleted

ton_amount: int

The amount of received Toncoins; in the smallest units of the cryptocurrency

class pytdbot.types.MessageSuggestedPostRefunded(suggested_post_message_id=0, reason=None)[source]

Bases: TlObject, MessageContent

A suggested post was refunded

Parameters:
  • suggested_post_message_id (int) – Identifier of the message with the suggested post; can be 0 if the message was deleted

  • reason ("types.SuggestedPostRefundReason") – Reason of the refund

__init__(suggested_post_message_id=0, reason=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageSuggestedPostRefunded]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageSuggestedPostRefunded']

to_dict()[source]
Return type:

dict

reason: Union[SuggestedPostRefundReasonPostDeleted, SuggestedPostRefundReasonPaymentRefunded, None]

Reason of the refund

suggested_post_message_id: int

Identifier of the message with the suggested post; can be 0 if the message was deleted

class pytdbot.types.MessageSupergroupChatCreate(title='')[source]

Bases: TlObject, MessageContent

A newly created supergroup or channel

Parameters:

title (str) – Title of the supergroup or channel

__init__(title='')[source]
Parameters:

title (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageSupergroupChatCreate]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageSupergroupChatCreate']

to_dict()[source]
Return type:

dict

title: Optional[str]

Title of the supergroup or channel

class pytdbot.types.MessageText(text=None, link_preview=None, link_preview_options=None)[source]

Bases: TlObject, MessageContent

A text message

Parameters:
  • text ("types.FormattedText") – Text of the message

  • link_preview ("types.LinkPreview") – A link preview attached to the message; may be null

  • link_preview_options ("types.LinkPreviewOptions") – Options which were used for generation of the link preview; may be null if default options were used

__init__(text=None, link_preview=None, link_preview_options=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageText]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageText']

to_dict()[source]
Return type:

dict

link_preview: Optional[LinkPreview]

A link preview attached to the message; may be null

link_preview_options: Optional[LinkPreviewOptions]

Options which were used for generation of the link preview; may be null if default options were used

text: Optional[FormattedText]

Text of the message

class pytdbot.types.MessageThreadInfo(chat_id=0, message_thread_id=0, reply_info=None, unread_message_count=0, messages=None, draft_message=None)[source]

Bases: TlObject

Contains information about a message thread

Parameters:
  • chat_id (int) – Identifier of the chat to which the message thread belongs

  • message_thread_id (int) – Message thread identifier, unique within the chat

  • reply_info ("types.MessageReplyInfo") – Information about the message thread; may be null for forum topic threads

  • unread_message_count (int) – Approximate number of unread messages in the message thread

  • messages (List["types.Message"]) – The messages from which the thread starts. The messages are returned in reverse chronological order (i.e., in order of decreasing message_id)

  • draft_message ("types.DraftMessage") – A draft of a message in the message thread; may be null if none

__init__(chat_id=0, message_thread_id=0, reply_info=None, unread_message_count=0, messages=None, draft_message=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageThreadInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageThreadInfo']

classmethod getType()[source]
Return type:

Literal['messageThreadInfo']

to_dict()[source]
Return type:

dict

chat_id: int

Identifier of the chat to which the message thread belongs

draft_message: Optional[DraftMessage]

A draft of a message in the message thread; may be null if none

message_thread_id: int

Message thread identifier, unique within the chat

messages: List[Message]

The messages from which the thread starts. The messages are returned in reverse chronological order (i.e., in order of decreasing message_id)

reply_info: Optional[MessageReplyInfo]

Information about the message thread; may be null for forum topic threads

unread_message_count: int

Approximate number of unread messages in the message thread

class pytdbot.types.MessageTopic[source]

Bases: object

Describes a topic of messages in a chat

class pytdbot.types.MessageTopicDirectMessages(direct_messages_chat_topic_id=0)[source]

Bases: TlObject, MessageTopic

A topic in a channel direct messages chat administered by the current user

Parameters:

direct_messages_chat_topic_id (int) – Unique identifier of the topic

__init__(direct_messages_chat_topic_id=0)[source]
Parameters:

direct_messages_chat_topic_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageTopicDirectMessages]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageTopic']

classmethod getType()[source]
Return type:

Literal['messageTopicDirectMessages']

to_dict()[source]
Return type:

dict

direct_messages_chat_topic_id: int

Unique identifier of the topic

class pytdbot.types.MessageTopicForum(forum_topic_id=0)[source]

Bases: TlObject, MessageTopic

A topic in a forum supergroup chat

Parameters:

forum_topic_id (int) – Unique identifier of the forum topic; all messages in a non-forum supergroup chats belongs to the General topic

__init__(forum_topic_id=0)[source]
Parameters:

forum_topic_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageTopicForum]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageTopic']

classmethod getType()[source]
Return type:

Literal['messageTopicForum']

to_dict()[source]
Return type:

dict

forum_topic_id: int

Unique identifier of the forum topic; all messages in a non-forum supergroup chats belongs to the General topic

class pytdbot.types.MessageTopicSavedMessages(saved_messages_topic_id=0)[source]

Bases: TlObject, MessageTopic

A topic in Saved Messages chat

Parameters:

saved_messages_topic_id (int) – Unique identifier of the Saved Messages topic

__init__(saved_messages_topic_id=0)[source]
Parameters:

saved_messages_topic_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageTopicSavedMessages]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageTopic']

classmethod getType()[source]
Return type:

Literal['messageTopicSavedMessages']

to_dict()[source]
Return type:

dict

saved_messages_topic_id: int

Unique identifier of the Saved Messages topic

class pytdbot.types.MessageUnsupported[source]

Bases: TlObject, MessageContent

A message content that is not supported in the current TDLib version

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageUnsupported]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageUnsupported']

to_dict()[source]
Return type:

dict

class pytdbot.types.MessageUpgradedGift(gift=None, sender_id=None, receiver_id=None, origin=None, received_gift_id='', is_saved=False, can_be_transferred=False, was_transferred=False, transfer_star_count=0, next_transfer_date=0, next_resale_date=0, export_date=0)[source]

Bases: TlObject, MessageContent

An upgraded gift was received or sent by the current user, or the current user was notified about a channel gift

Parameters:
  • gift ("types.UpgradedGift") – The gift

  • sender_id ("types.MessageSender") – Sender of the gift; may be null for anonymous gifts

  • receiver_id ("types.MessageSender") – Receiver of the gift

  • origin ("types.UpgradedGiftOrigin") – Origin of the upgraded gift

  • received_gift_id (str) – Unique identifier of the received gift for the current user; only for the receiver of the gift

  • is_saved (bool) – True, if the gift is displayed on the user’s or the channel’s profile page; only for the receiver of the gift

  • can_be_transferred (bool) – True, if the gift can be transferred to another owner; only for the receiver of the gift

  • was_transferred (bool) – True, if the gift has already been transferred to another owner; only for the receiver of the gift

  • transfer_star_count (int) – Number of Telegram Stars that must be paid to transfer the upgraded gift; only for the receiver of the gift

  • next_transfer_date (int) – Point in time (Unix timestamp) when the gift can be transferred to another owner; can be in the past; 0 if the gift can be transferred immediately or transfer isn’t possible; only for the receiver of the gift

  • next_resale_date (int) – Point in time (Unix timestamp) when the gift can be resold to another user; can be in the past; 0 if the gift can’t be resold; only for the receiver of the gift

  • export_date (int) – Point in time (Unix timestamp) when the gift can be transferred to the TON blockchain as an NFT; can be in the past; 0 if NFT export isn’t possible; only for the receiver of the gift

__init__(gift=None, sender_id=None, receiver_id=None, origin=None, received_gift_id='', is_saved=False, can_be_transferred=False, was_transferred=False, transfer_star_count=0, next_transfer_date=0, next_resale_date=0, export_date=0)[source]
Parameters:
  • gift (UpgradedGift | None)

  • sender_id (MessageSender | None)

  • receiver_id (MessageSender | None)

  • origin (UpgradedGiftOrigin | None)

  • received_gift_id (str)

  • is_saved (bool)

  • can_be_transferred (bool)

  • was_transferred (bool)

  • transfer_star_count (int)

  • next_transfer_date (int)

  • next_resale_date (int)

  • export_date (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageUpgradedGift]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageUpgradedGift']

to_dict()[source]
Return type:

dict

can_be_transferred: bool

True, if the gift can be transferred to another owner; only for the receiver of the gift

export_date: int

Point in time (Unix timestamp) when the gift can be transferred to the TON blockchain as an NFT; can be in the past; 0 if NFT export isn’t possible; only for the receiver of the gift

gift: Optional[UpgradedGift]

The gift

is_saved: bool

True, if the gift is displayed on the user’s or the channel’s profile page; only for the receiver of the gift

next_resale_date: int

Point in time (Unix timestamp) when the gift can be resold to another user; can be in the past; 0 if the gift can’t be resold; only for the receiver of the gift

next_transfer_date: int

Point in time (Unix timestamp) when the gift can be transferred to another owner; can be in the past; 0 if the gift can be transferred immediately or transfer isn’t possible; only for the receiver of the gift

origin: Union[UpgradedGiftOriginUpgrade, UpgradedGiftOriginTransfer, UpgradedGiftOriginResale, UpgradedGiftOriginPrepaidUpgrade, None]

Origin of the upgraded gift

received_gift_id: Optional[str]

Unique identifier of the received gift for the current user; only for the receiver of the gift

receiver_id: Union[MessageSenderUser, MessageSenderChat, None]

Receiver of the gift

sender_id: Union[MessageSenderUser, MessageSenderChat, None]

Sender of the gift; may be null for anonymous gifts

transfer_star_count: int

Number of Telegram Stars that must be paid to transfer the upgraded gift; only for the receiver of the gift

was_transferred: bool

True, if the gift has already been transferred to another owner; only for the receiver of the gift

class pytdbot.types.MessageUsersShared(users=None, button_id=0)[source]

Bases: TlObject, MessageContent

The current user shared users, which were requested by the bot

Parameters:
  • users (List["types.SharedUser"]) – The shared users

  • button_id (int) – Identifier of the keyboard button with the request

__init__(users=None, button_id=0)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageUsersShared]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageUsersShared']

to_dict()[source]
Return type:

dict

button_id: int

Identifier of the keyboard button with the request

users: List[SharedUser]

The shared users

class pytdbot.types.MessageVenue(venue=None)[source]

Bases: TlObject, MessageContent

A message with information about a venue

Parameters:

venue ("types.Venue") – The venue description

__init__(venue=None)[source]
Parameters:

venue (Venue | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageVenue]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageVenue']

to_dict()[source]
Return type:

dict

venue: Optional[Venue]

The venue description

class pytdbot.types.MessageVideo(video=None, alternative_videos=None, storyboards=None, cover=None, start_timestamp=0, caption=None, show_caption_above_media=False, has_spoiler=False, is_secret=False)[source]

Bases: TlObject, MessageContent

A video message

Parameters:
  • video ("types.Video") – The video description

  • alternative_videos (List["types.AlternativeVideo"]) – Alternative qualities of the video

  • storyboards (List["types.VideoStoryboard"]) – Available storyboards for the video

  • cover ("types.Photo") – Cover of the video; may be null if none

  • start_timestamp (int) – Timestamp from which the video playing must start, in seconds

  • caption ("types.FormattedText") – Video caption

  • show_caption_above_media (bool) – True, if the caption must be shown above the video; otherwise, the caption must be shown below the video

  • has_spoiler (bool) – True, if the video preview must be covered by a spoiler animation

  • is_secret (bool) – True, if the video thumbnail must be blurred and the video must be shown only while tapped

__init__(video=None, alternative_videos=None, storyboards=None, cover=None, start_timestamp=0, caption=None, show_caption_above_media=False, has_spoiler=False, is_secret=False)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageVideo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageVideo']

to_dict()[source]
Return type:

dict

alternative_videos: List[AlternativeVideo]

Alternative qualities of the video

caption: Optional[FormattedText]

Video caption

cover: Optional[Photo]

Cover of the video; may be null if none

has_spoiler: bool

True, if the video preview must be covered by a spoiler animation

is_secret: bool

True, if the video thumbnail must be blurred and the video must be shown only while tapped

show_caption_above_media: bool

True, if the caption must be shown above the video; otherwise, the caption must be shown below the video

start_timestamp: int

Timestamp from which the video playing must start, in seconds

storyboards: List[VideoStoryboard]

Available storyboards for the video

video: Optional[Video]

The video description

class pytdbot.types.MessageVideoChatEnded(duration=0)[source]

Bases: TlObject, MessageContent

A message with information about an ended video chat

Parameters:

duration (int) – Call duration, in seconds

__init__(duration=0)[source]
Parameters:

duration (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageVideoChatEnded]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageVideoChatEnded']

to_dict()[source]
Return type:

dict

duration: int

Call duration, in seconds

class pytdbot.types.MessageVideoChatScheduled(group_call_id=0, start_date=0)[source]

Bases: TlObject, MessageContent

A new video chat was scheduled

Parameters:
  • group_call_id (int) – Identifier of the video chat. The video chat can be received through the method getGroupCall

  • start_date (int) – Point in time (Unix timestamp) when the group call is expected to be started by an administrator

__init__(group_call_id=0, start_date=0)[source]
Parameters:
  • group_call_id (int)

  • start_date (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageVideoChatScheduled]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageVideoChatScheduled']

to_dict()[source]
Return type:

dict

group_call_id: int

Identifier of the video chat. The video chat can be received through the method getGroupCall

start_date: int

Point in time (Unix timestamp) when the group call is expected to be started by an administrator

class pytdbot.types.MessageVideoChatStarted(group_call_id=0)[source]

Bases: TlObject, MessageContent

A newly created video chat

Parameters:

group_call_id (int) – Identifier of the video chat. The video chat can be received through the method getGroupCall

__init__(group_call_id=0)[source]
Parameters:

group_call_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageVideoChatStarted]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageVideoChatStarted']

to_dict()[source]
Return type:

dict

group_call_id: int

Identifier of the video chat. The video chat can be received through the method getGroupCall

class pytdbot.types.MessageVideoNote(video_note=None, is_viewed=False, is_secret=False)[source]

Bases: TlObject, MessageContent

A video note message

Parameters:
  • video_note ("types.VideoNote") – The video note description

  • is_viewed (bool) – True, if at least one of the recipients has viewed the video note

  • is_secret (bool) – True, if the video note thumbnail must be blurred and the video note must be shown only while tapped

__init__(video_note=None, is_viewed=False, is_secret=False)[source]
Parameters:
  • video_note (VideoNote | None)

  • is_viewed (bool)

  • is_secret (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageVideoNote]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageVideoNote']

to_dict()[source]
Return type:

dict

is_secret: bool

True, if the video note thumbnail must be blurred and the video note must be shown only while tapped

is_viewed: bool

True, if at least one of the recipients has viewed the video note

video_note: Optional[VideoNote]

The video note description

class pytdbot.types.MessageViewer(user_id=0, view_date=0)[source]

Bases: TlObject

Represents a viewer of a message

Parameters:
  • user_id (int) – User identifier of the viewer

  • view_date (int) – Approximate point in time (Unix timestamp) when the message was viewed

__init__(user_id=0, view_date=0)[source]
Parameters:
  • user_id (int)

  • view_date (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageViewer]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageViewer']

classmethod getType()[source]
Return type:

Literal['messageViewer']

to_dict()[source]
Return type:

dict

user_id: int

User identifier of the viewer

view_date: int

Approximate point in time (Unix timestamp) when the message was viewed

class pytdbot.types.MessageViewers(viewers=None)[source]

Bases: TlObject

Represents a list of message viewers

Parameters:

viewers (List["types.MessageViewer"]) – List of message viewers

__init__(viewers=None)[source]
Parameters:

viewers (List[MessageViewer] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageViewers]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageViewers']

classmethod getType()[source]
Return type:

Literal['messageViewers']

to_dict()[source]
Return type:

dict

viewers: List[MessageViewer]

List of message viewers

class pytdbot.types.MessageVoiceNote(voice_note=None, caption=None, is_listened=False)[source]

Bases: TlObject, MessageContent

A voice note message

Parameters:
  • voice_note ("types.VoiceNote") – The voice note description

  • caption ("types.FormattedText") – Voice note caption

  • is_listened (bool) – True, if at least one of the recipients has listened to the voice note

__init__(voice_note=None, caption=None, is_listened=False)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageVoiceNote]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageVoiceNote']

to_dict()[source]
Return type:

dict

caption: Optional[FormattedText]

Voice note caption

is_listened: bool

True, if at least one of the recipients has listened to the voice note

voice_note: Optional[VoiceNote]

The voice note description

class pytdbot.types.MessageWebAppDataReceived(button_text='', data='')[source]

Bases: TlObject, MessageContent

Data from a Web App has been received; for bots only

Parameters:
  • button_text (str) – Text of the keyboardButtonTypeWebApp button, which opened the Web App

  • data (str) – The data

__init__(button_text='', data='')[source]
Parameters:
  • button_text (str)

  • data (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageWebAppDataReceived]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageWebAppDataReceived']

to_dict()[source]
Return type:

dict

button_text: Optional[str]

Text of the keyboardButtonTypeWebApp button, which opened the Web App

data: Optional[str]

The data

class pytdbot.types.MessageWebAppDataSent(button_text='')[source]

Bases: TlObject, MessageContent

Data from a Web App has been sent to a bot

Parameters:

button_text (str) – Text of the keyboardButtonTypeWebApp button, which opened the Web App

__init__(button_text='')[source]
Parameters:

button_text (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[MessageWebAppDataSent]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['MessageContent']

classmethod getType()[source]
Return type:

Literal['messageWebAppDataSent']

to_dict()[source]
Return type:

dict

button_text: Optional[str]

Text of the keyboardButtonTypeWebApp button, which opened the Web App

class pytdbot.types.Messages(total_count=0, messages=None)[source]

Bases: TlObject

Contains a list of messages

Parameters:
  • total_count (int) – Approximate total number of messages found

  • messages (List["types.Message"]) – List of messages; messages may be null

__init__(total_count=0, messages=None)[source]
Parameters:
  • total_count (int)

  • messages (List[Message] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Messages]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Messages']

classmethod getType()[source]
Return type:

Literal['messages']

to_dict()[source]
Return type:

dict

messages: List[Message]

List of messages; messages may be null

total_count: int

Approximate total number of messages found

class pytdbot.types.Minithumbnail(width=0, height=0, data=b'')[source]

Bases: TlObject

Thumbnail image of a very poor quality and low resolution

Parameters:
  • width (int) – Thumbnail width, usually doesn’t exceed 40

  • height (int) – Thumbnail height, usually doesn’t exceed 40

  • data (bytes) – The thumbnail in JPEG format

__init__(width=0, height=0, data=b'')[source]
Parameters:
  • width (int)

  • height (int)

  • data (bytes)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Minithumbnail]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Minithumbnail']

classmethod getType()[source]
Return type:

Literal['minithumbnail']

to_dict()[source]
Return type:

dict

data: Optional[bytes]

The thumbnail in JPEG format

height: int

Thumbnail height, usually doesn’t exceed 40

width: int

Thumbnail width, usually doesn’t exceed 40

class pytdbot.types.NetworkStatistics(since_date=0, entries=None)[source]

Bases: TlObject

A full list of available network statistic entries

Parameters:
  • since_date (int) – Point in time (Unix timestamp) from which the statistics are collected

  • entries (List["types.NetworkStatisticsEntry"]) – Network statistics entries

__init__(since_date=0, entries=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[NetworkStatistics]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['NetworkStatistics']

classmethod getType()[source]
Return type:

Literal['networkStatistics']

to_dict()[source]
Return type:

dict

entries: List[NetworkStatisticsEntry]

Network statistics entries

since_date: int

Point in time (Unix timestamp) from which the statistics are collected

class pytdbot.types.NetworkStatisticsEntry[source]

Bases: object

Contains statistics about network usage

class pytdbot.types.NetworkStatisticsEntryCall(network_type=None, sent_bytes=0, received_bytes=0, duration=0.0)[source]

Bases: TlObject, NetworkStatisticsEntry

Contains information about the total amount of data that was used for calls

Parameters:
  • network_type ("types.NetworkType") – Type of the network the data was sent through. Call setNetworkType to maintain the actual network type

  • sent_bytes (int) – Total number of bytes sent

  • received_bytes (int) – Total number of bytes received

  • duration (float) – Total call duration, in seconds

__init__(network_type=None, sent_bytes=0, received_bytes=0, duration=0.0)[source]
Parameters:
  • network_type (NetworkType | None)

  • sent_bytes (int)

  • received_bytes (int)

  • duration (float)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[NetworkStatisticsEntryCall]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['NetworkStatisticsEntry']

classmethod getType()[source]
Return type:

Literal['networkStatisticsEntryCall']

to_dict()[source]
Return type:

dict

duration: float

Total call duration, in seconds

network_type: Union[NetworkTypeNone, NetworkTypeMobile, NetworkTypeMobileRoaming, NetworkTypeWiFi, NetworkTypeOther, None]

Type of the network the data was sent through. Call setNetworkType to maintain the actual network type

received_bytes: int

Total number of bytes received

sent_bytes: int

Total number of bytes sent

class pytdbot.types.NetworkStatisticsEntryFile(file_type=None, network_type=None, sent_bytes=0, received_bytes=0)[source]

Bases: TlObject, NetworkStatisticsEntry

Contains information about the total amount of data that was used to send and receive files

Parameters:
  • file_type ("types.FileType") – Type of the file the data is part of; pass null if the data isn’t related to files

  • network_type ("types.NetworkType") – Type of the network the data was sent through. Call setNetworkType to maintain the actual network type

  • sent_bytes (int) – Total number of bytes sent

  • received_bytes (int) – Total number of bytes received

__init__(file_type=None, network_type=None, sent_bytes=0, received_bytes=0)[source]
Parameters:
  • file_type (FileType | None)

  • network_type (NetworkType | None)

  • sent_bytes (int)

  • received_bytes (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[NetworkStatisticsEntryFile]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['NetworkStatisticsEntry']

classmethod getType()[source]
Return type:

Literal['networkStatisticsEntryFile']

to_dict()[source]
Return type:

dict

file_type: Union[FileTypeNone, FileTypeAnimation, FileTypeAudio, FileTypeDocument, FileTypeNotificationSound, FileTypePhoto, FileTypePhotoStory, FileTypeProfilePhoto, FileTypeSecret, FileTypeSecretThumbnail, FileTypeSecure, FileTypeSelfDestructingPhoto, FileTypeSelfDestructingVideo, FileTypeSelfDestructingVideoNote, FileTypeSelfDestructingVoiceNote, FileTypeSticker, FileTypeThumbnail, FileTypeUnknown, FileTypeVideo, FileTypeVideoNote, FileTypeVideoStory, FileTypeVoiceNote, FileTypeWallpaper, None]

Type of the file the data is part of; pass null if the data isn’t related to files

network_type: Union[NetworkTypeNone, NetworkTypeMobile, NetworkTypeMobileRoaming, NetworkTypeWiFi, NetworkTypeOther, None]

Type of the network the data was sent through. Call setNetworkType to maintain the actual network type

received_bytes: int

Total number of bytes received

sent_bytes: int

Total number of bytes sent

class pytdbot.types.NetworkType[source]

Bases: object

Represents the type of network

class pytdbot.types.NetworkTypeMobile[source]

Bases: TlObject, NetworkType

A mobile network

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[NetworkTypeMobile]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['NetworkType']

classmethod getType()[source]
Return type:

Literal['networkTypeMobile']

to_dict()[source]
Return type:

dict

class pytdbot.types.NetworkTypeMobileRoaming[source]

Bases: TlObject, NetworkType

A mobile roaming network

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[NetworkTypeMobileRoaming]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['NetworkType']

classmethod getType()[source]
Return type:

Literal['networkTypeMobileRoaming']

to_dict()[source]
Return type:

dict

class pytdbot.types.NetworkTypeNone[source]

Bases: TlObject, NetworkType

The network is not available

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[NetworkTypeNone]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['NetworkType']

classmethod getType()[source]
Return type:

Literal['networkTypeNone']

to_dict()[source]
Return type:

dict

class pytdbot.types.NetworkTypeOther[source]

Bases: TlObject, NetworkType

A different network type (e.g., Ethernet network)

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[NetworkTypeOther]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['NetworkType']

classmethod getType()[source]
Return type:

Literal['networkTypeOther']

to_dict()[source]
Return type:

dict

class pytdbot.types.NetworkTypeWiFi[source]

Bases: TlObject, NetworkType

A Wi-Fi network

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[NetworkTypeWiFi]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['NetworkType']

classmethod getType()[source]
Return type:

Literal['networkTypeWiFi']

to_dict()[source]
Return type:

dict

class pytdbot.types.NewChatPrivacySettings(allow_new_chats_from_unknown_users=False, incoming_paid_message_star_count=0)[source]

Bases: TlObject

Contains privacy settings for chats with non-contacts

Parameters:
  • allow_new_chats_from_unknown_users (bool) – True, if non-contacts users are able to write first to the current user. Telegram Premium subscribers are able to write first regardless of this setting

  • incoming_paid_message_star_count (int) – Number of Telegram Stars that must be paid for every incoming private message by non-contacts; 0-getOption("paid_message_star_count_max"). If positive, then allow_new_chats_from_unknown_users must be true. The current user will receive getOption("paid_message_earnings_per_mille") Telegram Stars for each 1000 Telegram Stars paid for message sending. Can be positive, only if getOption("can_enable_paid_messages") is true

__init__(allow_new_chats_from_unknown_users=False, incoming_paid_message_star_count=0)[source]
Parameters:
  • allow_new_chats_from_unknown_users (bool)

  • incoming_paid_message_star_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[NewChatPrivacySettings]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['NewChatPrivacySettings']

classmethod getType()[source]
Return type:

Literal['newChatPrivacySettings']

to_dict()[source]
Return type:

dict

allow_new_chats_from_unknown_users: bool

True, if non-contacts users are able to write first to the current user. Telegram Premium subscribers are able to write first regardless of this setting

incoming_paid_message_star_count: int

Number of Telegram Stars that must be paid for every incoming private message by non-contacts; 0-getOption("paid_message_star_count_max"). If positive, then allow_new_chats_from_unknown_users must be true. The current user will receive getOption("paid_message_earnings_per_mille") Telegram Stars for each 1000 Telegram Stars paid for message sending. Can be positive, only if getOption("can_enable_paid_messages") is true

class pytdbot.types.Notification(id=0, date=0, is_silent=False, type=None)[source]

Bases: TlObject

Contains information about a notification

Parameters:
  • id (int) – Unique persistent identifier of this notification

  • date (int) – Notification date

  • is_silent (bool) – True, if the notification was explicitly sent without sound

  • type ("types.NotificationType") – Notification type

__init__(id=0, date=0, is_silent=False, type=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Notification]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Notification']

classmethod getType()[source]
Return type:

Literal['notification']

to_dict()[source]
Return type:

dict

date: int

Notification date

id: int

Unique persistent identifier of this notification

is_silent: bool

True, if the notification was explicitly sent without sound

type: Union[NotificationTypeNewMessage, NotificationTypeNewSecretChat, NotificationTypeNewCall, NotificationTypeNewPushMessage, None]

Notification type

class pytdbot.types.NotificationGroup(id=0, type=None, chat_id=0, total_count=0, notifications=None)[source]

Bases: TlObject

Describes a group of notifications

Parameters:
  • id (int) – Unique persistent auto-incremented from 1 identifier of the notification group

  • type ("types.NotificationGroupType") – Type of the group

  • chat_id (int) – Identifier of a chat to which all notifications in the group belong

  • total_count (int) – Total number of active notifications in the group

  • notifications (List["types.Notification"]) – The list of active notifications

__init__(id=0, type=None, chat_id=0, total_count=0, notifications=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[NotificationGroup]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['NotificationGroup']

classmethod getType()[source]
Return type:

Literal['notificationGroup']

to_dict()[source]
Return type:

dict

chat_id: int

Identifier of a chat to which all notifications in the group belong

id: int

Unique persistent auto-incremented from 1 identifier of the notification group

notifications: List[Notification]

The list of active notifications

total_count: int

Total number of active notifications in the group

type: Union[NotificationGroupTypeMessages, NotificationGroupTypeMentions, NotificationGroupTypeSecretChat, NotificationGroupTypeCalls, None]

Type of the group

class pytdbot.types.NotificationGroupType[source]

Bases: object

Describes the type of notifications in a notification group

class pytdbot.types.NotificationGroupTypeCalls[source]

Bases: TlObject, NotificationGroupType

A group containing notifications of type notificationTypeNewCall

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[NotificationGroupTypeCalls]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['NotificationGroupType']

classmethod getType()[source]
Return type:

Literal['notificationGroupTypeCalls']

to_dict()[source]
Return type:

dict

class pytdbot.types.NotificationGroupTypeMentions[source]

Bases: TlObject, NotificationGroupType

A group containing notifications of type notificationTypeNewMessage and notificationTypeNewPushMessage with unread mentions of the current user, replies to their messages, or a pinned message

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[NotificationGroupTypeMentions]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['NotificationGroupType']

classmethod getType()[source]
Return type:

Literal['notificationGroupTypeMentions']

to_dict()[source]
Return type:

dict

class pytdbot.types.NotificationGroupTypeMessages[source]

Bases: TlObject, NotificationGroupType

A group containing notifications of type notificationTypeNewMessage and notificationTypeNewPushMessage with ordinary unread messages

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[NotificationGroupTypeMessages]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['NotificationGroupType']

classmethod getType()[source]
Return type:

Literal['notificationGroupTypeMessages']

to_dict()[source]
Return type:

dict

class pytdbot.types.NotificationGroupTypeSecretChat[source]

Bases: TlObject, NotificationGroupType

A group containing a notification of type notificationTypeNewSecretChat

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[NotificationGroupTypeSecretChat]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['NotificationGroupType']

classmethod getType()[source]
Return type:

Literal['notificationGroupTypeSecretChat']

to_dict()[source]
Return type:

dict

class pytdbot.types.NotificationSettingsScope[source]

Bases: object

Describes the types of chats to which notification settings are relevant

class pytdbot.types.NotificationSettingsScopeChannelChats[source]

Bases: TlObject, NotificationSettingsScope

Notification settings applied to all channel chats when the corresponding chat setting has a default value

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[NotificationSettingsScopeChannelChats]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['NotificationSettingsScope']

classmethod getType()[source]
Return type:

Literal['notificationSettingsScopeChannelChats']

to_dict()[source]
Return type:

dict

class pytdbot.types.NotificationSettingsScopeGroupChats[source]

Bases: TlObject, NotificationSettingsScope

Notification settings applied to all basic group and supergroup chats when the corresponding chat setting has a default value

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[NotificationSettingsScopeGroupChats]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['NotificationSettingsScope']

classmethod getType()[source]
Return type:

Literal['notificationSettingsScopeGroupChats']

to_dict()[source]
Return type:

dict

class pytdbot.types.NotificationSettingsScopePrivateChats[source]

Bases: TlObject, NotificationSettingsScope

Notification settings applied to all private and secret chats when the corresponding chat setting has a default value

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[NotificationSettingsScopePrivateChats]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['NotificationSettingsScope']

classmethod getType()[source]
Return type:

Literal['notificationSettingsScopePrivateChats']

to_dict()[source]
Return type:

dict

class pytdbot.types.NotificationSound(id=0, duration=0, date=0, title='', data='', sound=None)[source]

Bases: TlObject

Describes a notification sound in MP3 format

Parameters:
  • id (int) – Unique identifier of the notification sound

  • duration (int) – Duration of the sound, in seconds

  • date (int) – Point in time (Unix timestamp) when the sound was created

  • title (str) – Title of the notification sound

  • data (str) – Arbitrary data, defined while the sound was uploaded

  • sound ("types.File") – File containing the sound

__init__(id=0, duration=0, date=0, title='', data='', sound=None)[source]
Parameters:
  • id (int)

  • duration (int)

  • date (int)

  • title (str)

  • data (str)

  • sound (File | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[NotificationSound]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['NotificationSound']

classmethod getType()[source]
Return type:

Literal['notificationSound']

to_dict()[source]
Return type:

dict

data: Optional[str]

Arbitrary data, defined while the sound was uploaded

date: int

Point in time (Unix timestamp) when the sound was created

duration: int

Duration of the sound, in seconds

id: int

Unique identifier of the notification sound

sound: Optional[File]

File containing the sound

title: Optional[str]

Title of the notification sound

class pytdbot.types.NotificationSounds(notification_sounds=None)[source]

Bases: TlObject

Contains a list of notification sounds

Parameters:

notification_sounds (List["types.NotificationSound"]) – A list of notification sounds

__init__(notification_sounds=None)[source]
Parameters:

notification_sounds (List[NotificationSound] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[NotificationSounds]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['NotificationSounds']

classmethod getType()[source]
Return type:

Literal['notificationSounds']

to_dict()[source]
Return type:

dict

notification_sounds: List[NotificationSound]

A list of notification sounds

class pytdbot.types.NotificationType[source]

Bases: object

Contains detailed information about a notification

class pytdbot.types.NotificationTypeNewCall(call_id=0)[source]

Bases: TlObject, NotificationType

New call was received

Parameters:

call_id (int) – Call identifier

__init__(call_id=0)[source]
Parameters:

call_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[NotificationTypeNewCall]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['NotificationType']

classmethod getType()[source]
Return type:

Literal['notificationTypeNewCall']

to_dict()[source]
Return type:

dict

call_id: int

Call identifier

class pytdbot.types.NotificationTypeNewMessage(message=None, show_preview=False)[source]

Bases: TlObject, NotificationType

New message was received

Parameters:
  • message ("types.Message") – The message

  • show_preview (bool) – True, if message content must be displayed in notifications

__init__(message=None, show_preview=False)[source]
Parameters:
  • message (Message | None)

  • show_preview (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[NotificationTypeNewMessage]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['NotificationType']

classmethod getType()[source]
Return type:

Literal['notificationTypeNewMessage']

to_dict()[source]
Return type:

dict

message: Optional[Message]

The message

show_preview: bool

True, if message content must be displayed in notifications

class pytdbot.types.NotificationTypeNewPushMessage(message_id=0, sender_id=None, sender_name='', is_outgoing=False, content=None)[source]

Bases: TlObject, NotificationType

New message was received through a push notification

Parameters:
  • message_id (int) – The message identifier. The message will not be available in the chat history, but the identifier can be used in viewMessages, or as a message to be replied in the same chat

  • sender_id ("types.MessageSender") – Identifier of the sender of the message. Corresponding user or chat may be inaccessible

  • sender_name (str) – Name of the sender

  • is_outgoing (bool) – True, if the message is outgoing

  • content ("types.PushMessageContent") – Push message content

__init__(message_id=0, sender_id=None, sender_name='', is_outgoing=False, content=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[NotificationTypeNewPushMessage]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['NotificationType']

classmethod getType()[source]
Return type:

Literal['notificationTypeNewPushMessage']

to_dict()[source]
Return type:

dict

content: Union[PushMessageContentHidden, PushMessageContentAnimation, PushMessageContentAudio, PushMessageContentContact, PushMessageContentContactRegistered, PushMessageContentDocument, PushMessageContentGame, PushMessageContentGameScore, PushMessageContentInvoice, PushMessageContentLocation, PushMessageContentPaidMedia, PushMessageContentPhoto, PushMessageContentPoll, PushMessageContentPremiumGiftCode, PushMessageContentGiveaway, PushMessageContentGift, PushMessageContentUpgradedGift, PushMessageContentScreenshotTaken, PushMessageContentSticker, PushMessageContentStory, PushMessageContentText, PushMessageContentChecklist, PushMessageContentVideo, PushMessageContentVideoNote, PushMessageContentVoiceNote, PushMessageContentBasicGroupChatCreate, PushMessageContentVideoChatStarted, PushMessageContentVideoChatEnded, PushMessageContentInviteVideoChatParticipants, PushMessageContentChatAddMembers, PushMessageContentChatChangePhoto, PushMessageContentChatChangeTitle, PushMessageContentChatSetBackground, PushMessageContentChatSetTheme, PushMessageContentChatDeleteMember, PushMessageContentChatJoinByLink, PushMessageContentChatJoinByRequest, PushMessageContentRecurringPayment, PushMessageContentSuggestProfilePhoto, PushMessageContentProximityAlertTriggered, PushMessageContentChecklistTasksAdded, PushMessageContentChecklistTasksDone, PushMessageContentMessageForwards, PushMessageContentMediaAlbum, None]

Push message content

is_outgoing: bool

True, if the message is outgoing

message_id: int

The message identifier. The message will not be available in the chat history, but the identifier can be used in viewMessages, or as a message to be replied in the same chat

sender_id: Union[MessageSenderUser, MessageSenderChat, None]

Identifier of the sender of the message. Corresponding user or chat may be inaccessible

sender_name: Optional[str]

Name of the sender

class pytdbot.types.NotificationTypeNewSecretChat[source]

Bases: TlObject, NotificationType

New secret chat was created

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[NotificationTypeNewSecretChat]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['NotificationType']

classmethod getType()[source]
Return type:

Literal['notificationTypeNewSecretChat']

to_dict()[source]
Return type:

dict

class pytdbot.types.Ok[source]

Bases: TlObject

An object of this type is returned on a successful function call for certain functions

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Ok]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Ok']

classmethod getType()[source]
Return type:

Literal['ok']

to_dict()[source]
Return type:

dict

class pytdbot.types.OptionValue[source]

Bases: object

Represents the value of an option

class pytdbot.types.OptionValueBoolean(value=False)[source]

Bases: TlObject, OptionValue

Represents a boolean option

Parameters:

value (bool) – The value of the option

__init__(value=False)[source]
Parameters:

value (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[OptionValueBoolean]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['OptionValue']

classmethod getType()[source]
Return type:

Literal['optionValueBoolean']

to_dict()[source]
Return type:

dict

value: bool

The value of the option

class pytdbot.types.OptionValueEmpty[source]

Bases: TlObject, OptionValue

Represents an unknown option or an option which has a default value

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[OptionValueEmpty]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['OptionValue']

classmethod getType()[source]
Return type:

Literal['optionValueEmpty']

to_dict()[source]
Return type:

dict

class pytdbot.types.OptionValueInteger(value=0)[source]

Bases: TlObject, OptionValue

Represents an integer option

Parameters:

value (int) – The value of the option

__init__(value=0)[source]
Parameters:

value (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[OptionValueInteger]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['OptionValue']

classmethod getType()[source]
Return type:

Literal['optionValueInteger']

to_dict()[source]
Return type:

dict

value: int

The value of the option

class pytdbot.types.OptionValueString(value='')[source]

Bases: TlObject, OptionValue

Represents a string option

Parameters:

value (str) – The value of the option

__init__(value='')[source]
Parameters:

value (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[OptionValueString]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['OptionValue']

classmethod getType()[source]
Return type:

Literal['optionValueString']

to_dict()[source]
Return type:

dict

value: Optional[str]

The value of the option

class pytdbot.types.OrderInfo(name='', phone_number='', email_address='', shipping_address=None)[source]

Bases: TlObject

Order information

Parameters:
  • name (str) – Name of the user

  • phone_number (str) – Phone number of the user

  • email_address (str) – Email address of the user

  • shipping_address ("types.Address") – Shipping address for this order; may be null

__init__(name='', phone_number='', email_address='', shipping_address=None)[source]
Parameters:
  • name (str)

  • phone_number (str)

  • email_address (str)

  • shipping_address (Address | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[OrderInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['OrderInfo']

classmethod getType()[source]
Return type:

Literal['orderInfo']

to_dict()[source]
Return type:

dict

email_address: Optional[str]

Email address of the user

name: Optional[str]

Name of the user

phone_number: Optional[str]

Phone number of the user

shipping_address: Optional[Address]

Shipping address for this order; may be null

class pytdbot.types.Outline(paths=None)[source]

Bases: TlObject

Represents outline of an image

Parameters:

paths (List["types.ClosedVectorPath"]) – The list of closed vector paths

__init__(paths=None)[source]
Parameters:

paths (List[ClosedVectorPath] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Outline]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Outline']

classmethod getType()[source]
Return type:

Literal['outline']

to_dict()[source]
Return type:

dict

paths: List[ClosedVectorPath]

The list of closed vector paths

class pytdbot.types.PageBlock[source]

Bases: object

Describes a block of an instant view for a web page

class pytdbot.types.PageBlockAnchor(name='')[source]

Bases: TlObject, PageBlock

An invisible anchor on a page, which can be used in a URL to open the page from the specified anchor

Parameters:

name (str) – Name of the anchor

__init__(name='')[source]
Parameters:

name (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockAnchor]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlock']

classmethod getType()[source]
Return type:

Literal['pageBlockAnchor']

to_dict()[source]
Return type:

dict

name: Optional[str]

Name of the anchor

class pytdbot.types.PageBlockAnimation(animation=None, caption=None, need_autoplay=False)[source]

Bases: TlObject, PageBlock

An animation

Parameters:
  • animation ("types.Animation") – Animation file; may be null

  • caption ("types.PageBlockCaption") – Animation caption

  • need_autoplay (bool) – True, if the animation must be played automatically

__init__(animation=None, caption=None, need_autoplay=False)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockAnimation]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlock']

classmethod getType()[source]
Return type:

Literal['pageBlockAnimation']

to_dict()[source]
Return type:

dict

animation: Optional[Animation]

Animation file; may be null

caption: Optional[PageBlockCaption]

Animation caption

need_autoplay: bool

True, if the animation must be played automatically

class pytdbot.types.PageBlockAudio(audio=None, caption=None)[source]

Bases: TlObject, PageBlock

An audio file

Parameters:
  • audio ("types.Audio") – Audio file; may be null

  • caption ("types.PageBlockCaption") – Audio file caption

__init__(audio=None, caption=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockAudio]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlock']

classmethod getType()[source]
Return type:

Literal['pageBlockAudio']

to_dict()[source]
Return type:

dict

audio: Optional[Audio]

Audio file; may be null

caption: Optional[PageBlockCaption]

Audio file caption

class pytdbot.types.PageBlockAuthorDate(author=None, publish_date=0)[source]

Bases: TlObject, PageBlock

The author and publishing date of a page

Parameters:
  • author ("types.RichText") – Author

  • publish_date (int) – Point in time (Unix timestamp) when the article was published; 0 if unknown

__init__(author=None, publish_date=0)[source]
Parameters:
  • author (RichText | None)

  • publish_date (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockAuthorDate]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlock']

classmethod getType()[source]
Return type:

Literal['pageBlockAuthorDate']

to_dict()[source]
Return type:

dict

author: Union[RichTextPlain, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextFixed, RichTextUrl, RichTextEmailAddress, RichTextSubscript, RichTextSuperscript, RichTextMarked, RichTextPhoneNumber, RichTextIcon, RichTextReference, RichTextAnchor, RichTextAnchorLink, RichTexts, None]

Author

publish_date: int

Point in time (Unix timestamp) when the article was published; 0 if unknown

class pytdbot.types.PageBlockBlockQuote(text=None, credit=None)[source]

Bases: TlObject, PageBlock

A block quote

Parameters:
  • text ("types.RichText") – Quote text

  • credit ("types.RichText") – Quote credit

__init__(text=None, credit=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockBlockQuote]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlock']

classmethod getType()[source]
Return type:

Literal['pageBlockBlockQuote']

to_dict()[source]
Return type:

dict

credit: Union[RichTextPlain, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextFixed, RichTextUrl, RichTextEmailAddress, RichTextSubscript, RichTextSuperscript, RichTextMarked, RichTextPhoneNumber, RichTextIcon, RichTextReference, RichTextAnchor, RichTextAnchorLink, RichTexts, None]

Quote credit

text: Union[RichTextPlain, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextFixed, RichTextUrl, RichTextEmailAddress, RichTextSubscript, RichTextSuperscript, RichTextMarked, RichTextPhoneNumber, RichTextIcon, RichTextReference, RichTextAnchor, RichTextAnchorLink, RichTexts, None]

Quote text

class pytdbot.types.PageBlockCaption(text=None, credit=None)[source]

Bases: TlObject

Contains a caption of another block

Parameters:
  • text ("types.RichText") – Content of the caption

  • credit ("types.RichText") – Block credit (like HTML tag <cite>)

__init__(text=None, credit=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockCaption]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlockCaption']

classmethod getType()[source]
Return type:

Literal['pageBlockCaption']

to_dict()[source]
Return type:

dict

credit: Union[RichTextPlain, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextFixed, RichTextUrl, RichTextEmailAddress, RichTextSubscript, RichTextSuperscript, RichTextMarked, RichTextPhoneNumber, RichTextIcon, RichTextReference, RichTextAnchor, RichTextAnchorLink, RichTexts, None]

Block credit (like HTML tag <cite>)

text: Union[RichTextPlain, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextFixed, RichTextUrl, RichTextEmailAddress, RichTextSubscript, RichTextSuperscript, RichTextMarked, RichTextPhoneNumber, RichTextIcon, RichTextReference, RichTextAnchor, RichTextAnchorLink, RichTexts, None]

Content of the caption

class pytdbot.types.PageBlockChatLink(title='', photo=None, accent_color_id=0, username='')[source]

Bases: TlObject, PageBlock

A link to a chat

Parameters:
  • title (str) – Chat title

  • photo ("types.ChatPhotoInfo") – Chat photo; may be null

  • accent_color_id (int) – Identifier of the accent color for chat title and background of chat photo

  • username (str) – Chat username by which all other information about the chat can be resolved

__init__(title='', photo=None, accent_color_id=0, username='')[source]
Parameters:
  • title (str)

  • photo (ChatPhotoInfo | None)

  • accent_color_id (int)

  • username (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockChatLink]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlock']

classmethod getType()[source]
Return type:

Literal['pageBlockChatLink']

to_dict()[source]
Return type:

dict

accent_color_id: int

Identifier of the accent color for chat title and background of chat photo

photo: Optional[ChatPhotoInfo]

Chat photo; may be null

title: Optional[str]

Chat title

username: Optional[str]

Chat username by which all other information about the chat can be resolved

class pytdbot.types.PageBlockCollage(page_blocks=None, caption=None)[source]

Bases: TlObject, PageBlock

A collage

Parameters:
  • page_blocks (List["types.PageBlock"]) – Collage item contents

  • caption ("types.PageBlockCaption") – Block caption

__init__(page_blocks=None, caption=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockCollage]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlock']

classmethod getType()[source]
Return type:

Literal['pageBlockCollage']

to_dict()[source]
Return type:

dict

caption: Optional[PageBlockCaption]

Block caption

page_blocks: List[PageBlock]

Collage item contents

class pytdbot.types.PageBlockCover(cover=None)[source]

Bases: TlObject, PageBlock

A page cover

Parameters:

cover ("types.PageBlock") – Cover

__init__(cover=None)[source]
Parameters:

cover (PageBlock | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockCover]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlock']

classmethod getType()[source]
Return type:

Literal['pageBlockCover']

to_dict()[source]
Return type:

dict

cover: Union[PageBlockTitle, PageBlockSubtitle, PageBlockAuthorDate, PageBlockHeader, PageBlockSubheader, PageBlockKicker, PageBlockParagraph, PageBlockPreformatted, PageBlockFooter, PageBlockDivider, PageBlockAnchor, PageBlockList, PageBlockBlockQuote, PageBlockPullQuote, PageBlockAnimation, PageBlockAudio, PageBlockPhoto, PageBlockVideo, PageBlockVoiceNote, PageBlockCover, PageBlockEmbedded, PageBlockEmbeddedPost, PageBlockCollage, PageBlockSlideshow, PageBlockChatLink, PageBlockTable, PageBlockDetails, PageBlockRelatedArticles, PageBlockMap, None]

Cover

class pytdbot.types.PageBlockDetails(header=None, page_blocks=None, is_open=False)[source]

Bases: TlObject, PageBlock

A collapsible block

Parameters:
  • header ("types.RichText") – Always visible heading for the block

  • page_blocks (List["types.PageBlock"]) – Block contents

  • is_open (bool) – True, if the block is open by default

__init__(header=None, page_blocks=None, is_open=False)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockDetails]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlock']

classmethod getType()[source]
Return type:

Literal['pageBlockDetails']

to_dict()[source]
Return type:

dict

header: Union[RichTextPlain, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextFixed, RichTextUrl, RichTextEmailAddress, RichTextSubscript, RichTextSuperscript, RichTextMarked, RichTextPhoneNumber, RichTextIcon, RichTextReference, RichTextAnchor, RichTextAnchorLink, RichTexts, None]

Always visible heading for the block

is_open: bool

True, if the block is open by default

page_blocks: List[PageBlock]

Block contents

class pytdbot.types.PageBlockDivider[source]

Bases: TlObject, PageBlock

An empty block separating a page

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockDivider]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlock']

classmethod getType()[source]
Return type:

Literal['pageBlockDivider']

to_dict()[source]
Return type:

dict

class pytdbot.types.PageBlockEmbedded(url='', html='', poster_photo=None, width=0, height=0, caption=None, is_full_width=False, allow_scrolling=False)[source]

Bases: TlObject, PageBlock

An embedded web page

Parameters:
  • url (str) – URL of the embedded page, if available

  • html (str) – HTML-markup of the embedded page

  • poster_photo ("types.Photo") – Poster photo, if available; may be null

  • width (int) – Block width; 0 if unknown

  • height (int) – Block height; 0 if unknown

  • caption ("types.PageBlockCaption") – Block caption

  • is_full_width (bool) – True, if the block must be full width

  • allow_scrolling (bool) – True, if scrolling needs to be allowed

__init__(url='', html='', poster_photo=None, width=0, height=0, caption=None, is_full_width=False, allow_scrolling=False)[source]
Parameters:
  • url (str)

  • html (str)

  • poster_photo (Photo | None)

  • width (int)

  • height (int)

  • caption (PageBlockCaption | None)

  • is_full_width (bool)

  • allow_scrolling (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockEmbedded]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlock']

classmethod getType()[source]
Return type:

Literal['pageBlockEmbedded']

to_dict()[source]
Return type:

dict

allow_scrolling: bool

True, if scrolling needs to be allowed

caption: Optional[PageBlockCaption]

Block caption

height: int

Block height; 0 if unknown

html: Optional[str]

HTML-markup of the embedded page

is_full_width: bool

True, if the block must be full width

poster_photo: Optional[Photo]

Poster photo, if available; may be null

url: Optional[str]

URL of the embedded page, if available

width: int

Block width; 0 if unknown

class pytdbot.types.PageBlockEmbeddedPost(url='', author='', author_photo=None, date=0, page_blocks=None, caption=None)[source]

Bases: TlObject, PageBlock

An embedded post

Parameters:
  • url (str) – URL of the embedded post

  • author (str) – Post author

  • author_photo ("types.Photo") – Post author photo; may be null

  • date (int) – Point in time (Unix timestamp) when the post was created; 0 if unknown

  • page_blocks (List["types.PageBlock"]) – Post content

  • caption ("types.PageBlockCaption") – Post caption

__init__(url='', author='', author_photo=None, date=0, page_blocks=None, caption=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockEmbeddedPost]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlock']

classmethod getType()[source]
Return type:

Literal['pageBlockEmbeddedPost']

to_dict()[source]
Return type:

dict

author: Optional[str]

Post author

author_photo: Optional[Photo]

Post author photo; may be null

caption: Optional[PageBlockCaption]

Post caption

date: int

Point in time (Unix timestamp) when the post was created; 0 if unknown

page_blocks: List[PageBlock]

Post content

url: Optional[str]

URL of the embedded post

class pytdbot.types.PageBlockFooter(footer=None)[source]

Bases: TlObject, PageBlock

The footer of a page

Parameters:

footer ("types.RichText") – Footer

__init__(footer=None)[source]
Parameters:

footer (RichText | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockFooter]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlock']

classmethod getType()[source]
Return type:

Literal['pageBlockFooter']

to_dict()[source]
Return type:

dict

footer: Union[RichTextPlain, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextFixed, RichTextUrl, RichTextEmailAddress, RichTextSubscript, RichTextSuperscript, RichTextMarked, RichTextPhoneNumber, RichTextIcon, RichTextReference, RichTextAnchor, RichTextAnchorLink, RichTexts, None]

Footer

class pytdbot.types.PageBlockHeader(header=None)[source]

Bases: TlObject, PageBlock

A header

Parameters:

header ("types.RichText") – Header

__init__(header=None)[source]
Parameters:

header (RichText | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockHeader]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlock']

classmethod getType()[source]
Return type:

Literal['pageBlockHeader']

to_dict()[source]
Return type:

dict

header: Union[RichTextPlain, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextFixed, RichTextUrl, RichTextEmailAddress, RichTextSubscript, RichTextSuperscript, RichTextMarked, RichTextPhoneNumber, RichTextIcon, RichTextReference, RichTextAnchor, RichTextAnchorLink, RichTexts, None]

Header

class pytdbot.types.PageBlockHorizontalAlignment[source]

Bases: object

Describes a horizontal alignment of a table cell content

class pytdbot.types.PageBlockHorizontalAlignmentCenter[source]

Bases: TlObject, PageBlockHorizontalAlignment

The content must be center-aligned

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockHorizontalAlignmentCenter]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlockHorizontalAlignment']

classmethod getType()[source]
Return type:

Literal['pageBlockHorizontalAlignmentCenter']

to_dict()[source]
Return type:

dict

class pytdbot.types.PageBlockHorizontalAlignmentLeft[source]

Bases: TlObject, PageBlockHorizontalAlignment

The content must be left-aligned

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockHorizontalAlignmentLeft]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlockHorizontalAlignment']

classmethod getType()[source]
Return type:

Literal['pageBlockHorizontalAlignmentLeft']

to_dict()[source]
Return type:

dict

class pytdbot.types.PageBlockHorizontalAlignmentRight[source]

Bases: TlObject, PageBlockHorizontalAlignment

The content must be right-aligned

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockHorizontalAlignmentRight]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlockHorizontalAlignment']

classmethod getType()[source]
Return type:

Literal['pageBlockHorizontalAlignmentRight']

to_dict()[source]
Return type:

dict

class pytdbot.types.PageBlockKicker(kicker=None)[source]

Bases: TlObject, PageBlock

A kicker

Parameters:

kicker ("types.RichText") – Kicker

__init__(kicker=None)[source]
Parameters:

kicker (RichText | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockKicker]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlock']

classmethod getType()[source]
Return type:

Literal['pageBlockKicker']

to_dict()[source]
Return type:

dict

kicker: Union[RichTextPlain, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextFixed, RichTextUrl, RichTextEmailAddress, RichTextSubscript, RichTextSuperscript, RichTextMarked, RichTextPhoneNumber, RichTextIcon, RichTextReference, RichTextAnchor, RichTextAnchorLink, RichTexts, None]

Kicker

class pytdbot.types.PageBlockList(items=None)[source]

Bases: TlObject, PageBlock

A list of data blocks

Parameters:

items (List["types.PageBlockListItem"]) – The items of the list

__init__(items=None)[source]
Parameters:

items (List[PageBlockListItem] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockList]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlock']

classmethod getType()[source]
Return type:

Literal['pageBlockList']

to_dict()[source]
Return type:

dict

items: List[PageBlockListItem]

The items of the list

class pytdbot.types.PageBlockListItem(label='', page_blocks=None)[source]

Bases: TlObject

Describes an item of a list page block

Parameters:
  • label (str) – Item label

  • page_blocks (List["types.PageBlock"]) – Item blocks

__init__(label='', page_blocks=None)[source]
Parameters:
  • label (str)

  • page_blocks (List[PageBlock] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockListItem]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlockListItem']

classmethod getType()[source]
Return type:

Literal['pageBlockListItem']

to_dict()[source]
Return type:

dict

label: Optional[str]

Item label

page_blocks: List[PageBlock]

Item blocks

class pytdbot.types.PageBlockMap(location=None, zoom=0, width=0, height=0, caption=None)[source]

Bases: TlObject, PageBlock

A map

Parameters:
  • location ("types.Location") – Location of the map center

  • zoom (int) – Map zoom level

  • width (int) – Map width

  • height (int) – Map height

  • caption ("types.PageBlockCaption") – Block caption

__init__(location=None, zoom=0, width=0, height=0, caption=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockMap]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlock']

classmethod getType()[source]
Return type:

Literal['pageBlockMap']

to_dict()[source]
Return type:

dict

caption: Optional[PageBlockCaption]

Block caption

height: int

Map height

location: Optional[Location]

Location of the map center

width: int

Map width

zoom: int

Map zoom level

class pytdbot.types.PageBlockParagraph(text=None)[source]

Bases: TlObject, PageBlock

A text paragraph

Parameters:

text ("types.RichText") – Paragraph text

__init__(text=None)[source]
Parameters:

text (RichText | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockParagraph]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlock']

classmethod getType()[source]
Return type:

Literal['pageBlockParagraph']

to_dict()[source]
Return type:

dict

text: Union[RichTextPlain, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextFixed, RichTextUrl, RichTextEmailAddress, RichTextSubscript, RichTextSuperscript, RichTextMarked, RichTextPhoneNumber, RichTextIcon, RichTextReference, RichTextAnchor, RichTextAnchorLink, RichTexts, None]

Paragraph text

class pytdbot.types.PageBlockPhoto(photo=None, caption=None, url='')[source]

Bases: TlObject, PageBlock

A photo

Parameters:
  • photo ("types.Photo") – Photo file; may be null

  • caption ("types.PageBlockCaption") – Photo caption

  • url (str) – URL that needs to be opened when the photo is clicked

__init__(photo=None, caption=None, url='')[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockPhoto]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlock']

classmethod getType()[source]
Return type:

Literal['pageBlockPhoto']

to_dict()[source]
Return type:

dict

caption: Optional[PageBlockCaption]

Photo caption

photo: Optional[Photo]

Photo file; may be null

url: Optional[str]

URL that needs to be opened when the photo is clicked

class pytdbot.types.PageBlockPreformatted(text=None, language='')[source]

Bases: TlObject, PageBlock

A preformatted text paragraph

Parameters:
  • text ("types.RichText") – Paragraph text

  • language (str) – Programming language for which the text needs to be formatted

__init__(text=None, language='')[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockPreformatted]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlock']

classmethod getType()[source]
Return type:

Literal['pageBlockPreformatted']

to_dict()[source]
Return type:

dict

language: Optional[str]

Programming language for which the text needs to be formatted

text: Union[RichTextPlain, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextFixed, RichTextUrl, RichTextEmailAddress, RichTextSubscript, RichTextSuperscript, RichTextMarked, RichTextPhoneNumber, RichTextIcon, RichTextReference, RichTextAnchor, RichTextAnchorLink, RichTexts, None]

Paragraph text

class pytdbot.types.PageBlockPullQuote(text=None, credit=None)[source]

Bases: TlObject, PageBlock

A pull quote

Parameters:
  • text ("types.RichText") – Quote text

  • credit ("types.RichText") – Quote credit

__init__(text=None, credit=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockPullQuote]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlock']

classmethod getType()[source]
Return type:

Literal['pageBlockPullQuote']

to_dict()[source]
Return type:

dict

credit: Union[RichTextPlain, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextFixed, RichTextUrl, RichTextEmailAddress, RichTextSubscript, RichTextSuperscript, RichTextMarked, RichTextPhoneNumber, RichTextIcon, RichTextReference, RichTextAnchor, RichTextAnchorLink, RichTexts, None]

Quote credit

text: Union[RichTextPlain, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextFixed, RichTextUrl, RichTextEmailAddress, RichTextSubscript, RichTextSuperscript, RichTextMarked, RichTextPhoneNumber, RichTextIcon, RichTextReference, RichTextAnchor, RichTextAnchorLink, RichTexts, None]

Quote text

class pytdbot.types.PageBlockRelatedArticle(url='', title='', description='', photo=None, author='', publish_date=0)[source]

Bases: TlObject

Contains information about a related article

Parameters:
  • url (str) – Related article URL

  • title (str) – Article title; may be empty

  • description (str) – Article description; may be empty

  • photo ("types.Photo") – Article photo; may be null

  • author (str) – Article author; may be empty

  • publish_date (int) – Point in time (Unix timestamp) when the article was published; 0 if unknown

__init__(url='', title='', description='', photo=None, author='', publish_date=0)[source]
Parameters:
  • url (str)

  • title (str)

  • description (str)

  • photo (Photo | None)

  • author (str)

  • publish_date (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockRelatedArticle]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlockRelatedArticle']

classmethod getType()[source]
Return type:

Literal['pageBlockRelatedArticle']

to_dict()[source]
Return type:

dict

author: Optional[str]

Article author; may be empty

description: Optional[str]

Article description; may be empty

photo: Optional[Photo]

Article photo; may be null

publish_date: int

Point in time (Unix timestamp) when the article was published; 0 if unknown

title: Optional[str]

Article title; may be empty

url: Optional[str]

Related article URL

class pytdbot.types.PageBlockRelatedArticles(header=None, articles=None)[source]

Bases: TlObject, PageBlock

Related articles

Parameters:
  • header ("types.RichText") – Block header

  • articles (List["types.PageBlockRelatedArticle"]) – List of related articles

__init__(header=None, articles=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockRelatedArticles]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlock']

classmethod getType()[source]
Return type:

Literal['pageBlockRelatedArticles']

to_dict()[source]
Return type:

dict

articles: List[PageBlockRelatedArticle]

List of related articles

header: Union[RichTextPlain, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextFixed, RichTextUrl, RichTextEmailAddress, RichTextSubscript, RichTextSuperscript, RichTextMarked, RichTextPhoneNumber, RichTextIcon, RichTextReference, RichTextAnchor, RichTextAnchorLink, RichTexts, None]

Block header

class pytdbot.types.PageBlockSlideshow(page_blocks=None, caption=None)[source]

Bases: TlObject, PageBlock

A slideshow

Parameters:
  • page_blocks (List["types.PageBlock"]) – Slideshow item contents

  • caption ("types.PageBlockCaption") – Block caption

__init__(page_blocks=None, caption=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockSlideshow]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlock']

classmethod getType()[source]
Return type:

Literal['pageBlockSlideshow']

to_dict()[source]
Return type:

dict

caption: Optional[PageBlockCaption]

Block caption

page_blocks: List[PageBlock]

Slideshow item contents

class pytdbot.types.PageBlockSubheader(subheader=None)[source]

Bases: TlObject, PageBlock

A subheader

Parameters:

subheader ("types.RichText") – Subheader

__init__(subheader=None)[source]
Parameters:

subheader (RichText | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockSubheader]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlock']

classmethod getType()[source]
Return type:

Literal['pageBlockSubheader']

to_dict()[source]
Return type:

dict

subheader: Union[RichTextPlain, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextFixed, RichTextUrl, RichTextEmailAddress, RichTextSubscript, RichTextSuperscript, RichTextMarked, RichTextPhoneNumber, RichTextIcon, RichTextReference, RichTextAnchor, RichTextAnchorLink, RichTexts, None]

Subheader

class pytdbot.types.PageBlockSubtitle(subtitle=None)[source]

Bases: TlObject, PageBlock

The subtitle of a page

Parameters:

subtitle ("types.RichText") – Subtitle

__init__(subtitle=None)[source]
Parameters:

subtitle (RichText | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockSubtitle]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlock']

classmethod getType()[source]
Return type:

Literal['pageBlockSubtitle']

to_dict()[source]
Return type:

dict

subtitle: Union[RichTextPlain, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextFixed, RichTextUrl, RichTextEmailAddress, RichTextSubscript, RichTextSuperscript, RichTextMarked, RichTextPhoneNumber, RichTextIcon, RichTextReference, RichTextAnchor, RichTextAnchorLink, RichTexts, None]

Subtitle

class pytdbot.types.PageBlockTable(caption=None, cells=None, is_bordered=False, is_striped=False)[source]

Bases: TlObject, PageBlock

A table

Parameters:
  • caption ("types.RichText") – Table caption

  • cells (List[List["types.PageBlockTableCell"]]) – Table cells

  • is_bordered (bool) – True, if the table is bordered

  • is_striped (bool) – True, if the table is striped

__init__(caption=None, cells=None, is_bordered=False, is_striped=False)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockTable]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlock']

classmethod getType()[source]
Return type:

Literal['pageBlockTable']

to_dict()[source]
Return type:

dict

caption: Union[RichTextPlain, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextFixed, RichTextUrl, RichTextEmailAddress, RichTextSubscript, RichTextSuperscript, RichTextMarked, RichTextPhoneNumber, RichTextIcon, RichTextReference, RichTextAnchor, RichTextAnchorLink, RichTexts, None]

Table caption

cells: List[List[PageBlockTableCell]]

Table cells

is_bordered: bool

True, if the table is bordered

is_striped: bool

True, if the table is striped

class pytdbot.types.PageBlockTableCell(text=None, is_header=False, colspan=0, rowspan=0, align=None, valign=None)[source]

Bases: TlObject

Represents a cell of a table

Parameters:
  • text ("types.RichText") – Cell text; may be null. If the text is null, then the cell must be invisible

  • is_header (bool) – True, if it is a header cell

  • colspan (int) – The number of columns the cell spans

  • rowspan (int) – The number of rows the cell spans

  • align ("types.PageBlockHorizontalAlignment") – Horizontal cell content alignment

  • valign ("types.PageBlockVerticalAlignment") – Vertical cell content alignment

__init__(text=None, is_header=False, colspan=0, rowspan=0, align=None, valign=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockTableCell]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlockTableCell']

classmethod getType()[source]
Return type:

Literal['pageBlockTableCell']

to_dict()[source]
Return type:

dict

align: Union[PageBlockHorizontalAlignmentLeft, PageBlockHorizontalAlignmentCenter, PageBlockHorizontalAlignmentRight, None]

Horizontal cell content alignment

colspan: int

The number of columns the cell spans

is_header: bool

True, if it is a header cell

rowspan: int

The number of rows the cell spans

text: Union[RichTextPlain, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextFixed, RichTextUrl, RichTextEmailAddress, RichTextSubscript, RichTextSuperscript, RichTextMarked, RichTextPhoneNumber, RichTextIcon, RichTextReference, RichTextAnchor, RichTextAnchorLink, RichTexts, None]

Cell text; may be null. If the text is null, then the cell must be invisible

valign: Union[PageBlockVerticalAlignmentTop, PageBlockVerticalAlignmentMiddle, PageBlockVerticalAlignmentBottom, None]

Vertical cell content alignment

class pytdbot.types.PageBlockTitle(title=None)[source]

Bases: TlObject, PageBlock

The title of a page

Parameters:

title ("types.RichText") – Title

__init__(title=None)[source]
Parameters:

title (RichText | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockTitle]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlock']

classmethod getType()[source]
Return type:

Literal['pageBlockTitle']

to_dict()[source]
Return type:

dict

title: Union[RichTextPlain, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextFixed, RichTextUrl, RichTextEmailAddress, RichTextSubscript, RichTextSuperscript, RichTextMarked, RichTextPhoneNumber, RichTextIcon, RichTextReference, RichTextAnchor, RichTextAnchorLink, RichTexts, None]

Title

class pytdbot.types.PageBlockVerticalAlignment[source]

Bases: object

Describes a Vertical alignment of a table cell content

class pytdbot.types.PageBlockVerticalAlignmentBottom[source]

Bases: TlObject, PageBlockVerticalAlignment

The content must be bottom-aligned

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockVerticalAlignmentBottom]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlockVerticalAlignment']

classmethod getType()[source]
Return type:

Literal['pageBlockVerticalAlignmentBottom']

to_dict()[source]
Return type:

dict

class pytdbot.types.PageBlockVerticalAlignmentMiddle[source]

Bases: TlObject, PageBlockVerticalAlignment

The content must be middle-aligned

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockVerticalAlignmentMiddle]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlockVerticalAlignment']

classmethod getType()[source]
Return type:

Literal['pageBlockVerticalAlignmentMiddle']

to_dict()[source]
Return type:

dict

class pytdbot.types.PageBlockVerticalAlignmentTop[source]

Bases: TlObject, PageBlockVerticalAlignment

The content must be top-aligned

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockVerticalAlignmentTop]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlockVerticalAlignment']

classmethod getType()[source]
Return type:

Literal['pageBlockVerticalAlignmentTop']

to_dict()[source]
Return type:

dict

class pytdbot.types.PageBlockVideo(video=None, caption=None, need_autoplay=False, is_looped=False)[source]

Bases: TlObject, PageBlock

A video

Parameters:
  • video ("types.Video") – Video file; may be null

  • caption ("types.PageBlockCaption") – Video caption

  • need_autoplay (bool) – True, if the video must be played automatically

  • is_looped (bool) – True, if the video must be looped

__init__(video=None, caption=None, need_autoplay=False, is_looped=False)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockVideo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlock']

classmethod getType()[source]
Return type:

Literal['pageBlockVideo']

to_dict()[source]
Return type:

dict

caption: Optional[PageBlockCaption]

Video caption

is_looped: bool

True, if the video must be looped

need_autoplay: bool

True, if the video must be played automatically

video: Optional[Video]

Video file; may be null

class pytdbot.types.PageBlockVoiceNote(voice_note=None, caption=None)[source]

Bases: TlObject, PageBlock

A voice note

Parameters:
  • voice_note ("types.VoiceNote") – Voice note; may be null

  • caption ("types.PageBlockCaption") – Voice note caption

__init__(voice_note=None, caption=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PageBlockVoiceNote]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PageBlock']

classmethod getType()[source]
Return type:

Literal['pageBlockVoiceNote']

to_dict()[source]
Return type:

dict

caption: Optional[PageBlockCaption]

Voice note caption

voice_note: Optional[VoiceNote]

Voice note; may be null

class pytdbot.types.PaidMedia[source]

Bases: object

Describes a paid media

class pytdbot.types.PaidMediaPhoto(photo=None)[source]

Bases: TlObject, PaidMedia

The media is a photo

Parameters:

photo ("types.Photo") – The photo

__init__(photo=None)[source]
Parameters:

photo (Photo | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PaidMediaPhoto]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PaidMedia']

classmethod getType()[source]
Return type:

Literal['paidMediaPhoto']

to_dict()[source]
Return type:

dict

photo: Optional[Photo]

The photo

class pytdbot.types.PaidMediaPreview(width=0, height=0, duration=0, minithumbnail=None)[source]

Bases: TlObject, PaidMedia

The media is hidden until the invoice is paid

Parameters:
  • width (int) – Media width; 0 if unknown

  • height (int) – Media height; 0 if unknown

  • duration (int) – Media duration, in seconds; 0 if unknown

  • minithumbnail ("types.Minithumbnail") – Media minithumbnail; may be null

__init__(width=0, height=0, duration=0, minithumbnail=None)[source]
Parameters:
  • width (int)

  • height (int)

  • duration (int)

  • minithumbnail (Minithumbnail | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PaidMediaPreview]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PaidMedia']

classmethod getType()[source]
Return type:

Literal['paidMediaPreview']

to_dict()[source]
Return type:

dict

duration: int

Media duration, in seconds; 0 if unknown

height: int

Media height; 0 if unknown

minithumbnail: Optional[Minithumbnail]

Media minithumbnail; may be null

width: int

Media width; 0 if unknown

class pytdbot.types.PaidMediaUnsupported[source]

Bases: TlObject, PaidMedia

The media is unsupported

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PaidMediaUnsupported]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PaidMedia']

classmethod getType()[source]
Return type:

Literal['paidMediaUnsupported']

to_dict()[source]
Return type:

dict

class pytdbot.types.PaidMediaVideo(video=None, cover=None, start_timestamp=0)[source]

Bases: TlObject, PaidMedia

The media is a video

Parameters:
  • video ("types.Video") – The video

  • cover ("types.Photo") – Cover of the video; may be null if none

  • start_timestamp (int) – Timestamp from which the video playing must start, in seconds

__init__(video=None, cover=None, start_timestamp=0)[source]
Parameters:
  • video (Video | None)

  • cover (Photo | None)

  • start_timestamp (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PaidMediaVideo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PaidMedia']

classmethod getType()[source]
Return type:

Literal['paidMediaVideo']

to_dict()[source]
Return type:

dict

cover: Optional[Photo]

Cover of the video; may be null if none

start_timestamp: int

Timestamp from which the video playing must start, in seconds

video: Optional[Video]

The video

class pytdbot.types.PaidReactionType[source]

Bases: object

Describes type of paid message reaction

class pytdbot.types.PaidReactionTypeAnonymous[source]

Bases: TlObject, PaidReactionType

An anonymous paid reaction

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PaidReactionTypeAnonymous]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PaidReactionType']

classmethod getType()[source]
Return type:

Literal['paidReactionTypeAnonymous']

to_dict()[source]
Return type:

dict

class pytdbot.types.PaidReactionTypeChat(chat_id=0)[source]

Bases: TlObject, PaidReactionType

A paid reaction on behalf of an owned chat

Parameters:

chat_id (int) – Identifier of the chat

__init__(chat_id=0)[source]
Parameters:

chat_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PaidReactionTypeChat]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PaidReactionType']

classmethod getType()[source]
Return type:

Literal['paidReactionTypeChat']

to_dict()[source]
Return type:

dict

chat_id: int

Identifier of the chat

class pytdbot.types.PaidReactionTypeRegular[source]

Bases: TlObject, PaidReactionType

A paid reaction on behalf of the current user

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PaidReactionTypeRegular]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PaidReactionType']

classmethod getType()[source]
Return type:

Literal['paidReactionTypeRegular']

to_dict()[source]
Return type:

dict

class pytdbot.types.PaidReactor(sender_id=None, star_count=0, is_top=False, is_me=False, is_anonymous=False)[source]

Bases: TlObject

Contains information about a user that added paid reactions

Parameters:
  • sender_id ("types.MessageSender") – Identifier of the user or chat that added the reactions; may be null for anonymous reactors that aren’t the current user

  • star_count (int) – Number of Telegram Stars added

  • is_top (bool) – True, if the reactor is one of the most active reactors; may be false if the reactor is the current user

  • is_me (bool) – True, if the paid reaction was added by the current user

  • is_anonymous (bool) – True, if the reactor is anonymous

__init__(sender_id=None, star_count=0, is_top=False, is_me=False, is_anonymous=False)[source]
Parameters:
  • sender_id (MessageSender | None)

  • star_count (int)

  • is_top (bool)

  • is_me (bool)

  • is_anonymous (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PaidReactor]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PaidReactor']

classmethod getType()[source]
Return type:

Literal['paidReactor']

to_dict()[source]
Return type:

dict

is_anonymous: bool

True, if the reactor is anonymous

is_me: bool

True, if the paid reaction was added by the current user

is_top: bool

True, if the reactor is one of the most active reactors; may be false if the reactor is the current user

sender_id: Union[MessageSenderUser, MessageSenderChat, None]

Identifier of the user or chat that added the reactions; may be null for anonymous reactors that aren’t the current user

star_count: int

Number of Telegram Stars added

class pytdbot.types.PassportAuthorizationForm(id=0, required_elements=None, privacy_policy_url='')[source]

Bases: TlObject

Contains information about a Telegram Passport authorization form that was requested

Parameters:
  • id (int) – Unique identifier of the authorization form

  • required_elements (List["types.PassportRequiredElement"]) – Telegram Passport elements that must be provided to complete the form

  • privacy_policy_url (str) – URL for the privacy policy of the service; may be empty

__init__(id=0, required_elements=None, privacy_policy_url='')[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportAuthorizationForm]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportAuthorizationForm']

classmethod getType()[source]
Return type:

Literal['passportAuthorizationForm']

to_dict()[source]
Return type:

dict

id: int

Unique identifier of the authorization form

privacy_policy_url: Optional[str]

URL for the privacy policy of the service; may be empty

required_elements: List[PassportRequiredElement]

Telegram Passport elements that must be provided to complete the form

class pytdbot.types.PassportElement[source]

Bases: object

Contains information about a Telegram Passport element

class pytdbot.types.PassportElementAddress(address=None)[source]

Bases: TlObject, PassportElement

A Telegram Passport element containing the user’s address

Parameters:

address ("types.Address") – Address

__init__(address=None)[source]
Parameters:

address (Address | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElementAddress]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElement']

classmethod getType()[source]
Return type:

Literal['passportElementAddress']

to_dict()[source]
Return type:

dict

address: Optional[Address]

Address

class pytdbot.types.PassportElementBankStatement(bank_statement=None)[source]

Bases: TlObject, PassportElement

A Telegram Passport element containing the user’s bank statement

Parameters:

bank_statement ("types.PersonalDocument") – Bank statement

__init__(bank_statement=None)[source]
Parameters:

bank_statement (PersonalDocument | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElementBankStatement]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElement']

classmethod getType()[source]
Return type:

Literal['passportElementBankStatement']

to_dict()[source]
Return type:

dict

bank_statement: Optional[PersonalDocument]

Bank statement

class pytdbot.types.PassportElementDriverLicense(driver_license=None)[source]

Bases: TlObject, PassportElement

A Telegram Passport element containing the user’s driver license

Parameters:

driver_license ("types.IdentityDocument") – Driver license

__init__(driver_license=None)[source]
Parameters:

driver_license (IdentityDocument | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElementDriverLicense]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElement']

classmethod getType()[source]
Return type:

Literal['passportElementDriverLicense']

to_dict()[source]
Return type:

dict

driver_license: Optional[IdentityDocument]

Driver license

class pytdbot.types.PassportElementEmailAddress(email_address='')[source]

Bases: TlObject, PassportElement

A Telegram Passport element containing the user’s email address

Parameters:

email_address (str) – Email address

__init__(email_address='')[source]
Parameters:

email_address (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElementEmailAddress]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElement']

classmethod getType()[source]
Return type:

Literal['passportElementEmailAddress']

to_dict()[source]
Return type:

dict

email_address: Optional[str]

Email address

class pytdbot.types.PassportElementError(type=None, message='', source=None)[source]

Bases: TlObject

Contains the description of an error in a Telegram Passport element

Parameters:
  • type ("types.PassportElementType") – Type of the Telegram Passport element which has the error

  • message (str) – Error message

  • source ("types.PassportElementErrorSource") – Error source

__init__(type=None, message='', source=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElementError]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElementError']

classmethod getType()[source]
Return type:

Literal['passportElementError']

to_dict()[source]
Return type:

dict

message: Optional[str]

Error message

source: Union[PassportElementErrorSourceUnspecified, PassportElementErrorSourceDataField, PassportElementErrorSourceFrontSide, PassportElementErrorSourceReverseSide, PassportElementErrorSourceSelfie, PassportElementErrorSourceTranslationFile, PassportElementErrorSourceTranslationFiles, PassportElementErrorSourceFile, PassportElementErrorSourceFiles, None]

Error source

type: Union[PassportElementTypePersonalDetails, PassportElementTypePassport, PassportElementTypeDriverLicense, PassportElementTypeIdentityCard, PassportElementTypeInternalPassport, PassportElementTypeAddress, PassportElementTypeUtilityBill, PassportElementTypeBankStatement, PassportElementTypeRentalAgreement, PassportElementTypePassportRegistration, PassportElementTypeTemporaryRegistration, PassportElementTypePhoneNumber, PassportElementTypeEmailAddress, None]

Type of the Telegram Passport element which has the error

class pytdbot.types.PassportElementErrorSource[source]

Bases: object

Contains the description of an error in a Telegram Passport element

class pytdbot.types.PassportElementErrorSourceDataField(field_name='')[source]

Bases: TlObject, PassportElementErrorSource

One of the data fields contains an error. The error will be considered resolved when the value of the field changes

Parameters:

field_name (str) – Field name

__init__(field_name='')[source]
Parameters:

field_name (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElementErrorSourceDataField]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElementErrorSource']

classmethod getType()[source]
Return type:

Literal['passportElementErrorSourceDataField']

to_dict()[source]
Return type:

dict

field_name: Optional[str]

Field name

class pytdbot.types.PassportElementErrorSourceFile(file_index=0)[source]

Bases: TlObject, PassportElementErrorSource

The file contains an error. The error will be considered resolved when the file changes

Parameters:

file_index (int) – Index of a file with the error

__init__(file_index=0)[source]
Parameters:

file_index (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElementErrorSourceFile]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElementErrorSource']

classmethod getType()[source]
Return type:

Literal['passportElementErrorSourceFile']

to_dict()[source]
Return type:

dict

file_index: int

Index of a file with the error

class pytdbot.types.PassportElementErrorSourceFiles[source]

Bases: TlObject, PassportElementErrorSource

The list of attached files contains an error. The error will be considered resolved when the list of files changes

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElementErrorSourceFiles]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElementErrorSource']

classmethod getType()[source]
Return type:

Literal['passportElementErrorSourceFiles']

to_dict()[source]
Return type:

dict

class pytdbot.types.PassportElementErrorSourceFrontSide[source]

Bases: TlObject, PassportElementErrorSource

The front side of the document contains an error. The error will be considered resolved when the file with the front side changes

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElementErrorSourceFrontSide]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElementErrorSource']

classmethod getType()[source]
Return type:

Literal['passportElementErrorSourceFrontSide']

to_dict()[source]
Return type:

dict

class pytdbot.types.PassportElementErrorSourceReverseSide[source]

Bases: TlObject, PassportElementErrorSource

The reverse side of the document contains an error. The error will be considered resolved when the file with the reverse side changes

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElementErrorSourceReverseSide]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElementErrorSource']

classmethod getType()[source]
Return type:

Literal['passportElementErrorSourceReverseSide']

to_dict()[source]
Return type:

dict

class pytdbot.types.PassportElementErrorSourceSelfie[source]

Bases: TlObject, PassportElementErrorSource

The selfie with the document contains an error. The error will be considered resolved when the file with the selfie changes

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElementErrorSourceSelfie]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElementErrorSource']

classmethod getType()[source]
Return type:

Literal['passportElementErrorSourceSelfie']

to_dict()[source]
Return type:

dict

class pytdbot.types.PassportElementErrorSourceTranslationFile(file_index=0)[source]

Bases: TlObject, PassportElementErrorSource

One of files with the translation of the document contains an error. The error will be considered resolved when the file changes

Parameters:

file_index (int) – Index of a file with the error

__init__(file_index=0)[source]
Parameters:

file_index (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElementErrorSourceTranslationFile]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElementErrorSource']

classmethod getType()[source]
Return type:

Literal['passportElementErrorSourceTranslationFile']

to_dict()[source]
Return type:

dict

file_index: int

Index of a file with the error

class pytdbot.types.PassportElementErrorSourceTranslationFiles[source]

Bases: TlObject, PassportElementErrorSource

The translation of the document contains an error. The error will be considered resolved when the list of translation files changes

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElementErrorSourceTranslationFiles]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElementErrorSource']

classmethod getType()[source]
Return type:

Literal['passportElementErrorSourceTranslationFiles']

to_dict()[source]
Return type:

dict

class pytdbot.types.PassportElementErrorSourceUnspecified[source]

Bases: TlObject, PassportElementErrorSource

The element contains an error in an unspecified place. The error will be considered resolved when new data is added

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElementErrorSourceUnspecified]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElementErrorSource']

classmethod getType()[source]
Return type:

Literal['passportElementErrorSourceUnspecified']

to_dict()[source]
Return type:

dict

class pytdbot.types.PassportElementIdentityCard(identity_card=None)[source]

Bases: TlObject, PassportElement

A Telegram Passport element containing the user’s identity card

Parameters:

identity_card ("types.IdentityDocument") – Identity card

__init__(identity_card=None)[source]
Parameters:

identity_card (IdentityDocument | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElementIdentityCard]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElement']

classmethod getType()[source]
Return type:

Literal['passportElementIdentityCard']

to_dict()[source]
Return type:

dict

identity_card: Optional[IdentityDocument]

Identity card

class pytdbot.types.PassportElementInternalPassport(internal_passport=None)[source]

Bases: TlObject, PassportElement

A Telegram Passport element containing the user’s internal passport

Parameters:

internal_passport ("types.IdentityDocument") – Internal passport

__init__(internal_passport=None)[source]
Parameters:

internal_passport (IdentityDocument | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElementInternalPassport]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElement']

classmethod getType()[source]
Return type:

Literal['passportElementInternalPassport']

to_dict()[source]
Return type:

dict

internal_passport: Optional[IdentityDocument]

Internal passport

class pytdbot.types.PassportElementPassport(passport=None)[source]

Bases: TlObject, PassportElement

A Telegram Passport element containing the user’s passport

Parameters:

passport ("types.IdentityDocument") – Passport

__init__(passport=None)[source]
Parameters:

passport (IdentityDocument | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElementPassport]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElement']

classmethod getType()[source]
Return type:

Literal['passportElementPassport']

to_dict()[source]
Return type:

dict

passport: Optional[IdentityDocument]

Passport

class pytdbot.types.PassportElementPassportRegistration(passport_registration=None)[source]

Bases: TlObject, PassportElement

A Telegram Passport element containing the user’s passport registration pages

Parameters:

passport_registration ("types.PersonalDocument") – Passport registration pages

__init__(passport_registration=None)[source]
Parameters:

passport_registration (PersonalDocument | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElementPassportRegistration]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElement']

classmethod getType()[source]
Return type:

Literal['passportElementPassportRegistration']

to_dict()[source]
Return type:

dict

passport_registration: Optional[PersonalDocument]

Passport registration pages

class pytdbot.types.PassportElementPersonalDetails(personal_details=None)[source]

Bases: TlObject, PassportElement

A Telegram Passport element containing the user’s personal details

Parameters:

personal_details ("types.PersonalDetails") – Personal details of the user

__init__(personal_details=None)[source]
Parameters:

personal_details (PersonalDetails | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElementPersonalDetails]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElement']

classmethod getType()[source]
Return type:

Literal['passportElementPersonalDetails']

to_dict()[source]
Return type:

dict

personal_details: Optional[PersonalDetails]

Personal details of the user

class pytdbot.types.PassportElementPhoneNumber(phone_number='')[source]

Bases: TlObject, PassportElement

A Telegram Passport element containing the user’s phone number

Parameters:

phone_number (str) – Phone number

__init__(phone_number='')[source]
Parameters:

phone_number (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElementPhoneNumber]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElement']

classmethod getType()[source]
Return type:

Literal['passportElementPhoneNumber']

to_dict()[source]
Return type:

dict

phone_number: Optional[str]

Phone number

class pytdbot.types.PassportElementRentalAgreement(rental_agreement=None)[source]

Bases: TlObject, PassportElement

A Telegram Passport element containing the user’s rental agreement

Parameters:

rental_agreement ("types.PersonalDocument") – Rental agreement

__init__(rental_agreement=None)[source]
Parameters:

rental_agreement (PersonalDocument | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElementRentalAgreement]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElement']

classmethod getType()[source]
Return type:

Literal['passportElementRentalAgreement']

to_dict()[source]
Return type:

dict

rental_agreement: Optional[PersonalDocument]

Rental agreement

class pytdbot.types.PassportElementTemporaryRegistration(temporary_registration=None)[source]

Bases: TlObject, PassportElement

A Telegram Passport element containing the user’s temporary registration

Parameters:

temporary_registration ("types.PersonalDocument") – Temporary registration

__init__(temporary_registration=None)[source]
Parameters:

temporary_registration (PersonalDocument | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElementTemporaryRegistration]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElement']

classmethod getType()[source]
Return type:

Literal['passportElementTemporaryRegistration']

to_dict()[source]
Return type:

dict

temporary_registration: Optional[PersonalDocument]

Temporary registration

class pytdbot.types.PassportElementType[source]

Bases: object

Contains the type of Telegram Passport element

class pytdbot.types.PassportElementTypeAddress[source]

Bases: TlObject, PassportElementType

A Telegram Passport element containing the user’s address

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElementTypeAddress]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElementType']

classmethod getType()[source]
Return type:

Literal['passportElementTypeAddress']

to_dict()[source]
Return type:

dict

class pytdbot.types.PassportElementTypeBankStatement[source]

Bases: TlObject, PassportElementType

A Telegram Passport element containing the user’s bank statement

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElementTypeBankStatement]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElementType']

classmethod getType()[source]
Return type:

Literal['passportElementTypeBankStatement']

to_dict()[source]
Return type:

dict

class pytdbot.types.PassportElementTypeDriverLicense[source]

Bases: TlObject, PassportElementType

A Telegram Passport element containing the user’s driver license

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElementTypeDriverLicense]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElementType']

classmethod getType()[source]
Return type:

Literal['passportElementTypeDriverLicense']

to_dict()[source]
Return type:

dict

class pytdbot.types.PassportElementTypeEmailAddress[source]

Bases: TlObject, PassportElementType

A Telegram Passport element containing the user’s email address

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElementTypeEmailAddress]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElementType']

classmethod getType()[source]
Return type:

Literal['passportElementTypeEmailAddress']

to_dict()[source]
Return type:

dict

class pytdbot.types.PassportElementTypeIdentityCard[source]

Bases: TlObject, PassportElementType

A Telegram Passport element containing the user’s identity card

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElementTypeIdentityCard]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElementType']

classmethod getType()[source]
Return type:

Literal['passportElementTypeIdentityCard']

to_dict()[source]
Return type:

dict

class pytdbot.types.PassportElementTypeInternalPassport[source]

Bases: TlObject, PassportElementType

A Telegram Passport element containing the user’s internal passport

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElementTypeInternalPassport]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElementType']

classmethod getType()[source]
Return type:

Literal['passportElementTypeInternalPassport']

to_dict()[source]
Return type:

dict

class pytdbot.types.PassportElementTypePassport[source]

Bases: TlObject, PassportElementType

A Telegram Passport element containing the user’s passport

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElementTypePassport]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElementType']

classmethod getType()[source]
Return type:

Literal['passportElementTypePassport']

to_dict()[source]
Return type:

dict

class pytdbot.types.PassportElementTypePassportRegistration[source]

Bases: TlObject, PassportElementType

A Telegram Passport element containing the registration page of the user’s passport

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElementTypePassportRegistration]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElementType']

classmethod getType()[source]
Return type:

Literal['passportElementTypePassportRegistration']

to_dict()[source]
Return type:

dict

class pytdbot.types.PassportElementTypePersonalDetails[source]

Bases: TlObject, PassportElementType

A Telegram Passport element containing the user’s personal details

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElementTypePersonalDetails]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElementType']

classmethod getType()[source]
Return type:

Literal['passportElementTypePersonalDetails']

to_dict()[source]
Return type:

dict

class pytdbot.types.PassportElementTypePhoneNumber[source]

Bases: TlObject, PassportElementType

A Telegram Passport element containing the user’s phone number

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElementTypePhoneNumber]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElementType']

classmethod getType()[source]
Return type:

Literal['passportElementTypePhoneNumber']

to_dict()[source]
Return type:

dict

class pytdbot.types.PassportElementTypeRentalAgreement[source]

Bases: TlObject, PassportElementType

A Telegram Passport element containing the user’s rental agreement

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElementTypeRentalAgreement]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElementType']

classmethod getType()[source]
Return type:

Literal['passportElementTypeRentalAgreement']

to_dict()[source]
Return type:

dict

class pytdbot.types.PassportElementTypeTemporaryRegistration[source]

Bases: TlObject, PassportElementType

A Telegram Passport element containing the user’s temporary registration

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElementTypeTemporaryRegistration]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElementType']

classmethod getType()[source]
Return type:

Literal['passportElementTypeTemporaryRegistration']

to_dict()[source]
Return type:

dict

class pytdbot.types.PassportElementTypeUtilityBill[source]

Bases: TlObject, PassportElementType

A Telegram Passport element containing the user’s utility bill

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElementTypeUtilityBill]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElementType']

classmethod getType()[source]
Return type:

Literal['passportElementTypeUtilityBill']

to_dict()[source]
Return type:

dict

class pytdbot.types.PassportElementUtilityBill(utility_bill=None)[source]

Bases: TlObject, PassportElement

A Telegram Passport element containing the user’s utility bill

Parameters:

utility_bill ("types.PersonalDocument") – Utility bill

__init__(utility_bill=None)[source]
Parameters:

utility_bill (PersonalDocument | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElementUtilityBill]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElement']

classmethod getType()[source]
Return type:

Literal['passportElementUtilityBill']

to_dict()[source]
Return type:

dict

utility_bill: Optional[PersonalDocument]

Utility bill

class pytdbot.types.PassportElements(elements=None)[source]

Bases: TlObject

Contains information about saved Telegram Passport elements

Parameters:

elements (List["types.PassportElement"]) – Telegram Passport elements

__init__(elements=None)[source]
Parameters:

elements (List[PassportElement] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElements]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElements']

classmethod getType()[source]
Return type:

Literal['passportElements']

to_dict()[source]
Return type:

dict

elements: List[PassportElement]

Telegram Passport elements

class pytdbot.types.PassportElementsWithErrors(elements=None, errors=None)[source]

Bases: TlObject

Contains information about a Telegram Passport elements and corresponding errors

Parameters:
  • elements (List["types.PassportElement"]) – Telegram Passport elements

  • errors (List["types.PassportElementError"]) – Errors in the elements that are already available

__init__(elements=None, errors=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportElementsWithErrors]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportElementsWithErrors']

classmethod getType()[source]
Return type:

Literal['passportElementsWithErrors']

to_dict()[source]
Return type:

dict

elements: List[PassportElement]

Telegram Passport elements

errors: List[PassportElementError]

Errors in the elements that are already available

class pytdbot.types.PassportRequiredElement(suitable_elements=None)[source]

Bases: TlObject

Contains a description of the required Telegram Passport element that was requested by a service

Parameters:

suitable_elements (List["types.PassportSuitableElement"]) – List of Telegram Passport elements any of which is enough to provide

__init__(suitable_elements=None)[source]
Parameters:

suitable_elements (List[PassportSuitableElement] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportRequiredElement]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportRequiredElement']

classmethod getType()[source]
Return type:

Literal['passportRequiredElement']

to_dict()[source]
Return type:

dict

suitable_elements: List[PassportSuitableElement]

List of Telegram Passport elements any of which is enough to provide

class pytdbot.types.PassportSuitableElement(type=None, is_selfie_required=False, is_translation_required=False, is_native_name_required=False)[source]

Bases: TlObject

Contains information about a Telegram Passport element that was requested by a service

Parameters:
  • type ("types.PassportElementType") – Type of the element

  • is_selfie_required (bool) – True, if a selfie is required with the identity document

  • is_translation_required (bool) – True, if a certified English translation is required with the document

  • is_native_name_required (bool) – True, if personal details must include the user’s name in the language of their country of residence

__init__(type=None, is_selfie_required=False, is_translation_required=False, is_native_name_required=False)[source]
Parameters:
  • type (PassportElementType | None)

  • is_selfie_required (bool)

  • is_translation_required (bool)

  • is_native_name_required (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PassportSuitableElement]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PassportSuitableElement']

classmethod getType()[source]
Return type:

Literal['passportSuitableElement']

to_dict()[source]
Return type:

dict

is_native_name_required: bool

True, if personal details must include the user’s name in the language of their country of residence

is_selfie_required: bool

True, if a selfie is required with the identity document

is_translation_required: bool

True, if a certified English translation is required with the document

type: Union[PassportElementTypePersonalDetails, PassportElementTypePassport, PassportElementTypeDriverLicense, PassportElementTypeIdentityCard, PassportElementTypeInternalPassport, PassportElementTypeAddress, PassportElementTypeUtilityBill, PassportElementTypeBankStatement, PassportElementTypeRentalAgreement, PassportElementTypePassportRegistration, PassportElementTypeTemporaryRegistration, PassportElementTypePhoneNumber, PassportElementTypeEmailAddress, None]

Type of the element

class pytdbot.types.PasswordState(has_password=False, password_hint='', has_recovery_email_address=False, has_passport_data=False, recovery_email_address_code_info=None, login_email_address_pattern='', pending_reset_date=0)[source]

Bases: TlObject

Represents the current state of 2-step verification

Parameters:
  • has_password (bool) – True, if a 2-step verification password is set

  • password_hint (str) – Hint for the password; may be empty

  • has_recovery_email_address (bool) – True, if a recovery email is set

  • has_passport_data (bool) – True, if some Telegram Passport elements were saved

  • recovery_email_address_code_info ("types.EmailAddressAuthenticationCodeInfo") – Information about the recovery email address to which the confirmation email was sent; may be null

  • login_email_address_pattern (str) – Pattern of the email address set up for logging in

  • pending_reset_date (int) – If not 0, point in time (Unix timestamp) after which the 2-step verification password can be reset immediately using resetPassword

__init__(has_password=False, password_hint='', has_recovery_email_address=False, has_passport_data=False, recovery_email_address_code_info=None, login_email_address_pattern='', pending_reset_date=0)[source]
Parameters:
  • has_password (bool)

  • password_hint (str)

  • has_recovery_email_address (bool)

  • has_passport_data (bool)

  • recovery_email_address_code_info (EmailAddressAuthenticationCodeInfo | None)

  • login_email_address_pattern (str)

  • pending_reset_date (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PasswordState]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PasswordState']

classmethod getType()[source]
Return type:

Literal['passwordState']

to_dict()[source]
Return type:

dict

has_passport_data: bool

True, if some Telegram Passport elements were saved

has_password: bool

True, if a 2-step verification password is set

has_recovery_email_address: bool

True, if a recovery email is set

login_email_address_pattern: Optional[str]

Pattern of the email address set up for logging in

password_hint: Optional[str]

Hint for the password; may be empty

pending_reset_date: int

If not 0, point in time (Unix timestamp) after which the 2-step verification password can be reset immediately using resetPassword

recovery_email_address_code_info: Optional[EmailAddressAuthenticationCodeInfo]

Information about the recovery email address to which the confirmation email was sent; may be null

class pytdbot.types.PaymentForm(id=0, type=None, seller_bot_user_id=0, product_info=None)[source]

Bases: TlObject

Contains information about an invoice payment form

Parameters:
  • id (int) – The payment form identifier

  • type ("types.PaymentFormType") – Type of the payment form

  • seller_bot_user_id (int) – User identifier of the seller bot

  • product_info ("types.ProductInfo") – Information about the product

__init__(id=0, type=None, seller_bot_user_id=0, product_info=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PaymentForm]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PaymentForm']

classmethod getType()[source]
Return type:

Literal['paymentForm']

to_dict()[source]
Return type:

dict

id: int

The payment form identifier

product_info: Optional[ProductInfo]

Information about the product

seller_bot_user_id: int

User identifier of the seller bot

type: Union[PaymentFormTypeRegular, PaymentFormTypeStars, PaymentFormTypeStarSubscription, None]

Type of the payment form

class pytdbot.types.PaymentFormType[source]

Bases: object

Describes type of payment form

class pytdbot.types.PaymentFormTypeRegular(invoice=None, payment_provider_user_id=0, payment_provider=None, additional_payment_options=None, saved_order_info=None, saved_credentials=None, can_save_credentials=False, need_password=False)[source]

Bases: TlObject, PaymentFormType

The payment form is for a regular payment

Parameters:
  • invoice ("types.Invoice") – Full information about the invoice

  • payment_provider_user_id (int) – User identifier of the payment provider bot

  • payment_provider ("types.PaymentProvider") – Information about the payment provider

  • additional_payment_options (List["types.PaymentOption"]) – The list of additional payment options

  • saved_order_info ("types.OrderInfo") – Saved server-side order information; may be null

  • saved_credentials (List["types.SavedCredentials"]) – The list of saved payment credentials

  • can_save_credentials (bool) – True, if the user can choose to save credentials

  • need_password (bool) – True, if the user will be able to save credentials, if sets up a 2-step verification password

__init__(invoice=None, payment_provider_user_id=0, payment_provider=None, additional_payment_options=None, saved_order_info=None, saved_credentials=None, can_save_credentials=False, need_password=False)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PaymentFormTypeRegular]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PaymentFormType']

classmethod getType()[source]
Return type:

Literal['paymentFormTypeRegular']

to_dict()[source]
Return type:

dict

additional_payment_options: List[PaymentOption]

The list of additional payment options

can_save_credentials: bool

True, if the user can choose to save credentials

invoice: Optional[Invoice]

Full information about the invoice

need_password: bool

True, if the user will be able to save credentials, if sets up a 2-step verification password

payment_provider: Union[PaymentProviderSmartGlocal, PaymentProviderStripe, PaymentProviderOther, None]

Information about the payment provider

payment_provider_user_id: int

User identifier of the payment provider bot

saved_credentials: List[SavedCredentials]

The list of saved payment credentials

saved_order_info: Optional[OrderInfo]

Saved server-side order information; may be null

class pytdbot.types.PaymentFormTypeStarSubscription(pricing=None)[source]

Bases: TlObject, PaymentFormType

The payment form is for a payment in Telegram Stars for subscription

Parameters:

pricing ("types.StarSubscriptionPricing") – Information about subscription plan

__init__(pricing=None)[source]
Parameters:

pricing (StarSubscriptionPricing | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PaymentFormTypeStarSubscription]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PaymentFormType']

classmethod getType()[source]
Return type:

Literal['paymentFormTypeStarSubscription']

to_dict()[source]
Return type:

dict

pricing: Optional[StarSubscriptionPricing]

Information about subscription plan

class pytdbot.types.PaymentFormTypeStars(star_count=0)[source]

Bases: TlObject, PaymentFormType

The payment form is for a payment in Telegram Stars

Parameters:

star_count (int) – Number of Telegram Stars that will be paid

__init__(star_count=0)[source]
Parameters:

star_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PaymentFormTypeStars]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PaymentFormType']

classmethod getType()[source]
Return type:

Literal['paymentFormTypeStars']

to_dict()[source]
Return type:

dict

star_count: int

Number of Telegram Stars that will be paid

class pytdbot.types.PaymentOption(title='', url='')[source]

Bases: TlObject

Describes an additional payment option

Parameters:
  • title (str) – Title for the payment option

  • url (str) – Payment form URL to be opened in a web view

__init__(title='', url='')[source]
Parameters:
  • title (str)

  • url (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PaymentOption]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PaymentOption']

classmethod getType()[source]
Return type:

Literal['paymentOption']

to_dict()[source]
Return type:

dict

title: Optional[str]

Title for the payment option

url: Optional[str]

Payment form URL to be opened in a web view

class pytdbot.types.PaymentProvider[source]

Bases: object

Contains information about a payment provider

class pytdbot.types.PaymentProviderOther(url='')[source]

Bases: TlObject, PaymentProvider

Some other payment provider, for which a web payment form must be shown

Parameters:

url (str) – Payment form URL

__init__(url='')[source]
Parameters:

url (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PaymentProviderOther]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PaymentProvider']

classmethod getType()[source]
Return type:

Literal['paymentProviderOther']

to_dict()[source]
Return type:

dict

url: Optional[str]

Payment form URL

class pytdbot.types.PaymentProviderSmartGlocal(public_token='', tokenize_url='')[source]

Bases: TlObject, PaymentProvider

Smart Glocal payment provider

Parameters:
  • public_token (str) – Public payment token

  • tokenize_url (str) – URL for sending card tokenization requests

__init__(public_token='', tokenize_url='')[source]
Parameters:
  • public_token (str)

  • tokenize_url (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PaymentProviderSmartGlocal]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PaymentProvider']

classmethod getType()[source]
Return type:

Literal['paymentProviderSmartGlocal']

to_dict()[source]
Return type:

dict

public_token: Optional[str]

Public payment token

tokenize_url: Optional[str]

URL for sending card tokenization requests

class pytdbot.types.PaymentProviderStripe(publishable_key='', need_country=False, need_postal_code=False, need_cardholder_name=False)[source]

Bases: TlObject, PaymentProvider

Stripe payment provider

Parameters:
  • publishable_key (str) – Stripe API publishable key

  • need_country (bool) – True, if the user country must be provided

  • need_postal_code (bool) – True, if the user ZIP/postal code must be provided

  • need_cardholder_name (bool) – True, if the cardholder name must be provided

__init__(publishable_key='', need_country=False, need_postal_code=False, need_cardholder_name=False)[source]
Parameters:
  • publishable_key (str)

  • need_country (bool)

  • need_postal_code (bool)

  • need_cardholder_name (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PaymentProviderStripe]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PaymentProvider']

classmethod getType()[source]
Return type:

Literal['paymentProviderStripe']

to_dict()[source]
Return type:

dict

need_cardholder_name: bool

True, if the cardholder name must be provided

need_country: bool

True, if the user country must be provided

need_postal_code: bool

True, if the user ZIP/postal code must be provided

publishable_key: Optional[str]

Stripe API publishable key

class pytdbot.types.PaymentReceipt(product_info=None, date=0, seller_bot_user_id=0, type=None)[source]

Bases: TlObject

Contains information about a successful payment

Parameters:
  • product_info ("types.ProductInfo") – Information about the product

  • date (int) – Point in time (Unix timestamp) when the payment was made

  • seller_bot_user_id (int) – User identifier of the seller bot

  • type ("types.PaymentReceiptType") – Type of the payment receipt

__init__(product_info=None, date=0, seller_bot_user_id=0, type=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PaymentReceipt]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PaymentReceipt']

classmethod getType()[source]
Return type:

Literal['paymentReceipt']

to_dict()[source]
Return type:

dict

date: int

Point in time (Unix timestamp) when the payment was made

product_info: Optional[ProductInfo]

Information about the product

seller_bot_user_id: int

User identifier of the seller bot

type: Union[PaymentReceiptTypeRegular, PaymentReceiptTypeStars, None]

Type of the payment receipt

class pytdbot.types.PaymentReceiptType[source]

Bases: object

Describes type of successful payment

class pytdbot.types.PaymentReceiptTypeRegular(payment_provider_user_id=0, invoice=None, order_info=None, shipping_option=None, credentials_title='', tip_amount=0)[source]

Bases: TlObject, PaymentReceiptType

The payment was done using a third-party payment provider

Parameters:
  • payment_provider_user_id (int) – User identifier of the payment provider bot

  • invoice ("types.Invoice") – Information about the invoice

  • order_info ("types.OrderInfo") – Order information; may be null

  • shipping_option ("types.ShippingOption") – Chosen shipping option; may be null

  • credentials_title (str) – Title of the saved credentials chosen by the buyer

  • tip_amount (int) – The amount of tip chosen by the buyer in the smallest units of the currency

__init__(payment_provider_user_id=0, invoice=None, order_info=None, shipping_option=None, credentials_title='', tip_amount=0)[source]
Parameters:
  • payment_provider_user_id (int)

  • invoice (Invoice | None)

  • order_info (OrderInfo | None)

  • shipping_option (ShippingOption | None)

  • credentials_title (str)

  • tip_amount (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PaymentReceiptTypeRegular]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PaymentReceiptType']

classmethod getType()[source]
Return type:

Literal['paymentReceiptTypeRegular']

to_dict()[source]
Return type:

dict

credentials_title: Optional[str]

Title of the saved credentials chosen by the buyer

invoice: Optional[Invoice]

Information about the invoice

order_info: Optional[OrderInfo]

Order information; may be null

payment_provider_user_id: int

User identifier of the payment provider bot

shipping_option: Optional[ShippingOption]

Chosen shipping option; may be null

tip_amount: int

The amount of tip chosen by the buyer in the smallest units of the currency

class pytdbot.types.PaymentReceiptTypeStars(star_count=0, transaction_id='')[source]

Bases: TlObject, PaymentReceiptType

The payment was done using Telegram Stars

Parameters:
  • star_count (int) – Number of Telegram Stars that were paid

  • transaction_id (str) – Unique identifier of the transaction that can be used to dispute it

__init__(star_count=0, transaction_id='')[source]
Parameters:
  • star_count (int)

  • transaction_id (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PaymentReceiptTypeStars]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PaymentReceiptType']

classmethod getType()[source]
Return type:

Literal['paymentReceiptTypeStars']

to_dict()[source]
Return type:

dict

star_count: int

Number of Telegram Stars that were paid

transaction_id: Optional[str]

Unique identifier of the transaction that can be used to dispute it

class pytdbot.types.PaymentResult(success=False, verification_url='')[source]

Bases: TlObject

Contains the result of a payment request

Parameters:
  • success (bool) – True, if the payment request was successful; otherwise, the verification_url will be non-empty

  • verification_url (str) – URL for additional payment credentials verification

__init__(success=False, verification_url='')[source]
Parameters:
  • success (bool)

  • verification_url (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PaymentResult]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PaymentResult']

classmethod getType()[source]
Return type:

Literal['paymentResult']

to_dict()[source]
Return type:

dict

success: bool

True, if the payment request was successful; otherwise, the verification_url will be non-empty

verification_url: Optional[str]

URL for additional payment credentials verification

class pytdbot.types.PersonalDetails(first_name='', middle_name='', last_name='', native_first_name='', native_middle_name='', native_last_name='', birthdate=None, gender='', country_code='', residence_country_code='')[source]

Bases: TlObject

Contains the user’s personal details

Parameters:
  • first_name (str) – First name of the user written in English; 1-255 characters

  • middle_name (str) – Middle name of the user written in English; 0-255 characters

  • last_name (str) – Last name of the user written in English; 1-255 characters

  • native_first_name (str) – Native first name of the user; 1-255 characters

  • native_middle_name (str) – Native middle name of the user; 0-255 characters

  • native_last_name (str) – Native last name of the user; 1-255 characters

  • birthdate ("types.Date") – Birthdate of the user

  • gender (str) – Gender of the user, "male" or "female"

  • country_code (str) – A two-letter ISO 3166-1 alpha-2 country code of the user’s country

  • residence_country_code (str) – A two-letter ISO 3166-1 alpha-2 country code of the user’s residence country

__init__(first_name='', middle_name='', last_name='', native_first_name='', native_middle_name='', native_last_name='', birthdate=None, gender='', country_code='', residence_country_code='')[source]
Parameters:
  • first_name (str)

  • middle_name (str)

  • last_name (str)

  • native_first_name (str)

  • native_middle_name (str)

  • native_last_name (str)

  • birthdate (Date | None)

  • gender (str)

  • country_code (str)

  • residence_country_code (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PersonalDetails]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PersonalDetails']

classmethod getType()[source]
Return type:

Literal['personalDetails']

to_dict()[source]
Return type:

dict

birthdate: Optional[Date]

Birthdate of the user

country_code: Optional[str]

A two-letter ISO 3166-1 alpha-2 country code of the user’s country

first_name: Optional[str]

First name of the user written in English; 1-255 characters

gender: Optional[str]

Gender of the user, "male" or "female"

last_name: Optional[str]

Last name of the user written in English; 1-255 characters

middle_name: Optional[str]

Middle name of the user written in English; 0-255 characters

native_first_name: Optional[str]

Native first name of the user; 1-255 characters

native_last_name: Optional[str]

Native last name of the user; 1-255 characters

native_middle_name: Optional[str]

Native middle name of the user; 0-255 characters

residence_country_code: Optional[str]

A two-letter ISO 3166-1 alpha-2 country code of the user’s residence country

class pytdbot.types.PersonalDocument(files=None, translation=None)[source]

Bases: TlObject

A personal document, containing some information about a user

Parameters:
  • files (List["types.DatedFile"]) – List of files containing the pages of the document

  • translation (List["types.DatedFile"]) – List of files containing a certified English translation of the document

__init__(files=None, translation=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PersonalDocument]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PersonalDocument']

classmethod getType()[source]
Return type:

Literal['personalDocument']

to_dict()[source]
Return type:

dict

files: List[DatedFile]

List of files containing the pages of the document

translation: List[DatedFile]

List of files containing a certified English translation of the document

class pytdbot.types.PhoneNumberAuthenticationSettings(allow_flash_call=False, allow_missed_call=False, is_current_phone_number=False, has_unknown_phone_number=False, allow_sms_retriever_api=False, firebase_authentication_settings=None, authentication_tokens=None)[source]

Bases: TlObject

Contains settings for the authentication of the user’s phone number

Parameters:
  • allow_flash_call (bool) – Pass true if the authentication code may be sent via a flash call to the specified phone number

  • allow_missed_call (bool) – Pass true if the authentication code may be sent via a missed call to the specified phone number

  • is_current_phone_number (bool) – Pass true if the authenticated phone number is used on the current device

  • has_unknown_phone_number (bool) – Pass true if there is a SIM card in the current device, but it is not possible to check whether phone number matches

  • allow_sms_retriever_api (bool) – For official applications only. True, if the application can use Android SMS Retriever API (requires Google Play Services >= 10.2) to automatically receive the authentication code from the SMS. See https://developers.google.com/identity/sms-retriever/ for more details

  • firebase_authentication_settings ("types.FirebaseAuthenticationSettings") – For official Android and iOS applications only; pass null otherwise. Settings for Firebase Authentication

  • authentication_tokens (List[str]) – List of up to 20 authentication tokens, recently received in updateOption("authentication_token") in previously logged out sessions; for setAuthenticationPhoneNumber only

__init__(allow_flash_call=False, allow_missed_call=False, is_current_phone_number=False, has_unknown_phone_number=False, allow_sms_retriever_api=False, firebase_authentication_settings=None, authentication_tokens=None)[source]
Parameters:
  • allow_flash_call (bool)

  • allow_missed_call (bool)

  • is_current_phone_number (bool)

  • has_unknown_phone_number (bool)

  • allow_sms_retriever_api (bool)

  • firebase_authentication_settings (FirebaseAuthenticationSettings | None)

  • authentication_tokens (List[str] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PhoneNumberAuthenticationSettings]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PhoneNumberAuthenticationSettings']

classmethod getType()[source]
Return type:

Literal['phoneNumberAuthenticationSettings']

to_dict()[source]
Return type:

dict

allow_flash_call: bool

Pass true if the authentication code may be sent via a flash call to the specified phone number

allow_missed_call: bool

Pass true if the authentication code may be sent via a missed call to the specified phone number

allow_sms_retriever_api: bool

//developers.google.com/identity/sms-retriever/ for more details

Type:

For official applications only. True, if the application can use Android SMS Retriever API (requires Google Play Services >= 10.2) to automatically receive the authentication code from the SMS. See https

authentication_tokens: List[str]

List of up to 20 authentication tokens, recently received in updateOption("authentication_token") in previously logged out sessions; for setAuthenticationPhoneNumber only

firebase_authentication_settings: Union[FirebaseAuthenticationSettingsAndroid, FirebaseAuthenticationSettingsIos, None]

For official Android and iOS applications only; pass null otherwise. Settings for Firebase Authentication

has_unknown_phone_number: bool

Pass true if there is a SIM card in the current device, but it is not possible to check whether phone number matches

is_current_phone_number: bool

Pass true if the authenticated phone number is used on the current device

class pytdbot.types.PhoneNumberCodeType[source]

Bases: object

Describes type of the request for which a code is sent to a phone number

class pytdbot.types.PhoneNumberCodeTypeChange[source]

Bases: TlObject, PhoneNumberCodeType

Checks ownership of a new phone number to change the user’s authentication phone number; for official Android and iOS applications only

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PhoneNumberCodeTypeChange]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PhoneNumberCodeType']

classmethod getType()[source]
Return type:

Literal['phoneNumberCodeTypeChange']

to_dict()[source]
Return type:

dict

class pytdbot.types.PhoneNumberCodeTypeConfirmOwnership(hash='')[source]

Bases: TlObject, PhoneNumberCodeType

Confirms ownership of a phone number to prevent account deletion while handling links of the type internalLinkTypePhoneNumberConfirmation

Parameters:

hash (str) – Hash value from the link

__init__(hash='')[source]
Parameters:

hash (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PhoneNumberCodeTypeConfirmOwnership]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PhoneNumberCodeType']

classmethod getType()[source]
Return type:

Literal['phoneNumberCodeTypeConfirmOwnership']

to_dict()[source]
Return type:

dict

hash: Optional[str]

Hash value from the link

class pytdbot.types.PhoneNumberCodeTypeVerify[source]

Bases: TlObject, PhoneNumberCodeType

Verifies ownership of a phone number to be added to the user’s Telegram Passport

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PhoneNumberCodeTypeVerify]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PhoneNumberCodeType']

classmethod getType()[source]
Return type:

Literal['phoneNumberCodeTypeVerify']

to_dict()[source]
Return type:

dict

class pytdbot.types.PhoneNumberInfo(country=None, country_calling_code='', formatted_phone_number='', is_anonymous=False)[source]

Bases: TlObject

Contains information about a phone number

Parameters:
  • country ("types.CountryInfo") – Information about the country to which the phone number belongs; may be null

  • country_calling_code (str) – The part of the phone number denoting country calling code or its part

  • formatted_phone_number (str) – The phone number without country calling code formatted accordingly to local rules. Expected digits are returned as ‘-’, but even more digits might be entered by the user

  • is_anonymous (bool) – True, if the phone number was bought at https://fragment.com and isn’t tied to a SIM card. Information about the phone number can be received using getCollectibleItemInfo

__init__(country=None, country_calling_code='', formatted_phone_number='', is_anonymous=False)[source]
Parameters:
  • country (CountryInfo | None)

  • country_calling_code (str)

  • formatted_phone_number (str)

  • is_anonymous (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PhoneNumberInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PhoneNumberInfo']

classmethod getType()[source]
Return type:

Literal['phoneNumberInfo']

to_dict()[source]
Return type:

dict

country: Optional[CountryInfo]

Information about the country to which the phone number belongs; may be null

country_calling_code: Optional[str]

The part of the phone number denoting country calling code or its part

formatted_phone_number: Optional[str]

The phone number without country calling code formatted accordingly to local rules. Expected digits are returned as ‘-’, but even more digits might be entered by the user

is_anonymous: bool

//fragment.com and isn’t tied to a SIM card. Information about the phone number can be received using getCollectibleItemInfo

Type:

True, if the phone number was bought at https

class pytdbot.types.Photo(has_stickers=False, minithumbnail=None, sizes=None)[source]

Bases: TlObject

Describes a photo

Parameters:
  • has_stickers (bool) – True, if stickers were added to the photo. The list of corresponding sticker sets can be received using getAttachedStickerSets

  • minithumbnail ("types.Minithumbnail") – Photo minithumbnail; may be null

  • sizes (List["types.PhotoSize"]) – Available variants of the photo, in different sizes

__init__(has_stickers=False, minithumbnail=None, sizes=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Photo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Photo']

classmethod getType()[source]
Return type:

Literal['photo']

to_dict()[source]
Return type:

dict

has_stickers: bool

True, if stickers were added to the photo. The list of corresponding sticker sets can be received using getAttachedStickerSets

minithumbnail: Optional[Minithumbnail]

Photo minithumbnail; may be null

sizes: List[PhotoSize]

Available variants of the photo, in different sizes

class pytdbot.types.PhotoSize(type='', photo=None, width=0, height=0, progressive_sizes=None)[source]

Bases: TlObject

Describes an image in JPEG format

Parameters:
  • type (str) – Image type (see https://core.telegram.org/constructor/photoSize)

  • photo ("types.File") – Information about the image file

  • width (int) – Image width

  • height (int) – Image height

  • progressive_sizes (List[int]) – Sizes of progressive JPEG file prefixes, which can be used to preliminarily show the image; in bytes

__init__(type='', photo=None, width=0, height=0, progressive_sizes=None)[source]
Parameters:
  • type (str)

  • photo (File | None)

  • width (int)

  • height (int)

  • progressive_sizes (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PhotoSize]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PhotoSize']

classmethod getType()[source]
Return type:

Literal['photoSize']

to_dict()[source]
Return type:

dict

height: int

Image height

photo: Optional[File]

Information about the image file

progressive_sizes: List[int]

Sizes of progressive JPEG file prefixes, which can be used to preliminarily show the image; in bytes

type: Optional[str]

//core.telegram.org/constructor/photoSize)

Type:

Image type (see https

width: int

Image width

class pytdbot.types.Plugins(folder, include=None, exclude=None)[source]

Bases: object

Load and filter plugins from a folder

Parameters:
  • folder (str)

  • include (list)

  • exclude (list)

__init__(folder, include=None, exclude=None)[source]
Parameters:
  • folder (str) – The folder to load plugins from

  • include (list, optional) – Only load plugins with names in this list

  • exclude (list, optional) – Exclude plugins with names in this list

Return type:

None

Example

To load only the plugins with path “plugins/rules.py” and “plugins/subfolder1/commands.py”, you should create the Plugins object like this:

>>> plugins = Plugins(
        folder="plugins/",
        include=[
            "rules" # will be translated to "plugins.rules"
            "subfolder1.commands" # -> plugins.subfolder1.commands
        ]
    )
Raises:

TypeError

Parameters:
  • folder (str)

  • include (list | None)

  • exclude (list | None)

Return type:

None

class pytdbot.types.Point(x=0.0, y=0.0)[source]

Bases: TlObject

A point on a Cartesian plane

Parameters:
  • x (float) – The point’s first coordinate

  • y (float) – The point’s second coordinate

__init__(x=0.0, y=0.0)[source]
Parameters:
  • x (float)

  • y (float)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Point]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Point']

classmethod getType()[source]
Return type:

Literal['point']

to_dict()[source]
Return type:

dict

x: float

The point’s first coordinate

y: float

The point’s second coordinate

class pytdbot.types.Poll(id=0, question=None, options=None, total_voter_count=0, recent_voter_ids=None, is_anonymous=False, type=None, open_period=0, close_date=0, is_closed=False)[source]

Bases: TlObject

Describes a poll

Parameters:
  • id (int) – Unique poll identifier

  • question ("types.FormattedText") – Poll question; 1-300 characters. Only custom emoji entities are allowed

  • options (List["types.PollOption"]) – List of poll answer options

  • total_voter_count (int) – Total number of voters, participating in the poll

  • recent_voter_ids (List["types.MessageSender"]) – Identifiers of recent voters, if the poll is non-anonymous

  • is_anonymous (bool) – True, if the poll is anonymous

  • type ("types.PollType") – Type of the poll

  • open_period (int) – Amount of time the poll will be active after creation, in seconds

  • close_date (int) – Point in time (Unix timestamp) when the poll will automatically be closed

  • is_closed (bool) – True, if the poll is closed

__init__(id=0, question=None, options=None, total_voter_count=0, recent_voter_ids=None, is_anonymous=False, type=None, open_period=0, close_date=0, is_closed=False)[source]
Parameters:
  • id (int)

  • question (FormattedText | None)

  • options (List[PollOption] | None)

  • total_voter_count (int)

  • recent_voter_ids (List[MessageSender] | None)

  • is_anonymous (bool)

  • type (PollType | None)

  • open_period (int)

  • close_date (int)

  • is_closed (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Poll]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Poll']

classmethod getType()[source]
Return type:

Literal['poll']

to_dict()[source]
Return type:

dict

close_date: int

Point in time (Unix timestamp) when the poll will automatically be closed

id: int

Unique poll identifier

is_anonymous: bool

True, if the poll is anonymous

is_closed: bool

True, if the poll is closed

open_period: int

Amount of time the poll will be active after creation, in seconds

options: List[PollOption]

List of poll answer options

question: Optional[FormattedText]

Poll question; 1-300 characters. Only custom emoji entities are allowed

recent_voter_ids: List[MessageSender]

Identifiers of recent voters, if the poll is non-anonymous

total_voter_count: int

Total number of voters, participating in the poll

type: Union[PollTypeRegular, PollTypeQuiz, None]

Type of the poll

class pytdbot.types.PollOption(text=None, voter_count=0, vote_percentage=0, is_chosen=False, is_being_chosen=False)[source]

Bases: TlObject

Describes one answer option of a poll

Parameters:
  • text ("types.FormattedText") – Option text; 1-100 characters. Only custom emoji entities are allowed

  • voter_count (int) – Number of voters for this option, available only for closed or voted polls

  • vote_percentage (int) – The percentage of votes for this option; 0-100

  • is_chosen (bool) – True, if the option was chosen by the user

  • is_being_chosen (bool) – True, if the option is being chosen by a pending setPollAnswer request

__init__(text=None, voter_count=0, vote_percentage=0, is_chosen=False, is_being_chosen=False)[source]
Parameters:
  • text (FormattedText | None)

  • voter_count (int)

  • vote_percentage (int)

  • is_chosen (bool)

  • is_being_chosen (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PollOption]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PollOption']

classmethod getType()[source]
Return type:

Literal['pollOption']

to_dict()[source]
Return type:

dict

is_being_chosen: bool

True, if the option is being chosen by a pending setPollAnswer request

is_chosen: bool

True, if the option was chosen by the user

text: Optional[FormattedText]

Option text; 1-100 characters. Only custom emoji entities are allowed

vote_percentage: int

The percentage of votes for this option; 0-100

voter_count: int

Number of voters for this option, available only for closed or voted polls

class pytdbot.types.PollType[source]

Bases: object

Describes the type of poll

class pytdbot.types.PollTypeQuiz(correct_option_id=0, explanation=None)[source]

Bases: TlObject, PollType

A poll in quiz mode, which has exactly one correct answer option and can be answered only once

Parameters:
  • correct_option_id (int) – 0-based identifier of the correct answer option; -1 for a yet unanswered poll

  • explanation ("types.FormattedText") – Text that is shown when the user chooses an incorrect answer or taps on the lamp icon; 0-200 characters with at most 2 line feeds; empty for a yet unanswered poll

__init__(correct_option_id=0, explanation=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PollTypeQuiz]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PollType']

classmethod getType()[source]
Return type:

Literal['pollTypeQuiz']

to_dict()[source]
Return type:

dict

correct_option_id: int

0-based identifier of the correct answer option; -1 for a yet unanswered poll

explanation: Optional[FormattedText]

Text that is shown when the user chooses an incorrect answer or taps on the lamp icon; 0-200 characters with at most 2 line feeds; empty for a yet unanswered poll

class pytdbot.types.PollTypeRegular(allow_multiple_answers=False)[source]

Bases: TlObject, PollType

A regular poll

Parameters:

allow_multiple_answers (bool) – True, if multiple answer options can be chosen simultaneously

__init__(allow_multiple_answers=False)[source]
Parameters:

allow_multiple_answers (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PollTypeRegular]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PollType']

classmethod getType()[source]
Return type:

Literal['pollTypeRegular']

to_dict()[source]
Return type:

dict

allow_multiple_answers: bool

True, if multiple answer options can be chosen simultaneously

class pytdbot.types.PremiumFeature[source]

Bases: object

Describes a feature available to Premium users

class pytdbot.types.PremiumFeatureAccentColor[source]

Bases: TlObject, PremiumFeature

The ability to choose accent color for replies and user profile

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumFeatureAccentColor]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumFeature']

classmethod getType()[source]
Return type:

Literal['premiumFeatureAccentColor']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumFeatureAdvancedChatManagement[source]

Bases: TlObject, PremiumFeature

Ability to change position of the main chat list, archive and mute all new chats from non-contacts, and completely disable notifications about the user’s contacts joined Telegram

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumFeatureAdvancedChatManagement]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumFeature']

classmethod getType()[source]
Return type:

Literal['premiumFeatureAdvancedChatManagement']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumFeatureAnimatedProfilePhoto[source]

Bases: TlObject, PremiumFeature

Profile photo animation on message and chat screens

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumFeatureAnimatedProfilePhoto]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumFeature']

classmethod getType()[source]
Return type:

Literal['premiumFeatureAnimatedProfilePhoto']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumFeatureAppIcons[source]

Bases: TlObject, PremiumFeature

Allowed to set a premium application icons

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumFeatureAppIcons]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumFeature']

classmethod getType()[source]
Return type:

Literal['premiumFeatureAppIcons']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumFeatureBackgroundForBoth[source]

Bases: TlObject, PremiumFeature

The ability to set private chat background for both users

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumFeatureBackgroundForBoth]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumFeature']

classmethod getType()[source]
Return type:

Literal['premiumFeatureBackgroundForBoth']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumFeatureBusiness[source]

Bases: TlObject, PremiumFeature

The ability to use Business features

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumFeatureBusiness]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumFeature']

classmethod getType()[source]
Return type:

Literal['premiumFeatureBusiness']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumFeatureChatBoost[source]

Bases: TlObject, PremiumFeature

The ability to boost chats

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumFeatureChatBoost]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumFeature']

classmethod getType()[source]
Return type:

Literal['premiumFeatureChatBoost']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumFeatureChecklists[source]

Bases: TlObject, PremiumFeature

The ability to create and use checklist messages

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumFeatureChecklists]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumFeature']

classmethod getType()[source]
Return type:

Literal['premiumFeatureChecklists']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumFeatureCustomEmoji[source]

Bases: TlObject, PremiumFeature

Allowed to use custom emoji stickers in message texts and captions

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumFeatureCustomEmoji]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumFeature']

classmethod getType()[source]
Return type:

Literal['premiumFeatureCustomEmoji']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumFeatureDisabledAds[source]

Bases: TlObject, PremiumFeature

Disabled ads

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumFeatureDisabledAds]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumFeature']

classmethod getType()[source]
Return type:

Literal['premiumFeatureDisabledAds']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumFeatureEmojiStatus[source]

Bases: TlObject, PremiumFeature

The ability to show an emoji status along with the user’s name

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumFeatureEmojiStatus]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumFeature']

classmethod getType()[source]
Return type:

Literal['premiumFeatureEmojiStatus']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumFeatureForumTopicIcon[source]

Bases: TlObject, PremiumFeature

The ability to set a custom emoji as a forum topic icon

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumFeatureForumTopicIcon]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumFeature']

classmethod getType()[source]
Return type:

Literal['premiumFeatureForumTopicIcon']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumFeatureImprovedDownloadSpeed[source]

Bases: TlObject, PremiumFeature

Improved download speed

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumFeatureImprovedDownloadSpeed]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumFeature']

classmethod getType()[source]
Return type:

Literal['premiumFeatureImprovedDownloadSpeed']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumFeatureIncreasedLimits[source]

Bases: TlObject, PremiumFeature

Increased limits

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumFeatureIncreasedLimits]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumFeature']

classmethod getType()[source]
Return type:

Literal['premiumFeatureIncreasedLimits']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumFeatureIncreasedUploadFileSize[source]

Bases: TlObject, PremiumFeature

Increased maximum upload file size

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumFeatureIncreasedUploadFileSize]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumFeature']

classmethod getType()[source]
Return type:

Literal['premiumFeatureIncreasedUploadFileSize']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumFeatureLastSeenTimes[source]

Bases: TlObject, PremiumFeature

The ability to view last seen and read times of other users even if they can’t view last seen or read time for the current user

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumFeatureLastSeenTimes]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumFeature']

classmethod getType()[source]
Return type:

Literal['premiumFeatureLastSeenTimes']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumFeatureMessageEffects[source]

Bases: TlObject, PremiumFeature

The ability to use all available message effects

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumFeatureMessageEffects]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumFeature']

classmethod getType()[source]
Return type:

Literal['premiumFeatureMessageEffects']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumFeatureMessagePrivacy[source]

Bases: TlObject, PremiumFeature

The ability to disallow incoming voice and video note messages in private chats using setUserPrivacySettingRules with userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages and to restrict incoming messages from non-contacts using setNewChatPrivacySettings

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumFeatureMessagePrivacy]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumFeature']

classmethod getType()[source]
Return type:

Literal['premiumFeatureMessagePrivacy']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumFeatureProfileBadge[source]

Bases: TlObject, PremiumFeature

A badge in the user’s profile

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumFeatureProfileBadge]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumFeature']

classmethod getType()[source]
Return type:

Literal['premiumFeatureProfileBadge']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumFeaturePromotionAnimation(feature=None, animation=None)[source]

Bases: TlObject

Describes a promotion animation for a Premium feature

Parameters:
  • feature ("types.PremiumFeature") – Premium feature

  • animation ("types.Animation") – Promotion animation for the feature

__init__(feature=None, animation=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumFeaturePromotionAnimation]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumFeaturePromotionAnimation']

classmethod getType()[source]
Return type:

Literal['premiumFeaturePromotionAnimation']

to_dict()[source]
Return type:

dict

animation: Optional[Animation]

Promotion animation for the feature

feature: Union[PremiumFeatureIncreasedLimits, PremiumFeatureIncreasedUploadFileSize, PremiumFeatureImprovedDownloadSpeed, PremiumFeatureVoiceRecognition, PremiumFeatureDisabledAds, PremiumFeatureUniqueReactions, PremiumFeatureUniqueStickers, PremiumFeatureCustomEmoji, PremiumFeatureAdvancedChatManagement, PremiumFeatureProfileBadge, PremiumFeatureEmojiStatus, PremiumFeatureAnimatedProfilePhoto, PremiumFeatureForumTopicIcon, PremiumFeatureAppIcons, PremiumFeatureRealTimeChatTranslation, PremiumFeatureUpgradedStories, PremiumFeatureChatBoost, PremiumFeatureAccentColor, PremiumFeatureBackgroundForBoth, PremiumFeatureSavedMessagesTags, PremiumFeatureMessagePrivacy, PremiumFeatureLastSeenTimes, PremiumFeatureBusiness, PremiumFeatureMessageEffects, PremiumFeatureChecklists, None]

Premium feature

class pytdbot.types.PremiumFeatureRealTimeChatTranslation[source]

Bases: TlObject, PremiumFeature

Allowed to translate chat messages real-time

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumFeatureRealTimeChatTranslation]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumFeature']

classmethod getType()[source]
Return type:

Literal['premiumFeatureRealTimeChatTranslation']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumFeatureSavedMessagesTags[source]

Bases: TlObject, PremiumFeature

The ability to use tags in Saved Messages

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumFeatureSavedMessagesTags]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumFeature']

classmethod getType()[source]
Return type:

Literal['premiumFeatureSavedMessagesTags']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumFeatureUniqueReactions[source]

Bases: TlObject, PremiumFeature

Allowed to use more reactions

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumFeatureUniqueReactions]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumFeature']

classmethod getType()[source]
Return type:

Literal['premiumFeatureUniqueReactions']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumFeatureUniqueStickers[source]

Bases: TlObject, PremiumFeature

Allowed to use premium stickers with unique effects

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumFeatureUniqueStickers]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumFeature']

classmethod getType()[source]
Return type:

Literal['premiumFeatureUniqueStickers']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumFeatureUpgradedStories[source]

Bases: TlObject, PremiumFeature

Allowed to use many additional features for stories

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumFeatureUpgradedStories]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumFeature']

classmethod getType()[source]
Return type:

Literal['premiumFeatureUpgradedStories']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumFeatureVoiceRecognition[source]

Bases: TlObject, PremiumFeature

The ability to convert voice notes to text

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumFeatureVoiceRecognition]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumFeature']

classmethod getType()[source]
Return type:

Literal['premiumFeatureVoiceRecognition']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumFeatures(features=None, limits=None, payment_link=None)[source]

Bases: TlObject

Contains information about features, available to Premium users

Parameters:
  • features (List["types.PremiumFeature"]) – The list of available features

  • limits (List["types.PremiumLimit"]) – The list of limits, increased for Premium users

  • payment_link ("types.InternalLinkType") – An internal link to be opened to pay for Telegram Premium if store payment isn’t possible; may be null if direct payment isn’t available

__init__(features=None, limits=None, payment_link=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumFeatures]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumFeatures']

classmethod getType()[source]
Return type:

Literal['premiumFeatures']

to_dict()[source]
Return type:

dict

features: List[PremiumFeature]

The list of available features

limits: List[PremiumLimit]

The list of limits, increased for Premium users

payment_link: Union[InternalLinkTypeActiveSessions, InternalLinkTypeAttachmentMenuBot, InternalLinkTypeAuthenticationCode, InternalLinkTypeBackground, InternalLinkTypeBotAddToChannel, InternalLinkTypeBotStart, InternalLinkTypeBotStartInGroup, InternalLinkTypeBusinessChat, InternalLinkTypeBuyStars, InternalLinkTypeChangePhoneNumber, InternalLinkTypeChatAffiliateProgram, InternalLinkTypeChatBoost, InternalLinkTypeChatFolderInvite, InternalLinkTypeChatFolderSettings, InternalLinkTypeChatInvite, InternalLinkTypeDefaultMessageAutoDeleteTimerSettings, InternalLinkTypeDirectMessagesChat, InternalLinkTypeEditProfileSettings, InternalLinkTypeGame, InternalLinkTypeGiftCollection, InternalLinkTypeGroupCall, InternalLinkTypeInstantView, InternalLinkTypeInvoice, InternalLinkTypeLanguagePack, InternalLinkTypeLanguageSettings, InternalLinkTypeMainWebApp, InternalLinkTypeMessage, InternalLinkTypeMessageDraft, InternalLinkTypeMyStars, InternalLinkTypeMyToncoins, InternalLinkTypePassportDataRequest, InternalLinkTypePhoneNumberConfirmation, InternalLinkTypePremiumFeatures, InternalLinkTypePremiumGift, InternalLinkTypePremiumGiftCode, InternalLinkTypePrivacyAndSecuritySettings, InternalLinkTypeProxy, InternalLinkTypePublicChat, InternalLinkTypeQrCodeAuthentication, InternalLinkTypeRestorePurchases, InternalLinkTypeSettings, InternalLinkTypeStickerSet, InternalLinkTypeStory, InternalLinkTypeStoryAlbum, InternalLinkTypeTheme, InternalLinkTypeThemeSettings, InternalLinkTypeUnknownDeepLink, InternalLinkTypeUnsupportedProxy, InternalLinkTypeUpgradedGift, InternalLinkTypeUserPhoneNumber, InternalLinkTypeUserToken, InternalLinkTypeVideoChat, InternalLinkTypeWebApp, None]

An internal link to be opened to pay for Telegram Premium if store payment isn’t possible; may be null if direct payment isn’t available

class pytdbot.types.PremiumGiftCodeInfo(creator_id=None, creation_date=0, is_from_giveaway=False, giveaway_message_id=0, month_count=0, user_id=0, use_date=0)[source]

Bases: TlObject

Contains information about a Telegram Premium gift code

Parameters:
  • creator_id ("types.MessageSender") – Identifier of a chat or a user that created the gift code; may be null if unknown. If null and the code is from messagePremiumGiftCode message, then creator_id from the message can be used

  • creation_date (int) – Point in time (Unix timestamp) when the code was created

  • is_from_giveaway (bool) – True, if the gift code was created for a giveaway

  • giveaway_message_id (int) – Identifier of the corresponding giveaway message in the creator_id chat; can be 0 or an identifier of a deleted message

  • month_count (int) – Number of months the Telegram Premium subscription will be active after code activation

  • user_id (int) – Identifier of a user for which the code was created; 0 if none

  • use_date (int) – Point in time (Unix timestamp) when the code was activated; 0 if none

__init__(creator_id=None, creation_date=0, is_from_giveaway=False, giveaway_message_id=0, month_count=0, user_id=0, use_date=0)[source]
Parameters:
  • creator_id (MessageSender | None)

  • creation_date (int)

  • is_from_giveaway (bool)

  • giveaway_message_id (int)

  • month_count (int)

  • user_id (int)

  • use_date (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumGiftCodeInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumGiftCodeInfo']

classmethod getType()[source]
Return type:

Literal['premiumGiftCodeInfo']

to_dict()[source]
Return type:

dict

creation_date: int

Point in time (Unix timestamp) when the code was created

creator_id: Union[MessageSenderUser, MessageSenderChat, None]

Identifier of a chat or a user that created the gift code; may be null if unknown. If null and the code is from messagePremiumGiftCode message, then creator_id from the message can be used

giveaway_message_id: int

Identifier of the corresponding giveaway message in the creator_id chat; can be 0 or an identifier of a deleted message

is_from_giveaway: bool

True, if the gift code was created for a giveaway

month_count: int

Number of months the Telegram Premium subscription will be active after code activation

use_date: int

Point in time (Unix timestamp) when the code was activated; 0 if none

user_id: int

Identifier of a user for which the code was created; 0 if none

class pytdbot.types.PremiumGiftPaymentOption(currency='', amount=0, star_count=0, discount_percentage=0, month_count=0, store_product_id='', sticker=None)[source]

Bases: TlObject

Describes an option for gifting Telegram Premium to a user. Use telegramPaymentPurposePremiumGift for out-of-store payments or payments in Telegram Stars

Parameters:
  • currency (str) – ISO 4217 currency code for the payment

  • amount (int) – The amount to pay, in the smallest units of the currency

  • star_count (int) – The alternative amount of Telegram Stars to pay; 0 if payment in Telegram Stars is not possible

  • discount_percentage (int) – The discount associated with this option, as a percentage

  • month_count (int) – Number of months the Telegram Premium subscription will be active

  • store_product_id (str) – Identifier of the store product associated with the option

  • sticker ("types.Sticker") – A sticker to be shown along with the option; may be null if unknown

__init__(currency='', amount=0, star_count=0, discount_percentage=0, month_count=0, store_product_id='', sticker=None)[source]
Parameters:
  • currency (str)

  • amount (int)

  • star_count (int)

  • discount_percentage (int)

  • month_count (int)

  • store_product_id (str)

  • sticker (Sticker | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumGiftPaymentOption]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumGiftPaymentOption']

classmethod getType()[source]
Return type:

Literal['premiumGiftPaymentOption']

to_dict()[source]
Return type:

dict

amount: int

The amount to pay, in the smallest units of the currency

currency: Optional[str]

ISO 4217 currency code for the payment

discount_percentage: int

The discount associated with this option, as a percentage

month_count: int

Number of months the Telegram Premium subscription will be active

star_count: int

The alternative amount of Telegram Stars to pay; 0 if payment in Telegram Stars is not possible

sticker: Optional[Sticker]

A sticker to be shown along with the option; may be null if unknown

store_product_id: Optional[str]

Identifier of the store product associated with the option

class pytdbot.types.PremiumGiftPaymentOptions(options=None)[source]

Bases: TlObject

Contains a list of options for gifting Telegram Premium to a user

Parameters:

options (List["types.PremiumGiftPaymentOption"]) – The list of options sorted by Telegram Premium subscription duration

__init__(options=None)[source]
Parameters:

options (List[PremiumGiftPaymentOption] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumGiftPaymentOptions]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumGiftPaymentOptions']

classmethod getType()[source]
Return type:

Literal['premiumGiftPaymentOptions']

to_dict()[source]
Return type:

dict

options: List[PremiumGiftPaymentOption]

The list of options sorted by Telegram Premium subscription duration

class pytdbot.types.PremiumGiveawayPaymentOption(currency='', amount=0, winner_count=0, month_count=0, store_product_id='', store_product_quantity=0)[source]

Bases: TlObject

Describes an option for creating of Telegram Premium giveaway or manual distribution of Telegram Premium among chat members. Use telegramPaymentPurposePremiumGiftCodes or telegramPaymentPurposePremiumGiveaway for out-of-store payments

Parameters:
  • currency (str) – ISO 4217 currency code for Telegram Premium gift code payment

  • amount (int) – The amount to pay, in the smallest units of the currency

  • winner_count (int) – Number of users which will be able to activate the gift codes

  • month_count (int) – Number of months the Telegram Premium subscription will be active

  • store_product_id (str) – Identifier of the store product associated with the option; may be empty if none

  • store_product_quantity (int) – Number of times the store product must be paid

__init__(currency='', amount=0, winner_count=0, month_count=0, store_product_id='', store_product_quantity=0)[source]
Parameters:
  • currency (str)

  • amount (int)

  • winner_count (int)

  • month_count (int)

  • store_product_id (str)

  • store_product_quantity (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumGiveawayPaymentOption]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumGiveawayPaymentOption']

classmethod getType()[source]
Return type:

Literal['premiumGiveawayPaymentOption']

to_dict()[source]
Return type:

dict

amount: int

The amount to pay, in the smallest units of the currency

currency: Optional[str]

ISO 4217 currency code for Telegram Premium gift code payment

month_count: int

Number of months the Telegram Premium subscription will be active

store_product_id: Optional[str]

Identifier of the store product associated with the option; may be empty if none

store_product_quantity: int

Number of times the store product must be paid

winner_count: int

Number of users which will be able to activate the gift codes

class pytdbot.types.PremiumGiveawayPaymentOptions(options=None)[source]

Bases: TlObject

Contains a list of options for creating of Telegram Premium giveaway or manual distribution of Telegram Premium among chat members

Parameters:

options (List["types.PremiumGiveawayPaymentOption"]) – The list of options

__init__(options=None)[source]
Parameters:

options (List[PremiumGiveawayPaymentOption] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumGiveawayPaymentOptions]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumGiveawayPaymentOptions']

classmethod getType()[source]
Return type:

Literal['premiumGiveawayPaymentOptions']

to_dict()[source]
Return type:

dict

options: List[PremiumGiveawayPaymentOption]

The list of options

class pytdbot.types.PremiumLimit(type=None, default_value=0, premium_value=0)[source]

Bases: TlObject

Contains information about a limit, increased for Premium users

Parameters:
  • type ("types.PremiumLimitType") – The type of the limit

  • default_value (int) – Default value of the limit

  • premium_value (int) – Value of the limit for Premium users

__init__(type=None, default_value=0, premium_value=0)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumLimit]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumLimit']

classmethod getType()[source]
Return type:

Literal['premiumLimit']

to_dict()[source]
Return type:

dict

default_value: int

Default value of the limit

premium_value: int

Value of the limit for Premium users

type: Union[PremiumLimitTypeSupergroupCount, PremiumLimitTypePinnedChatCount, PremiumLimitTypeCreatedPublicChatCount, PremiumLimitTypeSavedAnimationCount, PremiumLimitTypeFavoriteStickerCount, PremiumLimitTypeChatFolderCount, PremiumLimitTypeChatFolderChosenChatCount, PremiumLimitTypePinnedArchivedChatCount, PremiumLimitTypePinnedSavedMessagesTopicCount, PremiumLimitTypeCaptionLength, PremiumLimitTypeBioLength, PremiumLimitTypeChatFolderInviteLinkCount, PremiumLimitTypeShareableChatFolderCount, PremiumLimitTypeActiveStoryCount, PremiumLimitTypeWeeklyPostedStoryCount, PremiumLimitTypeMonthlyPostedStoryCount, PremiumLimitTypeStoryCaptionLength, PremiumLimitTypeStorySuggestedReactionAreaCount, PremiumLimitTypeSimilarChatCount, None]

The type of the limit

class pytdbot.types.PremiumLimitType[source]

Bases: object

Describes type of limit, increased for Premium users

class pytdbot.types.PremiumLimitTypeActiveStoryCount[source]

Bases: TlObject, PremiumLimitType

The maximum number of active stories

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumLimitTypeActiveStoryCount]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumLimitType']

classmethod getType()[source]
Return type:

Literal['premiumLimitTypeActiveStoryCount']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumLimitTypeBioLength[source]

Bases: TlObject, PremiumLimitType

The maximum length of the user’s bio

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumLimitTypeBioLength]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumLimitType']

classmethod getType()[source]
Return type:

Literal['premiumLimitTypeBioLength']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumLimitTypeCaptionLength[source]

Bases: TlObject, PremiumLimitType

The maximum length of sent media caption

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumLimitTypeCaptionLength]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumLimitType']

classmethod getType()[source]
Return type:

Literal['premiumLimitTypeCaptionLength']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumLimitTypeChatFolderChosenChatCount[source]

Bases: TlObject, PremiumLimitType

The maximum number of pinned and always included, or always excluded chats in a chat folder

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumLimitTypeChatFolderChosenChatCount]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumLimitType']

classmethod getType()[source]
Return type:

Literal['premiumLimitTypeChatFolderChosenChatCount']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumLimitTypeChatFolderCount[source]

Bases: TlObject, PremiumLimitType

The maximum number of chat folders

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumLimitTypeChatFolderCount]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumLimitType']

classmethod getType()[source]
Return type:

Literal['premiumLimitTypeChatFolderCount']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumLimitTypeChatFolderInviteLinkCount[source]

Bases: TlObject, PremiumLimitType

The maximum number of invite links for a chat folder

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumLimitTypeChatFolderInviteLinkCount]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumLimitType']

classmethod getType()[source]
Return type:

Literal['premiumLimitTypeChatFolderInviteLinkCount']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumLimitTypeCreatedPublicChatCount[source]

Bases: TlObject, PremiumLimitType

The maximum number of created public chats

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumLimitTypeCreatedPublicChatCount]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumLimitType']

classmethod getType()[source]
Return type:

Literal['premiumLimitTypeCreatedPublicChatCount']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumLimitTypeFavoriteStickerCount[source]

Bases: TlObject, PremiumLimitType

The maximum number of favorite stickers

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumLimitTypeFavoriteStickerCount]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumLimitType']

classmethod getType()[source]
Return type:

Literal['premiumLimitTypeFavoriteStickerCount']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumLimitTypeMonthlyPostedStoryCount[source]

Bases: TlObject, PremiumLimitType

The maximum number of stories posted per month

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumLimitTypeMonthlyPostedStoryCount]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumLimitType']

classmethod getType()[source]
Return type:

Literal['premiumLimitTypeMonthlyPostedStoryCount']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumLimitTypePinnedArchivedChatCount[source]

Bases: TlObject, PremiumLimitType

The maximum number of pinned chats in the archive chat list

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumLimitTypePinnedArchivedChatCount]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumLimitType']

classmethod getType()[source]
Return type:

Literal['premiumLimitTypePinnedArchivedChatCount']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumLimitTypePinnedChatCount[source]

Bases: TlObject, PremiumLimitType

The maximum number of pinned chats in the main chat list

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumLimitTypePinnedChatCount]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumLimitType']

classmethod getType()[source]
Return type:

Literal['premiumLimitTypePinnedChatCount']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumLimitTypePinnedSavedMessagesTopicCount[source]

Bases: TlObject, PremiumLimitType

The maximum number of pinned Saved Messages topics

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumLimitTypePinnedSavedMessagesTopicCount]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumLimitType']

classmethod getType()[source]
Return type:

Literal['premiumLimitTypePinnedSavedMessagesTopicCount']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumLimitTypeSavedAnimationCount[source]

Bases: TlObject, PremiumLimitType

The maximum number of saved animations

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumLimitTypeSavedAnimationCount]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumLimitType']

classmethod getType()[source]
Return type:

Literal['premiumLimitTypeSavedAnimationCount']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumLimitTypeShareableChatFolderCount[source]

Bases: TlObject, PremiumLimitType

The maximum number of added shareable chat folders

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumLimitTypeShareableChatFolderCount]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumLimitType']

classmethod getType()[source]
Return type:

Literal['premiumLimitTypeShareableChatFolderCount']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumLimitTypeSimilarChatCount[source]

Bases: TlObject, PremiumLimitType

The maximum number of received similar chats

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumLimitTypeSimilarChatCount]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumLimitType']

classmethod getType()[source]
Return type:

Literal['premiumLimitTypeSimilarChatCount']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumLimitTypeStoryCaptionLength[source]

Bases: TlObject, PremiumLimitType

The maximum length of captions of posted stories

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumLimitTypeStoryCaptionLength]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumLimitType']

classmethod getType()[source]
Return type:

Literal['premiumLimitTypeStoryCaptionLength']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumLimitTypeStorySuggestedReactionAreaCount[source]

Bases: TlObject, PremiumLimitType

The maximum number of suggested reaction areas on a story

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumLimitTypeStorySuggestedReactionAreaCount]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumLimitType']

classmethod getType()[source]
Return type:

Literal['premiumLimitTypeStorySuggestedReactionAreaCount']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumLimitTypeSupergroupCount[source]

Bases: TlObject, PremiumLimitType

The maximum number of joined supergroups and channels

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumLimitTypeSupergroupCount]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumLimitType']

classmethod getType()[source]
Return type:

Literal['premiumLimitTypeSupergroupCount']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumLimitTypeWeeklyPostedStoryCount[source]

Bases: TlObject, PremiumLimitType

The maximum number of stories posted per week

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumLimitTypeWeeklyPostedStoryCount]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumLimitType']

classmethod getType()[source]
Return type:

Literal['premiumLimitTypeWeeklyPostedStoryCount']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumPaymentOption(currency='', amount=0, discount_percentage=0, month_count=0, store_product_id='', payment_link=None)[source]

Bases: TlObject

Describes an option for buying Telegram Premium to a user

Parameters:
  • currency (str) – ISO 4217 currency code for Telegram Premium subscription payment

  • amount (int) – The amount to pay, in the smallest units of the currency

  • discount_percentage (int) – The discount associated with this option, as a percentage

  • month_count (int) – Number of months the Telegram Premium subscription will be active. Use getPremiumInfoSticker to get the sticker to be used as representation of the Telegram Premium subscription

  • store_product_id (str) – Identifier of the store product associated with the option

  • payment_link ("types.InternalLinkType") – An internal link to be opened for buying Telegram Premium to the user if store payment isn’t possible; may be null if direct payment isn’t available

__init__(currency='', amount=0, discount_percentage=0, month_count=0, store_product_id='', payment_link=None)[source]
Parameters:
  • currency (str)

  • amount (int)

  • discount_percentage (int)

  • month_count (int)

  • store_product_id (str)

  • payment_link (InternalLinkType | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumPaymentOption]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumPaymentOption']

classmethod getType()[source]
Return type:

Literal['premiumPaymentOption']

to_dict()[source]
Return type:

dict

amount: int

The amount to pay, in the smallest units of the currency

currency: Optional[str]

ISO 4217 currency code for Telegram Premium subscription payment

discount_percentage: int

The discount associated with this option, as a percentage

month_count: int

Number of months the Telegram Premium subscription will be active. Use getPremiumInfoSticker to get the sticker to be used as representation of the Telegram Premium subscription

payment_link: Union[InternalLinkTypeActiveSessions, InternalLinkTypeAttachmentMenuBot, InternalLinkTypeAuthenticationCode, InternalLinkTypeBackground, InternalLinkTypeBotAddToChannel, InternalLinkTypeBotStart, InternalLinkTypeBotStartInGroup, InternalLinkTypeBusinessChat, InternalLinkTypeBuyStars, InternalLinkTypeChangePhoneNumber, InternalLinkTypeChatAffiliateProgram, InternalLinkTypeChatBoost, InternalLinkTypeChatFolderInvite, InternalLinkTypeChatFolderSettings, InternalLinkTypeChatInvite, InternalLinkTypeDefaultMessageAutoDeleteTimerSettings, InternalLinkTypeDirectMessagesChat, InternalLinkTypeEditProfileSettings, InternalLinkTypeGame, InternalLinkTypeGiftCollection, InternalLinkTypeGroupCall, InternalLinkTypeInstantView, InternalLinkTypeInvoice, InternalLinkTypeLanguagePack, InternalLinkTypeLanguageSettings, InternalLinkTypeMainWebApp, InternalLinkTypeMessage, InternalLinkTypeMessageDraft, InternalLinkTypeMyStars, InternalLinkTypeMyToncoins, InternalLinkTypePassportDataRequest, InternalLinkTypePhoneNumberConfirmation, InternalLinkTypePremiumFeatures, InternalLinkTypePremiumGift, InternalLinkTypePremiumGiftCode, InternalLinkTypePrivacyAndSecuritySettings, InternalLinkTypeProxy, InternalLinkTypePublicChat, InternalLinkTypeQrCodeAuthentication, InternalLinkTypeRestorePurchases, InternalLinkTypeSettings, InternalLinkTypeStickerSet, InternalLinkTypeStory, InternalLinkTypeStoryAlbum, InternalLinkTypeTheme, InternalLinkTypeThemeSettings, InternalLinkTypeUnknownDeepLink, InternalLinkTypeUnsupportedProxy, InternalLinkTypeUpgradedGift, InternalLinkTypeUserPhoneNumber, InternalLinkTypeUserToken, InternalLinkTypeVideoChat, InternalLinkTypeWebApp, None]

An internal link to be opened for buying Telegram Premium to the user if store payment isn’t possible; may be null if direct payment isn’t available

store_product_id: Optional[str]

Identifier of the store product associated with the option

class pytdbot.types.PremiumSource[source]

Bases: object

Describes a source from which the Premium features screen is opened

class pytdbot.types.PremiumSourceBusinessFeature(feature=None)[source]

Bases: TlObject, PremiumSource

A user tried to use a Business feature

Parameters:

feature ("types.BusinessFeature") – The used feature; pass null if none specific feature was used

__init__(feature=None)[source]
Parameters:

feature (BusinessFeature | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumSourceBusinessFeature]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumSource']

classmethod getType()[source]
Return type:

Literal['premiumSourceBusinessFeature']

to_dict()[source]
Return type:

dict

feature: Union[BusinessFeatureLocation, BusinessFeatureOpeningHours, BusinessFeatureQuickReplies, BusinessFeatureGreetingMessage, BusinessFeatureAwayMessage, BusinessFeatureAccountLinks, BusinessFeatureStartPage, BusinessFeatureBots, BusinessFeatureEmojiStatus, BusinessFeatureChatFolderTags, BusinessFeatureUpgradedStories, None]

The used feature; pass null if none specific feature was used

class pytdbot.types.PremiumSourceFeature(feature=None)[source]

Bases: TlObject, PremiumSource

A user tried to use a Premium feature

Parameters:

feature ("types.PremiumFeature") – The used feature

__init__(feature=None)[source]
Parameters:

feature (PremiumFeature | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumSourceFeature]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumSource']

classmethod getType()[source]
Return type:

Literal['premiumSourceFeature']

to_dict()[source]
Return type:

dict

feature: Union[PremiumFeatureIncreasedLimits, PremiumFeatureIncreasedUploadFileSize, PremiumFeatureImprovedDownloadSpeed, PremiumFeatureVoiceRecognition, PremiumFeatureDisabledAds, PremiumFeatureUniqueReactions, PremiumFeatureUniqueStickers, PremiumFeatureCustomEmoji, PremiumFeatureAdvancedChatManagement, PremiumFeatureProfileBadge, PremiumFeatureEmojiStatus, PremiumFeatureAnimatedProfilePhoto, PremiumFeatureForumTopicIcon, PremiumFeatureAppIcons, PremiumFeatureRealTimeChatTranslation, PremiumFeatureUpgradedStories, PremiumFeatureChatBoost, PremiumFeatureAccentColor, PremiumFeatureBackgroundForBoth, PremiumFeatureSavedMessagesTags, PremiumFeatureMessagePrivacy, PremiumFeatureLastSeenTimes, PremiumFeatureBusiness, PremiumFeatureMessageEffects, PremiumFeatureChecklists, None]

The used feature

class pytdbot.types.PremiumSourceLimitExceeded(limit_type=None)[source]

Bases: TlObject, PremiumSource

A limit was exceeded

Parameters:

limit_type ("types.PremiumLimitType") – Type of the exceeded limit

__init__(limit_type=None)[source]
Parameters:

limit_type (PremiumLimitType | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumSourceLimitExceeded]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumSource']

classmethod getType()[source]
Return type:

Literal['premiumSourceLimitExceeded']

to_dict()[source]
Return type:

dict

limit_type: Union[PremiumLimitTypeSupergroupCount, PremiumLimitTypePinnedChatCount, PremiumLimitTypeCreatedPublicChatCount, PremiumLimitTypeSavedAnimationCount, PremiumLimitTypeFavoriteStickerCount, PremiumLimitTypeChatFolderCount, PremiumLimitTypeChatFolderChosenChatCount, PremiumLimitTypePinnedArchivedChatCount, PremiumLimitTypePinnedSavedMessagesTopicCount, PremiumLimitTypeCaptionLength, PremiumLimitTypeBioLength, PremiumLimitTypeChatFolderInviteLinkCount, PremiumLimitTypeShareableChatFolderCount, PremiumLimitTypeActiveStoryCount, PremiumLimitTypeWeeklyPostedStoryCount, PremiumLimitTypeMonthlyPostedStoryCount, PremiumLimitTypeStoryCaptionLength, PremiumLimitTypeStorySuggestedReactionAreaCount, PremiumLimitTypeSimilarChatCount, None]

Type of the exceeded limit

class pytdbot.types.PremiumSourceLink(referrer='')[source]

Bases: TlObject, PremiumSource

A user opened an internal link of the type internalLinkTypePremiumFeatures

Parameters:

referrer (str) – The referrer from the link

__init__(referrer='')[source]
Parameters:

referrer (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumSourceLink]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumSource']

classmethod getType()[source]
Return type:

Literal['premiumSourceLink']

to_dict()[source]
Return type:

dict

referrer: Optional[str]

The referrer from the link

class pytdbot.types.PremiumSourceSettings[source]

Bases: TlObject, PremiumSource

A user opened the Premium features screen from settings

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumSourceSettings]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumSource']

classmethod getType()[source]
Return type:

Literal['premiumSourceSettings']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumSourceStoryFeature(feature=None)[source]

Bases: TlObject, PremiumSource

A user tried to use a Premium story feature

Parameters:

feature ("types.PremiumStoryFeature") – The used feature

__init__(feature=None)[source]
Parameters:

feature (PremiumStoryFeature | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumSourceStoryFeature]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumSource']

classmethod getType()[source]
Return type:

Literal['premiumSourceStoryFeature']

to_dict()[source]
Return type:

dict

feature: Union[PremiumStoryFeaturePriorityOrder, PremiumStoryFeatureStealthMode, PremiumStoryFeaturePermanentViewsHistory, PremiumStoryFeatureCustomExpirationDuration, PremiumStoryFeatureSaveStories, PremiumStoryFeatureLinksAndFormatting, PremiumStoryFeatureVideoQuality, None]

The used feature

class pytdbot.types.PremiumState(state=None, payment_options=None, animations=None, business_animations=None)[source]

Bases: TlObject

Contains state of Telegram Premium subscription and promotion videos for Premium features

Parameters:
  • state ("types.FormattedText") – Text description of the state of the current Premium subscription; may be empty if the current user has no Telegram Premium subscription

  • payment_options (List["types.PremiumStatePaymentOption"]) – The list of available options for buying Telegram Premium

  • animations (List["types.PremiumFeaturePromotionAnimation"]) – The list of available promotion animations for Premium features

  • business_animations (List["types.BusinessFeaturePromotionAnimation"]) – The list of available promotion animations for Business features

__init__(state=None, payment_options=None, animations=None, business_animations=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumState]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumState']

classmethod getType()[source]
Return type:

Literal['premiumState']

to_dict()[source]
Return type:

dict

animations: List[PremiumFeaturePromotionAnimation]

The list of available promotion animations for Premium features

business_animations: List[BusinessFeaturePromotionAnimation]

The list of available promotion animations for Business features

payment_options: List[PremiumStatePaymentOption]

The list of available options for buying Telegram Premium

state: Optional[FormattedText]

Text description of the state of the current Premium subscription; may be empty if the current user has no Telegram Premium subscription

class pytdbot.types.PremiumStatePaymentOption(payment_option=None, is_current=False, is_upgrade=False, last_transaction_id='')[source]

Bases: TlObject

Describes an option for buying or upgrading Telegram Premium for self

Parameters:
  • payment_option ("types.PremiumPaymentOption") – Information about the payment option

  • is_current (bool) – True, if this is the currently used Telegram Premium subscription option

  • is_upgrade (bool) – True, if the payment option can be used to upgrade the existing Telegram Premium subscription

  • last_transaction_id (str) – Identifier of the last in-store transaction for the currently used option

__init__(payment_option=None, is_current=False, is_upgrade=False, last_transaction_id='')[source]
Parameters:
  • payment_option (PremiumPaymentOption | None)

  • is_current (bool)

  • is_upgrade (bool)

  • last_transaction_id (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumStatePaymentOption]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumStatePaymentOption']

classmethod getType()[source]
Return type:

Literal['premiumStatePaymentOption']

to_dict()[source]
Return type:

dict

is_current: bool

True, if this is the currently used Telegram Premium subscription option

is_upgrade: bool

True, if the payment option can be used to upgrade the existing Telegram Premium subscription

last_transaction_id: Optional[str]

Identifier of the last in-store transaction for the currently used option

payment_option: Optional[PremiumPaymentOption]

Information about the payment option

class pytdbot.types.PremiumStoryFeature[source]

Bases: object

Describes a story feature available to Premium users

class pytdbot.types.PremiumStoryFeatureCustomExpirationDuration[source]

Bases: TlObject, PremiumStoryFeature

The ability to set custom expiration duration for stories

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumStoryFeatureCustomExpirationDuration]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumStoryFeature']

classmethod getType()[source]
Return type:

Literal['premiumStoryFeatureCustomExpirationDuration']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumStoryFeatureLinksAndFormatting[source]

Bases: TlObject, PremiumStoryFeature

The ability to use links and formatting in story caption, and use inputStoryAreaTypeLink areas

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumStoryFeatureLinksAndFormatting]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumStoryFeature']

classmethod getType()[source]
Return type:

Literal['premiumStoryFeatureLinksAndFormatting']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumStoryFeaturePermanentViewsHistory[source]

Bases: TlObject, PremiumStoryFeature

The ability to check who opened the current user’s stories after they expire

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumStoryFeaturePermanentViewsHistory]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumStoryFeature']

classmethod getType()[source]
Return type:

Literal['premiumStoryFeaturePermanentViewsHistory']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumStoryFeaturePriorityOrder[source]

Bases: TlObject, PremiumStoryFeature

Stories of the current user are displayed before stories of non-Premium contacts, supergroups, and channels

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumStoryFeaturePriorityOrder]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumStoryFeature']

classmethod getType()[source]
Return type:

Literal['premiumStoryFeaturePriorityOrder']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumStoryFeatureSaveStories[source]

Bases: TlObject, PremiumStoryFeature

The ability to save other’s unprotected stories

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumStoryFeatureSaveStories]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumStoryFeature']

classmethod getType()[source]
Return type:

Literal['premiumStoryFeatureSaveStories']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumStoryFeatureStealthMode[source]

Bases: TlObject, PremiumStoryFeature

The ability to hide the fact that the user viewed other’s stories

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumStoryFeatureStealthMode]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumStoryFeature']

classmethod getType()[source]
Return type:

Literal['premiumStoryFeatureStealthMode']

to_dict()[source]
Return type:

dict

class pytdbot.types.PremiumStoryFeatureVideoQuality[source]

Bases: TlObject, PremiumStoryFeature

The ability to choose better quality for viewed stories

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PremiumStoryFeatureVideoQuality]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PremiumStoryFeature']

classmethod getType()[source]
Return type:

Literal['premiumStoryFeatureVideoQuality']

to_dict()[source]
Return type:

dict

class pytdbot.types.PrepaidGiveaway(id=0, winner_count=0, prize=None, boost_count=0, payment_date=0)[source]

Bases: TlObject

Describes a prepaid giveaway

Parameters:
  • id (int) – Unique identifier of the prepaid giveaway

  • winner_count (int) – Number of users which will receive giveaway prize

  • prize ("types.GiveawayPrize") – Prize of the giveaway

  • boost_count (int) – The number of boosts received by the chat from the giveaway; for Telegram Star giveaways only

  • payment_date (int) – Point in time (Unix timestamp) when the giveaway was paid

__init__(id=0, winner_count=0, prize=None, boost_count=0, payment_date=0)[source]
Parameters:
  • id (int)

  • winner_count (int)

  • prize (GiveawayPrize | None)

  • boost_count (int)

  • payment_date (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PrepaidGiveaway]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PrepaidGiveaway']

classmethod getType()[source]
Return type:

Literal['prepaidGiveaway']

to_dict()[source]
Return type:

dict

boost_count: int

The number of boosts received by the chat from the giveaway; for Telegram Star giveaways only

id: int

Unique identifier of the prepaid giveaway

payment_date: int

Point in time (Unix timestamp) when the giveaway was paid

prize: Union[GiveawayPrizePremium, GiveawayPrizeStars, None]

Prize of the giveaway

winner_count: int

Number of users which will receive giveaway prize

class pytdbot.types.PreparedInlineMessage(inline_query_id=0, result=None, chat_types=None)[source]

Bases: TlObject

Represents a ready to send inline message. Use sendInlineQueryResultMessage to send the message

Parameters:
  • inline_query_id (int) – Unique identifier of the inline query to pass to sendInlineQueryResultMessage

  • result ("types.InlineQueryResult") – Resulted inline message of the query

  • chat_types ("types.TargetChatTypes") – Types of the chats to which the message can be sent

__init__(inline_query_id=0, result=None, chat_types=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PreparedInlineMessage]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PreparedInlineMessage']

classmethod getType()[source]
Return type:

Literal['preparedInlineMessage']

to_dict()[source]
Return type:

dict

chat_types: Optional[TargetChatTypes]

Types of the chats to which the message can be sent

inline_query_id: int

Unique identifier of the inline query to pass to sendInlineQueryResultMessage

result: Union[InlineQueryResultArticle, InlineQueryResultContact, InlineQueryResultLocation, InlineQueryResultVenue, InlineQueryResultGame, InlineQueryResultAnimation, InlineQueryResultAudio, InlineQueryResultDocument, InlineQueryResultPhoto, InlineQueryResultSticker, InlineQueryResultVideo, InlineQueryResultVoiceNote, None]

Resulted inline message of the query

class pytdbot.types.PreparedInlineMessageId(id='', expiration_date=0)[source]

Bases: TlObject

Represents an inline message that can be sent via the bot

Parameters:
  • id (str) – Unique identifier for the message

  • expiration_date (int) – Point in time (Unix timestamp) when the message can’t be used anymore

__init__(id='', expiration_date=0)[source]
Parameters:
  • id (str)

  • expiration_date (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PreparedInlineMessageId]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PreparedInlineMessageId']

classmethod getType()[source]
Return type:

Literal['preparedInlineMessageId']

to_dict()[source]
Return type:

dict

expiration_date: int

Point in time (Unix timestamp) when the message can’t be used anymore

id: Optional[str]

Unique identifier for the message

class pytdbot.types.ProductInfo(title='', description=None, photo=None)[source]

Bases: TlObject

Contains information about a product that can be paid with invoice

Parameters:
  • title (str) – Product title

  • description ("types.FormattedText") – Product description

  • photo ("types.Photo") – Product photo; may be null

__init__(title='', description=None, photo=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ProductInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ProductInfo']

classmethod getType()[source]
Return type:

Literal['productInfo']

to_dict()[source]
Return type:

dict

description: Optional[FormattedText]

Product description

photo: Optional[Photo]

Product photo; may be null

title: Optional[str]

Product title

class pytdbot.types.ProfileAccentColor(id=0, light_theme_colors=None, dark_theme_colors=None, min_supergroup_chat_boost_level=0, min_channel_chat_boost_level=0)[source]

Bases: TlObject

Contains information about supported accent color for user profile photo background

Parameters:
  • id (int) – Profile accent color identifier

  • light_theme_colors ("types.ProfileAccentColors") – Accent colors expected to be used in light themes

  • dark_theme_colors ("types.ProfileAccentColors") – Accent colors expected to be used in dark themes

  • min_supergroup_chat_boost_level (int) – The minimum chat boost level required to use the color in a supergroup chat

  • min_channel_chat_boost_level (int) – The minimum chat boost level required to use the color in a channel chat

__init__(id=0, light_theme_colors=None, dark_theme_colors=None, min_supergroup_chat_boost_level=0, min_channel_chat_boost_level=0)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ProfileAccentColor]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ProfileAccentColor']

classmethod getType()[source]
Return type:

Literal['profileAccentColor']

to_dict()[source]
Return type:

dict

dark_theme_colors: Optional[ProfileAccentColors]

Accent colors expected to be used in dark themes

id: int

Profile accent color identifier

light_theme_colors: Optional[ProfileAccentColors]

Accent colors expected to be used in light themes

min_channel_chat_boost_level: int

The minimum chat boost level required to use the color in a channel chat

min_supergroup_chat_boost_level: int

The minimum chat boost level required to use the color in a supergroup chat

class pytdbot.types.ProfileAccentColors(palette_colors=None, background_colors=None, story_colors=None)[source]

Bases: TlObject

Contains information about supported accent colors for user profile photo background in RGB format

Parameters:
  • palette_colors (List[int]) – The list of 1-2 colors in RGB format, describing the colors, as expected to be shown in the color palette settings

  • background_colors (List[int]) – The list of 1-2 colors in RGB format, describing the colors, as expected to be used for the profile photo background

  • story_colors (List[int]) – The list of 2 colors in RGB format, describing the colors of the gradient to be used for the unread active story indicator around profile photo

__init__(palette_colors=None, background_colors=None, story_colors=None)[source]
Parameters:
  • palette_colors (List[int] | None)

  • background_colors (List[int] | None)

  • story_colors (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ProfileAccentColors]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ProfileAccentColors']

classmethod getType()[source]
Return type:

Literal['profileAccentColors']

to_dict()[source]
Return type:

dict

background_colors: List[int]

The list of 1-2 colors in RGB format, describing the colors, as expected to be used for the profile photo background

palette_colors: List[int]

The list of 1-2 colors in RGB format, describing the colors, as expected to be shown in the color palette settings

story_colors: List[int]

The list of 2 colors in RGB format, describing the colors of the gradient to be used for the unread active story indicator around profile photo

class pytdbot.types.ProfilePhoto(id=0, small=None, big=None, minithumbnail=None, has_animation=False, is_personal=False)[source]

Bases: TlObject

Describes a user profile photo

Parameters:
  • id (int) – Photo identifier; 0 for an empty photo. Can be used to find a photo in a list of user profile photos

  • small ("types.File") – A small (160x160) user profile photo. The file can be downloaded only before the photo is changed

  • big ("types.File") – A big (640x640) user profile photo. The file can be downloaded only before the photo is changed

  • minithumbnail ("types.Minithumbnail") – User profile photo minithumbnail; may be null

  • has_animation (bool) – True, if the photo has animated variant

  • is_personal (bool) – True, if the photo is visible only for the current user

__init__(id=0, small=None, big=None, minithumbnail=None, has_animation=False, is_personal=False)[source]
Parameters:
  • id (int)

  • small (File | None)

  • big (File | None)

  • minithumbnail (Minithumbnail | None)

  • has_animation (bool)

  • is_personal (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ProfilePhoto]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ProfilePhoto']

classmethod getType()[source]
Return type:

Literal['profilePhoto']

to_dict()[source]
Return type:

dict

big: Optional[File]

A big (640x640) user profile photo. The file can be downloaded only before the photo is changed

has_animation: bool

True, if the photo has animated variant

id: int

Photo identifier; 0 for an empty photo. Can be used to find a photo in a list of user profile photos

is_personal: bool

True, if the photo is visible only for the current user

minithumbnail: Optional[Minithumbnail]

User profile photo minithumbnail; may be null

small: Optional[File]

A small (160x160) user profile photo. The file can be downloaded only before the photo is changed

class pytdbot.types.ProfileTab[source]

Bases: object

Describes a tab shown in a user or a chat profile

class pytdbot.types.ProfileTabFiles[source]

Bases: TlObject, ProfileTab

A tab with documents posted by the channel

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ProfileTabFiles]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ProfileTab']

classmethod getType()[source]
Return type:

Literal['profileTabFiles']

to_dict()[source]
Return type:

dict

class pytdbot.types.ProfileTabGifs[source]

Bases: TlObject, ProfileTab

A tab with animations posted by the channel

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ProfileTabGifs]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ProfileTab']

classmethod getType()[source]
Return type:

Literal['profileTabGifs']

to_dict()[source]
Return type:

dict

class pytdbot.types.ProfileTabGifts[source]

Bases: TlObject, ProfileTab

A tab with gifts received by the user or the channel chat

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ProfileTabGifts]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ProfileTab']

classmethod getType()[source]
Return type:

Literal['profileTabGifts']

to_dict()[source]
Return type:

dict

class pytdbot.types.ProfileTabLinks[source]

Bases: TlObject, ProfileTab

A tab with messages posted by the channel and containing links

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ProfileTabLinks]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ProfileTab']

classmethod getType()[source]
Return type:

Literal['profileTabLinks']

to_dict()[source]
Return type:

dict

class pytdbot.types.ProfileTabMedia[source]

Bases: TlObject, ProfileTab

A tab with photos and videos posted by the channel

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ProfileTabMedia]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ProfileTab']

classmethod getType()[source]
Return type:

Literal['profileTabMedia']

to_dict()[source]
Return type:

dict

class pytdbot.types.ProfileTabMusic[source]

Bases: TlObject, ProfileTab

A tab with audio messages posted by the channel

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ProfileTabMusic]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ProfileTab']

classmethod getType()[source]
Return type:

Literal['profileTabMusic']

to_dict()[source]
Return type:

dict

class pytdbot.types.ProfileTabPosts[source]

Bases: TlObject, ProfileTab

A tab with stories posted by the user or the channel chat and saved to profile

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ProfileTabPosts]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ProfileTab']

classmethod getType()[source]
Return type:

Literal['profileTabPosts']

to_dict()[source]
Return type:

dict

class pytdbot.types.ProfileTabVoice[source]

Bases: TlObject, ProfileTab

A tab with voice notes posted by the channel

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ProfileTabVoice]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ProfileTab']

classmethod getType()[source]
Return type:

Literal['profileTabVoice']

to_dict()[source]
Return type:

dict

class pytdbot.types.Proxies(proxies=None)[source]

Bases: TlObject

Represents a list of proxy servers

Parameters:

proxies (List["types.Proxy"]) – List of proxy servers

__init__(proxies=None)[source]
Parameters:

proxies (List[Proxy] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Proxies]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Proxies']

classmethod getType()[source]
Return type:

Literal['proxies']

to_dict()[source]
Return type:

dict

proxies: List[Proxy]

List of proxy servers

class pytdbot.types.Proxy(id=0, server='', port=0, last_used_date=0, is_enabled=False, type=None)[source]

Bases: TlObject

Contains information about a proxy server

Parameters:
  • id (int) – Unique identifier of the proxy

  • server (str) – Proxy server domain or IP address

  • port (int) – Proxy server port

  • last_used_date (int) – Point in time (Unix timestamp) when the proxy was last used; 0 if never

  • is_enabled (bool) – True, if the proxy is enabled now

  • type ("types.ProxyType") – Type of the proxy

__init__(id=0, server='', port=0, last_used_date=0, is_enabled=False, type=None)[source]
Parameters:
  • id (int)

  • server (str)

  • port (int)

  • last_used_date (int)

  • is_enabled (bool)

  • type (ProxyType | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Proxy]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Proxy']

classmethod getType()[source]
Return type:

Literal['proxy']

to_dict()[source]
Return type:

dict

id: int

Unique identifier of the proxy

is_enabled: bool

True, if the proxy is enabled now

last_used_date: int

Point in time (Unix timestamp) when the proxy was last used; 0 if never

port: int

Proxy server port

server: Optional[str]

Proxy server domain or IP address

type: Union[ProxyTypeSocks5, ProxyTypeHttp, ProxyTypeMtproto, None]

Type of the proxy

class pytdbot.types.ProxyType[source]

Bases: object

Describes the type of proxy server

class pytdbot.types.ProxyTypeHttp(username='', password='', http_only=False)[source]

Bases: TlObject, ProxyType

A HTTP transparent proxy server

Parameters:
  • username (str) – Username for logging in; may be empty

  • password (str) – Password for logging in; may be empty

  • http_only (bool) – Pass true if the proxy supports only HTTP requests and doesn’t support transparent TCP connections via HTTP CONNECT method

__init__(username='', password='', http_only=False)[source]
Parameters:
  • username (str)

  • password (str)

  • http_only (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ProxyTypeHttp]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ProxyType']

classmethod getType()[source]
Return type:

Literal['proxyTypeHttp']

to_dict()[source]
Return type:

dict

http_only: bool

Pass true if the proxy supports only HTTP requests and doesn’t support transparent TCP connections via HTTP CONNECT method

password: Optional[str]

Password for logging in; may be empty

username: Optional[str]

Username for logging in; may be empty

class pytdbot.types.ProxyTypeMtproto(secret='')[source]

Bases: TlObject, ProxyType

An MTProto proxy server

Parameters:

secret (str) – The proxy’s secret in hexadecimal encoding

__init__(secret='')[source]
Parameters:

secret (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ProxyTypeMtproto]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ProxyType']

classmethod getType()[source]
Return type:

Literal['proxyTypeMtproto']

to_dict()[source]
Return type:

dict

secret: Optional[str]

The proxy’s secret in hexadecimal encoding

class pytdbot.types.ProxyTypeSocks5(username='', password='')[source]

Bases: TlObject, ProxyType

A SOCKS5 proxy server

Parameters:
  • username (str) – Username for logging in; may be empty

  • password (str) – Password for logging in; may be empty

__init__(username='', password='')[source]
Parameters:
  • username (str)

  • password (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ProxyTypeSocks5]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ProxyType']

classmethod getType()[source]
Return type:

Literal['proxyTypeSocks5']

to_dict()[source]
Return type:

dict

password: Optional[str]

Password for logging in; may be empty

username: Optional[str]

Username for logging in; may be empty

class pytdbot.types.PublicChatType[source]

Bases: object

Describes type of public chat

class pytdbot.types.PublicChatTypeHasUsername[source]

Bases: TlObject, PublicChatType

The chat is public, because it has an active username

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PublicChatTypeHasUsername]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PublicChatType']

classmethod getType()[source]
Return type:

Literal['publicChatTypeHasUsername']

to_dict()[source]
Return type:

dict

class pytdbot.types.PublicChatTypeIsLocationBased[source]

Bases: TlObject, PublicChatType

The chat is public, because it is a location-based supergroup

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PublicChatTypeIsLocationBased]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PublicChatType']

classmethod getType()[source]
Return type:

Literal['publicChatTypeIsLocationBased']

to_dict()[source]
Return type:

dict

class pytdbot.types.PublicForward[source]

Bases: object

Describes a public forward or repost of a story

class pytdbot.types.PublicForwardMessage(message=None)[source]

Bases: TlObject, PublicForward

Contains a public forward as a message

Parameters:

message ("types.Message") – Information about the message

__init__(message=None)[source]
Parameters:

message (Message | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PublicForwardMessage]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PublicForward']

classmethod getType()[source]
Return type:

Literal['publicForwardMessage']

to_dict()[source]
Return type:

dict

message: Optional[Message]

Information about the message

class pytdbot.types.PublicForwardStory(story=None)[source]

Bases: TlObject, PublicForward

Contains a public repost to a story

Parameters:

story ("types.Story") – Information about the story

__init__(story=None)[source]
Parameters:

story (Story | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PublicForwardStory]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PublicForward']

classmethod getType()[source]
Return type:

Literal['publicForwardStory']

to_dict()[source]
Return type:

dict

story: Optional[Story]

Information about the story

class pytdbot.types.PublicForwards(total_count=0, forwards=None, next_offset='')[source]

Bases: TlObject

Represents a list of public forwards and reposts as a story of a message or a story

Parameters:
  • total_count (int) – Approximate total number of messages and stories found

  • forwards (List["types.PublicForward"]) – List of found public forwards and reposts

  • next_offset (str) – The offset for the next request. If empty, then there are no more results

__init__(total_count=0, forwards=None, next_offset='')[source]
Parameters:
  • total_count (int)

  • forwards (List[PublicForward] | None)

  • next_offset (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PublicForwards]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PublicForwards']

classmethod getType()[source]
Return type:

Literal['publicForwards']

to_dict()[source]
Return type:

dict

forwards: List[PublicForward]

List of found public forwards and reposts

next_offset: Optional[str]

The offset for the next request. If empty, then there are no more results

total_count: int

Approximate total number of messages and stories found

class pytdbot.types.PublicPostSearchLimits(daily_free_query_count=0, remaining_free_query_count=0, next_free_query_in=0, star_count=0, is_current_query_free=False)[source]

Bases: TlObject

Contains information about public post search limits

Parameters:
  • daily_free_query_count (int) – Number of queries that can be sent daily for free

  • remaining_free_query_count (int) – Number of remaining free queries today

  • next_free_query_in (int) – Amount of time till the next free query can be sent; 0 if it can be sent now

  • star_count (int) – Number of Telegram Stars that must be paid for each non-free query

  • is_current_query_free (bool) – True, if the search for the specified query isn’t charged

__init__(daily_free_query_count=0, remaining_free_query_count=0, next_free_query_in=0, star_count=0, is_current_query_free=False)[source]
Parameters:
  • daily_free_query_count (int)

  • remaining_free_query_count (int)

  • next_free_query_in (int)

  • star_count (int)

  • is_current_query_free (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PublicPostSearchLimits]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PublicPostSearchLimits']

classmethod getType()[source]
Return type:

Literal['publicPostSearchLimits']

to_dict()[source]
Return type:

dict

daily_free_query_count: int

Number of queries that can be sent daily for free

is_current_query_free: bool

True, if the search for the specified query isn’t charged

next_free_query_in: int

Amount of time till the next free query can be sent; 0 if it can be sent now

remaining_free_query_count: int

Number of remaining free queries today

star_count: int

Number of Telegram Stars that must be paid for each non-free query

class pytdbot.types.PushMessageContent[source]

Bases: object

Contains content of a push message notification

class pytdbot.types.PushMessageContentAnimation(animation=None, caption='', is_pinned=False)[source]

Bases: TlObject, PushMessageContent

An animation message (GIF-style).

Parameters:
  • animation ("types.Animation") – Message content; may be null

  • caption (str) – Animation caption

  • is_pinned (bool) – True, if the message is a pinned message with the specified content

__init__(animation=None, caption='', is_pinned=False)[source]
Parameters:
  • animation (Animation | None)

  • caption (str)

  • is_pinned (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentAnimation]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentAnimation']

to_dict()[source]
Return type:

dict

animation: Optional[Animation]

Message content; may be null

caption: Optional[str]

Animation caption

is_pinned: bool

True, if the message is a pinned message with the specified content

class pytdbot.types.PushMessageContentAudio(audio=None, is_pinned=False)[source]

Bases: TlObject, PushMessageContent

An audio message

Parameters:
  • audio ("types.Audio") – Message content; may be null

  • is_pinned (bool) – True, if the message is a pinned message with the specified content

__init__(audio=None, is_pinned=False)[source]
Parameters:
  • audio (Audio | None)

  • is_pinned (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentAudio]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentAudio']

to_dict()[source]
Return type:

dict

audio: Optional[Audio]

Message content; may be null

is_pinned: bool

True, if the message is a pinned message with the specified content

class pytdbot.types.PushMessageContentBasicGroupChatCreate[source]

Bases: TlObject, PushMessageContent

A newly created basic group

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentBasicGroupChatCreate]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentBasicGroupChatCreate']

to_dict()[source]
Return type:

dict

class pytdbot.types.PushMessageContentChatAddMembers(member_name='', is_current_user=False, is_returned=False)[source]

Bases: TlObject, PushMessageContent

New chat members were invited to a group

Parameters:
  • member_name (str) – Name of the added member

  • is_current_user (bool) – True, if the current user was added to the group

  • is_returned (bool) – True, if the user has returned to the group themselves

__init__(member_name='', is_current_user=False, is_returned=False)[source]
Parameters:
  • member_name (str)

  • is_current_user (bool)

  • is_returned (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentChatAddMembers]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentChatAddMembers']

to_dict()[source]
Return type:

dict

is_current_user: bool

True, if the current user was added to the group

is_returned: bool

True, if the user has returned to the group themselves

member_name: Optional[str]

Name of the added member

class pytdbot.types.PushMessageContentChatChangePhoto[source]

Bases: TlObject, PushMessageContent

A chat photo was edited

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentChatChangePhoto]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentChatChangePhoto']

to_dict()[source]
Return type:

dict

class pytdbot.types.PushMessageContentChatChangeTitle(title='')[source]

Bases: TlObject, PushMessageContent

A chat title was edited

Parameters:

title (str) – New chat title

__init__(title='')[source]
Parameters:

title (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentChatChangeTitle]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentChatChangeTitle']

to_dict()[source]
Return type:

dict

title: Optional[str]

New chat title

class pytdbot.types.PushMessageContentChatDeleteMember(member_name='', is_current_user=False, is_left=False)[source]

Bases: TlObject, PushMessageContent

A chat member was deleted

Parameters:
  • member_name (str) – Name of the deleted member

  • is_current_user (bool) – True, if the current user was deleted from the group

  • is_left (bool) – True, if the user has left the group themselves

__init__(member_name='', is_current_user=False, is_left=False)[source]
Parameters:
  • member_name (str)

  • is_current_user (bool)

  • is_left (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentChatDeleteMember]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentChatDeleteMember']

to_dict()[source]
Return type:

dict

is_current_user: bool

True, if the current user was deleted from the group

is_left: bool

True, if the user has left the group themselves

member_name: Optional[str]

Name of the deleted member

class pytdbot.types.PushMessageContentChatJoinByLink[source]

Bases: TlObject, PushMessageContent

A new member joined the chat via an invite link

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentChatJoinByLink]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentChatJoinByLink']

to_dict()[source]
Return type:

dict

class pytdbot.types.PushMessageContentChatJoinByRequest[source]

Bases: TlObject, PushMessageContent

A new member was accepted to the chat by an administrator

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentChatJoinByRequest]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentChatJoinByRequest']

to_dict()[source]
Return type:

dict

class pytdbot.types.PushMessageContentChatSetBackground(is_same=False)[source]

Bases: TlObject, PushMessageContent

A chat background was edited

Parameters:

is_same (bool) – True, if the set background is the same as the background of the current user

__init__(is_same=False)[source]
Parameters:

is_same (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentChatSetBackground]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentChatSetBackground']

to_dict()[source]
Return type:

dict

is_same: bool

True, if the set background is the same as the background of the current user

class pytdbot.types.PushMessageContentChatSetTheme(name='')[source]

Bases: TlObject, PushMessageContent

A chat theme was edited

Parameters:

name (str) – If non-empty, human-readable name of the new theme. Otherwise, the chat theme was reset to the default one

__init__(name='')[source]
Parameters:

name (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentChatSetTheme]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentChatSetTheme']

to_dict()[source]
Return type:

dict

name: Optional[str]

If non-empty, human-readable name of the new theme. Otherwise, the chat theme was reset to the default one

class pytdbot.types.PushMessageContentChecklist(title='', is_pinned=False)[source]

Bases: TlObject, PushMessageContent

A message with a checklist

Parameters:
  • title (str) – Checklist title

  • is_pinned (bool) – True, if the message is a pinned message with the specified content

__init__(title='', is_pinned=False)[source]
Parameters:
  • title (str)

  • is_pinned (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentChecklist]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentChecklist']

to_dict()[source]
Return type:

dict

is_pinned: bool

True, if the message is a pinned message with the specified content

title: Optional[str]

Checklist title

class pytdbot.types.PushMessageContentChecklistTasksAdded(task_count=0)[source]

Bases: TlObject, PushMessageContent

Some tasks were added to a checklist

Parameters:

task_count (int) – Number of added tasks

__init__(task_count=0)[source]
Parameters:

task_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentChecklistTasksAdded]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentChecklistTasksAdded']

to_dict()[source]
Return type:

dict

task_count: int

Number of added tasks

class pytdbot.types.PushMessageContentChecklistTasksDone(task_count=0)[source]

Bases: TlObject, PushMessageContent

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

Parameters:

task_count (int) – Number of changed tasks

__init__(task_count=0)[source]
Parameters:

task_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentChecklistTasksDone]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentChecklistTasksDone']

to_dict()[source]
Return type:

dict

task_count: int

Number of changed tasks

class pytdbot.types.PushMessageContentContact(name='', is_pinned=False)[source]

Bases: TlObject, PushMessageContent

A message with a user contact

Parameters:
  • name (str) – Contact’s name

  • is_pinned (bool) – True, if the message is a pinned message with the specified content

__init__(name='', is_pinned=False)[source]
Parameters:
  • name (str)

  • is_pinned (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentContact]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentContact']

to_dict()[source]
Return type:

dict

is_pinned: bool

True, if the message is a pinned message with the specified content

name: Optional[str]

Contact’s name

class pytdbot.types.PushMessageContentContactRegistered(as_premium_account=False)[source]

Bases: TlObject, PushMessageContent

A contact has registered with Telegram

Parameters:

as_premium_account (bool) – True, if the user joined Telegram as a Telegram Premium account

__init__(as_premium_account=False)[source]
Parameters:

as_premium_account (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentContactRegistered]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentContactRegistered']

to_dict()[source]
Return type:

dict

as_premium_account: bool

True, if the user joined Telegram as a Telegram Premium account

class pytdbot.types.PushMessageContentDocument(document=None, is_pinned=False)[source]

Bases: TlObject, PushMessageContent

A document message (a general file)

Parameters:
  • document ("types.Document") – Message content; may be null

  • is_pinned (bool) – True, if the message is a pinned message with the specified content

__init__(document=None, is_pinned=False)[source]
Parameters:
  • document (Document | None)

  • is_pinned (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentDocument]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentDocument']

to_dict()[source]
Return type:

dict

document: Optional[Document]

Message content; may be null

is_pinned: bool

True, if the message is a pinned message with the specified content

class pytdbot.types.PushMessageContentGame(title='', is_pinned=False)[source]

Bases: TlObject, PushMessageContent

A message with a game

Parameters:
  • title (str) – Game title, empty for pinned game message

  • is_pinned (bool) – True, if the message is a pinned message with the specified content

__init__(title='', is_pinned=False)[source]
Parameters:
  • title (str)

  • is_pinned (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentGame]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentGame']

to_dict()[source]
Return type:

dict

is_pinned: bool

True, if the message is a pinned message with the specified content

title: Optional[str]

Game title, empty for pinned game message

class pytdbot.types.PushMessageContentGameScore(title='', score=0, is_pinned=False)[source]

Bases: TlObject, PushMessageContent

A new high score was achieved in a game

Parameters:
  • title (str) – Game title, empty for pinned message

  • score (int) – New score, 0 for pinned message

  • is_pinned (bool) – True, if the message is a pinned message with the specified content

__init__(title='', score=0, is_pinned=False)[source]
Parameters:
  • title (str)

  • score (int)

  • is_pinned (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentGameScore]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentGameScore']

to_dict()[source]
Return type:

dict

is_pinned: bool

True, if the message is a pinned message with the specified content

score: int

New score, 0 for pinned message

title: Optional[str]

Game title, empty for pinned message

class pytdbot.types.PushMessageContentGift(star_count=0, is_prepaid_upgrade=False)[source]

Bases: TlObject, PushMessageContent

A message with a gift

Parameters:
  • star_count (int) – Number of Telegram Stars that sender paid for the gift

  • is_prepaid_upgrade (bool) – True, if the message is about prepaid upgrade of the gift by another user instead of actual receiving of a new gift

__init__(star_count=0, is_prepaid_upgrade=False)[source]
Parameters:
  • star_count (int)

  • is_prepaid_upgrade (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentGift]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentGift']

to_dict()[source]
Return type:

dict

is_prepaid_upgrade: bool

True, if the message is about prepaid upgrade of the gift by another user instead of actual receiving of a new gift

star_count: int

Number of Telegram Stars that sender paid for the gift

class pytdbot.types.PushMessageContentGiveaway(winner_count=0, prize=None, is_pinned=False)[source]

Bases: TlObject, PushMessageContent

A message with a giveaway

Parameters:
  • winner_count (int) – Number of users which will receive giveaway prizes; 0 for pinned message

  • prize ("types.GiveawayPrize") – Prize of the giveaway; may be null for pinned message

  • is_pinned (bool) – True, if the message is a pinned message with the specified content

__init__(winner_count=0, prize=None, is_pinned=False)[source]
Parameters:
  • winner_count (int)

  • prize (GiveawayPrize | None)

  • is_pinned (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentGiveaway]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentGiveaway']

to_dict()[source]
Return type:

dict

is_pinned: bool

True, if the message is a pinned message with the specified content

prize: Union[GiveawayPrizePremium, GiveawayPrizeStars, None]

Prize of the giveaway; may be null for pinned message

winner_count: int

Number of users which will receive giveaway prizes; 0 for pinned message

class pytdbot.types.PushMessageContentHidden(is_pinned=False)[source]

Bases: TlObject, PushMessageContent

A general message with hidden content

Parameters:

is_pinned (bool) – True, if the message is a pinned message with the specified content

__init__(is_pinned=False)[source]
Parameters:

is_pinned (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentHidden]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentHidden']

to_dict()[source]
Return type:

dict

is_pinned: bool

True, if the message is a pinned message with the specified content

class pytdbot.types.PushMessageContentInviteVideoChatParticipants(is_current_user=False)[source]

Bases: TlObject, PushMessageContent

An invitation of participants to a video chat or live stream

Parameters:

is_current_user (bool) – True, if the current user was invited to the video chat or the live stream

__init__(is_current_user=False)[source]
Parameters:

is_current_user (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentInviteVideoChatParticipants]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentInviteVideoChatParticipants']

to_dict()[source]
Return type:

dict

is_current_user: bool

True, if the current user was invited to the video chat or the live stream

class pytdbot.types.PushMessageContentInvoice(price='', is_pinned=False)[source]

Bases: TlObject, PushMessageContent

A message with an invoice from a bot

Parameters:
  • price (str) – Product price

  • is_pinned (bool) – True, if the message is a pinned message with the specified content

__init__(price='', is_pinned=False)[source]
Parameters:
  • price (str)

  • is_pinned (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentInvoice]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentInvoice']

to_dict()[source]
Return type:

dict

is_pinned: bool

True, if the message is a pinned message with the specified content

price: Optional[str]

Product price

class pytdbot.types.PushMessageContentLocation(is_live=False, is_pinned=False)[source]

Bases: TlObject, PushMessageContent

A message with a location

Parameters:
  • is_live (bool) – True, if the location is live

  • is_pinned (bool) – True, if the message is a pinned message with the specified content

__init__(is_live=False, is_pinned=False)[source]
Parameters:
  • is_live (bool)

  • is_pinned (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentLocation]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentLocation']

to_dict()[source]
Return type:

dict

is_live: bool

True, if the location is live

is_pinned: bool

True, if the message is a pinned message with the specified content

class pytdbot.types.PushMessageContentMediaAlbum(total_count=0, has_photos=False, has_videos=False, has_audios=False, has_documents=False)[source]

Bases: TlObject, PushMessageContent

A media album

Parameters:
  • total_count (int) – Number of messages in the album

  • has_photos (bool) – True, if the album has at least one photo

  • has_videos (bool) – True, if the album has at least one video file

  • has_audios (bool) – True, if the album has at least one audio file

  • has_documents (bool) – True, if the album has at least one document

__init__(total_count=0, has_photos=False, has_videos=False, has_audios=False, has_documents=False)[source]
Parameters:
  • total_count (int)

  • has_photos (bool)

  • has_videos (bool)

  • has_audios (bool)

  • has_documents (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentMediaAlbum]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentMediaAlbum']

to_dict()[source]
Return type:

dict

has_audios: bool

True, if the album has at least one audio file

has_documents: bool

True, if the album has at least one document

has_photos: bool

True, if the album has at least one photo

has_videos: bool

True, if the album has at least one video file

total_count: int

Number of messages in the album

class pytdbot.types.PushMessageContentMessageForwards(total_count=0)[source]

Bases: TlObject, PushMessageContent

A forwarded messages

Parameters:

total_count (int) – Number of forwarded messages

__init__(total_count=0)[source]
Parameters:

total_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentMessageForwards]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentMessageForwards']

to_dict()[source]
Return type:

dict

total_count: int

Number of forwarded messages

class pytdbot.types.PushMessageContentPaidMedia(star_count=0, is_pinned=False)[source]

Bases: TlObject, PushMessageContent

A message with paid media

Parameters:
  • star_count (int) – Number of Telegram Stars needed to buy access to the media in the message; 0 for pinned message

  • is_pinned (bool) – True, if the message is a pinned message with the specified content

__init__(star_count=0, is_pinned=False)[source]
Parameters:
  • star_count (int)

  • is_pinned (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentPaidMedia]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentPaidMedia']

to_dict()[source]
Return type:

dict

is_pinned: bool

True, if the message is a pinned message with the specified content

star_count: int

Number of Telegram Stars needed to buy access to the media in the message; 0 for pinned message

class pytdbot.types.PushMessageContentPhoto(photo=None, caption='', is_secret=False, is_pinned=False)[source]

Bases: TlObject, PushMessageContent

A photo message

Parameters:
  • photo ("types.Photo") – Message content; may be null

  • caption (str) – Photo caption

  • is_secret (bool) – True, if the photo is secret

  • is_pinned (bool) – True, if the message is a pinned message with the specified content

__init__(photo=None, caption='', is_secret=False, is_pinned=False)[source]
Parameters:
  • photo (Photo | None)

  • caption (str)

  • is_secret (bool)

  • is_pinned (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentPhoto]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentPhoto']

to_dict()[source]
Return type:

dict

caption: Optional[str]

Photo caption

is_pinned: bool

True, if the message is a pinned message with the specified content

is_secret: bool

True, if the photo is secret

photo: Optional[Photo]

Message content; may be null

class pytdbot.types.PushMessageContentPoll(question='', is_regular=False, is_pinned=False)[source]

Bases: TlObject, PushMessageContent

A message with a poll

Parameters:
  • question (str) – Poll question

  • is_regular (bool) – True, if the poll is regular and not in quiz mode

  • is_pinned (bool) – True, if the message is a pinned message with the specified content

__init__(question='', is_regular=False, is_pinned=False)[source]
Parameters:
  • question (str)

  • is_regular (bool)

  • is_pinned (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentPoll]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentPoll']

to_dict()[source]
Return type:

dict

is_pinned: bool

True, if the message is a pinned message with the specified content

is_regular: bool

True, if the poll is regular and not in quiz mode

question: Optional[str]

Poll question

class pytdbot.types.PushMessageContentPremiumGiftCode(month_count=0)[source]

Bases: TlObject, PushMessageContent

A message with a Telegram Premium gift code created for the user

Parameters:

month_count (int) – Number of months the Telegram Premium subscription will be active after code activation

__init__(month_count=0)[source]
Parameters:

month_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentPremiumGiftCode]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentPremiumGiftCode']

to_dict()[source]
Return type:

dict

month_count: int

Number of months the Telegram Premium subscription will be active after code activation

class pytdbot.types.PushMessageContentProximityAlertTriggered(distance=0)[source]

Bases: TlObject, PushMessageContent

A user in the chat came within proximity alert range from the current user

Parameters:

distance (int) – The distance to the user

__init__(distance=0)[source]
Parameters:

distance (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentProximityAlertTriggered]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentProximityAlertTriggered']

to_dict()[source]
Return type:

dict

distance: int

The distance to the user

class pytdbot.types.PushMessageContentRecurringPayment(amount='')[source]

Bases: TlObject, PushMessageContent

A new recurring payment was made by the current user

Parameters:

amount (str) – The paid amount

__init__(amount='')[source]
Parameters:

amount (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentRecurringPayment]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentRecurringPayment']

to_dict()[source]
Return type:

dict

amount: Optional[str]

The paid amount

class pytdbot.types.PushMessageContentScreenshotTaken[source]

Bases: TlObject, PushMessageContent

A screenshot of a message in the chat has been taken

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentScreenshotTaken]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentScreenshotTaken']

to_dict()[source]
Return type:

dict

class pytdbot.types.PushMessageContentSticker(sticker=None, emoji='', is_pinned=False)[source]

Bases: TlObject, PushMessageContent

A message with a sticker

Parameters:
  • sticker ("types.Sticker") – Message content; may be null

  • emoji (str) – Emoji corresponding to the sticker; may be empty

  • is_pinned (bool) – True, if the message is a pinned message with the specified content

__init__(sticker=None, emoji='', is_pinned=False)[source]
Parameters:
  • sticker (Sticker | None)

  • emoji (str)

  • is_pinned (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentSticker]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentSticker']

to_dict()[source]
Return type:

dict

emoji: Optional[str]

Emoji corresponding to the sticker; may be empty

is_pinned: bool

True, if the message is a pinned message with the specified content

sticker: Optional[Sticker]

Message content; may be null

class pytdbot.types.PushMessageContentStory(is_mention=False, is_pinned=False)[source]

Bases: TlObject, PushMessageContent

A message with a story

Parameters:
  • is_mention (bool) – True, if the user was mentioned in the story

  • is_pinned (bool) – True, if the message is a pinned message with the specified content

__init__(is_mention=False, is_pinned=False)[source]
Parameters:
  • is_mention (bool)

  • is_pinned (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentStory]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentStory']

to_dict()[source]
Return type:

dict

is_mention: bool

True, if the user was mentioned in the story

is_pinned: bool

True, if the message is a pinned message with the specified content

class pytdbot.types.PushMessageContentSuggestProfilePhoto[source]

Bases: TlObject, PushMessageContent

A profile photo was suggested to the user

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentSuggestProfilePhoto]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentSuggestProfilePhoto']

to_dict()[source]
Return type:

dict

class pytdbot.types.PushMessageContentText(text='', is_pinned=False)[source]

Bases: TlObject, PushMessageContent

A text message

Parameters:
  • text (str) – Message text

  • is_pinned (bool) – True, if the message is a pinned message with the specified content

__init__(text='', is_pinned=False)[source]
Parameters:
  • text (str)

  • is_pinned (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentText]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentText']

to_dict()[source]
Return type:

dict

is_pinned: bool

True, if the message is a pinned message with the specified content

text: Optional[str]

Message text

class pytdbot.types.PushMessageContentUpgradedGift(is_upgrade=False, is_prepaid_upgrade=False)[source]

Bases: TlObject, PushMessageContent

A message with an upgraded gift

Parameters:
  • is_upgrade (bool) – True, if the gift was obtained by upgrading of a previously received gift; otherwise, if is_prepaid_upgrade == false, then this is a transferred or resold gift

  • is_prepaid_upgrade (bool) – True, if the message is about completion of prepaid upgrade of the gift instead of actual receiving of a new gift

__init__(is_upgrade=False, is_prepaid_upgrade=False)[source]
Parameters:
  • is_upgrade (bool)

  • is_prepaid_upgrade (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentUpgradedGift]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentUpgradedGift']

to_dict()[source]
Return type:

dict

is_prepaid_upgrade: bool

True, if the message is about completion of prepaid upgrade of the gift instead of actual receiving of a new gift

is_upgrade: bool

True, if the gift was obtained by upgrading of a previously received gift; otherwise, if is_prepaid_upgrade == false, then this is a transferred or resold gift

class pytdbot.types.PushMessageContentVideo(video=None, caption='', is_secret=False, is_pinned=False)[source]

Bases: TlObject, PushMessageContent

A video message

Parameters:
  • video ("types.Video") – Message content; may be null

  • caption (str) – Video caption

  • is_secret (bool) – True, if the video is secret

  • is_pinned (bool) – True, if the message is a pinned message with the specified content

__init__(video=None, caption='', is_secret=False, is_pinned=False)[source]
Parameters:
  • video (Video | None)

  • caption (str)

  • is_secret (bool)

  • is_pinned (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentVideo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentVideo']

to_dict()[source]
Return type:

dict

caption: Optional[str]

Video caption

is_pinned: bool

True, if the message is a pinned message with the specified content

is_secret: bool

True, if the video is secret

video: Optional[Video]

Message content; may be null

class pytdbot.types.PushMessageContentVideoChatEnded[source]

Bases: TlObject, PushMessageContent

A video chat or live stream has ended

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentVideoChatEnded]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentVideoChatEnded']

to_dict()[source]
Return type:

dict

class pytdbot.types.PushMessageContentVideoChatStarted[source]

Bases: TlObject, PushMessageContent

A video chat or live stream was started

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentVideoChatStarted]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentVideoChatStarted']

to_dict()[source]
Return type:

dict

class pytdbot.types.PushMessageContentVideoNote(video_note=None, is_pinned=False)[source]

Bases: TlObject, PushMessageContent

A video note message

Parameters:
  • video_note ("types.VideoNote") – Message content; may be null

  • is_pinned (bool) – True, if the message is a pinned message with the specified content

__init__(video_note=None, is_pinned=False)[source]
Parameters:
  • video_note (VideoNote | None)

  • is_pinned (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentVideoNote]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentVideoNote']

to_dict()[source]
Return type:

dict

is_pinned: bool

True, if the message is a pinned message with the specified content

video_note: Optional[VideoNote]

Message content; may be null

class pytdbot.types.PushMessageContentVoiceNote(voice_note=None, is_pinned=False)[source]

Bases: TlObject, PushMessageContent

A voice note message

Parameters:
  • voice_note ("types.VoiceNote") – Message content; may be null

  • is_pinned (bool) – True, if the message is a pinned message with the specified content

__init__(voice_note=None, is_pinned=False)[source]
Parameters:
  • voice_note (VoiceNote | None)

  • is_pinned (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushMessageContentVoiceNote]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushMessageContent']

classmethod getType()[source]
Return type:

Literal['pushMessageContentVoiceNote']

to_dict()[source]
Return type:

dict

is_pinned: bool

True, if the message is a pinned message with the specified content

voice_note: Optional[VoiceNote]

Message content; may be null

class pytdbot.types.PushReceiverId(id=0)[source]

Bases: TlObject

Contains a globally unique push receiver identifier, which can be used to identify which account has received a push notification

Parameters:

id (int) – The globally unique identifier of push notification subscription

__init__(id=0)[source]
Parameters:

id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[PushReceiverId]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['PushReceiverId']

classmethod getType()[source]
Return type:

Literal['pushReceiverId']

to_dict()[source]
Return type:

dict

id: int

The globally unique identifier of push notification subscription

class pytdbot.types.QuickReplyMessage(id=0, sending_state=None, can_be_edited=False, reply_to_message_id=0, via_bot_user_id=0, media_album_id=0, content=None, reply_markup=None)[source]

Bases: TlObject

Describes a message that can be used for quick reply

Parameters:
  • id (int) – Unique message identifier among all quick replies

  • sending_state ("types.MessageSendingState") – The sending state of the message; may be null if the message isn’t being sent and didn’t fail to be sent

  • can_be_edited (bool) – True, if the message can be edited

  • reply_to_message_id (int) – The identifier of the quick reply message to which the message replies; 0 if none

  • via_bot_user_id (int) – If non-zero, the user identifier of the bot through which this message was sent

  • media_album_id (int) – Unique identifier of an album this message belongs to; 0 if none. Only audios, documents, photos and videos can be grouped together in albums

  • content ("types.MessageContent") – Content of the message

  • reply_markup ("types.ReplyMarkup") – Inline keyboard reply markup for the message; may be null if none

__init__(id=0, sending_state=None, can_be_edited=False, reply_to_message_id=0, via_bot_user_id=0, media_album_id=0, content=None, reply_markup=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[QuickReplyMessage]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['QuickReplyMessage']

classmethod getType()[source]
Return type:

Literal['quickReplyMessage']

to_dict()[source]
Return type:

dict

can_be_edited: bool

True, if the message can be edited

content: Union[MessageText, MessageAnimation, MessageAudio, MessageDocument, MessagePaidMedia, MessagePhoto, MessageSticker, MessageVideo, MessageVideoNote, MessageVoiceNote, MessageExpiredPhoto, MessageExpiredVideo, MessageExpiredVideoNote, MessageExpiredVoiceNote, MessageLocation, MessageVenue, MessageContact, MessageAnimatedEmoji, MessageDice, MessageGame, MessagePoll, MessageStory, MessageChecklist, MessageInvoice, MessageCall, MessageGroupCall, MessageVideoChatScheduled, MessageVideoChatStarted, MessageVideoChatEnded, MessageInviteVideoChatParticipants, MessageBasicGroupChatCreate, MessageSupergroupChatCreate, MessageChatChangeTitle, MessageChatChangePhoto, MessageChatDeletePhoto, MessageChatAddMembers, MessageChatJoinByLink, MessageChatJoinByRequest, MessageChatDeleteMember, MessageChatUpgradeTo, MessageChatUpgradeFrom, MessagePinMessage, MessageScreenshotTaken, MessageChatSetBackground, MessageChatSetTheme, MessageChatSetMessageAutoDeleteTime, MessageChatBoost, MessageForumTopicCreated, MessageForumTopicEdited, MessageForumTopicIsClosedToggled, MessageForumTopicIsHiddenToggled, MessageSuggestProfilePhoto, MessageCustomServiceAction, MessageGameScore, MessagePaymentSuccessful, MessagePaymentSuccessfulBot, MessagePaymentRefunded, MessageGiftedPremium, MessagePremiumGiftCode, MessageGiveawayCreated, MessageGiveaway, MessageGiveawayCompleted, MessageGiveawayWinners, MessageGiftedStars, MessageGiftedTon, MessageGiveawayPrizeStars, MessageGift, MessageUpgradedGift, MessageRefundedUpgradedGift, MessagePaidMessagesRefunded, MessagePaidMessagePriceChanged, MessageDirectMessagePriceChanged, MessageChecklistTasksDone, MessageChecklistTasksAdded, MessageSuggestedPostApprovalFailed, MessageSuggestedPostApproved, MessageSuggestedPostDeclined, MessageSuggestedPostPaid, MessageSuggestedPostRefunded, MessageContactRegistered, MessageUsersShared, MessageChatShared, MessageBotWriteAccessAllowed, MessageWebAppDataSent, MessageWebAppDataReceived, MessagePassportDataSent, MessagePassportDataReceived, MessageProximityAlertTriggered, MessageUnsupported, None]

Content of the message

id: int

Unique message identifier among all quick replies

media_album_id: int

Unique identifier of an album this message belongs to; 0 if none. Only audios, documents, photos and videos can be grouped together in albums

reply_markup: Union[ReplyMarkupRemoveKeyboard, ReplyMarkupForceReply, ReplyMarkupShowKeyboard, ReplyMarkupInlineKeyboard, None]

Inline keyboard reply markup for the message; may be null if none

reply_to_message_id: int

The identifier of the quick reply message to which the message replies; 0 if none

sending_state: Union[MessageSendingStatePending, MessageSendingStateFailed, None]

The sending state of the message; may be null if the message isn’t being sent and didn’t fail to be sent

via_bot_user_id: int

If non-zero, the user identifier of the bot through which this message was sent

class pytdbot.types.QuickReplyMessages(messages=None)[source]

Bases: TlObject

Contains a list of quick reply messages

Parameters:

messages (List["types.QuickReplyMessage"]) – List of quick reply messages; messages may be null

__init__(messages=None)[source]
Parameters:

messages (List[QuickReplyMessage] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[QuickReplyMessages]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['QuickReplyMessages']

classmethod getType()[source]
Return type:

Literal['quickReplyMessages']

to_dict()[source]
Return type:

dict

messages: List[QuickReplyMessage]

List of quick reply messages; messages may be null

class pytdbot.types.QuickReplyShortcut(id=0, name='', first_message=None, message_count=0)[source]

Bases: TlObject

Describes a shortcut that can be used for a quick reply

Parameters:
  • id (int) – Unique shortcut identifier

  • name (str) – The name of the shortcut that can be used to use the shortcut

  • first_message ("types.QuickReplyMessage") – The first shortcut message

  • message_count (int) – The total number of messages in the shortcut

__init__(id=0, name='', first_message=None, message_count=0)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[QuickReplyShortcut]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['QuickReplyShortcut']

classmethod getType()[source]
Return type:

Literal['quickReplyShortcut']

to_dict()[source]
Return type:

dict

first_message: Optional[QuickReplyMessage]

The first shortcut message

id: int

Unique shortcut identifier

message_count: int

The total number of messages in the shortcut

name: Optional[str]

The name of the shortcut that can be used to use the shortcut

class pytdbot.types.ReactionNotificationSettings(message_reaction_source=None, story_reaction_source=None, sound_id=0, show_preview=False)[source]

Bases: TlObject

Contains information about notification settings for reactions

Parameters:
  • message_reaction_source ("types.ReactionNotificationSource") – Source of message reactions for which notifications are shown

  • story_reaction_source ("types.ReactionNotificationSource") – Source of story reactions for which notifications are shown

  • sound_id (int) – Identifier of the notification sound to be played; 0 if sound is disabled

  • show_preview (bool) – True, if reaction sender and emoji must be displayed in notifications

__init__(message_reaction_source=None, story_reaction_source=None, sound_id=0, show_preview=False)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReactionNotificationSettings]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReactionNotificationSettings']

classmethod getType()[source]
Return type:

Literal['reactionNotificationSettings']

to_dict()[source]
Return type:

dict

message_reaction_source: Union[ReactionNotificationSourceNone, ReactionNotificationSourceContacts, ReactionNotificationSourceAll, None]

Source of message reactions for which notifications are shown

show_preview: bool

True, if reaction sender and emoji must be displayed in notifications

sound_id: int

Identifier of the notification sound to be played; 0 if sound is disabled

story_reaction_source: Union[ReactionNotificationSourceNone, ReactionNotificationSourceContacts, ReactionNotificationSourceAll, None]

Source of story reactions for which notifications are shown

class pytdbot.types.ReactionNotificationSource[source]

Bases: object

Describes sources of reactions for which notifications will be shown

class pytdbot.types.ReactionNotificationSourceAll[source]

Bases: TlObject, ReactionNotificationSource

Notifications for reactions are shown for all reactions

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReactionNotificationSourceAll]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReactionNotificationSource']

classmethod getType()[source]
Return type:

Literal['reactionNotificationSourceAll']

to_dict()[source]
Return type:

dict

class pytdbot.types.ReactionNotificationSourceContacts[source]

Bases: TlObject, ReactionNotificationSource

Notifications for reactions are shown only for reactions from contacts

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReactionNotificationSourceContacts]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReactionNotificationSource']

classmethod getType()[source]
Return type:

Literal['reactionNotificationSourceContacts']

to_dict()[source]
Return type:

dict

class pytdbot.types.ReactionNotificationSourceNone[source]

Bases: TlObject, ReactionNotificationSource

Notifications for reactions are disabled

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReactionNotificationSourceNone]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReactionNotificationSource']

classmethod getType()[source]
Return type:

Literal['reactionNotificationSourceNone']

to_dict()[source]
Return type:

dict

class pytdbot.types.ReactionType[source]

Bases: object

Describes type of message reaction

class pytdbot.types.ReactionTypeCustomEmoji(custom_emoji_id=0)[source]

Bases: TlObject, ReactionType

A reaction with a custom emoji

Parameters:

custom_emoji_id (int) – Unique identifier of the custom emoji

__init__(custom_emoji_id=0)[source]
Parameters:

custom_emoji_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReactionTypeCustomEmoji]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReactionType']

classmethod getType()[source]
Return type:

Literal['reactionTypeCustomEmoji']

to_dict()[source]
Return type:

dict

custom_emoji_id: int

Unique identifier of the custom emoji

class pytdbot.types.ReactionTypeEmoji(emoji='')[source]

Bases: TlObject, ReactionType

A reaction with an emoji

Parameters:

emoji (str) – Text representation of the reaction

__init__(emoji='')[source]
Parameters:

emoji (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReactionTypeEmoji]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReactionType']

classmethod getType()[source]
Return type:

Literal['reactionTypeEmoji']

to_dict()[source]
Return type:

dict

emoji: Optional[str]

Text representation of the reaction

class pytdbot.types.ReactionTypePaid[source]

Bases: TlObject, ReactionType

The paid reaction in a channel chat

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReactionTypePaid]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReactionType']

classmethod getType()[source]
Return type:

Literal['reactionTypePaid']

to_dict()[source]
Return type:

dict

class pytdbot.types.ReactionUnavailabilityReason[source]

Bases: object

Describes why the current user can’t add reactions to the message, despite some other users can

class pytdbot.types.ReactionUnavailabilityReasonAnonymousAdministrator[source]

Bases: TlObject, ReactionUnavailabilityReason

The user is an anonymous administrator in the supergroup, but isn’t a creator of it, so they can’t vote on behalf of the supergroup

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReactionUnavailabilityReasonAnonymousAdministrator]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReactionUnavailabilityReason']

classmethod getType()[source]
Return type:

Literal['reactionUnavailabilityReasonAnonymousAdministrator']

to_dict()[source]
Return type:

dict

class pytdbot.types.ReactionUnavailabilityReasonGuest[source]

Bases: TlObject, ReactionUnavailabilityReason

The user isn’t a member of the supergroup and can’t send messages and reactions there without joining

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReactionUnavailabilityReasonGuest]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReactionUnavailabilityReason']

classmethod getType()[source]
Return type:

Literal['reactionUnavailabilityReasonGuest']

to_dict()[source]
Return type:

dict

class pytdbot.types.ReadDatePrivacySettings(show_read_date=False)[source]

Bases: TlObject

Contains privacy settings for message read date in private chats. Read dates are always shown to the users that can see online status of the current user regardless of this setting

Parameters:

show_read_date (bool) – True, if message read date is shown to other users in private chats. If false and the current user isn’t a Telegram Premium user, then they will not be able to see other’s message read date

__init__(show_read_date=False)[source]
Parameters:

show_read_date (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReadDatePrivacySettings]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReadDatePrivacySettings']

classmethod getType()[source]
Return type:

Literal['readDatePrivacySettings']

to_dict()[source]
Return type:

dict

show_read_date: bool

True, if message read date is shown to other users in private chats. If false and the current user isn’t a Telegram Premium user, then they will not be able to see other’s message read date

class pytdbot.types.ReceivedGift(received_gift_id='', sender_id=None, text=None, is_private=False, is_saved=False, is_pinned=False, can_be_upgraded=False, can_be_transferred=False, was_refunded=False, date=0, gift=None, collection_ids=None, sell_star_count=0, prepaid_upgrade_star_count=0, is_upgrade_separate=False, transfer_star_count=0, next_transfer_date=0, next_resale_date=0, export_date=0, prepaid_upgrade_hash='')[source]

Bases: TlObject

Represents a gift received by a user or a chat

Parameters:
  • received_gift_id (str) – Unique identifier of the received gift for the current user; only for the receiver of the gift

  • sender_id ("types.MessageSender") – Identifier of a user or a chat that sent the gift; may be null if unknown

  • text ("types.FormattedText") – Message added to the gift

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

  • is_saved (bool) – True, if the gift is displayed on the chat’s profile page; only for the receiver of the gift

  • is_pinned (bool) – True, if the gift is pinned to the top of the chat’s profile page

  • can_be_upgraded (bool) – True, if the gift is a regular gift that can be upgraded to a unique gift; only for the receiver of the gift

  • can_be_transferred (bool) – True, if the gift is an upgraded gift that can be transferred to another owner; only for the receiver of the gift

  • was_refunded (bool) – True, if the gift was refunded and isn’t available anymore

  • date (int) – Point in time (Unix timestamp) when the gift was sent

  • gift ("types.SentGift") – The gift

  • collection_ids (List[int]) – Identifiers of collections to which the gift is added; only for the receiver of the gift

  • sell_star_count (int) – Number of Telegram Stars that can be claimed by the receiver instead of the regular gift; 0 if the gift can’t be sold by the current user

  • prepaid_upgrade_star_count (int) – Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift

  • is_upgrade_separate (bool) – True, if the upgrade was bought after the gift was sent. In this case, prepaid upgrade cost must not be added to the gift cost

  • transfer_star_count (int) – Number of Telegram Stars that must be paid to transfer the upgraded gift; only for the receiver of the gift

  • next_transfer_date (int) – Point in time (Unix timestamp) when the gift can be transferred to another owner; can be in the past; 0 if the gift can be transferred immediately or transfer isn’t possible; only for the receiver of the gift

  • next_resale_date (int) – Point in time (Unix timestamp) when the gift can be resold to another user; can be in the past; 0 if the gift can’t be resold; only for the receiver of the gift

  • export_date (int) – Point in time (Unix timestamp) when the upgraded gift can be transferred to the TON blockchain as an NFT; can be in the past; 0 if NFT export isn’t possible; only for the receiver of the gift

  • prepaid_upgrade_hash (str) – If non-empty, then the user can pay for an upgrade of the gift using buyGiftUpgrade

__init__(received_gift_id='', sender_id=None, text=None, is_private=False, is_saved=False, is_pinned=False, can_be_upgraded=False, can_be_transferred=False, was_refunded=False, date=0, gift=None, collection_ids=None, sell_star_count=0, prepaid_upgrade_star_count=0, is_upgrade_separate=False, transfer_star_count=0, next_transfer_date=0, next_resale_date=0, export_date=0, prepaid_upgrade_hash='')[source]
Parameters:
  • received_gift_id (str)

  • sender_id (MessageSender | None)

  • text (FormattedText | None)

  • is_private (bool)

  • is_saved (bool)

  • is_pinned (bool)

  • can_be_upgraded (bool)

  • can_be_transferred (bool)

  • was_refunded (bool)

  • date (int)

  • gift (SentGift | None)

  • collection_ids (List[int] | None)

  • sell_star_count (int)

  • prepaid_upgrade_star_count (int)

  • is_upgrade_separate (bool)

  • transfer_star_count (int)

  • next_transfer_date (int)

  • next_resale_date (int)

  • export_date (int)

  • prepaid_upgrade_hash (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReceivedGift]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReceivedGift']

classmethod getType()[source]
Return type:

Literal['receivedGift']

to_dict()[source]
Return type:

dict

can_be_transferred: bool

True, if the gift is an upgraded gift that can be transferred to another owner; only for the receiver of the gift

can_be_upgraded: bool

True, if the gift is a regular gift that can be upgraded to a unique gift; only for the receiver of the gift

collection_ids: List[int]

Identifiers of collections to which the gift is added; only for the receiver of the gift

date: int

Point in time (Unix timestamp) when the gift was sent

export_date: int

Point in time (Unix timestamp) when the upgraded gift can be transferred to the TON blockchain as an NFT; can be in the past; 0 if NFT export isn’t possible; only for the receiver of the gift

gift: Union[SentGiftRegular, SentGiftUpgraded, None]

The gift

is_pinned: bool

True, if the gift is pinned to the top of the chat’s profile page

is_private: bool

True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone are able to see them

is_saved: bool

True, if the gift is displayed on the chat’s profile page; only for the receiver of the gift

is_upgrade_separate: bool

True, if the upgrade was bought after the gift was sent. In this case, prepaid upgrade cost must not be added to the gift cost

next_resale_date: int

Point in time (Unix timestamp) when the gift can be resold to another user; can be in the past; 0 if the gift can’t be resold; only for the receiver of the gift

next_transfer_date: int

Point in time (Unix timestamp) when the gift can be transferred to another owner; can be in the past; 0 if the gift can be transferred immediately or transfer isn’t possible; only for the receiver of the gift

prepaid_upgrade_hash: Optional[str]

If non-empty, then the user can pay for an upgrade of the gift using buyGiftUpgrade

prepaid_upgrade_star_count: int

Number of Telegram Stars that were paid by the sender for the ability to upgrade the gift

received_gift_id: Optional[str]

Unique identifier of the received gift for the current user; only for the receiver of the gift

sell_star_count: int

Number of Telegram Stars that can be claimed by the receiver instead of the regular gift; 0 if the gift can’t be sold by the current user

sender_id: Union[MessageSenderUser, MessageSenderChat, None]

Identifier of a user or a chat that sent the gift; may be null if unknown

text: Optional[FormattedText]

Message added to the gift

transfer_star_count: int

Number of Telegram Stars that must be paid to transfer the upgraded gift; only for the receiver of the gift

was_refunded: bool

True, if the gift was refunded and isn’t available anymore

class pytdbot.types.ReceivedGifts(total_count=0, gifts=None, are_notifications_enabled=False, next_offset='')[source]

Bases: TlObject

Represents a list of gifts received by a user or a chat

Parameters:
  • total_count (int) – The total number of received gifts

  • gifts (List["types.ReceivedGift"]) – The list of gifts

  • are_notifications_enabled (bool) – True, if notifications about new gifts of the owner are enabled

  • next_offset (str) – The offset for the next request. If empty, then there are no more results

__init__(total_count=0, gifts=None, are_notifications_enabled=False, next_offset='')[source]
Parameters:
  • total_count (int)

  • gifts (List[ReceivedGift] | None)

  • are_notifications_enabled (bool)

  • next_offset (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReceivedGifts]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReceivedGifts']

classmethod getType()[source]
Return type:

Literal['receivedGifts']

to_dict()[source]
Return type:

dict

are_notifications_enabled: bool

True, if notifications about new gifts of the owner are enabled

gifts: List[ReceivedGift]

The list of gifts

next_offset: Optional[str]

The offset for the next request. If empty, then there are no more results

total_count: int

The total number of received gifts

class pytdbot.types.RecommendedChatFolder(folder=None, description='')[source]

Bases: TlObject

Describes a recommended chat folder

Parameters:
  • folder ("types.ChatFolder") – The chat folder

  • description (str) – Chat folder description

__init__(folder=None, description='')[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[RecommendedChatFolder]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['RecommendedChatFolder']

classmethod getType()[source]
Return type:

Literal['recommendedChatFolder']

to_dict()[source]
Return type:

dict

description: Optional[str]

Chat folder description

folder: Optional[ChatFolder]

The chat folder

class pytdbot.types.RecommendedChatFolders(chat_folders=None)[source]

Bases: TlObject

Contains a list of recommended chat folders

Parameters:

chat_folders (List["types.RecommendedChatFolder"]) – List of recommended chat folders

__init__(chat_folders=None)[source]
Parameters:

chat_folders (List[RecommendedChatFolder] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[RecommendedChatFolders]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['RecommendedChatFolders']

classmethod getType()[source]
Return type:

Literal['recommendedChatFolders']

to_dict()[source]
Return type:

dict

chat_folders: List[RecommendedChatFolder]

List of recommended chat folders

class pytdbot.types.RecoveryEmailAddress(recovery_email_address='')[source]

Bases: TlObject

Contains information about the current recovery email address

Parameters:

recovery_email_address (str) – Recovery email address

__init__(recovery_email_address='')[source]
Parameters:

recovery_email_address (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[RecoveryEmailAddress]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['RecoveryEmailAddress']

classmethod getType()[source]
Return type:

Literal['recoveryEmailAddress']

to_dict()[source]
Return type:

dict

recovery_email_address: Optional[str]

Recovery email address

class pytdbot.types.RemoteFile(id='', unique_id='', is_uploading_active=False, is_uploading_completed=False, uploaded_size=0)[source]

Bases: TlObject, FileBoundMethods

Represents a remote file

Parameters:
  • id (str) – Remote file identifier; may be empty. Can be used by the current user across application restarts or even from other devices. Uniquely identifies a file, but a file can have a lot of different valid identifiers. If the identifier starts with "http://" or "https://", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. If downloadFile/addFileToDownloads is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the application with the HTTP URL in the original_path and "#url#" as the conversion string. Application must generate the file by downloading it to the specified location

  • unique_id (str) – Unique file identifier; may be empty if unknown. The unique file identifier which is the same for the same file even for different users and is persistent over time

  • is_uploading_active (bool) – True, if the file is currently being uploaded (or a remote copy is being generated by some other means)

  • is_uploading_completed (bool) – True, if a remote copy is fully available

  • uploaded_size (int) – Size of the remote available part of the file, in bytes; 0 if unknown

__init__(id='', unique_id='', is_uploading_active=False, is_uploading_completed=False, uploaded_size=0)[source]
Parameters:
  • id (str)

  • unique_id (str)

  • is_uploading_active (bool)

  • is_uploading_completed (bool)

  • uploaded_size (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[RemoteFile]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['RemoteFile']

classmethod getType()[source]
Return type:

Literal['remoteFile']

to_dict()[source]
Return type:

dict

id: Optional[str]

//" or "https://", it represents the HTTP URL of the file. TDLib is currently unable to download files if only their URL is known. If downloadFile/addFileToDownloads is called on such a file or if it is sent to a secret chat, TDLib starts a file generation process by sending updateFileGenerationStart to the application with the HTTP URL in the original_path and "#url#" as the conversion string. Application must generate the file by downloading it to the specified location

Type:

Remote file identifier; may be empty. Can be used by the current user across application restarts or even from other devices. Uniquely identifies a file, but a file can have a lot of different valid identifiers. If the identifier starts with “http

is_uploading_active: bool

True, if the file is currently being uploaded (or a remote copy is being generated by some other means)

is_uploading_completed: bool

True, if a remote copy is fully available

unique_id: Optional[str]

Unique file identifier; may be empty if unknown. The unique file identifier which is the same for the same file even for different users and is persistent over time

uploaded_size: int

Size of the remote available part of the file, in bytes; 0 if unknown

class pytdbot.types.ReplyMarkup[source]

Bases: object

Contains a description of a custom keyboard and actions that can be done with it to quickly reply to bots

class pytdbot.types.ReplyMarkupForceReply(is_personal=False, input_field_placeholder='')[source]

Bases: TlObject, ReplyMarkup

Instructs application to force a reply to this message

Parameters:
  • is_personal (bool) – True, if a forced reply must automatically be shown to the current user. For outgoing messages, specify true to show the forced reply only for the mentioned users and for the target user of a reply

  • input_field_placeholder (str) – If non-empty, the placeholder to be shown in the input field when the reply is active; 0-64 characters

__init__(is_personal=False, input_field_placeholder='')[source]
Parameters:
  • is_personal (bool)

  • input_field_placeholder (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReplyMarkupForceReply]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReplyMarkup']

classmethod getType()[source]
Return type:

Literal['replyMarkupForceReply']

to_dict()[source]
Return type:

dict

input_field_placeholder: Optional[str]

If non-empty, the placeholder to be shown in the input field when the reply is active; 0-64 characters

is_personal: bool

True, if a forced reply must automatically be shown to the current user. For outgoing messages, specify true to show the forced reply only for the mentioned users and for the target user of a reply

class pytdbot.types.ReplyMarkupInlineKeyboard(rows=None)[source]

Bases: TlObject, ReplyMarkup

Contains an inline keyboard layout

Parameters:

rows (List[List["types.InlineKeyboardButton"]]) – A list of rows of inline keyboard buttons

__init__(rows=None)[source]
Parameters:

rows (List[List[InlineKeyboardButton]] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReplyMarkupInlineKeyboard]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReplyMarkup']

classmethod getType()[source]
Return type:

Literal['replyMarkupInlineKeyboard']

to_dict()[source]
Return type:

dict

rows: List[List[InlineKeyboardButton]]

A list of rows of inline keyboard buttons

class pytdbot.types.ReplyMarkupRemoveKeyboard(is_personal=False)[source]

Bases: TlObject, ReplyMarkup

Instructs application to remove the keyboard once this message has been received. This kind of keyboard can’t be received in an incoming message; instead, updateChatReplyMarkup with message_id == 0 will be sent

Parameters:

is_personal (bool) – True, if the keyboard is removed only for the mentioned users or the target user of a reply

__init__(is_personal=False)[source]
Parameters:

is_personal (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReplyMarkupRemoveKeyboard]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReplyMarkup']

classmethod getType()[source]
Return type:

Literal['replyMarkupRemoveKeyboard']

to_dict()[source]
Return type:

dict

is_personal: bool

True, if the keyboard is removed only for the mentioned users or the target user of a reply

class pytdbot.types.ReplyMarkupShowKeyboard(rows=None, is_persistent=False, resize_keyboard=False, one_time=False, is_personal=False, input_field_placeholder='')[source]

Bases: TlObject, ReplyMarkup

Contains a custom keyboard layout to quickly reply to bots

Parameters:
  • rows (List[List["types.KeyboardButton"]]) – A list of rows of bot keyboard buttons

  • is_persistent (bool) – True, if the keyboard is expected to always be shown when the ordinary keyboard is hidden

  • resize_keyboard (bool) – True, if the application needs to resize the keyboard vertically

  • one_time (bool) – True, if the application needs to hide the keyboard after use

  • is_personal (bool) – True, if the keyboard must automatically be shown to the current user. For outgoing messages, specify true to show the keyboard only for the mentioned users and for the target user of a reply

  • input_field_placeholder (str) – If non-empty, the placeholder to be shown in the input field when the keyboard is active; 0-64 characters

__init__(rows=None, is_persistent=False, resize_keyboard=False, one_time=False, is_personal=False, input_field_placeholder='')[source]
Parameters:
  • rows (List[List[KeyboardButton]] | None)

  • is_persistent (bool)

  • resize_keyboard (bool)

  • one_time (bool)

  • is_personal (bool)

  • input_field_placeholder (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReplyMarkupShowKeyboard]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReplyMarkup']

classmethod getType()[source]
Return type:

Literal['replyMarkupShowKeyboard']

to_dict()[source]
Return type:

dict

input_field_placeholder: Optional[str]

If non-empty, the placeholder to be shown in the input field when the keyboard is active; 0-64 characters

is_persistent: bool

True, if the keyboard is expected to always be shown when the ordinary keyboard is hidden

is_personal: bool

True, if the keyboard must automatically be shown to the current user. For outgoing messages, specify true to show the keyboard only for the mentioned users and for the target user of a reply

one_time: bool

True, if the application needs to hide the keyboard after use

resize_keyboard: bool

True, if the application needs to resize the keyboard vertically

rows: List[List[KeyboardButton]]

A list of rows of bot keyboard buttons

class pytdbot.types.ReportChatResult[source]

Bases: object

Describes result of chat report

class pytdbot.types.ReportChatResultMessagesRequired[source]

Bases: TlObject, ReportChatResult

The user must choose messages to report and repeat the reportChat request with the chosen messages

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReportChatResultMessagesRequired]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReportChatResult']

classmethod getType()[source]
Return type:

Literal['reportChatResultMessagesRequired']

to_dict()[source]
Return type:

dict

class pytdbot.types.ReportChatResultOk[source]

Bases: TlObject, ReportChatResult

The chat was reported successfully

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReportChatResultOk]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReportChatResult']

classmethod getType()[source]
Return type:

Literal['reportChatResultOk']

to_dict()[source]
Return type:

dict

class pytdbot.types.ReportChatResultOptionRequired(title='', options=None)[source]

Bases: TlObject, ReportChatResult

The user must choose an option to report the chat and repeat request with the chosen option

Parameters:
  • title (str) – Title for the option choice

  • options (List["types.ReportOption"]) – List of available options

__init__(title='', options=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReportChatResultOptionRequired]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReportChatResult']

classmethod getType()[source]
Return type:

Literal['reportChatResultOptionRequired']

to_dict()[source]
Return type:

dict

options: List[ReportOption]

List of available options

title: Optional[str]

Title for the option choice

class pytdbot.types.ReportChatResultTextRequired(option_id=b'', is_optional=False)[source]

Bases: TlObject, ReportChatResult

The user must add additional text details to the report

Parameters:
  • option_id (bytes) – Option identifier for the next reportChat request

  • is_optional (bool) – True, if the user can skip text adding

__init__(option_id=b'', is_optional=False)[source]
Parameters:
  • option_id (bytes)

  • is_optional (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReportChatResultTextRequired]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReportChatResult']

classmethod getType()[source]
Return type:

Literal['reportChatResultTextRequired']

to_dict()[source]
Return type:

dict

is_optional: bool

True, if the user can skip text adding

option_id: Optional[bytes]

Option identifier for the next reportChat request

class pytdbot.types.ReportOption(id=b'', text='')[source]

Bases: TlObject

Describes an option to report an entity to Telegram

Parameters:
  • id (bytes) – Unique identifier of the option

  • text (str) – Text of the option

__init__(id=b'', text='')[source]
Parameters:
  • id (bytes)

  • text (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReportOption]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReportOption']

classmethod getType()[source]
Return type:

Literal['reportOption']

to_dict()[source]
Return type:

dict

id: Optional[bytes]

Unique identifier of the option

text: Optional[str]

Text of the option

class pytdbot.types.ReportReason[source]

Bases: object

Describes the reason why a chat is reported

class pytdbot.types.ReportReasonChildAbuse[source]

Bases: TlObject, ReportReason

The chat has child abuse related content

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReportReasonChildAbuse]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReportReason']

classmethod getType()[source]
Return type:

Literal['reportReasonChildAbuse']

to_dict()[source]
Return type:

dict

class pytdbot.types.ReportReasonCopyright[source]

Bases: TlObject, ReportReason

The chat contains copyrighted content

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReportReasonCopyright]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReportReason']

classmethod getType()[source]
Return type:

Literal['reportReasonCopyright']

to_dict()[source]
Return type:

dict

class pytdbot.types.ReportReasonCustom[source]

Bases: TlObject, ReportReason

A custom reason provided by the user

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReportReasonCustom]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReportReason']

classmethod getType()[source]
Return type:

Literal['reportReasonCustom']

to_dict()[source]
Return type:

dict

class pytdbot.types.ReportReasonFake[source]

Bases: TlObject, ReportReason

The chat represents a fake account

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReportReasonFake]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReportReason']

classmethod getType()[source]
Return type:

Literal['reportReasonFake']

to_dict()[source]
Return type:

dict

class pytdbot.types.ReportReasonIllegalDrugs[source]

Bases: TlObject, ReportReason

The chat has illegal drugs related content

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReportReasonIllegalDrugs]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReportReason']

classmethod getType()[source]
Return type:

Literal['reportReasonIllegalDrugs']

to_dict()[source]
Return type:

dict

class pytdbot.types.ReportReasonPersonalDetails[source]

Bases: TlObject, ReportReason

The chat contains messages with personal details

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReportReasonPersonalDetails]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReportReason']

classmethod getType()[source]
Return type:

Literal['reportReasonPersonalDetails']

to_dict()[source]
Return type:

dict

class pytdbot.types.ReportReasonPornography[source]

Bases: TlObject, ReportReason

The chat contains pornographic messages

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReportReasonPornography]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReportReason']

classmethod getType()[source]
Return type:

Literal['reportReasonPornography']

to_dict()[source]
Return type:

dict

class pytdbot.types.ReportReasonSpam[source]

Bases: TlObject, ReportReason

The chat contains spam messages

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReportReasonSpam]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReportReason']

classmethod getType()[source]
Return type:

Literal['reportReasonSpam']

to_dict()[source]
Return type:

dict

class pytdbot.types.ReportReasonUnrelatedLocation[source]

Bases: TlObject, ReportReason

The location-based chat is unrelated to its stated location

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReportReasonUnrelatedLocation]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReportReason']

classmethod getType()[source]
Return type:

Literal['reportReasonUnrelatedLocation']

to_dict()[source]
Return type:

dict

class pytdbot.types.ReportReasonViolence[source]

Bases: TlObject, ReportReason

The chat promotes violence

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReportReasonViolence]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReportReason']

classmethod getType()[source]
Return type:

Literal['reportReasonViolence']

to_dict()[source]
Return type:

dict

class pytdbot.types.ReportSponsoredResult[source]

Bases: object

Describes result of sponsored message or chat report

class pytdbot.types.ReportSponsoredResultAdsHidden[source]

Bases: TlObject, ReportSponsoredResult

Sponsored messages were hidden for the user in all chats

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReportSponsoredResultAdsHidden]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReportSponsoredResult']

classmethod getType()[source]
Return type:

Literal['reportSponsoredResultAdsHidden']

to_dict()[source]
Return type:

dict

class pytdbot.types.ReportSponsoredResultFailed[source]

Bases: TlObject, ReportSponsoredResult

The sponsored message is too old or not found

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReportSponsoredResultFailed]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReportSponsoredResult']

classmethod getType()[source]
Return type:

Literal['reportSponsoredResultFailed']

to_dict()[source]
Return type:

dict

class pytdbot.types.ReportSponsoredResultOk[source]

Bases: TlObject, ReportSponsoredResult

The message was reported successfully

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReportSponsoredResultOk]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReportSponsoredResult']

classmethod getType()[source]
Return type:

Literal['reportSponsoredResultOk']

to_dict()[source]
Return type:

dict

class pytdbot.types.ReportSponsoredResultOptionRequired(title='', options=None)[source]

Bases: TlObject, ReportSponsoredResult

The user must choose an option to report the message and repeat request with the chosen option

Parameters:
  • title (str) – Title for the option choice

  • options (List["types.ReportOption"]) – List of available options

__init__(title='', options=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReportSponsoredResultOptionRequired]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReportSponsoredResult']

classmethod getType()[source]
Return type:

Literal['reportSponsoredResultOptionRequired']

to_dict()[source]
Return type:

dict

options: List[ReportOption]

List of available options

title: Optional[str]

Title for the option choice

class pytdbot.types.ReportSponsoredResultPremiumRequired[source]

Bases: TlObject, ReportSponsoredResult

The user asked to hide sponsored messages, but Telegram Premium is required for this

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReportSponsoredResultPremiumRequired]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReportSponsoredResult']

classmethod getType()[source]
Return type:

Literal['reportSponsoredResultPremiumRequired']

to_dict()[source]
Return type:

dict

class pytdbot.types.ReportStoryResult[source]

Bases: object

Describes result of story report

class pytdbot.types.ReportStoryResultOk[source]

Bases: TlObject, ReportStoryResult

The story was reported successfully

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReportStoryResultOk]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReportStoryResult']

classmethod getType()[source]
Return type:

Literal['reportStoryResultOk']

to_dict()[source]
Return type:

dict

class pytdbot.types.ReportStoryResultOptionRequired(title='', options=None)[source]

Bases: TlObject, ReportStoryResult

The user must choose an option to report the story and repeat request with the chosen option

Parameters:
  • title (str) – Title for the option choice

  • options (List["types.ReportOption"]) – List of available options

__init__(title='', options=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReportStoryResultOptionRequired]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReportStoryResult']

classmethod getType()[source]
Return type:

Literal['reportStoryResultOptionRequired']

to_dict()[source]
Return type:

dict

options: List[ReportOption]

List of available options

title: Optional[str]

Title for the option choice

class pytdbot.types.ReportStoryResultTextRequired(option_id=b'', is_optional=False)[source]

Bases: TlObject, ReportStoryResult

The user must add additional text details to the report

Parameters:
  • option_id (bytes) – Option identifier for the next reportStory request

  • is_optional (bool) – True, if the user can skip text adding

__init__(option_id=b'', is_optional=False)[source]
Parameters:
  • option_id (bytes)

  • is_optional (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ReportStoryResultTextRequired]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ReportStoryResult']

classmethod getType()[source]
Return type:

Literal['reportStoryResultTextRequired']

to_dict()[source]
Return type:

dict

is_optional: bool

True, if the user can skip text adding

option_id: Optional[bytes]

Option identifier for the next reportStory request

class pytdbot.types.ResendCodeReason[source]

Bases: object

Describes the reason why a code needs to be re-sent

class pytdbot.types.ResendCodeReasonUserRequest[source]

Bases: TlObject, ResendCodeReason

The user requested to resend the code

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ResendCodeReasonUserRequest]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ResendCodeReason']

classmethod getType()[source]
Return type:

Literal['resendCodeReasonUserRequest']

to_dict()[source]
Return type:

dict

class pytdbot.types.ResendCodeReasonVerificationFailed(error_message='')[source]

Bases: TlObject, ResendCodeReason

The code is re-sent, because device verification has failed

Parameters:

error_message (str) – Cause of the verification failure, for example, "PLAY_SERVICES_NOT_AVAILABLE", "APNS_RECEIVE_TIMEOUT", or "APNS_INIT_FAILED"

__init__(error_message='')[source]
Parameters:

error_message (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ResendCodeReasonVerificationFailed]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ResendCodeReason']

classmethod getType()[source]
Return type:

Literal['resendCodeReasonVerificationFailed']

to_dict()[source]
Return type:

dict

error_message: Optional[str]

Cause of the verification failure, for example, "PLAY_SERVICES_NOT_AVAILABLE", "APNS_RECEIVE_TIMEOUT", or "APNS_INIT_FAILED"

class pytdbot.types.ResetPasswordResult[source]

Bases: object

Represents result of 2-step verification password reset

class pytdbot.types.ResetPasswordResultDeclined(retry_date=0)[source]

Bases: TlObject, ResetPasswordResult

The password reset request was declined

Parameters:

retry_date (int) – Point in time (Unix timestamp) when the password reset can be retried

__init__(retry_date=0)[source]
Parameters:

retry_date (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ResetPasswordResultDeclined]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ResetPasswordResult']

classmethod getType()[source]
Return type:

Literal['resetPasswordResultDeclined']

to_dict()[source]
Return type:

dict

retry_date: int

Point in time (Unix timestamp) when the password reset can be retried

class pytdbot.types.ResetPasswordResultOk[source]

Bases: TlObject, ResetPasswordResult

The password was reset

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ResetPasswordResultOk]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ResetPasswordResult']

classmethod getType()[source]
Return type:

Literal['resetPasswordResultOk']

to_dict()[source]
Return type:

dict

class pytdbot.types.ResetPasswordResultPending(pending_reset_date=0)[source]

Bases: TlObject, ResetPasswordResult

The password reset request is pending

Parameters:

pending_reset_date (int) – Point in time (Unix timestamp) after which the password can be reset immediately using resetPassword

__init__(pending_reset_date=0)[source]
Parameters:

pending_reset_date (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ResetPasswordResultPending]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ResetPasswordResult']

classmethod getType()[source]
Return type:

Literal['resetPasswordResultPending']

to_dict()[source]
Return type:

dict

pending_reset_date: int

Point in time (Unix timestamp) after which the password can be reset immediately using resetPassword

class pytdbot.types.RestrictionInfo(restriction_reason='', has_sensitive_content=False)[source]

Bases: TlObject

Contains information about restrictions that must be applied to a chat or a message

Parameters:
  • restriction_reason (str) – A human-readable description of the reason why access to the content must be restricted. If empty, then the content can be accessed, but may be covered by hidden with 18+ spoiler anyway

  • has_sensitive_content (bool) – True, if media content of the messages must be hidden with 18+ spoiler. Use value of the option "can_ignore_sensitive_content_restrictions" to check whether the current user can ignore the restriction. If age verification parameters were received in updateAgeVerificationParameters, then the user must complete age verification to ignore the restriction. Set the option "ignore_sensitive_content_restrictions" to true if the user passes age verification

__init__(restriction_reason='', has_sensitive_content=False)[source]
Parameters:
  • restriction_reason (str)

  • has_sensitive_content (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[RestrictionInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['RestrictionInfo']

classmethod getType()[source]
Return type:

Literal['restrictionInfo']

to_dict()[source]
Return type:

dict

has_sensitive_content: bool

True, if media content of the messages must be hidden with 18+ spoiler. Use value of the option "can_ignore_sensitive_content_restrictions" to check whether the current user can ignore the restriction. If age verification parameters were received in updateAgeVerificationParameters, then the user must complete age verification to ignore the restriction. Set the option "ignore_sensitive_content_restrictions" to true if the user passes age verification

restriction_reason: Optional[str]

A human-readable description of the reason why access to the content must be restricted. If empty, then the content can be accessed, but may be covered by hidden with 18+ spoiler anyway

class pytdbot.types.RevenueWithdrawalState[source]

Bases: object

Describes state of a revenue withdrawal

class pytdbot.types.RevenueWithdrawalStateFailed[source]

Bases: TlObject, RevenueWithdrawalState

Withdrawal failed

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[RevenueWithdrawalStateFailed]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['RevenueWithdrawalState']

classmethod getType()[source]
Return type:

Literal['revenueWithdrawalStateFailed']

to_dict()[source]
Return type:

dict

class pytdbot.types.RevenueWithdrawalStatePending[source]

Bases: TlObject, RevenueWithdrawalState

Withdrawal is pending

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[RevenueWithdrawalStatePending]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['RevenueWithdrawalState']

classmethod getType()[source]
Return type:

Literal['revenueWithdrawalStatePending']

to_dict()[source]
Return type:

dict

class pytdbot.types.RevenueWithdrawalStateSucceeded(date=0, url='')[source]

Bases: TlObject, RevenueWithdrawalState

Withdrawal succeeded

Parameters:
  • date (int) – Point in time (Unix timestamp) when the withdrawal was completed

  • url (str) – The URL where the withdrawal transaction can be viewed

__init__(date=0, url='')[source]
Parameters:
  • date (int)

  • url (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[RevenueWithdrawalStateSucceeded]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['RevenueWithdrawalState']

classmethod getType()[source]
Return type:

Literal['revenueWithdrawalStateSucceeded']

to_dict()[source]
Return type:

dict

date: int

Point in time (Unix timestamp) when the withdrawal was completed

url: Optional[str]

The URL where the withdrawal transaction can be viewed

class pytdbot.types.RichText[source]

Bases: object

Describes a formatted text object

class pytdbot.types.RichTextAnchor(name='')[source]

Bases: TlObject, RichText

An anchor

Parameters:

name (str) – Anchor name

__init__(name='')[source]
Parameters:

name (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[RichTextAnchor]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['RichText']

classmethod getType()[source]
Return type:

Literal['richTextAnchor']

to_dict()[source]
Return type:

dict

name: Optional[str]

Anchor name

class pytdbot.types.RichTextAnchorLink(text=None, anchor_name='', url='')[source]

Bases: TlObject, RichText

A link to an anchor on the same page

Parameters:
  • text ("types.RichText") – The link text

  • anchor_name (str) – The anchor name. If the name is empty, the link must bring back to top

  • url (str) – An HTTP URL, opening the anchor

__init__(text=None, anchor_name='', url='')[source]
Parameters:
  • text (RichText | None)

  • anchor_name (str)

  • url (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[RichTextAnchorLink]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['RichText']

classmethod getType()[source]
Return type:

Literal['richTextAnchorLink']

to_dict()[source]
Return type:

dict

anchor_name: Optional[str]

The anchor name. If the name is empty, the link must bring back to top

text: Union[RichTextPlain, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextFixed, RichTextUrl, RichTextEmailAddress, RichTextSubscript, RichTextSuperscript, RichTextMarked, RichTextPhoneNumber, RichTextIcon, RichTextReference, RichTextAnchor, RichTextAnchorLink, RichTexts, None]

The link text

url: Optional[str]

An HTTP URL, opening the anchor

class pytdbot.types.RichTextBold(text=None)[source]

Bases: TlObject, RichText

A bold rich text

Parameters:

text ("types.RichText") – Text

__init__(text=None)[source]
Parameters:

text (RichText | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[RichTextBold]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['RichText']

classmethod getType()[source]
Return type:

Literal['richTextBold']

to_dict()[source]
Return type:

dict

text: Union[RichTextPlain, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextFixed, RichTextUrl, RichTextEmailAddress, RichTextSubscript, RichTextSuperscript, RichTextMarked, RichTextPhoneNumber, RichTextIcon, RichTextReference, RichTextAnchor, RichTextAnchorLink, RichTexts, None]

Text

class pytdbot.types.RichTextEmailAddress(text=None, email_address='')[source]

Bases: TlObject, RichText

A rich text email link

Parameters:
  • text ("types.RichText") – Text

  • email_address (str) – Email address

__init__(text=None, email_address='')[source]
Parameters:
  • text (RichText | None)

  • email_address (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[RichTextEmailAddress]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['RichText']

classmethod getType()[source]
Return type:

Literal['richTextEmailAddress']

to_dict()[source]
Return type:

dict

email_address: Optional[str]

Email address

text: Union[RichTextPlain, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextFixed, RichTextUrl, RichTextEmailAddress, RichTextSubscript, RichTextSuperscript, RichTextMarked, RichTextPhoneNumber, RichTextIcon, RichTextReference, RichTextAnchor, RichTextAnchorLink, RichTexts, None]

Text

class pytdbot.types.RichTextFixed(text=None)[source]

Bases: TlObject, RichText

A fixed-width rich text

Parameters:

text ("types.RichText") – Text

__init__(text=None)[source]
Parameters:

text (RichText | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[RichTextFixed]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['RichText']

classmethod getType()[source]
Return type:

Literal['richTextFixed']

to_dict()[source]
Return type:

dict

text: Union[RichTextPlain, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextFixed, RichTextUrl, RichTextEmailAddress, RichTextSubscript, RichTextSuperscript, RichTextMarked, RichTextPhoneNumber, RichTextIcon, RichTextReference, RichTextAnchor, RichTextAnchorLink, RichTexts, None]

Text

class pytdbot.types.RichTextIcon(document=None, width=0, height=0)[source]

Bases: TlObject, RichText

A small image inside the text

Parameters:
  • document ("types.Document") – The image represented as a document. The image can be in GIF, JPEG or PNG format

  • width (int) – Width of a bounding box in which the image must be shown; 0 if unknown

  • height (int) – Height of a bounding box in which the image must be shown; 0 if unknown

__init__(document=None, width=0, height=0)[source]
Parameters:
  • document (Document | None)

  • width (int)

  • height (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[RichTextIcon]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['RichText']

classmethod getType()[source]
Return type:

Literal['richTextIcon']

to_dict()[source]
Return type:

dict

document: Optional[Document]

The image represented as a document. The image can be in GIF, JPEG or PNG format

height: int

Height of a bounding box in which the image must be shown; 0 if unknown

width: int

Width of a bounding box in which the image must be shown; 0 if unknown

class pytdbot.types.RichTextItalic(text=None)[source]

Bases: TlObject, RichText

An italicized rich text

Parameters:

text ("types.RichText") – Text

__init__(text=None)[source]
Parameters:

text (RichText | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[RichTextItalic]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['RichText']

classmethod getType()[source]
Return type:

Literal['richTextItalic']

to_dict()[source]
Return type:

dict

text: Union[RichTextPlain, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextFixed, RichTextUrl, RichTextEmailAddress, RichTextSubscript, RichTextSuperscript, RichTextMarked, RichTextPhoneNumber, RichTextIcon, RichTextReference, RichTextAnchor, RichTextAnchorLink, RichTexts, None]

Text

class pytdbot.types.RichTextMarked(text=None)[source]

Bases: TlObject, RichText

A marked rich text

Parameters:

text ("types.RichText") – Text

__init__(text=None)[source]
Parameters:

text (RichText | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[RichTextMarked]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['RichText']

classmethod getType()[source]
Return type:

Literal['richTextMarked']

to_dict()[source]
Return type:

dict

text: Union[RichTextPlain, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextFixed, RichTextUrl, RichTextEmailAddress, RichTextSubscript, RichTextSuperscript, RichTextMarked, RichTextPhoneNumber, RichTextIcon, RichTextReference, RichTextAnchor, RichTextAnchorLink, RichTexts, None]

Text

class pytdbot.types.RichTextPhoneNumber(text=None, phone_number='')[source]

Bases: TlObject, RichText

A rich text phone number

Parameters:
  • text ("types.RichText") – Text

  • phone_number (str) – Phone number

__init__(text=None, phone_number='')[source]
Parameters:
  • text (RichText | None)

  • phone_number (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[RichTextPhoneNumber]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['RichText']

classmethod getType()[source]
Return type:

Literal['richTextPhoneNumber']

to_dict()[source]
Return type:

dict

phone_number: Optional[str]

Phone number

text: Union[RichTextPlain, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextFixed, RichTextUrl, RichTextEmailAddress, RichTextSubscript, RichTextSuperscript, RichTextMarked, RichTextPhoneNumber, RichTextIcon, RichTextReference, RichTextAnchor, RichTextAnchorLink, RichTexts, None]

Text

class pytdbot.types.RichTextPlain(text='')[source]

Bases: TlObject, RichText

A plain text

Parameters:

text (str) – Text

__init__(text='')[source]
Parameters:

text (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[RichTextPlain]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['RichText']

classmethod getType()[source]
Return type:

Literal['richTextPlain']

to_dict()[source]
Return type:

dict

text: Optional[str]

Text

class pytdbot.types.RichTextReference(text=None, anchor_name='', url='')[source]

Bases: TlObject, RichText

A reference to a richTexts object on the same page

Parameters:
  • text ("types.RichText") – The text

  • anchor_name (str) – The name of a richTextAnchor object, which is the first element of the target richTexts object

  • url (str) – An HTTP URL, opening the reference

__init__(text=None, anchor_name='', url='')[source]
Parameters:
  • text (RichText | None)

  • anchor_name (str)

  • url (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[RichTextReference]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['RichText']

classmethod getType()[source]
Return type:

Literal['richTextReference']

to_dict()[source]
Return type:

dict

anchor_name: Optional[str]

The name of a richTextAnchor object, which is the first element of the target richTexts object

text: Union[RichTextPlain, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextFixed, RichTextUrl, RichTextEmailAddress, RichTextSubscript, RichTextSuperscript, RichTextMarked, RichTextPhoneNumber, RichTextIcon, RichTextReference, RichTextAnchor, RichTextAnchorLink, RichTexts, None]

The text

url: Optional[str]

An HTTP URL, opening the reference

class pytdbot.types.RichTextStrikethrough(text=None)[source]

Bases: TlObject, RichText

A strikethrough rich text

Parameters:

text ("types.RichText") – Text

__init__(text=None)[source]
Parameters:

text (RichText | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[RichTextStrikethrough]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['RichText']

classmethod getType()[source]
Return type:

Literal['richTextStrikethrough']

to_dict()[source]
Return type:

dict

text: Union[RichTextPlain, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextFixed, RichTextUrl, RichTextEmailAddress, RichTextSubscript, RichTextSuperscript, RichTextMarked, RichTextPhoneNumber, RichTextIcon, RichTextReference, RichTextAnchor, RichTextAnchorLink, RichTexts, None]

Text

class pytdbot.types.RichTextSubscript(text=None)[source]

Bases: TlObject, RichText

A subscript rich text

Parameters:

text ("types.RichText") – Text

__init__(text=None)[source]
Parameters:

text (RichText | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[RichTextSubscript]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['RichText']

classmethod getType()[source]
Return type:

Literal['richTextSubscript']

to_dict()[source]
Return type:

dict

text: Union[RichTextPlain, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextFixed, RichTextUrl, RichTextEmailAddress, RichTextSubscript, RichTextSuperscript, RichTextMarked, RichTextPhoneNumber, RichTextIcon, RichTextReference, RichTextAnchor, RichTextAnchorLink, RichTexts, None]

Text

class pytdbot.types.RichTextSuperscript(text=None)[source]

Bases: TlObject, RichText

A superscript rich text

Parameters:

text ("types.RichText") – Text

__init__(text=None)[source]
Parameters:

text (RichText | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[RichTextSuperscript]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['RichText']

classmethod getType()[source]
Return type:

Literal['richTextSuperscript']

to_dict()[source]
Return type:

dict

text: Union[RichTextPlain, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextFixed, RichTextUrl, RichTextEmailAddress, RichTextSubscript, RichTextSuperscript, RichTextMarked, RichTextPhoneNumber, RichTextIcon, RichTextReference, RichTextAnchor, RichTextAnchorLink, RichTexts, None]

Text

class pytdbot.types.RichTextUnderline(text=None)[source]

Bases: TlObject, RichText

An underlined rich text

Parameters:

text ("types.RichText") – Text

__init__(text=None)[source]
Parameters:

text (RichText | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[RichTextUnderline]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['RichText']

classmethod getType()[source]
Return type:

Literal['richTextUnderline']

to_dict()[source]
Return type:

dict

text: Union[RichTextPlain, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextFixed, RichTextUrl, RichTextEmailAddress, RichTextSubscript, RichTextSuperscript, RichTextMarked, RichTextPhoneNumber, RichTextIcon, RichTextReference, RichTextAnchor, RichTextAnchorLink, RichTexts, None]

Text

class pytdbot.types.RichTextUrl(text=None, url='', is_cached=False)[source]

Bases: TlObject, RichText

A rich text URL link

Parameters:
  • text ("types.RichText") – Text

  • url (str) – URL

  • is_cached (bool) – True, if the URL has cached instant view server-side

__init__(text=None, url='', is_cached=False)[source]
Parameters:
  • text (RichText | None)

  • url (str)

  • is_cached (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[RichTextUrl]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['RichText']

classmethod getType()[source]
Return type:

Literal['richTextUrl']

to_dict()[source]
Return type:

dict

is_cached: bool

True, if the URL has cached instant view server-side

text: Union[RichTextPlain, RichTextBold, RichTextItalic, RichTextUnderline, RichTextStrikethrough, RichTextFixed, RichTextUrl, RichTextEmailAddress, RichTextSubscript, RichTextSuperscript, RichTextMarked, RichTextPhoneNumber, RichTextIcon, RichTextReference, RichTextAnchor, RichTextAnchorLink, RichTexts, None]

Text

url: Optional[str]

URL

class pytdbot.types.RichTexts(texts=None)[source]

Bases: TlObject, RichText

A concatenation of rich texts

Parameters:

texts (List["types.RichText"]) – Texts

__init__(texts=None)[source]
Parameters:

texts (List[RichText] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[RichTexts]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['RichText']

classmethod getType()[source]
Return type:

Literal['richTexts']

to_dict()[source]
Return type:

dict

texts: List[RichText]

Texts

class pytdbot.types.RtmpUrl(url='', stream_key='')[source]

Bases: TlObject

Represents an RTMP URL

Parameters:
  • url (str) – The URL

  • stream_key (str) – Stream key

__init__(url='', stream_key='')[source]
Parameters:
  • url (str)

  • stream_key (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[RtmpUrl]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['RtmpUrl']

classmethod getType()[source]
Return type:

Literal['rtmpUrl']

to_dict()[source]
Return type:

dict

stream_key: Optional[str]

Stream key

url: Optional[str]

The URL

class pytdbot.types.SavedCredentials(id='', title='')[source]

Bases: TlObject

Contains information about saved payment credentials

Parameters:
  • id (str) – Unique identifier of the saved credentials

  • title (str) – Title of the saved credentials

__init__(id='', title='')[source]
Parameters:
  • id (str)

  • title (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SavedCredentials]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SavedCredentials']

classmethod getType()[source]
Return type:

Literal['savedCredentials']

to_dict()[source]
Return type:

dict

id: Optional[str]

Unique identifier of the saved credentials

title: Optional[str]

Title of the saved credentials

class pytdbot.types.SavedMessagesTag(tag=None, label='', count=0)[source]

Bases: TlObject

Represents a tag used in Saved Messages or a Saved Messages topic

Parameters:
  • tag ("types.ReactionType") – The tag

  • label (str) – Label of the tag; 0-12 characters. Always empty if the tag is returned for a Saved Messages topic

  • count (int) – Number of times the tag was used; may be 0 if the tag has non-empty label

__init__(tag=None, label='', count=0)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SavedMessagesTag]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SavedMessagesTag']

classmethod getType()[source]
Return type:

Literal['savedMessagesTag']

to_dict()[source]
Return type:

dict

count: int

Number of times the tag was used; may be 0 if the tag has non-empty label

label: Optional[str]

Label of the tag; 0-12 characters. Always empty if the tag is returned for a Saved Messages topic

tag: Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid, None]

The tag

class pytdbot.types.SavedMessagesTags(tags=None)[source]

Bases: TlObject

Contains a list of tags used in Saved Messages

Parameters:

tags (List["types.SavedMessagesTag"]) – List of tags

__init__(tags=None)[source]
Parameters:

tags (List[SavedMessagesTag] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SavedMessagesTags]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SavedMessagesTags']

classmethod getType()[source]
Return type:

Literal['savedMessagesTags']

to_dict()[source]
Return type:

dict

tags: List[SavedMessagesTag]

List of tags

class pytdbot.types.SavedMessagesTopic(id=0, type=None, is_pinned=False, order=0, last_message=None, draft_message=None)[source]

Bases: TlObject

Contains information about a Saved Messages topic

Parameters:
  • id (int) – Unique topic identifier

  • type ("types.SavedMessagesTopicType") – Type of the topic

  • is_pinned (bool) – True, if the topic is pinned

  • order (int) – A parameter used to determine order of the topic in the topic list. Topics must be sorted by the order in descending order

  • last_message ("types.Message") – Last message in the topic; may be null if none or unknown

  • draft_message ("types.DraftMessage") – A draft of a message in the topic; may be null if none

__init__(id=0, type=None, is_pinned=False, order=0, last_message=None, draft_message=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SavedMessagesTopic]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SavedMessagesTopic']

classmethod getType()[source]
Return type:

Literal['savedMessagesTopic']

to_dict()[source]
Return type:

dict

draft_message: Optional[DraftMessage]

A draft of a message in the topic; may be null if none

id: int

Unique topic identifier

is_pinned: bool

True, if the topic is pinned

last_message: Optional[Message]

Last message in the topic; may be null if none or unknown

order: int

A parameter used to determine order of the topic in the topic list. Topics must be sorted by the order in descending order

type: Union[SavedMessagesTopicTypeMyNotes, SavedMessagesTopicTypeAuthorHidden, SavedMessagesTopicTypeSavedFromChat, None]

Type of the topic

class pytdbot.types.SavedMessagesTopicType[source]

Bases: object

Describes type of Saved Messages topic

class pytdbot.types.SavedMessagesTopicTypeAuthorHidden[source]

Bases: TlObject, SavedMessagesTopicType

Topic containing messages forwarded from a user with hidden privacy

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SavedMessagesTopicTypeAuthorHidden]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SavedMessagesTopicType']

classmethod getType()[source]
Return type:

Literal['savedMessagesTopicTypeAuthorHidden']

to_dict()[source]
Return type:

dict

class pytdbot.types.SavedMessagesTopicTypeMyNotes[source]

Bases: TlObject, SavedMessagesTopicType

Topic containing messages sent by the current user of forwarded from an unknown chat

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SavedMessagesTopicTypeMyNotes]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SavedMessagesTopicType']

classmethod getType()[source]
Return type:

Literal['savedMessagesTopicTypeMyNotes']

to_dict()[source]
Return type:

dict

class pytdbot.types.SavedMessagesTopicTypeSavedFromChat(chat_id=0)[source]

Bases: TlObject, SavedMessagesTopicType

Topic containing messages forwarded from a specific chat

Parameters:

chat_id (int) – Identifier of the chat

__init__(chat_id=0)[source]
Parameters:

chat_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SavedMessagesTopicTypeSavedFromChat]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SavedMessagesTopicType']

classmethod getType()[source]
Return type:

Literal['savedMessagesTopicTypeSavedFromChat']

to_dict()[source]
Return type:

dict

chat_id: int

Identifier of the chat

class pytdbot.types.ScheduledEvent(event_id=0, send_at=0)[source]

Bases: object

Describes a scheduled event

Parameters:
  • event_id (int) – Unique identifier of the scheduled event

  • send_at (int) – Point in time (Unix timestamp) when the scheduled event will be sent

__init__(event_id=0, send_at=0)[source]
Parameters:
  • event_id (int)

  • send_at (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ScheduledEvent]

Parameters:

data (dict)

getClass()[source]
Return type:

Literal['ScheduledEvent']

getType()[source]
Return type:

Literal['scheduledEvent']

to_dict()[source]
Return type:

dict

event_id

Unique identifier of the scheduled event

send_at

Point in time (Unix timestamp) when the scheduled event will be sent

class pytdbot.types.ScopeAutosaveSettings(autosave_photos=False, autosave_videos=False, max_video_file_size=0)[source]

Bases: TlObject

Contains autosave settings for an autosave settings scope

Parameters:
  • autosave_photos (bool) – True, if photo autosave is enabled

  • autosave_videos (bool) – True, if video autosave is enabled

  • max_video_file_size (int) – The maximum size of a video file to be autosaved, in bytes; 512 KB - 4000 MB

__init__(autosave_photos=False, autosave_videos=False, max_video_file_size=0)[source]
Parameters:
  • autosave_photos (bool)

  • autosave_videos (bool)

  • max_video_file_size (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ScopeAutosaveSettings]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ScopeAutosaveSettings']

classmethod getType()[source]
Return type:

Literal['scopeAutosaveSettings']

to_dict()[source]
Return type:

dict

autosave_photos: bool

True, if photo autosave is enabled

autosave_videos: bool

True, if video autosave is enabled

max_video_file_size: int

The maximum size of a video file to be autosaved, in bytes; 512 KB - 4000 MB

class pytdbot.types.ScopeNotificationSettings(mute_for=0, sound_id=0, show_preview=False, use_default_mute_stories=False, mute_stories=False, story_sound_id=0, show_story_poster=False, disable_pinned_message_notifications=False, disable_mention_notifications=False)[source]

Bases: TlObject

Contains information about notification settings for several chats

Parameters:
  • mute_for (int) – Time left before notifications will be unmuted, in seconds

  • sound_id (int) – Identifier of the notification sound to be played; 0 if sound is disabled

  • show_preview (bool) – True, if message content must be displayed in notifications

  • use_default_mute_stories (bool) – If true, story notifications are received only for the first 5 chats from topChatCategoryUsers regardless of the value of mute_stories

  • mute_stories (bool) – True, if story notifications are disabled

  • story_sound_id (int) – Identifier of the notification sound to be played for stories; 0 if sound is disabled

  • show_story_poster (bool) – True, if the chat that posted a story must be displayed in notifications

  • disable_pinned_message_notifications (bool) – True, if notifications for incoming pinned messages will be created as for an ordinary unread message

  • disable_mention_notifications (bool) – True, if notifications for messages with mentions will be created as for an ordinary unread message

__init__(mute_for=0, sound_id=0, show_preview=False, use_default_mute_stories=False, mute_stories=False, story_sound_id=0, show_story_poster=False, disable_pinned_message_notifications=False, disable_mention_notifications=False)[source]
Parameters:
  • mute_for (int)

  • sound_id (int)

  • show_preview (bool)

  • use_default_mute_stories (bool)

  • mute_stories (bool)

  • story_sound_id (int)

  • show_story_poster (bool)

  • disable_pinned_message_notifications (bool)

  • disable_mention_notifications (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ScopeNotificationSettings]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ScopeNotificationSettings']

classmethod getType()[source]
Return type:

Literal['scopeNotificationSettings']

to_dict()[source]
Return type:

dict

disable_mention_notifications: bool

True, if notifications for messages with mentions will be created as for an ordinary unread message

disable_pinned_message_notifications: bool

True, if notifications for incoming pinned messages will be created as for an ordinary unread message

mute_for: int

Time left before notifications will be unmuted, in seconds

mute_stories: bool

True, if story notifications are disabled

show_preview: bool

True, if message content must be displayed in notifications

show_story_poster: bool

True, if the chat that posted a story must be displayed in notifications

sound_id: int

Identifier of the notification sound to be played; 0 if sound is disabled

story_sound_id: int

Identifier of the notification sound to be played for stories; 0 if sound is disabled

use_default_mute_stories: bool

If true, story notifications are received only for the first 5 chats from topChatCategoryUsers regardless of the value of mute_stories

class pytdbot.types.SearchMessagesChatTypeFilter[source]

Bases: object

Represents a filter for type of the chats in which to search messages

class pytdbot.types.SearchMessagesChatTypeFilterChannel[source]

Bases: TlObject, SearchMessagesChatTypeFilter

Returns only messages in channel chats

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SearchMessagesChatTypeFilterChannel]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SearchMessagesChatTypeFilter']

classmethod getType()[source]
Return type:

Literal['searchMessagesChatTypeFilterChannel']

to_dict()[source]
Return type:

dict

class pytdbot.types.SearchMessagesChatTypeFilterGroup[source]

Bases: TlObject, SearchMessagesChatTypeFilter

Returns only messages in basic group and supergroup chats

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SearchMessagesChatTypeFilterGroup]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SearchMessagesChatTypeFilter']

classmethod getType()[source]
Return type:

Literal['searchMessagesChatTypeFilterGroup']

to_dict()[source]
Return type:

dict

class pytdbot.types.SearchMessagesChatTypeFilterPrivate[source]

Bases: TlObject, SearchMessagesChatTypeFilter

Returns only messages in private chats

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SearchMessagesChatTypeFilterPrivate]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SearchMessagesChatTypeFilter']

classmethod getType()[source]
Return type:

Literal['searchMessagesChatTypeFilterPrivate']

to_dict()[source]
Return type:

dict

class pytdbot.types.SearchMessagesFilter[source]

Bases: object

Represents a filter for message search results

class pytdbot.types.SearchMessagesFilterAnimation[source]

Bases: TlObject, SearchMessagesFilter

Returns only animation messages

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SearchMessagesFilterAnimation]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SearchMessagesFilter']

classmethod getType()[source]
Return type:

Literal['searchMessagesFilterAnimation']

to_dict()[source]
Return type:

dict

class pytdbot.types.SearchMessagesFilterAudio[source]

Bases: TlObject, SearchMessagesFilter

Returns only audio messages

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SearchMessagesFilterAudio]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SearchMessagesFilter']

classmethod getType()[source]
Return type:

Literal['searchMessagesFilterAudio']

to_dict()[source]
Return type:

dict

class pytdbot.types.SearchMessagesFilterChatPhoto[source]

Bases: TlObject, SearchMessagesFilter

Returns only messages containing chat photos

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SearchMessagesFilterChatPhoto]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SearchMessagesFilter']

classmethod getType()[source]
Return type:

Literal['searchMessagesFilterChatPhoto']

to_dict()[source]
Return type:

dict

class pytdbot.types.SearchMessagesFilterDocument[source]

Bases: TlObject, SearchMessagesFilter

Returns only document messages

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SearchMessagesFilterDocument]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SearchMessagesFilter']

classmethod getType()[source]
Return type:

Literal['searchMessagesFilterDocument']

to_dict()[source]
Return type:

dict

class pytdbot.types.SearchMessagesFilterEmpty[source]

Bases: TlObject, SearchMessagesFilter

Returns all found messages, no filter is applied

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SearchMessagesFilterEmpty]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SearchMessagesFilter']

classmethod getType()[source]
Return type:

Literal['searchMessagesFilterEmpty']

to_dict()[source]
Return type:

dict

class pytdbot.types.SearchMessagesFilterFailedToSend[source]

Bases: TlObject, SearchMessagesFilter

Returns only failed to send messages. This filter can be used only if the message database is used

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SearchMessagesFilterFailedToSend]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SearchMessagesFilter']

classmethod getType()[source]
Return type:

Literal['searchMessagesFilterFailedToSend']

to_dict()[source]
Return type:

dict

class pytdbot.types.SearchMessagesFilterMention[source]

Bases: TlObject, SearchMessagesFilter

Returns only messages with mentions of the current user, or messages that are replies to their messages

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SearchMessagesFilterMention]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SearchMessagesFilter']

classmethod getType()[source]
Return type:

Literal['searchMessagesFilterMention']

to_dict()[source]
Return type:

dict

class pytdbot.types.SearchMessagesFilterPhoto[source]

Bases: TlObject, SearchMessagesFilter

Returns only photo messages

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SearchMessagesFilterPhoto]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SearchMessagesFilter']

classmethod getType()[source]
Return type:

Literal['searchMessagesFilterPhoto']

to_dict()[source]
Return type:

dict

class pytdbot.types.SearchMessagesFilterPhotoAndVideo[source]

Bases: TlObject, SearchMessagesFilter

Returns only photo and video messages

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SearchMessagesFilterPhotoAndVideo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SearchMessagesFilter']

classmethod getType()[source]
Return type:

Literal['searchMessagesFilterPhotoAndVideo']

to_dict()[source]
Return type:

dict

class pytdbot.types.SearchMessagesFilterPinned[source]

Bases: TlObject, SearchMessagesFilter

Returns only pinned messages

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SearchMessagesFilterPinned]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SearchMessagesFilter']

classmethod getType()[source]
Return type:

Literal['searchMessagesFilterPinned']

to_dict()[source]
Return type:

dict

class pytdbot.types.SearchMessagesFilterUnreadMention[source]

Bases: TlObject, SearchMessagesFilter

Returns only messages with unread mentions of the current user, or messages that are replies to their messages. When using this filter the results can’t be additionally filtered by a query, a message thread or by the sending user

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SearchMessagesFilterUnreadMention]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SearchMessagesFilter']

classmethod getType()[source]
Return type:

Literal['searchMessagesFilterUnreadMention']

to_dict()[source]
Return type:

dict

class pytdbot.types.SearchMessagesFilterUnreadReaction[source]

Bases: TlObject, SearchMessagesFilter

Returns only messages with unread reactions for the current user. When using this filter the results can’t be additionally filtered by a query, a message thread or by the sending user

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SearchMessagesFilterUnreadReaction]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SearchMessagesFilter']

classmethod getType()[source]
Return type:

Literal['searchMessagesFilterUnreadReaction']

to_dict()[source]
Return type:

dict

class pytdbot.types.SearchMessagesFilterUrl[source]

Bases: TlObject, SearchMessagesFilter

Returns only messages containing URLs

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SearchMessagesFilterUrl]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SearchMessagesFilter']

classmethod getType()[source]
Return type:

Literal['searchMessagesFilterUrl']

to_dict()[source]
Return type:

dict

class pytdbot.types.SearchMessagesFilterVideo[source]

Bases: TlObject, SearchMessagesFilter

Returns only video messages

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SearchMessagesFilterVideo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SearchMessagesFilter']

classmethod getType()[source]
Return type:

Literal['searchMessagesFilterVideo']

to_dict()[source]
Return type:

dict

class pytdbot.types.SearchMessagesFilterVideoNote[source]

Bases: TlObject, SearchMessagesFilter

Returns only video note messages

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SearchMessagesFilterVideoNote]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SearchMessagesFilter']

classmethod getType()[source]
Return type:

Literal['searchMessagesFilterVideoNote']

to_dict()[source]
Return type:

dict

class pytdbot.types.SearchMessagesFilterVoiceAndVideoNote[source]

Bases: TlObject, SearchMessagesFilter

Returns only voice and video note messages

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SearchMessagesFilterVoiceAndVideoNote]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SearchMessagesFilter']

classmethod getType()[source]
Return type:

Literal['searchMessagesFilterVoiceAndVideoNote']

to_dict()[source]
Return type:

dict

class pytdbot.types.SearchMessagesFilterVoiceNote[source]

Bases: TlObject, SearchMessagesFilter

Returns only voice note messages

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SearchMessagesFilterVoiceNote]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SearchMessagesFilter']

classmethod getType()[source]
Return type:

Literal['searchMessagesFilterVoiceNote']

to_dict()[source]
Return type:

dict

class pytdbot.types.Seconds(seconds=0.0)[source]

Bases: TlObject

Contains a value representing a number of seconds

Parameters:

seconds (float) – Number of seconds

__init__(seconds=0.0)[source]
Parameters:

seconds (float)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Seconds]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Seconds']

classmethod getType()[source]
Return type:

Literal['seconds']

to_dict()[source]
Return type:

dict

seconds: float

Number of seconds

class pytdbot.types.SecretChat(id=0, user_id=0, state=None, is_outbound=False, key_hash=b'', layer=0)[source]

Bases: TlObject

Represents a secret chat

Parameters:
  • id (int) – Secret chat identifier

  • user_id (int) – Identifier of the chat partner

  • state ("types.SecretChatState") – State of the secret chat

  • is_outbound (bool) – True, if the chat was created by the current user; false otherwise

  • key_hash (bytes) – Hash of the currently used key for comparison with the hash of the chat partner’s key. This is a string of 36 little-endian bytes, which must be split into groups of 2 bits, each denoting a pixel of one of 4 colors FFFFFF, D5E6F3, 2D5775, and 2F99C9. The pixels must be used to make a 12x12 square image filled from left to right, top to bottom. Alternatively, the first 32 bytes of the hash can be converted to the hexadecimal format and printed as 32 2-digit hex numbers

  • layer (int) – Secret chat layer; determines features supported by the chat partner’s application. Nested text entities and underline and strikethrough entities are supported if the layer >= 101, files bigger than 2000MB are supported if the layer >= 143, spoiler and custom emoji text entities are supported if the layer >= 144

__init__(id=0, user_id=0, state=None, is_outbound=False, key_hash=b'', layer=0)[source]
Parameters:
  • id (int)

  • user_id (int)

  • state (SecretChatState | None)

  • is_outbound (bool)

  • key_hash (bytes)

  • layer (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SecretChat]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SecretChat']

classmethod getType()[source]
Return type:

Literal['secretChat']

to_dict()[source]
Return type:

dict

id: int

Secret chat identifier

is_outbound: bool

True, if the chat was created by the current user; false otherwise

key_hash: Optional[bytes]

Hash of the currently used key for comparison with the hash of the chat partner’s key. This is a string of 36 little-endian bytes, which must be split into groups of 2 bits, each denoting a pixel of one of 4 colors FFFFFF, D5E6F3, 2D5775, and 2F99C9. The pixels must be used to make a 12x12 square image filled from left to right, top to bottom. Alternatively, the first 32 bytes of the hash can be converted to the hexadecimal format and printed as 32 2-digit hex numbers

layer: int

Secret chat layer; determines features supported by the chat partner’s application. Nested text entities and underline and strikethrough entities are supported if the layer >= 101, files bigger than 2000MB are supported if the layer >= 143, spoiler and custom emoji text entities are supported if the layer >= 144

state: Union[SecretChatStatePending, SecretChatStateReady, SecretChatStateClosed, None]

State of the secret chat

user_id: int

Identifier of the chat partner

class pytdbot.types.SecretChatState[source]

Bases: object

Describes the current secret chat state

class pytdbot.types.SecretChatStateClosed[source]

Bases: TlObject, SecretChatState

The secret chat is closed

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SecretChatStateClosed]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SecretChatState']

classmethod getType()[source]
Return type:

Literal['secretChatStateClosed']

to_dict()[source]
Return type:

dict

class pytdbot.types.SecretChatStatePending[source]

Bases: TlObject, SecretChatState

The secret chat is not yet created; waiting for the other user to get online

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SecretChatStatePending]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SecretChatState']

classmethod getType()[source]
Return type:

Literal['secretChatStatePending']

to_dict()[source]
Return type:

dict

class pytdbot.types.SecretChatStateReady[source]

Bases: TlObject, SecretChatState

The secret chat is ready to use

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SecretChatStateReady]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SecretChatState']

classmethod getType()[source]
Return type:

Literal['secretChatStateReady']

to_dict()[source]
Return type:

dict

class pytdbot.types.SentGift[source]

Bases: object

Represents content of a gift received by a user or a channel chat

class pytdbot.types.SentGiftRegular(gift=None)[source]

Bases: TlObject, SentGift

Regular gift

Parameters:

gift ("types.Gift") – The gift

__init__(gift=None)[source]
Parameters:

gift (Gift | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SentGiftRegular]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SentGift']

classmethod getType()[source]
Return type:

Literal['sentGiftRegular']

to_dict()[source]
Return type:

dict

gift: Optional[Gift]

The gift

class pytdbot.types.SentGiftUpgraded(gift=None)[source]

Bases: TlObject, SentGift

Upgraded gift

Parameters:

gift ("types.UpgradedGift") – The gift

__init__(gift=None)[source]
Parameters:

gift (UpgradedGift | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SentGiftUpgraded]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SentGift']

classmethod getType()[source]
Return type:

Literal['sentGiftUpgraded']

to_dict()[source]
Return type:

dict

gift: Optional[UpgradedGift]

The gift

class pytdbot.types.SentWebAppMessage(inline_message_id='')[source]

Bases: TlObject

Information about the message sent by answerWebAppQuery

Parameters:

inline_message_id (str) – Identifier of the sent inline message, if known

__init__(inline_message_id='')[source]
Parameters:

inline_message_id (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SentWebAppMessage]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SentWebAppMessage']

classmethod getType()[source]
Return type:

Literal['sentWebAppMessage']

to_dict()[source]
Return type:

dict

inline_message_id: Optional[str]

Identifier of the sent inline message, if known

class pytdbot.types.ServerStats(my_id=0, uptime=0, updates_count=0, requests_count=0)[source]

Bases: object

Describes TDLib Server stats

Parameters:
  • my_id (int) – Identifier of the current user

  • uptime (int) – Server uptime in seconds

  • updates_count (int) – Total number of received updates

  • requests_count (int) – Total number of sent requests

__init__(my_id=0, uptime=0, updates_count=0, requests_count=0)[source]
Parameters:
  • my_id (int)

  • uptime (int)

  • updates_count (int)

  • requests_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ServerStats]

Parameters:

data (dict)

getClass()[source]
Return type:

Literal['ServerStats']

getType()[source]
Return type:

Literal['serverStats']

to_dict()[source]
Return type:

dict

my_id

Identifier of the current user

requests_count

Total number of sent requests

updates_count

Total number of received updates

uptime

Server uptime in seconds

class pytdbot.types.Session(id=0, is_current=False, is_password_pending=False, is_unconfirmed=False, can_accept_secret_chats=False, can_accept_calls=False, type=None, api_id=0, application_name='', application_version='', is_official_application=False, device_model='', platform='', system_version='', log_in_date=0, last_active_date=0, ip_address='', location='')[source]

Bases: TlObject

Contains information about one session in a Telegram application used by the current user. Sessions must be shown to the user in the returned order

Parameters:
  • id (int) – Session identifier

  • is_current (bool) – True, if this session is the current session

  • is_password_pending (bool) – True, if a 2-step verification password is needed to complete authorization of the session

  • is_unconfirmed (bool) – True, if the session wasn’t confirmed from another session

  • can_accept_secret_chats (bool) – True, if incoming secret chats can be accepted by the session

  • can_accept_calls (bool) – True, if incoming calls can be accepted by the session

  • type ("types.SessionType") – Session type based on the system and application version, which can be used to display a corresponding icon

  • api_id (int) – Telegram API identifier, as provided by the application

  • application_name (str) – Name of the application, as provided by the application

  • application_version (str) – The version of the application, as provided by the application

  • is_official_application (bool) – True, if the application is an official application or uses the api_id of an official application

  • device_model (str) – Model of the device the application has been run or is running on, as provided by the application

  • platform (str) – Operating system the application has been run or is running on, as provided by the application

  • system_version (str) – Version of the operating system the application has been run or is running on, as provided by the application

  • log_in_date (int) – Point in time (Unix timestamp) when the user has logged in

  • last_active_date (int) – Point in time (Unix timestamp) when the session was last used

  • ip_address (str) – IP address from which the session was created, in human-readable format

  • location (str) – A human-readable description of the location from which the session was created, based on the IP address

__init__(id=0, is_current=False, is_password_pending=False, is_unconfirmed=False, can_accept_secret_chats=False, can_accept_calls=False, type=None, api_id=0, application_name='', application_version='', is_official_application=False, device_model='', platform='', system_version='', log_in_date=0, last_active_date=0, ip_address='', location='')[source]
Parameters:
  • id (int)

  • is_current (bool)

  • is_password_pending (bool)

  • is_unconfirmed (bool)

  • can_accept_secret_chats (bool)

  • can_accept_calls (bool)

  • type (SessionType | None)

  • api_id (int)

  • application_name (str)

  • application_version (str)

  • is_official_application (bool)

  • device_model (str)

  • platform (str)

  • system_version (str)

  • log_in_date (int)

  • last_active_date (int)

  • ip_address (str)

  • location (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Session]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Session']

classmethod getType()[source]
Return type:

Literal['session']

to_dict()[source]
Return type:

dict

api_id: int

Telegram API identifier, as provided by the application

application_name: Optional[str]

Name of the application, as provided by the application

application_version: Optional[str]

The version of the application, as provided by the application

can_accept_calls: bool

True, if incoming calls can be accepted by the session

can_accept_secret_chats: bool

True, if incoming secret chats can be accepted by the session

device_model: Optional[str]

Model of the device the application has been run or is running on, as provided by the application

id: int

Session identifier

ip_address: Optional[str]

IP address from which the session was created, in human-readable format

is_current: bool

True, if this session is the current session

is_official_application: bool

True, if the application is an official application or uses the api_id of an official application

is_password_pending: bool

True, if a 2-step verification password is needed to complete authorization of the session

is_unconfirmed: bool

True, if the session wasn’t confirmed from another session

last_active_date: int

Point in time (Unix timestamp) when the session was last used

location: Optional[str]

A human-readable description of the location from which the session was created, based on the IP address

log_in_date: int

Point in time (Unix timestamp) when the user has logged in

platform: Optional[str]

Operating system the application has been run or is running on, as provided by the application

system_version: Optional[str]

Version of the operating system the application has been run or is running on, as provided by the application

type: Union[SessionTypeAndroid, SessionTypeApple, SessionTypeBrave, SessionTypeChrome, SessionTypeEdge, SessionTypeFirefox, SessionTypeIpad, SessionTypeIphone, SessionTypeLinux, SessionTypeMac, SessionTypeOpera, SessionTypeSafari, SessionTypeUbuntu, SessionTypeUnknown, SessionTypeVivaldi, SessionTypeWindows, SessionTypeXbox, None]

Session type based on the system and application version, which can be used to display a corresponding icon

class pytdbot.types.SessionType[source]

Bases: object

Represents the type of session

class pytdbot.types.SessionTypeAndroid[source]

Bases: TlObject, SessionType

The session is running on an Android device

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SessionTypeAndroid]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SessionType']

classmethod getType()[source]
Return type:

Literal['sessionTypeAndroid']

to_dict()[source]
Return type:

dict

class pytdbot.types.SessionTypeApple[source]

Bases: TlObject, SessionType

The session is running on a generic Apple device

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SessionTypeApple]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SessionType']

classmethod getType()[source]
Return type:

Literal['sessionTypeApple']

to_dict()[source]
Return type:

dict

class pytdbot.types.SessionTypeBrave[source]

Bases: TlObject, SessionType

The session is running on the Brave browser

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SessionTypeBrave]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SessionType']

classmethod getType()[source]
Return type:

Literal['sessionTypeBrave']

to_dict()[source]
Return type:

dict

class pytdbot.types.SessionTypeChrome[source]

Bases: TlObject, SessionType

The session is running on the Chrome browser

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SessionTypeChrome]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SessionType']

classmethod getType()[source]
Return type:

Literal['sessionTypeChrome']

to_dict()[source]
Return type:

dict

class pytdbot.types.SessionTypeEdge[source]

Bases: TlObject, SessionType

The session is running on the Edge browser

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SessionTypeEdge]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SessionType']

classmethod getType()[source]
Return type:

Literal['sessionTypeEdge']

to_dict()[source]
Return type:

dict

class pytdbot.types.SessionTypeFirefox[source]

Bases: TlObject, SessionType

The session is running on the Firefox browser

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SessionTypeFirefox]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SessionType']

classmethod getType()[source]
Return type:

Literal['sessionTypeFirefox']

to_dict()[source]
Return type:

dict

class pytdbot.types.SessionTypeIpad[source]

Bases: TlObject, SessionType

The session is running on an iPad device

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SessionTypeIpad]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SessionType']

classmethod getType()[source]
Return type:

Literal['sessionTypeIpad']

to_dict()[source]
Return type:

dict

class pytdbot.types.SessionTypeIphone[source]

Bases: TlObject, SessionType

The session is running on an iPhone device

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SessionTypeIphone]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SessionType']

classmethod getType()[source]
Return type:

Literal['sessionTypeIphone']

to_dict()[source]
Return type:

dict

class pytdbot.types.SessionTypeLinux[source]

Bases: TlObject, SessionType

The session is running on a Linux device

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SessionTypeLinux]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SessionType']

classmethod getType()[source]
Return type:

Literal['sessionTypeLinux']

to_dict()[source]
Return type:

dict

class pytdbot.types.SessionTypeMac[source]

Bases: TlObject, SessionType

The session is running on a Mac device

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SessionTypeMac]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SessionType']

classmethod getType()[source]
Return type:

Literal['sessionTypeMac']

to_dict()[source]
Return type:

dict

class pytdbot.types.SessionTypeOpera[source]

Bases: TlObject, SessionType

The session is running on the Opera browser

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SessionTypeOpera]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SessionType']

classmethod getType()[source]
Return type:

Literal['sessionTypeOpera']

to_dict()[source]
Return type:

dict

class pytdbot.types.SessionTypeSafari[source]

Bases: TlObject, SessionType

The session is running on the Safari browser

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SessionTypeSafari]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SessionType']

classmethod getType()[source]
Return type:

Literal['sessionTypeSafari']

to_dict()[source]
Return type:

dict

class pytdbot.types.SessionTypeUbuntu[source]

Bases: TlObject, SessionType

The session is running on an Ubuntu device

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SessionTypeUbuntu]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SessionType']

classmethod getType()[source]
Return type:

Literal['sessionTypeUbuntu']

to_dict()[source]
Return type:

dict

class pytdbot.types.SessionTypeUnknown[source]

Bases: TlObject, SessionType

The session is running on an unknown type of device

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SessionTypeUnknown]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SessionType']

classmethod getType()[source]
Return type:

Literal['sessionTypeUnknown']

to_dict()[source]
Return type:

dict

class pytdbot.types.SessionTypeVivaldi[source]

Bases: TlObject, SessionType

The session is running on the Vivaldi browser

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SessionTypeVivaldi]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SessionType']

classmethod getType()[source]
Return type:

Literal['sessionTypeVivaldi']

to_dict()[source]
Return type:

dict

class pytdbot.types.SessionTypeWindows[source]

Bases: TlObject, SessionType

The session is running on a Windows device

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SessionTypeWindows]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SessionType']

classmethod getType()[source]
Return type:

Literal['sessionTypeWindows']

to_dict()[source]
Return type:

dict

class pytdbot.types.SessionTypeXbox[source]

Bases: TlObject, SessionType

The session is running on an Xbox console

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SessionTypeXbox]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SessionType']

classmethod getType()[source]
Return type:

Literal['sessionTypeXbox']

to_dict()[source]
Return type:

dict

class pytdbot.types.Sessions(sessions=None, inactive_session_ttl_days=0)[source]

Bases: TlObject

Contains a list of sessions

Parameters:
  • sessions (List["types.Session"]) – List of sessions

  • inactive_session_ttl_days (int) – Number of days of inactivity before sessions will automatically be terminated; 1-366 days

__init__(sessions=None, inactive_session_ttl_days=0)[source]
Parameters:
  • sessions (List[Session] | None)

  • inactive_session_ttl_days (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Sessions]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Sessions']

classmethod getType()[source]
Return type:

Literal['sessions']

to_dict()[source]
Return type:

dict

inactive_session_ttl_days: int

Number of days of inactivity before sessions will automatically be terminated; 1-366 days

sessions: List[Session]

List of sessions

class pytdbot.types.SharedChat(chat_id=0, title='', username='', photo=None)[source]

Bases: TlObject

Contains information about a chat shared with a bot

Parameters:
  • chat_id (int) – Chat identifier

  • title (str) – Title of the chat; for bots only

  • username (str) – Username of the chat; for bots only

  • photo ("types.Photo") – Photo of the chat; for bots only; may be null

__init__(chat_id=0, title='', username='', photo=None)[source]
Parameters:
  • chat_id (int)

  • title (str)

  • username (str)

  • photo (Photo | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SharedChat]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SharedChat']

classmethod getType()[source]
Return type:

Literal['sharedChat']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

photo: Optional[Photo]

Photo of the chat; for bots only; may be null

title: Optional[str]

Title of the chat; for bots only

username: Optional[str]

Username of the chat; for bots only

class pytdbot.types.SharedUser(user_id=0, first_name='', last_name='', username='', photo=None)[source]

Bases: TlObject

Contains information about a user shared with a bot

Parameters:
  • user_id (int) – User identifier

  • first_name (str) – First name of the user; for bots only

  • last_name (str) – Last name of the user; for bots only

  • username (str) – Username of the user; for bots only

  • photo ("types.Photo") – Profile photo of the user; for bots only; may be null

__init__(user_id=0, first_name='', last_name='', username='', photo=None)[source]
Parameters:
  • user_id (int)

  • first_name (str)

  • last_name (str)

  • username (str)

  • photo (Photo | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SharedUser]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SharedUser']

classmethod getType()[source]
Return type:

Literal['sharedUser']

to_dict()[source]
Return type:

dict

first_name: Optional[str]

First name of the user; for bots only

last_name: Optional[str]

Last name of the user; for bots only

photo: Optional[Photo]

Profile photo of the user; for bots only; may be null

user_id: int

User identifier

username: Optional[str]

Username of the user; for bots only

class pytdbot.types.ShippingOption(id='', title='', price_parts=None)[source]

Bases: TlObject

One shipping option

Parameters:
  • id (str) – Shipping option identifier

  • title (str) – Option title

  • price_parts (List["types.LabeledPricePart"]) – A list of objects used to calculate the total shipping costs

__init__(id='', title='', price_parts=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ShippingOption]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ShippingOption']

classmethod getType()[source]
Return type:

Literal['shippingOption']

to_dict()[source]
Return type:

dict

id: Optional[str]

Shipping option identifier

price_parts: List[LabeledPricePart]

A list of objects used to calculate the total shipping costs

title: Optional[str]

Option title

class pytdbot.types.SpeechRecognitionResult[source]

Bases: object

Describes result of speech recognition in a voice note

class pytdbot.types.SpeechRecognitionResultError(error=None)[source]

Bases: TlObject, SpeechRecognitionResult

The speech recognition failed

Parameters:

error ("types.Error") – Recognition error. An error with a message "MSG_VOICE_TOO_LONG" is returned when media duration is too big to be recognized

__init__(error=None)[source]
Parameters:

error (Error | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SpeechRecognitionResultError]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SpeechRecognitionResult']

classmethod getType()[source]
Return type:

Literal['speechRecognitionResultError']

to_dict()[source]
Return type:

dict

error: Optional[Error]

Recognition error. An error with a message "MSG_VOICE_TOO_LONG" is returned when media duration is too big to be recognized

class pytdbot.types.SpeechRecognitionResultPending(partial_text='')[source]

Bases: TlObject, SpeechRecognitionResult

The speech recognition is ongoing

Parameters:

partial_text (str) – Partially recognized text

__init__(partial_text='')[source]
Parameters:

partial_text (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SpeechRecognitionResultPending]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SpeechRecognitionResult']

classmethod getType()[source]
Return type:

Literal['speechRecognitionResultPending']

to_dict()[source]
Return type:

dict

partial_text: Optional[str]

Partially recognized text

class pytdbot.types.SpeechRecognitionResultText(text='')[source]

Bases: TlObject, SpeechRecognitionResult

The speech recognition successfully finished

Parameters:

text (str) – Recognized text

__init__(text='')[source]
Parameters:

text (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SpeechRecognitionResultText]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SpeechRecognitionResult']

classmethod getType()[source]
Return type:

Literal['speechRecognitionResultText']

to_dict()[source]
Return type:

dict

text: Optional[str]

Recognized text

class pytdbot.types.SponsoredChat(unique_id=0, chat_id=0, sponsor_info='', additional_info='')[source]

Bases: TlObject

Describes a sponsored chat

Parameters:
  • unique_id (int) – Unique identifier of this result

  • chat_id (int) – Chat identifier

  • sponsor_info (str) – Additional optional information about the sponsor to be shown along with the chat

  • additional_info (str) – If non-empty, additional information about the sponsored chat to be shown along with the chat

__init__(unique_id=0, chat_id=0, sponsor_info='', additional_info='')[source]
Parameters:
  • unique_id (int)

  • chat_id (int)

  • sponsor_info (str)

  • additional_info (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SponsoredChat]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SponsoredChat']

classmethod getType()[source]
Return type:

Literal['sponsoredChat']

to_dict()[source]
Return type:

dict

additional_info: Optional[str]

If non-empty, additional information about the sponsored chat to be shown along with the chat

chat_id: int

Chat identifier

sponsor_info: Optional[str]

Additional optional information about the sponsor to be shown along with the chat

unique_id: int

Unique identifier of this result

class pytdbot.types.SponsoredChats(chats=None)[source]

Bases: TlObject

Contains a list of sponsored chats

Parameters:

chats (List["types.SponsoredChat"]) – List of sponsored chats

__init__(chats=None)[source]
Parameters:

chats (List[SponsoredChat] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SponsoredChats]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SponsoredChats']

classmethod getType()[source]
Return type:

Literal['sponsoredChats']

to_dict()[source]
Return type:

dict

chats: List[SponsoredChat]

List of sponsored chats

class pytdbot.types.SponsoredMessage(message_id=0, is_recommended=False, can_be_reported=False, content=None, sponsor=None, title='', button_text='', accent_color_id=0, background_custom_emoji_id=0, additional_info='')[source]

Bases: TlObject

Describes a sponsored message

Parameters:
  • message_id (int) – Message identifier; unique for the chat to which the sponsored message belongs among both ordinary and sponsored messages

  • is_recommended (bool) – True, if the message needs to be labeled as "recommended" instead of "sponsored"

  • can_be_reported (bool) – True, if the message can be reported to Telegram moderators through reportChatSponsoredMessage

  • content ("types.MessageContent") – Content of the message. Currently, can be only of the types messageText, messageAnimation, messagePhoto, or messageVideo. Video messages can be viewed fullscreen

  • sponsor ("types.AdvertisementSponsor") – Information about the sponsor of the message

  • title (str) – Title of the sponsored message

  • button_text (str) – Text for the message action button

  • accent_color_id (int) – Identifier of the accent color for title, button text and message background

  • background_custom_emoji_id (int) – Identifier of a custom emoji to be shown on the message background; 0 if none

  • additional_info (str) – If non-empty, additional information about the sponsored message to be shown along with the message

__init__(message_id=0, is_recommended=False, can_be_reported=False, content=None, sponsor=None, title='', button_text='', accent_color_id=0, background_custom_emoji_id=0, additional_info='')[source]
Parameters:
  • message_id (int)

  • is_recommended (bool)

  • can_be_reported (bool)

  • content (MessageContent | None)

  • sponsor (AdvertisementSponsor | None)

  • title (str)

  • button_text (str)

  • accent_color_id (int)

  • background_custom_emoji_id (int)

  • additional_info (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SponsoredMessage]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SponsoredMessage']

classmethod getType()[source]
Return type:

Literal['sponsoredMessage']

to_dict()[source]
Return type:

dict

accent_color_id: int

Identifier of the accent color for title, button text and message background

additional_info: Optional[str]

If non-empty, additional information about the sponsored message to be shown along with the message

background_custom_emoji_id: int

Identifier of a custom emoji to be shown on the message background; 0 if none

button_text: Optional[str]

Text for the message action button

can_be_reported: bool

True, if the message can be reported to Telegram moderators through reportChatSponsoredMessage

content: Union[MessageText, MessageAnimation, MessageAudio, MessageDocument, MessagePaidMedia, MessagePhoto, MessageSticker, MessageVideo, MessageVideoNote, MessageVoiceNote, MessageExpiredPhoto, MessageExpiredVideo, MessageExpiredVideoNote, MessageExpiredVoiceNote, MessageLocation, MessageVenue, MessageContact, MessageAnimatedEmoji, MessageDice, MessageGame, MessagePoll, MessageStory, MessageChecklist, MessageInvoice, MessageCall, MessageGroupCall, MessageVideoChatScheduled, MessageVideoChatStarted, MessageVideoChatEnded, MessageInviteVideoChatParticipants, MessageBasicGroupChatCreate, MessageSupergroupChatCreate, MessageChatChangeTitle, MessageChatChangePhoto, MessageChatDeletePhoto, MessageChatAddMembers, MessageChatJoinByLink, MessageChatJoinByRequest, MessageChatDeleteMember, MessageChatUpgradeTo, MessageChatUpgradeFrom, MessagePinMessage, MessageScreenshotTaken, MessageChatSetBackground, MessageChatSetTheme, MessageChatSetMessageAutoDeleteTime, MessageChatBoost, MessageForumTopicCreated, MessageForumTopicEdited, MessageForumTopicIsClosedToggled, MessageForumTopicIsHiddenToggled, MessageSuggestProfilePhoto, MessageCustomServiceAction, MessageGameScore, MessagePaymentSuccessful, MessagePaymentSuccessfulBot, MessagePaymentRefunded, MessageGiftedPremium, MessagePremiumGiftCode, MessageGiveawayCreated, MessageGiveaway, MessageGiveawayCompleted, MessageGiveawayWinners, MessageGiftedStars, MessageGiftedTon, MessageGiveawayPrizeStars, MessageGift, MessageUpgradedGift, MessageRefundedUpgradedGift, MessagePaidMessagesRefunded, MessagePaidMessagePriceChanged, MessageDirectMessagePriceChanged, MessageChecklistTasksDone, MessageChecklistTasksAdded, MessageSuggestedPostApprovalFailed, MessageSuggestedPostApproved, MessageSuggestedPostDeclined, MessageSuggestedPostPaid, MessageSuggestedPostRefunded, MessageContactRegistered, MessageUsersShared, MessageChatShared, MessageBotWriteAccessAllowed, MessageWebAppDataSent, MessageWebAppDataReceived, MessagePassportDataSent, MessagePassportDataReceived, MessageProximityAlertTriggered, MessageUnsupported, None]

Content of the message. Currently, can be only of the types messageText, messageAnimation, messagePhoto, or messageVideo. Video messages can be viewed fullscreen

is_recommended: bool

True, if the message needs to be labeled as "recommended" instead of "sponsored"

message_id: int

Message identifier; unique for the chat to which the sponsored message belongs among both ordinary and sponsored messages

sponsor: Optional[AdvertisementSponsor]

Information about the sponsor of the message

title: Optional[str]

Title of the sponsored message

class pytdbot.types.SponsoredMessages(messages=None, messages_between=0)[source]

Bases: TlObject

Contains a list of sponsored messages

Parameters:
  • messages (List["types.SponsoredMessage"]) – List of sponsored messages

  • messages_between (int) – The minimum number of messages between shown sponsored messages, or 0 if only one sponsored message must be shown after all ordinary messages

__init__(messages=None, messages_between=0)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SponsoredMessages]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SponsoredMessages']

classmethod getType()[source]
Return type:

Literal['sponsoredMessages']

to_dict()[source]
Return type:

dict

messages: List[SponsoredMessage]

List of sponsored messages

messages_between: int

The minimum number of messages between shown sponsored messages, or 0 if only one sponsored message must be shown after all ordinary messages

class pytdbot.types.StarAmount(star_count=0, nanostar_count=0)[source]

Bases: TlObject

Describes a possibly non-integer amount of Telegram Stars

Parameters:
  • star_count (int) – The integer amount of Telegram Stars rounded to 0

  • nanostar_count (int) – The number of 1/1000000000 shares of Telegram Stars; from -999999999 to 999999999

__init__(star_count=0, nanostar_count=0)[source]
Parameters:
  • star_count (int)

  • nanostar_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarAmount]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarAmount']

classmethod getType()[source]
Return type:

Literal['starAmount']

to_dict()[source]
Return type:

dict

nanostar_count: int

The number of 1/1000000000 shares of Telegram Stars; from -999999999 to 999999999

star_count: int

The integer amount of Telegram Stars rounded to 0

class pytdbot.types.StarCount(star_count=0)[source]

Bases: TlObject

Contains a number of Telegram Stars

Parameters:

star_count (int) – Number of Telegram Stars

__init__(star_count=0)[source]
Parameters:

star_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarCount]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarCount']

classmethod getType()[source]
Return type:

Literal['starCount']

to_dict()[source]
Return type:

dict

star_count: int

Number of Telegram Stars

class pytdbot.types.StarGiveawayPaymentOption(currency='', amount=0, star_count=0, store_product_id='', yearly_boost_count=0, winner_options=None, is_default=False, is_additional=False)[source]

Bases: TlObject

Describes an option for creating of Telegram Star giveaway. Use telegramPaymentPurposeStarGiveaway for out-of-store payments

Parameters:
  • currency (str) – ISO 4217 currency code for the payment

  • amount (int) – The amount to pay, in the smallest units of the currency

  • star_count (int) – Number of Telegram Stars that will be distributed among winners

  • store_product_id (str) – Identifier of the store product associated with the option; may be empty if none

  • yearly_boost_count (int) – Number of times the chat will be boosted for one year if the option is chosen

  • winner_options (List["types.StarGiveawayWinnerOption"]) – Allowed options for the number of giveaway winners

  • is_default (bool) – True, if the option must be chosen by default

  • is_additional (bool) – True, if the option must be shown only in the full list of payment options

__init__(currency='', amount=0, star_count=0, store_product_id='', yearly_boost_count=0, winner_options=None, is_default=False, is_additional=False)[source]
Parameters:
  • currency (str)

  • amount (int)

  • star_count (int)

  • store_product_id (str)

  • yearly_boost_count (int)

  • winner_options (List[StarGiveawayWinnerOption] | None)

  • is_default (bool)

  • is_additional (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarGiveawayPaymentOption]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarGiveawayPaymentOption']

classmethod getType()[source]
Return type:

Literal['starGiveawayPaymentOption']

to_dict()[source]
Return type:

dict

amount: int

The amount to pay, in the smallest units of the currency

currency: Optional[str]

ISO 4217 currency code for the payment

is_additional: bool

True, if the option must be shown only in the full list of payment options

is_default: bool

True, if the option must be chosen by default

star_count: int

Number of Telegram Stars that will be distributed among winners

store_product_id: Optional[str]

Identifier of the store product associated with the option; may be empty if none

winner_options: List[StarGiveawayWinnerOption]

Allowed options for the number of giveaway winners

yearly_boost_count: int

Number of times the chat will be boosted for one year if the option is chosen

class pytdbot.types.StarGiveawayPaymentOptions(options=None)[source]

Bases: TlObject

Contains a list of options for creating of Telegram Star giveaway

Parameters:

options (List["types.StarGiveawayPaymentOption"]) – The list of options

__init__(options=None)[source]
Parameters:

options (List[StarGiveawayPaymentOption] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarGiveawayPaymentOptions]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarGiveawayPaymentOptions']

classmethod getType()[source]
Return type:

Literal['starGiveawayPaymentOptions']

to_dict()[source]
Return type:

dict

options: List[StarGiveawayPaymentOption]

The list of options

class pytdbot.types.StarGiveawayWinnerOption(winner_count=0, won_star_count=0, is_default=False)[source]

Bases: TlObject

Describes an option for the number of winners of a Telegram Star giveaway

Parameters:
  • winner_count (int) – The number of users that will be chosen as winners

  • won_star_count (int) – The number of Telegram Stars that will be won by the winners of the giveaway

  • is_default (bool) – True, if the option must be chosen by default

__init__(winner_count=0, won_star_count=0, is_default=False)[source]
Parameters:
  • winner_count (int)

  • won_star_count (int)

  • is_default (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarGiveawayWinnerOption]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarGiveawayWinnerOption']

classmethod getType()[source]
Return type:

Literal['starGiveawayWinnerOption']

to_dict()[source]
Return type:

dict

is_default: bool

True, if the option must be chosen by default

winner_count: int

The number of users that will be chosen as winners

won_star_count: int

The number of Telegram Stars that will be won by the winners of the giveaway

class pytdbot.types.StarPaymentOption(currency='', amount=0, star_count=0, store_product_id='', is_additional=False)[source]

Bases: TlObject

Describes an option for buying Telegram Stars. Use telegramPaymentPurposeStars for out-of-store payments

Parameters:
  • currency (str) – ISO 4217 currency code for the payment

  • amount (int) – The amount to pay, in the smallest units of the currency

  • star_count (int) – Number of Telegram Stars that will be purchased

  • store_product_id (str) – Identifier of the store product associated with the option; may be empty if none

  • is_additional (bool) – True, if the option must be shown only in the full list of payment options

__init__(currency='', amount=0, star_count=0, store_product_id='', is_additional=False)[source]
Parameters:
  • currency (str)

  • amount (int)

  • star_count (int)

  • store_product_id (str)

  • is_additional (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarPaymentOption]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarPaymentOption']

classmethod getType()[source]
Return type:

Literal['starPaymentOption']

to_dict()[source]
Return type:

dict

amount: int

The amount to pay, in the smallest units of the currency

currency: Optional[str]

ISO 4217 currency code for the payment

is_additional: bool

True, if the option must be shown only in the full list of payment options

star_count: int

Number of Telegram Stars that will be purchased

store_product_id: Optional[str]

Identifier of the store product associated with the option; may be empty if none

class pytdbot.types.StarPaymentOptions(options=None)[source]

Bases: TlObject

Contains a list of options for buying Telegram Stars

Parameters:

options (List["types.StarPaymentOption"]) – The list of options

__init__(options=None)[source]
Parameters:

options (List[StarPaymentOption] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarPaymentOptions]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarPaymentOptions']

classmethod getType()[source]
Return type:

Literal['starPaymentOptions']

to_dict()[source]
Return type:

dict

options: List[StarPaymentOption]

The list of options

class pytdbot.types.StarRevenueStatistics(revenue_by_day_graph=None, status=None, usd_rate=0.0)[source]

Bases: TlObject

A detailed statistics about Telegram Stars earned by a user or a chat

Parameters:
  • revenue_by_day_graph ("types.StatisticalGraph") – A graph containing amount of revenue in a given day

  • status ("types.StarRevenueStatus") – Telegram Star revenue status

  • usd_rate (float) – Current conversion rate of a Telegram Star to USD

__init__(revenue_by_day_graph=None, status=None, usd_rate=0.0)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarRevenueStatistics]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarRevenueStatistics']

classmethod getType()[source]
Return type:

Literal['starRevenueStatistics']

to_dict()[source]
Return type:

dict

revenue_by_day_graph: Union[StatisticalGraphData, StatisticalGraphAsync, StatisticalGraphError, None]

A graph containing amount of revenue in a given day

status: Optional[StarRevenueStatus]

Telegram Star revenue status

usd_rate: float

Current conversion rate of a Telegram Star to USD

class pytdbot.types.StarRevenueStatus(total_amount=None, current_amount=None, available_amount=None, withdrawal_enabled=False, next_withdrawal_in=0)[source]

Bases: TlObject

Contains information about Telegram Stars earned by a user or a chat

Parameters:
  • total_amount ("types.StarAmount") – Total amount of Telegram Stars earned

  • current_amount ("types.StarAmount") – The amount of Telegram Stars that aren’t withdrawn yet

  • available_amount ("types.StarAmount") – The amount of Telegram Stars that are available for withdrawal

  • withdrawal_enabled (bool) – True, if Telegram Stars can be withdrawn now or later

  • next_withdrawal_in (int) – Time left before the next withdrawal can be started, in seconds; 0 if withdrawal can be started now

__init__(total_amount=None, current_amount=None, available_amount=None, withdrawal_enabled=False, next_withdrawal_in=0)[source]
Parameters:
  • total_amount (StarAmount | None)

  • current_amount (StarAmount | None)

  • available_amount (StarAmount | None)

  • withdrawal_enabled (bool)

  • next_withdrawal_in (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarRevenueStatus]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarRevenueStatus']

classmethod getType()[source]
Return type:

Literal['starRevenueStatus']

to_dict()[source]
Return type:

dict

available_amount: Optional[StarAmount]

The amount of Telegram Stars that are available for withdrawal

current_amount: Optional[StarAmount]

The amount of Telegram Stars that aren’t withdrawn yet

next_withdrawal_in: int

Time left before the next withdrawal can be started, in seconds; 0 if withdrawal can be started now

total_amount: Optional[StarAmount]

Total amount of Telegram Stars earned

withdrawal_enabled: bool

True, if Telegram Stars can be withdrawn now or later

class pytdbot.types.StarSubscription(id='', chat_id=0, expiration_date=0, is_canceled=False, is_expiring=False, pricing=None, type=None)[source]

Bases: TlObject

Contains information about subscription to a channel chat, a bot, or a business account that was paid in Telegram Stars

Parameters:
  • id (str) – Unique identifier of the subscription

  • chat_id (int) – Identifier of the chat that is subscribed

  • expiration_date (int) – Point in time (Unix timestamp) when the subscription will expire or expired

  • is_canceled (bool) – True, if the subscription was canceled

  • is_expiring (bool) – True, if the subscription expires soon and there are no enough Telegram Stars on the user’s balance to extend it

  • pricing ("types.StarSubscriptionPricing") – The subscription plan

  • type ("types.StarSubscriptionType") – Type of the subscription

__init__(id='', chat_id=0, expiration_date=0, is_canceled=False, is_expiring=False, pricing=None, type=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarSubscription]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarSubscription']

classmethod getType()[source]
Return type:

Literal['starSubscription']

to_dict()[source]
Return type:

dict

chat_id: int

Identifier of the chat that is subscribed

expiration_date: int

Point in time (Unix timestamp) when the subscription will expire or expired

id: Optional[str]

Unique identifier of the subscription

is_canceled: bool

True, if the subscription was canceled

is_expiring: bool

True, if the subscription expires soon and there are no enough Telegram Stars on the user’s balance to extend it

pricing: Optional[StarSubscriptionPricing]

The subscription plan

type: Union[StarSubscriptionTypeChannel, StarSubscriptionTypeBot, None]

Type of the subscription

class pytdbot.types.StarSubscriptionPricing(period=0, star_count=0)[source]

Bases: TlObject

Describes subscription plan paid in Telegram Stars

Parameters:
  • period (int) – The number of seconds between consecutive Telegram Star debiting

  • star_count (int) – The amount of Telegram Stars that must be paid for each period

__init__(period=0, star_count=0)[source]
Parameters:
  • period (int)

  • star_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarSubscriptionPricing]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarSubscriptionPricing']

classmethod getType()[source]
Return type:

Literal['starSubscriptionPricing']

to_dict()[source]
Return type:

dict

period: int

The number of seconds between consecutive Telegram Star debiting

star_count: int

The amount of Telegram Stars that must be paid for each period

class pytdbot.types.StarSubscriptionType[source]

Bases: object

Describes type of subscription paid in Telegram Stars

class pytdbot.types.StarSubscriptionTypeBot(is_canceled_by_bot=False, title='', photo=None, invoice_link='')[source]

Bases: TlObject, StarSubscriptionType

Describes a subscription in a bot or a business account

Parameters:
  • is_canceled_by_bot (bool) – True, if the subscription was canceled by the bot and can’t be extended

  • title (str) – Subscription invoice title

  • photo ("types.Photo") – Subscription invoice photo

  • invoice_link (str) – The link to the subscription invoice

__init__(is_canceled_by_bot=False, title='', photo=None, invoice_link='')[source]
Parameters:
  • is_canceled_by_bot (bool)

  • title (str)

  • photo (Photo | None)

  • invoice_link (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarSubscriptionTypeBot]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarSubscriptionType']

classmethod getType()[source]
Return type:

Literal['starSubscriptionTypeBot']

to_dict()[source]
Return type:

dict

invoice_link: Optional[str]

The link to the subscription invoice

is_canceled_by_bot: bool

True, if the subscription was canceled by the bot and can’t be extended

photo: Optional[Photo]

Subscription invoice photo

title: Optional[str]

Subscription invoice title

class pytdbot.types.StarSubscriptionTypeChannel(can_reuse=False, invite_link='')[source]

Bases: TlObject, StarSubscriptionType

Describes a subscription to a channel chat

Parameters:
  • can_reuse (bool) – True, if the subscription is active and the user can use the method reuseStarSubscription to join the subscribed chat again

  • invite_link (str) – The invite link that can be used to renew the subscription if it has been expired; may be empty, if the link isn’t available anymore

__init__(can_reuse=False, invite_link='')[source]
Parameters:
  • can_reuse (bool)

  • invite_link (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarSubscriptionTypeChannel]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarSubscriptionType']

classmethod getType()[source]
Return type:

Literal['starSubscriptionTypeChannel']

to_dict()[source]
Return type:

dict

can_reuse: bool

True, if the subscription is active and the user can use the method reuseStarSubscription to join the subscribed chat again

invite_link: Optional[str]

The invite link that can be used to renew the subscription if it has been expired; may be empty, if the link isn’t available anymore

class pytdbot.types.StarSubscriptions(star_amount=None, subscriptions=None, required_star_count=0, next_offset='')[source]

Bases: TlObject

Represents a list of Telegram Star subscriptions

Parameters:
  • star_amount ("types.StarAmount") – The amount of owned Telegram Stars

  • subscriptions (List["types.StarSubscription"]) – List of subscriptions for Telegram Stars

  • required_star_count (int) – The number of Telegram Stars required to buy to extend subscriptions expiring soon

  • next_offset (str) – The offset for the next request. If empty, then there are no more results

__init__(star_amount=None, subscriptions=None, required_star_count=0, next_offset='')[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarSubscriptions]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarSubscriptions']

classmethod getType()[source]
Return type:

Literal['starSubscriptions']

to_dict()[source]
Return type:

dict

next_offset: Optional[str]

The offset for the next request. If empty, then there are no more results

required_star_count: int

The number of Telegram Stars required to buy to extend subscriptions expiring soon

star_amount: Optional[StarAmount]

The amount of owned Telegram Stars

subscriptions: List[StarSubscription]

List of subscriptions for Telegram Stars

class pytdbot.types.StarTransaction(id='', star_amount=None, is_refund=False, date=0, type=None)[source]

Bases: TlObject

Represents a transaction changing the amount of owned Telegram Stars

Parameters:
  • id (str) – Unique identifier of the transaction

  • star_amount ("types.StarAmount") – The amount of added owned Telegram Stars; negative for outgoing transactions

  • is_refund (bool) – True, if the transaction is a refund of a previous transaction

  • date (int) – Point in time (Unix timestamp) when the transaction was completed

  • type ("types.StarTransactionType") – Type of the transaction

__init__(id='', star_amount=None, is_refund=False, date=0, type=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransaction]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransaction']

classmethod getType()[source]
Return type:

Literal['starTransaction']

to_dict()[source]
Return type:

dict

date: int

Point in time (Unix timestamp) when the transaction was completed

id: Optional[str]

Unique identifier of the transaction

is_refund: bool

True, if the transaction is a refund of a previous transaction

star_amount: Optional[StarAmount]

The amount of added owned Telegram Stars; negative for outgoing transactions

type: Union[StarTransactionTypePremiumBotDeposit, StarTransactionTypeAppStoreDeposit, StarTransactionTypeGooglePlayDeposit, StarTransactionTypeFragmentDeposit, StarTransactionTypeUserDeposit, StarTransactionTypeGiveawayDeposit, StarTransactionTypeFragmentWithdrawal, StarTransactionTypeTelegramAdsWithdrawal, StarTransactionTypeTelegramApiUsage, StarTransactionTypeBotPaidMediaPurchase, StarTransactionTypeBotPaidMediaSale, StarTransactionTypeChannelPaidMediaPurchase, StarTransactionTypeChannelPaidMediaSale, StarTransactionTypeBotInvoicePurchase, StarTransactionTypeBotInvoiceSale, StarTransactionTypeBotSubscriptionPurchase, StarTransactionTypeBotSubscriptionSale, StarTransactionTypeChannelSubscriptionPurchase, StarTransactionTypeChannelSubscriptionSale, StarTransactionTypeGiftPurchase, StarTransactionTypeGiftTransfer, StarTransactionTypeGiftSale, StarTransactionTypeGiftUpgrade, StarTransactionTypeGiftUpgradePurchase, StarTransactionTypeUpgradedGiftPurchase, StarTransactionTypeUpgradedGiftSale, StarTransactionTypeChannelPaidReactionSend, StarTransactionTypeChannelPaidReactionReceive, StarTransactionTypeAffiliateProgramCommission, StarTransactionTypePaidMessageSend, StarTransactionTypePaidMessageReceive, StarTransactionTypeSuggestedPostPaymentSend, StarTransactionTypeSuggestedPostPaymentReceive, StarTransactionTypePremiumPurchase, StarTransactionTypeBusinessBotTransferSend, StarTransactionTypeBusinessBotTransferReceive, StarTransactionTypePublicPostSearch, StarTransactionTypeUnsupported, None]

Type of the transaction

class pytdbot.types.StarTransactionType[source]

Bases: object

Describes type of transaction with Telegram Stars

class pytdbot.types.StarTransactionTypeAffiliateProgramCommission(chat_id=0, commission_per_mille=0)[source]

Bases: TlObject, StarTransactionType

The transaction is a receiving of a commission from an affiliate program; for regular users, bots and channel chats only

Parameters:
  • chat_id (int) – Identifier of the chat that created the affiliate program

  • commission_per_mille (int) – The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the program owner

__init__(chat_id=0, commission_per_mille=0)[source]
Parameters:
  • chat_id (int)

  • commission_per_mille (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypeAffiliateProgramCommission]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypeAffiliateProgramCommission']

to_dict()[source]
Return type:

dict

chat_id: int

Identifier of the chat that created the affiliate program

commission_per_mille: int

The number of Telegram Stars received by the affiliate for each 1000 Telegram Stars received by the program owner

class pytdbot.types.StarTransactionTypeAppStoreDeposit[source]

Bases: TlObject, StarTransactionType

The transaction is a deposit of Telegram Stars from App Store; for regular users only

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypeAppStoreDeposit]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypeAppStoreDeposit']

to_dict()[source]
Return type:

dict

class pytdbot.types.StarTransactionTypeBotInvoicePurchase(user_id=0, product_info=None)[source]

Bases: TlObject, StarTransactionType

The transaction is a purchase of a product from a bot or a business account by the current user; for regular users only

Parameters:
  • user_id (int) – Identifier of the bot or the business account user that created the invoice

  • product_info ("types.ProductInfo") – Information about the bought product

__init__(user_id=0, product_info=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypeBotInvoicePurchase]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypeBotInvoicePurchase']

to_dict()[source]
Return type:

dict

product_info: Optional[ProductInfo]

Information about the bought product

user_id: int

Identifier of the bot or the business account user that created the invoice

class pytdbot.types.StarTransactionTypeBotInvoiceSale(user_id=0, product_info=None, invoice_payload=b'', affiliate=None)[source]

Bases: TlObject, StarTransactionType

The transaction is a sale of a product by the bot; for bots only

Parameters:
  • user_id (int) – Identifier of the user that bought the product

  • product_info ("types.ProductInfo") – Information about the bought product

  • invoice_payload (bytes) – Invoice payload

  • affiliate ("types.AffiliateInfo") – Information about the affiliate which received commission from the transaction; may be null if none

__init__(user_id=0, product_info=None, invoice_payload=b'', affiliate=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypeBotInvoiceSale]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypeBotInvoiceSale']

to_dict()[source]
Return type:

dict

affiliate: Optional[AffiliateInfo]

Information about the affiliate which received commission from the transaction; may be null if none

invoice_payload: Optional[bytes]

Invoice payload

product_info: Optional[ProductInfo]

Information about the bought product

user_id: int

Identifier of the user that bought the product

class pytdbot.types.StarTransactionTypeBotPaidMediaPurchase(user_id=0, media=None)[source]

Bases: TlObject, StarTransactionType

The transaction is a purchase of paid media from a bot or a business account by the current user; for regular users only

Parameters:
  • user_id (int) – Identifier of the bot or the business account user that sent the paid media

  • media (List["types.PaidMedia"]) – The bought media if the transaction wasn’t refunded

__init__(user_id=0, media=None)[source]
Parameters:
  • user_id (int)

  • media (List[PaidMedia] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypeBotPaidMediaPurchase]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypeBotPaidMediaPurchase']

to_dict()[source]
Return type:

dict

media: List[PaidMedia]

The bought media if the transaction wasn’t refunded

user_id: int

Identifier of the bot or the business account user that sent the paid media

class pytdbot.types.StarTransactionTypeBotPaidMediaSale(user_id=0, media=None, payload='', affiliate=None)[source]

Bases: TlObject, StarTransactionType

The transaction is a sale of paid media by the bot or a business account managed by the bot; for bots only

Parameters:
  • user_id (int) – Identifier of the user that bought the media

  • media (List["types.PaidMedia"]) – The bought media

  • payload (str) – Bot-provided payload

  • affiliate ("types.AffiliateInfo") – Information about the affiliate which received commission from the transaction; may be null if none

__init__(user_id=0, media=None, payload='', affiliate=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypeBotPaidMediaSale]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypeBotPaidMediaSale']

to_dict()[source]
Return type:

dict

affiliate: Optional[AffiliateInfo]

Information about the affiliate which received commission from the transaction; may be null if none

media: List[PaidMedia]

The bought media

payload: Optional[str]

Bot-provided payload

user_id: int

Identifier of the user that bought the media

class pytdbot.types.StarTransactionTypeBotSubscriptionPurchase(user_id=0, subscription_period=0, product_info=None)[source]

Bases: TlObject, StarTransactionType

The transaction is a purchase of a subscription from a bot or a business account by the current user; for regular users only

Parameters:
  • user_id (int) – Identifier of the bot or the business account user that created the subscription link

  • subscription_period (int) – The number of seconds between consecutive Telegram Star debitings

  • product_info ("types.ProductInfo") – Information about the bought subscription

__init__(user_id=0, subscription_period=0, product_info=None)[source]
Parameters:
  • user_id (int)

  • subscription_period (int)

  • product_info (ProductInfo | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypeBotSubscriptionPurchase]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypeBotSubscriptionPurchase']

to_dict()[source]
Return type:

dict

product_info: Optional[ProductInfo]

Information about the bought subscription

subscription_period: int

The number of seconds between consecutive Telegram Star debitings

user_id: int

Identifier of the bot or the business account user that created the subscription link

class pytdbot.types.StarTransactionTypeBotSubscriptionSale(user_id=0, subscription_period=0, product_info=None, invoice_payload=b'', affiliate=None)[source]

Bases: TlObject, StarTransactionType

The transaction is a sale of a subscription by the bot; for bots only

Parameters:
  • user_id (int) – Identifier of the user that bought the subscription

  • subscription_period (int) – The number of seconds between consecutive Telegram Star debitings

  • product_info ("types.ProductInfo") – Information about the bought subscription

  • invoice_payload (bytes) – Invoice payload

  • affiliate ("types.AffiliateInfo") – Information about the affiliate which received commission from the transaction; may be null if none

__init__(user_id=0, subscription_period=0, product_info=None, invoice_payload=b'', affiliate=None)[source]
Parameters:
  • user_id (int)

  • subscription_period (int)

  • product_info (ProductInfo | None)

  • invoice_payload (bytes)

  • affiliate (AffiliateInfo | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypeBotSubscriptionSale]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypeBotSubscriptionSale']

to_dict()[source]
Return type:

dict

affiliate: Optional[AffiliateInfo]

Information about the affiliate which received commission from the transaction; may be null if none

invoice_payload: Optional[bytes]

Invoice payload

product_info: Optional[ProductInfo]

Information about the bought subscription

subscription_period: int

The number of seconds between consecutive Telegram Star debitings

user_id: int

Identifier of the user that bought the subscription

class pytdbot.types.StarTransactionTypeBusinessBotTransferReceive(user_id=0)[source]

Bases: TlObject, StarTransactionType

The transaction is a transfer of Telegram Stars from a business account; for bots only

Parameters:

user_id (int) – Identifier of the user that sent Telegram Stars

__init__(user_id=0)[source]
Parameters:

user_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypeBusinessBotTransferReceive]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypeBusinessBotTransferReceive']

to_dict()[source]
Return type:

dict

user_id: int

Identifier of the user that sent Telegram Stars

class pytdbot.types.StarTransactionTypeBusinessBotTransferSend(user_id=0)[source]

Bases: TlObject, StarTransactionType

The transaction is a transfer of Telegram Stars to a business bot; for regular users only

Parameters:

user_id (int) – Identifier of the bot that received Telegram Stars

__init__(user_id=0)[source]
Parameters:

user_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypeBusinessBotTransferSend]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypeBusinessBotTransferSend']

to_dict()[source]
Return type:

dict

user_id: int

Identifier of the bot that received Telegram Stars

class pytdbot.types.StarTransactionTypeChannelPaidMediaPurchase(chat_id=0, message_id=0, media=None)[source]

Bases: TlObject, StarTransactionType

The transaction is a purchase of paid media from a channel by the current user; for regular users only

Parameters:
  • chat_id (int) – Identifier of the channel chat that sent the paid media

  • message_id (int) – Identifier of the corresponding message with paid media; can be 0 or an identifier of a deleted message

  • media (List["types.PaidMedia"]) – The bought media if the transaction wasn’t refunded

__init__(chat_id=0, message_id=0, media=None)[source]
Parameters:
  • chat_id (int)

  • message_id (int)

  • media (List[PaidMedia] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypeChannelPaidMediaPurchase]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypeChannelPaidMediaPurchase']

to_dict()[source]
Return type:

dict

chat_id: int

Identifier of the channel chat that sent the paid media

media: List[PaidMedia]

The bought media if the transaction wasn’t refunded

message_id: int

Identifier of the corresponding message with paid media; can be 0 or an identifier of a deleted message

class pytdbot.types.StarTransactionTypeChannelPaidMediaSale(user_id=0, message_id=0, media=None)[source]

Bases: TlObject, StarTransactionType

The transaction is a sale of paid media by the channel chat; for channel chats only

Parameters:
  • user_id (int) – Identifier of the user that bought the media

  • message_id (int) – Identifier of the corresponding message with paid media; can be 0 or an identifier of a deleted message

  • media (List["types.PaidMedia"]) – The bought media

__init__(user_id=0, message_id=0, media=None)[source]
Parameters:
  • user_id (int)

  • message_id (int)

  • media (List[PaidMedia] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypeChannelPaidMediaSale]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypeChannelPaidMediaSale']

to_dict()[source]
Return type:

dict

media: List[PaidMedia]

The bought media

message_id: int

Identifier of the corresponding message with paid media; can be 0 or an identifier of a deleted message

user_id: int

Identifier of the user that bought the media

class pytdbot.types.StarTransactionTypeChannelPaidReactionReceive(user_id=0, message_id=0)[source]

Bases: TlObject, StarTransactionType

The transaction is a receiving of a paid reaction to a message by the channel chat; for channel chats only

Parameters:
  • user_id (int) – Identifier of the user that added the paid reaction

  • message_id (int) – Identifier of the reacted message; can be 0 or an identifier of a deleted message

__init__(user_id=0, message_id=0)[source]
Parameters:
  • user_id (int)

  • message_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypeChannelPaidReactionReceive]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypeChannelPaidReactionReceive']

to_dict()[source]
Return type:

dict

message_id: int

Identifier of the reacted message; can be 0 or an identifier of a deleted message

user_id: int

Identifier of the user that added the paid reaction

class pytdbot.types.StarTransactionTypeChannelPaidReactionSend(chat_id=0, message_id=0)[source]

Bases: TlObject, StarTransactionType

The transaction is a sending of a paid reaction to a message in a channel chat by the current user; for regular users only

Parameters:
  • chat_id (int) – Identifier of the channel chat

  • message_id (int) – Identifier of the reacted message; can be 0 or an identifier of a deleted message

__init__(chat_id=0, message_id=0)[source]
Parameters:
  • chat_id (int)

  • message_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypeChannelPaidReactionSend]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypeChannelPaidReactionSend']

to_dict()[source]
Return type:

dict

chat_id: int

Identifier of the channel chat

message_id: int

Identifier of the reacted message; can be 0 or an identifier of a deleted message

class pytdbot.types.StarTransactionTypeChannelSubscriptionPurchase(chat_id=0, subscription_period=0)[source]

Bases: TlObject, StarTransactionType

The transaction is a purchase of a subscription to a channel chat by the current user; for regular users only

Parameters:
  • chat_id (int) – Identifier of the channel chat that created the subscription

  • subscription_period (int) – The number of seconds between consecutive Telegram Star debitings

__init__(chat_id=0, subscription_period=0)[source]
Parameters:
  • chat_id (int)

  • subscription_period (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypeChannelSubscriptionPurchase]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypeChannelSubscriptionPurchase']

to_dict()[source]
Return type:

dict

chat_id: int

Identifier of the channel chat that created the subscription

subscription_period: int

The number of seconds between consecutive Telegram Star debitings

class pytdbot.types.StarTransactionTypeChannelSubscriptionSale(user_id=0, subscription_period=0)[source]

Bases: TlObject, StarTransactionType

The transaction is a sale of a subscription by the channel chat; for channel chats only

Parameters:
  • user_id (int) – Identifier of the user that bought the subscription

  • subscription_period (int) – The number of seconds between consecutive Telegram Star debitings

__init__(user_id=0, subscription_period=0)[source]
Parameters:
  • user_id (int)

  • subscription_period (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypeChannelSubscriptionSale]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypeChannelSubscriptionSale']

to_dict()[source]
Return type:

dict

subscription_period: int

The number of seconds between consecutive Telegram Star debitings

user_id: int

Identifier of the user that bought the subscription

class pytdbot.types.StarTransactionTypeFragmentDeposit[source]

Bases: TlObject, StarTransactionType

The transaction is a deposit of Telegram Stars from Fragment; for regular users and bots only

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypeFragmentDeposit]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypeFragmentDeposit']

to_dict()[source]
Return type:

dict

class pytdbot.types.StarTransactionTypeFragmentWithdrawal(withdrawal_state=None)[source]

Bases: TlObject, StarTransactionType

The transaction is a withdrawal of earned Telegram Stars to Fragment; for regular users, bots, supergroup and channel chats only

Parameters:

withdrawal_state ("types.RevenueWithdrawalState") – State of the withdrawal; may be null for refunds from Fragment

__init__(withdrawal_state=None)[source]
Parameters:

withdrawal_state (RevenueWithdrawalState | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypeFragmentWithdrawal]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypeFragmentWithdrawal']

to_dict()[source]
Return type:

dict

withdrawal_state: Union[RevenueWithdrawalStatePending, RevenueWithdrawalStateSucceeded, RevenueWithdrawalStateFailed, None]

State of the withdrawal; may be null for refunds from Fragment

class pytdbot.types.StarTransactionTypeGiftPurchase(owner_id=None, gift=None)[source]

Bases: TlObject, StarTransactionType

The transaction is a purchase of a regular gift; for regular users and bots only

Parameters:
  • owner_id ("types.MessageSender") – Identifier of the user or the channel that received the gift

  • gift ("types.Gift") – The gift

__init__(owner_id=None, gift=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypeGiftPurchase]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypeGiftPurchase']

to_dict()[source]
Return type:

dict

gift: Optional[Gift]

The gift

owner_id: Union[MessageSenderUser, MessageSenderChat, None]

Identifier of the user or the channel that received the gift

class pytdbot.types.StarTransactionTypeGiftSale(user_id=0, gift=None)[source]

Bases: TlObject, StarTransactionType

The transaction is a sale of a received gift; for regular users and channel chats only

Parameters:
  • user_id (int) – Identifier of the user that sent the gift

  • gift ("types.Gift") – The gift

__init__(user_id=0, gift=None)[source]
Parameters:
  • user_id (int)

  • gift (Gift | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypeGiftSale]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypeGiftSale']

to_dict()[source]
Return type:

dict

gift: Optional[Gift]

The gift

user_id: int

Identifier of the user that sent the gift

class pytdbot.types.StarTransactionTypeGiftTransfer(owner_id=None, gift=None)[source]

Bases: TlObject, StarTransactionType

The transaction is a transfer of an upgraded gift; for regular users only

Parameters:
  • owner_id ("types.MessageSender") – Identifier of the user or the channel that received the gift

  • gift ("types.UpgradedGift") – The gift

__init__(owner_id=None, gift=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypeGiftTransfer]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypeGiftTransfer']

to_dict()[source]
Return type:

dict

gift: Optional[UpgradedGift]

The gift

owner_id: Union[MessageSenderUser, MessageSenderChat, None]

Identifier of the user or the channel that received the gift

class pytdbot.types.StarTransactionTypeGiftUpgrade(user_id=0, gift=None)[source]

Bases: TlObject, StarTransactionType

The transaction is an upgrade of a gift; for regular users only

Parameters:
  • user_id (int) – Identifier of the user that initially sent the gift

  • gift ("types.UpgradedGift") – The upgraded gift

__init__(user_id=0, gift=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypeGiftUpgrade]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypeGiftUpgrade']

to_dict()[source]
Return type:

dict

gift: Optional[UpgradedGift]

The upgraded gift

user_id: int

Identifier of the user that initially sent the gift

class pytdbot.types.StarTransactionTypeGiftUpgradePurchase(owner_id=None, gift=None)[source]

Bases: TlObject, StarTransactionType

The transaction is a purchase of an upgrade of a gift owned by another user or channel; for regular users only

Parameters:
  • owner_id ("types.MessageSender") – Owner of the upgraded gift

  • gift ("types.Gift") – The gift

__init__(owner_id=None, gift=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypeGiftUpgradePurchase]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypeGiftUpgradePurchase']

to_dict()[source]
Return type:

dict

gift: Optional[Gift]

The gift

owner_id: Union[MessageSenderUser, MessageSenderChat, None]

Owner of the upgraded gift

class pytdbot.types.StarTransactionTypeGiveawayDeposit(chat_id=0, giveaway_message_id=0)[source]

Bases: TlObject, StarTransactionType

The transaction is a deposit of Telegram Stars from a giveaway; for regular users only

Parameters:
  • chat_id (int) – Identifier of a supergroup or a channel chat that created the giveaway

  • giveaway_message_id (int) – Identifier of the message with the giveaway; can be 0 or an identifier of a deleted message

__init__(chat_id=0, giveaway_message_id=0)[source]
Parameters:
  • chat_id (int)

  • giveaway_message_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypeGiveawayDeposit]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypeGiveawayDeposit']

to_dict()[source]
Return type:

dict

chat_id: int

Identifier of a supergroup or a channel chat that created the giveaway

giveaway_message_id: int

Identifier of the message with the giveaway; can be 0 or an identifier of a deleted message

class pytdbot.types.StarTransactionTypeGooglePlayDeposit[source]

Bases: TlObject, StarTransactionType

The transaction is a deposit of Telegram Stars from Google Play; for regular users only

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypeGooglePlayDeposit]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypeGooglePlayDeposit']

to_dict()[source]
Return type:

dict

class pytdbot.types.StarTransactionTypePaidMessageReceive(sender_id=None, message_count=0, commission_per_mille=0, commission_star_amount=None)[source]

Bases: TlObject, StarTransactionType

The transaction is a receiving of a paid message; for regular users, supergroup and channel chats only

Parameters:
  • sender_id ("types.MessageSender") – Identifier of the sender of the message

  • message_count (int) – Number of received paid messages

  • commission_per_mille (int) – The number of Telegram Stars received by the Telegram for each 1000 Telegram Stars paid for message sending

  • commission_star_amount ("types.StarAmount") – The amount of Telegram Stars that were received by Telegram; can be negative for refunds

__init__(sender_id=None, message_count=0, commission_per_mille=0, commission_star_amount=None)[source]
Parameters:
  • sender_id (MessageSender | None)

  • message_count (int)

  • commission_per_mille (int)

  • commission_star_amount (StarAmount | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypePaidMessageReceive]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypePaidMessageReceive']

to_dict()[source]
Return type:

dict

commission_per_mille: int

The number of Telegram Stars received by the Telegram for each 1000 Telegram Stars paid for message sending

commission_star_amount: Optional[StarAmount]

The amount of Telegram Stars that were received by Telegram; can be negative for refunds

message_count: int

Number of received paid messages

sender_id: Union[MessageSenderUser, MessageSenderChat, None]

Identifier of the sender of the message

class pytdbot.types.StarTransactionTypePaidMessageSend(chat_id=0, message_count=0)[source]

Bases: TlObject, StarTransactionType

The transaction is a sending of a paid message; for regular users only

Parameters:
  • chat_id (int) – Identifier of the chat that received the payment

  • message_count (int) – Number of sent paid messages

__init__(chat_id=0, message_count=0)[source]
Parameters:
  • chat_id (int)

  • message_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypePaidMessageSend]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypePaidMessageSend']

to_dict()[source]
Return type:

dict

chat_id: int

Identifier of the chat that received the payment

message_count: int

Number of sent paid messages

class pytdbot.types.StarTransactionTypePremiumBotDeposit[source]

Bases: TlObject, StarTransactionType

The transaction is a deposit of Telegram Stars from the Premium bot; for regular users only

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypePremiumBotDeposit]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypePremiumBotDeposit']

to_dict()[source]
Return type:

dict

class pytdbot.types.StarTransactionTypePremiumPurchase(user_id=0, month_count=0, sticker=None)[source]

Bases: TlObject, StarTransactionType

The transaction is a purchase of Telegram Premium subscription; for regular users and bots only

Parameters:
  • user_id (int) – Identifier of the user that received the Telegram Premium subscription

  • month_count (int) – Number of months the Telegram Premium subscription will be active

  • sticker ("types.Sticker") – A sticker to be shown in the transaction information; may be null if unknown

__init__(user_id=0, month_count=0, sticker=None)[source]
Parameters:
  • user_id (int)

  • month_count (int)

  • sticker (Sticker | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypePremiumPurchase]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypePremiumPurchase']

to_dict()[source]
Return type:

dict

month_count: int

Number of months the Telegram Premium subscription will be active

sticker: Optional[Sticker]

A sticker to be shown in the transaction information; may be null if unknown

user_id: int

Identifier of the user that received the Telegram Premium subscription

class pytdbot.types.StarTransactionTypePublicPostSearch[source]

Bases: TlObject, StarTransactionType

The transaction is a payment for search of posts in public Telegram channels; for regular users only

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypePublicPostSearch]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypePublicPostSearch']

to_dict()[source]
Return type:

dict

class pytdbot.types.StarTransactionTypeSuggestedPostPaymentReceive(user_id=0)[source]

Bases: TlObject, StarTransactionType

The transaction is a receiving of a payment for a suggested post by the channel chat; for channel chats only

Parameters:

user_id (int) – Identifier of the user that paid for the suggested post

__init__(user_id=0)[source]
Parameters:

user_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypeSuggestedPostPaymentReceive]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypeSuggestedPostPaymentReceive']

to_dict()[source]
Return type:

dict

user_id: int

Identifier of the user that paid for the suggested post

class pytdbot.types.StarTransactionTypeSuggestedPostPaymentSend(chat_id=0)[source]

Bases: TlObject, StarTransactionType

The transaction is a payment for a suggested post; for regular users only

Parameters:

chat_id (int) – Identifier of the channel chat that posted the post

__init__(chat_id=0)[source]
Parameters:

chat_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypeSuggestedPostPaymentSend]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypeSuggestedPostPaymentSend']

to_dict()[source]
Return type:

dict

chat_id: int

Identifier of the channel chat that posted the post

class pytdbot.types.StarTransactionTypeTelegramAdsWithdrawal[source]

Bases: TlObject, StarTransactionType

The transaction is a withdrawal of earned Telegram Stars to Telegram Ad platform; for bots and channel chats only

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypeTelegramAdsWithdrawal]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypeTelegramAdsWithdrawal']

to_dict()[source]
Return type:

dict

class pytdbot.types.StarTransactionTypeTelegramApiUsage(request_count=0)[source]

Bases: TlObject, StarTransactionType

The transaction is a payment for Telegram API usage; for bots only

Parameters:

request_count (int) – The number of billed requests

__init__(request_count=0)[source]
Parameters:

request_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypeTelegramApiUsage]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypeTelegramApiUsage']

to_dict()[source]
Return type:

dict

request_count: int

The number of billed requests

class pytdbot.types.StarTransactionTypeUnsupported[source]

Bases: TlObject, StarTransactionType

The transaction is a transaction of an unsupported type

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypeUnsupported]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypeUnsupported']

to_dict()[source]
Return type:

dict

class pytdbot.types.StarTransactionTypeUpgradedGiftPurchase(user_id=0, gift=None)[source]

Bases: TlObject, StarTransactionType

The transaction is a purchase of an upgraded gift for some user or channel; for regular users only

Parameters:
  • user_id (int) – Identifier of the user that sold the gift

  • gift ("types.UpgradedGift") – The gift

__init__(user_id=0, gift=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypeUpgradedGiftPurchase]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypeUpgradedGiftPurchase']

to_dict()[source]
Return type:

dict

gift: Optional[UpgradedGift]

The gift

user_id: int

Identifier of the user that sold the gift

class pytdbot.types.StarTransactionTypeUpgradedGiftSale(user_id=0, gift=None, commission_per_mille=0, commission_star_amount=None)[source]

Bases: TlObject, StarTransactionType

The transaction is a sale of an upgraded gift; for regular users only

Parameters:
  • user_id (int) – Identifier of the user that bought the gift

  • gift ("types.UpgradedGift") – The gift

  • commission_per_mille (int) – The number of Telegram Stars received by the Telegram for each 1000 Telegram Stars received by the seller of the gift

  • commission_star_amount ("types.StarAmount") – The amount of Telegram Stars that were received by Telegram; can be negative for refunds

__init__(user_id=0, gift=None, commission_per_mille=0, commission_star_amount=None)[source]
Parameters:
  • user_id (int)

  • gift (UpgradedGift | None)

  • commission_per_mille (int)

  • commission_star_amount (StarAmount | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypeUpgradedGiftSale]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypeUpgradedGiftSale']

to_dict()[source]
Return type:

dict

commission_per_mille: int

The number of Telegram Stars received by the Telegram for each 1000 Telegram Stars received by the seller of the gift

commission_star_amount: Optional[StarAmount]

The amount of Telegram Stars that were received by Telegram; can be negative for refunds

gift: Optional[UpgradedGift]

The gift

user_id: int

Identifier of the user that bought the gift

class pytdbot.types.StarTransactionTypeUserDeposit(user_id=0, sticker=None)[source]

Bases: TlObject, StarTransactionType

The transaction is a deposit of Telegram Stars by another user; for regular users only

Parameters:
  • user_id (int) – Identifier of the user that gifted Telegram Stars; 0 if the user was anonymous

  • sticker ("types.Sticker") – The sticker to be shown in the transaction information; may be null if unknown

__init__(user_id=0, sticker=None)[source]
Parameters:
  • user_id (int)

  • sticker (Sticker | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactionTypeUserDeposit]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactionType']

classmethod getType()[source]
Return type:

Literal['starTransactionTypeUserDeposit']

to_dict()[source]
Return type:

dict

sticker: Optional[Sticker]

The sticker to be shown in the transaction information; may be null if unknown

user_id: int

Identifier of the user that gifted Telegram Stars; 0 if the user was anonymous

class pytdbot.types.StarTransactions(star_amount=None, transactions=None, next_offset='')[source]

Bases: TlObject

Represents a list of Telegram Star transactions

Parameters:
  • star_amount ("types.StarAmount") – The amount of owned Telegram Stars

  • transactions (List["types.StarTransaction"]) – List of transactions with Telegram Stars

  • next_offset (str) – The offset for the next request. If empty, then there are no more results

__init__(star_amount=None, transactions=None, next_offset='')[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StarTransactions]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StarTransactions']

classmethod getType()[source]
Return type:

Literal['starTransactions']

to_dict()[source]
Return type:

dict

next_offset: Optional[str]

The offset for the next request. If empty, then there are no more results

star_amount: Optional[StarAmount]

The amount of owned Telegram Stars

transactions: List[StarTransaction]

List of transactions with Telegram Stars

class pytdbot.types.StatisticalGraph[source]

Bases: object

Describes a statistical graph

class pytdbot.types.StatisticalGraphAsync(token='')[source]

Bases: TlObject, StatisticalGraph

The graph data to be asynchronously loaded through getStatisticalGraph

Parameters:

token (str) – The token to use for data loading

__init__(token='')[source]
Parameters:

token (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StatisticalGraphAsync]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StatisticalGraph']

classmethod getType()[source]
Return type:

Literal['statisticalGraphAsync']

to_dict()[source]
Return type:

dict

token: Optional[str]

The token to use for data loading

class pytdbot.types.StatisticalGraphData(json_data='', zoom_token='')[source]

Bases: TlObject, StatisticalGraph

A graph data

Parameters:
  • json_data (str) – Graph data in JSON format

  • zoom_token (str) – If non-empty, a token which can be used to receive a zoomed in graph

__init__(json_data='', zoom_token='')[source]
Parameters:
  • json_data (str)

  • zoom_token (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StatisticalGraphData]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StatisticalGraph']

classmethod getType()[source]
Return type:

Literal['statisticalGraphData']

to_dict()[source]
Return type:

dict

json_data: Optional[str]

Graph data in JSON format

zoom_token: Optional[str]

If non-empty, a token which can be used to receive a zoomed in graph

class pytdbot.types.StatisticalGraphError(error_message='')[source]

Bases: TlObject, StatisticalGraph

An error message to be shown to the user instead of the graph

Parameters:

error_message (str) – The error message

__init__(error_message='')[source]
Parameters:

error_message (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StatisticalGraphError]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StatisticalGraph']

classmethod getType()[source]
Return type:

Literal['statisticalGraphError']

to_dict()[source]
Return type:

dict

error_message: Optional[str]

The error message

class pytdbot.types.StatisticalValue(value=0.0, previous_value=0.0, growth_rate_percentage=0.0)[source]

Bases: TlObject

A value with information about its recent changes

Parameters:
  • value (float) – The current value

  • previous_value (float) – The value for the previous day

  • growth_rate_percentage (float) – The growth rate of the value, as a percentage

__init__(value=0.0, previous_value=0.0, growth_rate_percentage=0.0)[source]
Parameters:
  • value (float)

  • previous_value (float)

  • growth_rate_percentage (float)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StatisticalValue]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StatisticalValue']

classmethod getType()[source]
Return type:

Literal['statisticalValue']

to_dict()[source]
Return type:

dict

growth_rate_percentage: float

The growth rate of the value, as a percentage

previous_value: float

The value for the previous day

value: float

The current value

class pytdbot.types.Sticker(id=0, set_id=0, width=0, height=0, emoji='', format=None, full_type=None, thumbnail=None, sticker=None)[source]

Bases: TlObject

Describes a sticker

Parameters:
  • id (int) – Unique sticker identifier within the set; 0 if none

  • set_id (int) – Identifier of the sticker set to which the sticker belongs; 0 if none

  • width (int) – Sticker width; as defined by the sender

  • height (int) – Sticker height; as defined by the sender

  • emoji (str) – Emoji corresponding to the sticker

  • format ("types.StickerFormat") – Sticker format

  • full_type ("types.StickerFullType") – Sticker’s full type

  • thumbnail ("types.Thumbnail") – Sticker thumbnail in WEBP or JPEG format; may be null

  • sticker ("types.File") – File containing the sticker

__init__(id=0, set_id=0, width=0, height=0, emoji='', format=None, full_type=None, thumbnail=None, sticker=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Sticker]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Sticker']

classmethod getType()[source]
Return type:

Literal['sticker']

to_dict()[source]
Return type:

dict

emoji: Optional[str]

Emoji corresponding to the sticker

format: Union[StickerFormatWebp, StickerFormatTgs, StickerFormatWebm, None]

Sticker format

full_type: Union[StickerFullTypeRegular, StickerFullTypeMask, StickerFullTypeCustomEmoji, None]

Sticker’s full type

height: int

Sticker height; as defined by the sender

id: int

Unique sticker identifier within the set; 0 if none

set_id: int

Identifier of the sticker set to which the sticker belongs; 0 if none

sticker: Optional[File]

File containing the sticker

thumbnail: Optional[Thumbnail]

Sticker thumbnail in WEBP or JPEG format; may be null

width: int

Sticker width; as defined by the sender

class pytdbot.types.StickerFormat[source]

Bases: object

Describes format of a sticker

class pytdbot.types.StickerFormatTgs[source]

Bases: TlObject, StickerFormat

The sticker is an animation in TGS format

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StickerFormatTgs]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StickerFormat']

classmethod getType()[source]
Return type:

Literal['stickerFormatTgs']

to_dict()[source]
Return type:

dict

class pytdbot.types.StickerFormatWebm[source]

Bases: TlObject, StickerFormat

The sticker is a video in WEBM format

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StickerFormatWebm]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StickerFormat']

classmethod getType()[source]
Return type:

Literal['stickerFormatWebm']

to_dict()[source]
Return type:

dict

class pytdbot.types.StickerFormatWebp[source]

Bases: TlObject, StickerFormat

The sticker is an image in WEBP format

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StickerFormatWebp]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StickerFormat']

classmethod getType()[source]
Return type:

Literal['stickerFormatWebp']

to_dict()[source]
Return type:

dict

class pytdbot.types.StickerFullType[source]

Bases: object

Contains full information about sticker type

class pytdbot.types.StickerFullTypeCustomEmoji(custom_emoji_id=0, needs_repainting=False)[source]

Bases: TlObject, StickerFullType

The sticker is a custom emoji to be used inside message text and caption. Currently, only Telegram Premium users can use custom emoji

Parameters:
  • custom_emoji_id (int) – Identifier of the custom emoji

  • needs_repainting (bool) – 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

__init__(custom_emoji_id=0, needs_repainting=False)[source]
Parameters:
  • custom_emoji_id (int)

  • needs_repainting (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StickerFullTypeCustomEmoji]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StickerFullType']

classmethod getType()[source]
Return type:

Literal['stickerFullTypeCustomEmoji']

to_dict()[source]
Return type:

dict

custom_emoji_id: int

Identifier of the custom emoji

needs_repainting: bool

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

class pytdbot.types.StickerFullTypeMask(mask_position=None)[source]

Bases: TlObject, StickerFullType

The sticker is a mask in WEBP format to be placed on photos or videos

Parameters:

mask_position ("types.MaskPosition") – Position where the mask is placed; may be null

__init__(mask_position=None)[source]
Parameters:

mask_position (MaskPosition | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StickerFullTypeMask]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StickerFullType']

classmethod getType()[source]
Return type:

Literal['stickerFullTypeMask']

to_dict()[source]
Return type:

dict

mask_position: Optional[MaskPosition]

Position where the mask is placed; may be null

class pytdbot.types.StickerFullTypeRegular(premium_animation=None)[source]

Bases: TlObject, StickerFullType

The sticker is a regular sticker

Parameters:

premium_animation ("types.File") – Premium animation of the sticker; may be null. If present, only Telegram Premium users can use the sticker

__init__(premium_animation=None)[source]
Parameters:

premium_animation (File | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StickerFullTypeRegular]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StickerFullType']

classmethod getType()[source]
Return type:

Literal['stickerFullTypeRegular']

to_dict()[source]
Return type:

dict

premium_animation: Optional[File]

Premium animation of the sticker; may be null. If present, only Telegram Premium users can use the sticker

class pytdbot.types.StickerSet(id=0, title='', name='', thumbnail=None, thumbnail_outline=None, is_owned=False, is_installed=False, is_archived=False, is_official=False, sticker_type=None, needs_repainting=False, is_allowed_as_chat_emoji_status=False, is_viewed=False, stickers=None, emojis=None)[source]

Bases: TlObject

Represents a sticker set

Parameters:
  • id (int) – Identifier of the sticker set

  • title (str) – Title of the sticker set

  • name (str) – Name of the sticker set

  • thumbnail ("types.Thumbnail") – Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed

  • thumbnail_outline ("types.Outline") – Sticker set thumbnail’s outline; may be null if unknown

  • is_owned (bool) – True, if the sticker set is owned by the current user

  • is_installed (bool) – True, if the sticker set has been installed by the current user

  • is_archived (bool) – True, if the sticker set has been archived. A sticker set can’t be installed and archived simultaneously

  • is_official (bool) – True, if the sticker set is official

  • sticker_type ("types.StickerType") – Type of the stickers in the set

  • needs_repainting (bool) – True, if stickers in the sticker set are custom emoji that must be repainted; for custom emoji sticker sets only

  • is_allowed_as_chat_emoji_status (bool) – True, if stickers in the sticker set are custom emoji that can be used as chat emoji status; for custom emoji sticker sets only

  • is_viewed (bool) – True for already viewed trending sticker sets

  • stickers (List["types.Sticker"]) – List of stickers in this set

  • emojis (List["types.Emojis"]) – A list of emojis corresponding to the stickers in the same order. The list is only for informational purposes, because a sticker is always sent with a fixed emoji from the corresponding Sticker object

__init__(id=0, title='', name='', thumbnail=None, thumbnail_outline=None, is_owned=False, is_installed=False, is_archived=False, is_official=False, sticker_type=None, needs_repainting=False, is_allowed_as_chat_emoji_status=False, is_viewed=False, stickers=None, emojis=None)[source]
Parameters:
  • id (int)

  • title (str)

  • name (str)

  • thumbnail (Thumbnail | None)

  • thumbnail_outline (Outline | None)

  • is_owned (bool)

  • is_installed (bool)

  • is_archived (bool)

  • is_official (bool)

  • sticker_type (StickerType | None)

  • needs_repainting (bool)

  • is_allowed_as_chat_emoji_status (bool)

  • is_viewed (bool)

  • stickers (List[Sticker] | None)

  • emojis (List[Emojis] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StickerSet]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StickerSet']

classmethod getType()[source]
Return type:

Literal['stickerSet']

to_dict()[source]
Return type:

dict

emojis: List[Emojis]

A list of emojis corresponding to the stickers in the same order. The list is only for informational purposes, because a sticker is always sent with a fixed emoji from the corresponding Sticker object

id: int

Identifier of the sticker set

is_allowed_as_chat_emoji_status: bool

True, if stickers in the sticker set are custom emoji that can be used as chat emoji status; for custom emoji sticker sets only

is_archived: bool

True, if the sticker set has been archived. A sticker set can’t be installed and archived simultaneously

is_installed: bool

True, if the sticker set has been installed by the current user

is_official: bool

True, if the sticker set is official

is_owned: bool

True, if the sticker set is owned by the current user

is_viewed: bool

True for already viewed trending sticker sets

name: Optional[str]

Name of the sticker set

needs_repainting: bool

True, if stickers in the sticker set are custom emoji that must be repainted; for custom emoji sticker sets only

sticker_type: Union[StickerTypeRegular, StickerTypeMask, StickerTypeCustomEmoji, None]

Type of the stickers in the set

stickers: List[Sticker]

List of stickers in this set

thumbnail: Optional[Thumbnail]

Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed

thumbnail_outline: Optional[Outline]

Sticker set thumbnail’s outline; may be null if unknown

title: Optional[str]

Title of the sticker set

class pytdbot.types.StickerSetInfo(id=0, title='', name='', thumbnail=None, thumbnail_outline=None, is_owned=False, is_installed=False, is_archived=False, is_official=False, sticker_type=None, needs_repainting=False, is_allowed_as_chat_emoji_status=False, is_viewed=False, size=0, covers=None)[source]

Bases: TlObject

Represents short information about a sticker set

Parameters:
  • id (int) – Identifier of the sticker set

  • title (str) – Title of the sticker set

  • name (str) – Name of the sticker set

  • thumbnail ("types.Thumbnail") – Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed

  • thumbnail_outline ("types.Outline") – Sticker set thumbnail’s outline; may be null if unknown

  • is_owned (bool) – True, if the sticker set is owned by the current user

  • is_installed (bool) – True, if the sticker set has been installed by the current user

  • is_archived (bool) – True, if the sticker set has been archived. A sticker set can’t be installed and archived simultaneously

  • is_official (bool) – True, if the sticker set is official

  • sticker_type ("types.StickerType") – Type of the stickers in the set

  • needs_repainting (bool) – True, if stickers in the sticker set are custom emoji that must be repainted; for custom emoji sticker sets only

  • is_allowed_as_chat_emoji_status (bool) – True, if stickers in the sticker set are custom emoji that can be used as chat emoji status; for custom emoji sticker sets only

  • is_viewed (bool) – True for already viewed trending sticker sets

  • size (int) – Total number of stickers in the set

  • covers (List["types.Sticker"]) – Up to the first 5 stickers from the set, depending on the context. If the application needs more stickers the full sticker set needs to be requested

__init__(id=0, title='', name='', thumbnail=None, thumbnail_outline=None, is_owned=False, is_installed=False, is_archived=False, is_official=False, sticker_type=None, needs_repainting=False, is_allowed_as_chat_emoji_status=False, is_viewed=False, size=0, covers=None)[source]
Parameters:
  • id (int)

  • title (str)

  • name (str)

  • thumbnail (Thumbnail | None)

  • thumbnail_outline (Outline | None)

  • is_owned (bool)

  • is_installed (bool)

  • is_archived (bool)

  • is_official (bool)

  • sticker_type (StickerType | None)

  • needs_repainting (bool)

  • is_allowed_as_chat_emoji_status (bool)

  • is_viewed (bool)

  • size (int)

  • covers (List[Sticker] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StickerSetInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StickerSetInfo']

classmethod getType()[source]
Return type:

Literal['stickerSetInfo']

to_dict()[source]
Return type:

dict

covers: List[Sticker]

Up to the first 5 stickers from the set, depending on the context. If the application needs more stickers the full sticker set needs to be requested

id: int

Identifier of the sticker set

is_allowed_as_chat_emoji_status: bool

True, if stickers in the sticker set are custom emoji that can be used as chat emoji status; for custom emoji sticker sets only

is_archived: bool

True, if the sticker set has been archived. A sticker set can’t be installed and archived simultaneously

is_installed: bool

True, if the sticker set has been installed by the current user

is_official: bool

True, if the sticker set is official

is_owned: bool

True, if the sticker set is owned by the current user

is_viewed: bool

True for already viewed trending sticker sets

name: Optional[str]

Name of the sticker set

needs_repainting: bool

True, if stickers in the sticker set are custom emoji that must be repainted; for custom emoji sticker sets only

size: int

Total number of stickers in the set

sticker_type: Union[StickerTypeRegular, StickerTypeMask, StickerTypeCustomEmoji, None]

Type of the stickers in the set

thumbnail: Optional[Thumbnail]

Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed

thumbnail_outline: Optional[Outline]

Sticker set thumbnail’s outline; may be null if unknown

title: Optional[str]

Title of the sticker set

class pytdbot.types.StickerSets(total_count=0, sets=None)[source]

Bases: TlObject

Represents a list of sticker sets

Parameters:
  • total_count (int) – Approximate total number of sticker sets found

  • sets (List["types.StickerSetInfo"]) – List of sticker sets

__init__(total_count=0, sets=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StickerSets]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StickerSets']

classmethod getType()[source]
Return type:

Literal['stickerSets']

to_dict()[source]
Return type:

dict

sets: List[StickerSetInfo]

List of sticker sets

total_count: int

Approximate total number of sticker sets found

class pytdbot.types.StickerType[source]

Bases: object

Describes type of sticker

class pytdbot.types.StickerTypeCustomEmoji[source]

Bases: TlObject, StickerType

The sticker is a custom emoji to be used inside message text and caption

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StickerTypeCustomEmoji]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StickerType']

classmethod getType()[source]
Return type:

Literal['stickerTypeCustomEmoji']

to_dict()[source]
Return type:

dict

class pytdbot.types.StickerTypeMask[source]

Bases: TlObject, StickerType

The sticker is a mask in WEBP format to be placed on photos or videos

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StickerTypeMask]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StickerType']

classmethod getType()[source]
Return type:

Literal['stickerTypeMask']

to_dict()[source]
Return type:

dict

class pytdbot.types.StickerTypeRegular[source]

Bases: TlObject, StickerType

The sticker is a regular sticker

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StickerTypeRegular]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StickerType']

classmethod getType()[source]
Return type:

Literal['stickerTypeRegular']

to_dict()[source]
Return type:

dict

class pytdbot.types.Stickers(stickers=None)[source]

Bases: TlObject

Represents a list of stickers

Parameters:

stickers (List["types.Sticker"]) – List of stickers

__init__(stickers=None)[source]
Parameters:

stickers (List[Sticker] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Stickers]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Stickers']

classmethod getType()[source]
Return type:

Literal['stickers']

to_dict()[source]
Return type:

dict

stickers: List[Sticker]

List of stickers

class pytdbot.types.StorageStatistics(size=0, count=0, by_chat=None)[source]

Bases: TlObject

Contains the exact storage usage statistics split by chats and file type

Parameters:
  • size (int) – Total size of files, in bytes

  • count (int) – Total number of files

  • by_chat (List["types.StorageStatisticsByChat"]) – Statistics split by chats

__init__(size=0, count=0, by_chat=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StorageStatistics]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StorageStatistics']

classmethod getType()[source]
Return type:

Literal['storageStatistics']

to_dict()[source]
Return type:

dict

by_chat: List[StorageStatisticsByChat]

Statistics split by chats

count: int

Total number of files

size: int

Total size of files, in bytes

class pytdbot.types.StorageStatisticsByChat(chat_id=0, size=0, count=0, by_file_type=None)[source]

Bases: TlObject

Contains the storage usage statistics for a specific chat

Parameters:
  • chat_id (int) – Chat identifier; 0 if none

  • size (int) – Total size of the files in the chat, in bytes

  • count (int) – Total number of files in the chat

  • by_file_type (List["types.StorageStatisticsByFileType"]) – Statistics split by file types

__init__(chat_id=0, size=0, count=0, by_file_type=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StorageStatisticsByChat]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StorageStatisticsByChat']

classmethod getType()[source]
Return type:

Literal['storageStatisticsByChat']

to_dict()[source]
Return type:

dict

by_file_type: List[StorageStatisticsByFileType]

Statistics split by file types

chat_id: int

Chat identifier; 0 if none

count: int

Total number of files in the chat

size: int

Total size of the files in the chat, in bytes

class pytdbot.types.StorageStatisticsByFileType(file_type=None, size=0, count=0)[source]

Bases: TlObject

Contains the storage usage statistics for a specific file type

Parameters:
  • file_type ("types.FileType") – File type

  • size (int) – Total size of the files, in bytes

  • count (int) – Total number of files

__init__(file_type=None, size=0, count=0)[source]
Parameters:
  • file_type (FileType | None)

  • size (int)

  • count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StorageStatisticsByFileType]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StorageStatisticsByFileType']

classmethod getType()[source]
Return type:

Literal['storageStatisticsByFileType']

to_dict()[source]
Return type:

dict

count: int

Total number of files

file_type: Union[FileTypeNone, FileTypeAnimation, FileTypeAudio, FileTypeDocument, FileTypeNotificationSound, FileTypePhoto, FileTypePhotoStory, FileTypeProfilePhoto, FileTypeSecret, FileTypeSecretThumbnail, FileTypeSecure, FileTypeSelfDestructingPhoto, FileTypeSelfDestructingVideo, FileTypeSelfDestructingVideoNote, FileTypeSelfDestructingVoiceNote, FileTypeSticker, FileTypeThumbnail, FileTypeUnknown, FileTypeVideo, FileTypeVideoNote, FileTypeVideoStory, FileTypeVoiceNote, FileTypeWallpaper, None]

File type

size: int

Total size of the files, in bytes

class pytdbot.types.StorageStatisticsFast(files_size=0, file_count=0, database_size=0, language_pack_database_size=0, log_size=0)[source]

Bases: TlObject

Contains approximate storage usage statistics, excluding files of unknown file type

Parameters:
  • files_size (int) – Approximate total size of files, in bytes

  • file_count (int) – Approximate number of files

  • database_size (int) – Size of the database

  • language_pack_database_size (int) – Size of the language pack database

  • log_size (int) – Size of the TDLib internal log

__init__(files_size=0, file_count=0, database_size=0, language_pack_database_size=0, log_size=0)[source]
Parameters:
  • files_size (int)

  • file_count (int)

  • database_size (int)

  • language_pack_database_size (int)

  • log_size (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StorageStatisticsFast]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StorageStatisticsFast']

classmethod getType()[source]
Return type:

Literal['storageStatisticsFast']

to_dict()[source]
Return type:

dict

database_size: int

Size of the database

file_count: int

Approximate number of files

files_size: int

Approximate total size of files, in bytes

language_pack_database_size: int

Size of the language pack database

log_size: int

Size of the TDLib internal log

class pytdbot.types.StorePaymentPurpose[source]

Bases: object

Describes a purpose of an in-store payment

class pytdbot.types.StorePaymentPurposeGiftedStars(user_id=0, currency='', amount=0, star_count=0)[source]

Bases: TlObject, StorePaymentPurpose

The user buying Telegram Stars for other users

Parameters:
  • user_id (int) – Identifier of the user to which Telegram Stars are gifted

  • currency (str) – ISO 4217 currency code of the payment currency

  • amount (int) – Paid amount, in the smallest units of the currency

  • star_count (int) – Number of bought Telegram Stars

__init__(user_id=0, currency='', amount=0, star_count=0)[source]
Parameters:
  • user_id (int)

  • currency (str)

  • amount (int)

  • star_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StorePaymentPurposeGiftedStars]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StorePaymentPurpose']

classmethod getType()[source]
Return type:

Literal['storePaymentPurposeGiftedStars']

to_dict()[source]
Return type:

dict

amount: int

Paid amount, in the smallest units of the currency

currency: Optional[str]

ISO 4217 currency code of the payment currency

star_count: int

Number of bought Telegram Stars

user_id: int

Identifier of the user to which Telegram Stars are gifted

class pytdbot.types.StorePaymentPurposePremiumGift(currency='', amount=0, user_id=0, text=None)[source]

Bases: TlObject, StorePaymentPurpose

The user gifting Telegram Premium to another user

Parameters:
  • currency (str) – ISO 4217 currency code of the payment currency

  • amount (int) – Paid amount, in the smallest units of the currency

  • user_id (int) – Identifiers of the user which will receive Telegram Premium

  • text ("types.FormattedText") – Text to show along with the gift codes; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed

__init__(currency='', amount=0, user_id=0, text=None)[source]
Parameters:
  • currency (str)

  • amount (int)

  • user_id (int)

  • text (FormattedText | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StorePaymentPurposePremiumGift]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StorePaymentPurpose']

classmethod getType()[source]
Return type:

Literal['storePaymentPurposePremiumGift']

to_dict()[source]
Return type:

dict

amount: int

Paid amount, in the smallest units of the currency

currency: Optional[str]

ISO 4217 currency code of the payment currency

text: Optional[FormattedText]

Text to show along with the gift codes; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed

user_id: int

Identifiers of the user which will receive Telegram Premium

class pytdbot.types.StorePaymentPurposePremiumGiftCodes(boosted_chat_id=0, currency='', amount=0, user_ids=None, text=None)[source]

Bases: TlObject, StorePaymentPurpose

The user boosting a chat by creating Telegram Premium gift codes for other users

Parameters:
  • boosted_chat_id (int) – Identifier of the supergroup or channel chat, which will be automatically boosted by the users for duration of the Premium subscription and which is administered by the user

  • currency (str) – ISO 4217 currency code of the payment currency

  • amount (int) – Paid amount, in the smallest units of the currency

  • user_ids (List[int]) – Identifiers of the users which can activate the gift codes

  • text ("types.FormattedText") – Text to show along with the gift codes; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed

__init__(boosted_chat_id=0, currency='', amount=0, user_ids=None, text=None)[source]
Parameters:
  • boosted_chat_id (int)

  • currency (str)

  • amount (int)

  • user_ids (List[int] | None)

  • text (FormattedText | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StorePaymentPurposePremiumGiftCodes]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StorePaymentPurpose']

classmethod getType()[source]
Return type:

Literal['storePaymentPurposePremiumGiftCodes']

to_dict()[source]
Return type:

dict

amount: int

Paid amount, in the smallest units of the currency

boosted_chat_id: int

Identifier of the supergroup or channel chat, which will be automatically boosted by the users for duration of the Premium subscription and which is administered by the user

currency: Optional[str]

ISO 4217 currency code of the payment currency

text: Optional[FormattedText]

Text to show along with the gift codes; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed

user_ids: List[int]

Identifiers of the users which can activate the gift codes

class pytdbot.types.StorePaymentPurposePremiumGiveaway(parameters=None, currency='', amount=0)[source]

Bases: TlObject, StorePaymentPurpose

The user creating a Telegram Premium giveaway

Parameters:
  • parameters ("types.GiveawayParameters") – Giveaway parameters

  • currency (str) – ISO 4217 currency code of the payment currency

  • amount (int) – Paid amount, in the smallest units of the currency

__init__(parameters=None, currency='', amount=0)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StorePaymentPurposePremiumGiveaway]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StorePaymentPurpose']

classmethod getType()[source]
Return type:

Literal['storePaymentPurposePremiumGiveaway']

to_dict()[source]
Return type:

dict

amount: int

Paid amount, in the smallest units of the currency

currency: Optional[str]

ISO 4217 currency code of the payment currency

parameters: Optional[GiveawayParameters]

Giveaway parameters

class pytdbot.types.StorePaymentPurposePremiumSubscription(is_restore=False, is_upgrade=False)[source]

Bases: TlObject, StorePaymentPurpose

The user subscribing to Telegram Premium

Parameters:
  • is_restore (bool) – Pass true if this is a restore of a Telegram Premium purchase; only for App Store

  • is_upgrade (bool) – Pass true if this is an upgrade from a monthly subscription to early subscription; only for App Store

__init__(is_restore=False, is_upgrade=False)[source]
Parameters:
  • is_restore (bool)

  • is_upgrade (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StorePaymentPurposePremiumSubscription]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StorePaymentPurpose']

classmethod getType()[source]
Return type:

Literal['storePaymentPurposePremiumSubscription']

to_dict()[source]
Return type:

dict

is_restore: bool

Pass true if this is a restore of a Telegram Premium purchase; only for App Store

is_upgrade: bool

Pass true if this is an upgrade from a monthly subscription to early subscription; only for App Store

class pytdbot.types.StorePaymentPurposeStarGiveaway(parameters=None, currency='', amount=0, winner_count=0, star_count=0)[source]

Bases: TlObject, StorePaymentPurpose

The user creating a Telegram Star giveaway

Parameters:
  • parameters ("types.GiveawayParameters") – Giveaway parameters

  • currency (str) – ISO 4217 currency code of the payment currency

  • amount (int) – Paid amount, in the smallest units of the currency

  • winner_count (int) – The number of users to receive Telegram Stars

  • star_count (int) – The number of Telegram Stars to be distributed through the giveaway

__init__(parameters=None, currency='', amount=0, winner_count=0, star_count=0)[source]
Parameters:
  • parameters (GiveawayParameters | None)

  • currency (str)

  • amount (int)

  • winner_count (int)

  • star_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StorePaymentPurposeStarGiveaway]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StorePaymentPurpose']

classmethod getType()[source]
Return type:

Literal['storePaymentPurposeStarGiveaway']

to_dict()[source]
Return type:

dict

amount: int

Paid amount, in the smallest units of the currency

currency: Optional[str]

ISO 4217 currency code of the payment currency

parameters: Optional[GiveawayParameters]

Giveaway parameters

star_count: int

The number of Telegram Stars to be distributed through the giveaway

winner_count: int

The number of users to receive Telegram Stars

class pytdbot.types.StorePaymentPurposeStars(currency='', amount=0, star_count=0, chat_id=0)[source]

Bases: TlObject, StorePaymentPurpose

The user buying Telegram Stars

Parameters:
  • currency (str) – ISO 4217 currency code of the payment currency

  • amount (int) – Paid amount, in the smallest units of the currency

  • star_count (int) – Number of bought Telegram Stars

  • chat_id (int) – Identifier of the chat that is supposed to receive the Telegram Stars; pass 0 if none

__init__(currency='', amount=0, star_count=0, chat_id=0)[source]
Parameters:
  • currency (str)

  • amount (int)

  • star_count (int)

  • chat_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StorePaymentPurposeStars]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StorePaymentPurpose']

classmethod getType()[source]
Return type:

Literal['storePaymentPurposeStars']

to_dict()[source]
Return type:

dict

amount: int

Paid amount, in the smallest units of the currency

chat_id: int

Identifier of the chat that is supposed to receive the Telegram Stars; pass 0 if none

currency: Optional[str]

ISO 4217 currency code of the payment currency

star_count: int

Number of bought Telegram Stars

class pytdbot.types.StoreTransaction[source]

Bases: object

Describes an in-store transaction

class pytdbot.types.StoreTransactionAppStore(receipt=b'')[source]

Bases: TlObject, StoreTransaction

A purchase through App Store

Parameters:

receipt (bytes) – App Store receipt

__init__(receipt=b'')[source]
Parameters:

receipt (bytes)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StoreTransactionAppStore]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StoreTransaction']

classmethod getType()[source]
Return type:

Literal['storeTransactionAppStore']

to_dict()[source]
Return type:

dict

receipt: Optional[bytes]

App Store receipt

class pytdbot.types.StoreTransactionGooglePlay(package_name='', store_product_id='', purchase_token='')[source]

Bases: TlObject, StoreTransaction

A purchase through Google Play

Parameters:
  • package_name (str) – Application package name

  • store_product_id (str) – Identifier of the purchased store product

  • purchase_token (str) – Google Play purchase token

__init__(package_name='', store_product_id='', purchase_token='')[source]
Parameters:
  • package_name (str)

  • store_product_id (str)

  • purchase_token (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StoreTransactionGooglePlay]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StoreTransaction']

classmethod getType()[source]
Return type:

Literal['storeTransactionGooglePlay']

to_dict()[source]
Return type:

dict

package_name: Optional[str]

Application package name

purchase_token: Optional[str]

Google Play purchase token

store_product_id: Optional[str]

Identifier of the purchased store product

class pytdbot.types.Stories(total_count=0, stories=None, pinned_story_ids=None)[source]

Bases: TlObject

Represents a list of stories

Parameters:
  • total_count (int) – Approximate total number of stories found

  • stories (List["types.Story"]) – The list of stories

  • pinned_story_ids (List[int]) – Identifiers of the pinned stories; returned only in getChatPostedToChatPageStories with from_story_id == 0

__init__(total_count=0, stories=None, pinned_story_ids=None)[source]
Parameters:
  • total_count (int)

  • stories (List[Story] | None)

  • pinned_story_ids (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Stories]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Stories']

classmethod getType()[source]
Return type:

Literal['stories']

to_dict()[source]
Return type:

dict

pinned_story_ids: List[int]

Identifiers of the pinned stories; returned only in getChatPostedToChatPageStories with from_story_id == 0

stories: List[Story]

The list of stories

total_count: int

Approximate total number of stories found

class pytdbot.types.Story(id=0, poster_chat_id=0, poster_id=None, date=0, is_being_posted=False, is_being_edited=False, is_edited=False, is_posted_to_chat_page=False, is_visible_only_for_self=False, can_be_added_to_album=False, can_be_deleted=False, can_be_edited=False, can_be_forwarded=False, can_be_replied=False, can_toggle_is_posted_to_chat_page=False, can_get_statistics=False, can_get_interactions=False, has_expired_viewers=False, repost_info=None, interaction_info=None, chosen_reaction_type=None, privacy_settings=None, content=None, areas=None, caption=None, album_ids=None)[source]

Bases: TlObject

Represents a story

Parameters:
  • id (int) – Unique story identifier among stories posted by the given chat

  • poster_chat_id (int) – Identifier of the chat that posted the story

  • poster_id ("types.MessageSender") – Identifier of the user or chat that posted the story; may be null if the story is posted on behalf of the poster_chat_id

  • date (int) – Point in time (Unix timestamp) when the story was published

  • is_being_posted (bool) – True, if the story is being posted by the current user

  • is_being_edited (bool) – True, if the story is being edited by the current user

  • is_edited (bool) – True, if the story was edited

  • is_posted_to_chat_page (bool) – True, if the story is saved in the profile of the chat that posted it and will be available there after expiration

  • is_visible_only_for_self (bool) – True, if the story is visible only for the current user

  • can_be_added_to_album (bool) – True, if the story can be added to an album

  • can_be_deleted (bool) – True, if the story can be deleted

  • can_be_edited (bool) – True, if the story can be edited

  • can_be_forwarded (bool) – True, if the story can be forwarded as a message. Otherwise, screenshots and saving of the story content must be also forbidden

  • can_be_replied (bool) – True, if the story can be replied in the chat with the user that posted the story

  • can_toggle_is_posted_to_chat_page (bool) – True, if the story’s is_posted_to_chat_page value can be changed

  • can_get_statistics (bool) – True, if the story statistics are available through getStoryStatistics

  • can_get_interactions (bool) – True, if interactions with the story can be received through getStoryInteractions

  • has_expired_viewers (bool) – True, if users viewed the story can’t be received, because the story has expired more than getOption("story_viewers_expiration_delay") seconds ago

  • repost_info ("types.StoryRepostInfo") – Information about the original story; may be null if the story wasn’t reposted

  • interaction_info ("types.StoryInteractionInfo") – Information about interactions with the story; may be null if the story isn’t owned or there were no interactions

  • chosen_reaction_type ("types.ReactionType") – Type of the chosen reaction; may be null if none

  • privacy_settings ("types.StoryPrivacySettings") – Privacy rules affecting story visibility; may be approximate for non-owned stories

  • content ("types.StoryContent") – Content of the story

  • areas (List["types.StoryArea"]) – Clickable areas to be shown on the story content

  • caption ("types.FormattedText") – Caption of the story

  • album_ids (List[int]) – Identifiers of story albums to which the story is added; only for manageable stories

__init__(id=0, poster_chat_id=0, poster_id=None, date=0, is_being_posted=False, is_being_edited=False, is_edited=False, is_posted_to_chat_page=False, is_visible_only_for_self=False, can_be_added_to_album=False, can_be_deleted=False, can_be_edited=False, can_be_forwarded=False, can_be_replied=False, can_toggle_is_posted_to_chat_page=False, can_get_statistics=False, can_get_interactions=False, has_expired_viewers=False, repost_info=None, interaction_info=None, chosen_reaction_type=None, privacy_settings=None, content=None, areas=None, caption=None, album_ids=None)[source]
Parameters:
  • id (int)

  • poster_chat_id (int)

  • poster_id (MessageSender | None)

  • date (int)

  • is_being_posted (bool)

  • is_being_edited (bool)

  • is_edited (bool)

  • is_posted_to_chat_page (bool)

  • is_visible_only_for_self (bool)

  • can_be_added_to_album (bool)

  • can_be_deleted (bool)

  • can_be_edited (bool)

  • can_be_forwarded (bool)

  • can_be_replied (bool)

  • can_toggle_is_posted_to_chat_page (bool)

  • can_get_statistics (bool)

  • can_get_interactions (bool)

  • has_expired_viewers (bool)

  • repost_info (StoryRepostInfo | None)

  • interaction_info (StoryInteractionInfo | None)

  • chosen_reaction_type (ReactionType | None)

  • privacy_settings (StoryPrivacySettings | None)

  • content (StoryContent | None)

  • areas (List[StoryArea] | None)

  • caption (FormattedText | None)

  • album_ids (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Story]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Story']

classmethod getType()[source]
Return type:

Literal['story']

to_dict()[source]
Return type:

dict

album_ids: List[int]

Identifiers of story albums to which the story is added; only for manageable stories

areas: List[StoryArea]

Clickable areas to be shown on the story content

can_be_added_to_album: bool

True, if the story can be added to an album

can_be_deleted: bool

True, if the story can be deleted

can_be_edited: bool

True, if the story can be edited

can_be_forwarded: bool

True, if the story can be forwarded as a message. Otherwise, screenshots and saving of the story content must be also forbidden

can_be_replied: bool

True, if the story can be replied in the chat with the user that posted the story

can_get_interactions: bool

True, if interactions with the story can be received through getStoryInteractions

can_get_statistics: bool

True, if the story statistics are available through getStoryStatistics

can_toggle_is_posted_to_chat_page: bool

True, if the story’s is_posted_to_chat_page value can be changed

caption: Optional[FormattedText]

Caption of the story

chosen_reaction_type: Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid, None]

Type of the chosen reaction; may be null if none

content: Union[StoryContentPhoto, StoryContentVideo, StoryContentUnsupported, None]

Content of the story

date: int

Point in time (Unix timestamp) when the story was published

has_expired_viewers: bool

True, if users viewed the story can’t be received, because the story has expired more than getOption("story_viewers_expiration_delay") seconds ago

id: int

Unique story identifier among stories posted by the given chat

interaction_info: Optional[StoryInteractionInfo]

Information about interactions with the story; may be null if the story isn’t owned or there were no interactions

is_being_edited: bool

True, if the story is being edited by the current user

is_being_posted: bool

True, if the story is being posted by the current user

is_edited: bool

True, if the story was edited

is_posted_to_chat_page: bool

True, if the story is saved in the profile of the chat that posted it and will be available there after expiration

is_visible_only_for_self: bool

True, if the story is visible only for the current user

poster_chat_id: int

Identifier of the chat that posted the story

poster_id: Union[MessageSenderUser, MessageSenderChat, None]

Identifier of the user or chat that posted the story; may be null if the story is posted on behalf of the poster_chat_id

privacy_settings: Union[StoryPrivacySettingsEveryone, StoryPrivacySettingsContacts, StoryPrivacySettingsCloseFriends, StoryPrivacySettingsSelectedUsers, None]

Privacy rules affecting story visibility; may be approximate for non-owned stories

repost_info: Optional[StoryRepostInfo]

Information about the original story; may be null if the story wasn’t reposted

class pytdbot.types.StoryAlbum(id=0, name='', photo_icon=None, video_icon=None)[source]

Bases: TlObject

Describes album of stories

Parameters:
  • id (int) – Unique identifier of the album

  • name (str) – Name of the album

  • photo_icon ("types.Photo") – Icon of the album; may be null if none

  • video_icon ("types.Video") – Video icon of the album; may be null if none

__init__(id=0, name='', photo_icon=None, video_icon=None)[source]
Parameters:
  • id (int)

  • name (str)

  • photo_icon (Photo | None)

  • video_icon (Video | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StoryAlbum]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StoryAlbum']

classmethod getType()[source]
Return type:

Literal['storyAlbum']

to_dict()[source]
Return type:

dict

id: int

Unique identifier of the album

name: Optional[str]

Name of the album

photo_icon: Optional[Photo]

Icon of the album; may be null if none

video_icon: Optional[Video]

Video icon of the album; may be null if none

class pytdbot.types.StoryAlbums(albums=None)[source]

Bases: TlObject

Represents a list of story albums

Parameters:

albums (List["types.StoryAlbum"]) – List of story albums

__init__(albums=None)[source]
Parameters:

albums (List[StoryAlbum] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StoryAlbums]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StoryAlbums']

classmethod getType()[source]
Return type:

Literal['storyAlbums']

to_dict()[source]
Return type:

dict

albums: List[StoryAlbum]

List of story albums

class pytdbot.types.StoryArea(position=None, type=None)[source]

Bases: TlObject

Describes a clickable rectangle area on a story media

Parameters:
  • position ("types.StoryAreaPosition") – Position of the area

  • type ("types.StoryAreaType") – Type of the area

__init__(position=None, type=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StoryArea]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StoryArea']

classmethod getType()[source]
Return type:

Literal['storyArea']

to_dict()[source]
Return type:

dict

position: Optional[StoryAreaPosition]

Position of the area

type: Union[StoryAreaTypeLocation, StoryAreaTypeVenue, StoryAreaTypeSuggestedReaction, StoryAreaTypeMessage, StoryAreaTypeLink, StoryAreaTypeWeather, StoryAreaTypeUpgradedGift, None]

Type of the area

class pytdbot.types.StoryAreaPosition(x_percentage=0.0, y_percentage=0.0, width_percentage=0.0, height_percentage=0.0, rotation_angle=0.0, corner_radius_percentage=0.0)[source]

Bases: TlObject

Describes position of a clickable rectangle area on a story media

Parameters:
  • x_percentage (float) – The abscissa of the rectangle’s center, as a percentage of the media width

  • y_percentage (float) – The ordinate of the rectangle’s center, as a percentage of the media height

  • width_percentage (float) – The width of the rectangle, as a percentage of the media width

  • height_percentage (float) – The height of the rectangle, as a percentage of the media height

  • rotation_angle (float) – Clockwise rotation angle of the rectangle, in degrees; 0-360

  • corner_radius_percentage (float) – The radius of the rectangle corner rounding, as a percentage of the media width

__init__(x_percentage=0.0, y_percentage=0.0, width_percentage=0.0, height_percentage=0.0, rotation_angle=0.0, corner_radius_percentage=0.0)[source]
Parameters:
  • x_percentage (float)

  • y_percentage (float)

  • width_percentage (float)

  • height_percentage (float)

  • rotation_angle (float)

  • corner_radius_percentage (float)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StoryAreaPosition]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StoryAreaPosition']

classmethod getType()[source]
Return type:

Literal['storyAreaPosition']

to_dict()[source]
Return type:

dict

corner_radius_percentage: float

The radius of the rectangle corner rounding, as a percentage of the media width

height_percentage: float

The height of the rectangle, as a percentage of the media height

rotation_angle: float

Clockwise rotation angle of the rectangle, in degrees; 0-360

width_percentage: float

The width of the rectangle, as a percentage of the media width

x_percentage: float

The abscissa of the rectangle’s center, as a percentage of the media width

y_percentage: float

The ordinate of the rectangle’s center, as a percentage of the media height

class pytdbot.types.StoryAreaType[source]

Bases: object

Describes type of clickable area on a story media

class pytdbot.types.StoryAreaTypeLink(url='')[source]

Bases: TlObject, StoryAreaType

An area pointing to a HTTP or tg:// link

Parameters:

url (str) – HTTP or tg:// URL to be opened when the area is clicked

__init__(url='')[source]
Parameters:

url (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StoryAreaTypeLink]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StoryAreaType']

classmethod getType()[source]
Return type:

Literal['storyAreaTypeLink']

to_dict()[source]
Return type:

dict

url: Optional[str]

// URL to be opened when the area is clicked

Type:

HTTP or tg

class pytdbot.types.StoryAreaTypeLocation(location=None, address=None)[source]

Bases: TlObject, StoryAreaType

An area pointing to a location

Parameters:
  • location ("types.Location") – The location

  • address ("types.LocationAddress") – Address of the location; may be null if unknown

__init__(location=None, address=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StoryAreaTypeLocation]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StoryAreaType']

classmethod getType()[source]
Return type:

Literal['storyAreaTypeLocation']

to_dict()[source]
Return type:

dict

address: Optional[LocationAddress]

Address of the location; may be null if unknown

location: Optional[Location]

The location

class pytdbot.types.StoryAreaTypeMessage(chat_id=0, message_id=0)[source]

Bases: TlObject, StoryAreaType

An area pointing to a message

Parameters:
  • chat_id (int) – Identifier of the chat with the message

  • message_id (int) – Identifier of the message

__init__(chat_id=0, message_id=0)[source]
Parameters:
  • chat_id (int)

  • message_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StoryAreaTypeMessage]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StoryAreaType']

classmethod getType()[source]
Return type:

Literal['storyAreaTypeMessage']

to_dict()[source]
Return type:

dict

chat_id: int

Identifier of the chat with the message

message_id: int

Identifier of the message

class pytdbot.types.StoryAreaTypeSuggestedReaction(reaction_type=None, total_count=0, is_dark=False, is_flipped=False)[source]

Bases: TlObject, StoryAreaType

An area pointing to a suggested reaction. App needs to show a clickable reaction on the area and call setStoryReaction when the are is clicked

Parameters:
  • reaction_type ("types.ReactionType") – Type of the reaction

  • total_count (int) – Number of times the reaction was added

  • is_dark (bool) – True, if reaction has a dark background

  • is_flipped (bool) – True, if reaction corner is flipped

__init__(reaction_type=None, total_count=0, is_dark=False, is_flipped=False)[source]
Parameters:
  • reaction_type (ReactionType | None)

  • total_count (int)

  • is_dark (bool)

  • is_flipped (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StoryAreaTypeSuggestedReaction]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StoryAreaType']

classmethod getType()[source]
Return type:

Literal['storyAreaTypeSuggestedReaction']

to_dict()[source]
Return type:

dict

is_dark: bool

True, if reaction has a dark background

is_flipped: bool

True, if reaction corner is flipped

reaction_type: Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid, None]

Type of the reaction

total_count: int

Number of times the reaction was added

class pytdbot.types.StoryAreaTypeUpgradedGift(gift_name='')[source]

Bases: TlObject, StoryAreaType

An area with an upgraded gift

Parameters:

gift_name (str) – Unique name of the upgraded gift

__init__(gift_name='')[source]
Parameters:

gift_name (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StoryAreaTypeUpgradedGift]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StoryAreaType']

classmethod getType()[source]
Return type:

Literal['storyAreaTypeUpgradedGift']

to_dict()[source]
Return type:

dict

gift_name: Optional[str]

Unique name of the upgraded gift

class pytdbot.types.StoryAreaTypeVenue(venue=None)[source]

Bases: TlObject, StoryAreaType

An area pointing to a venue

Parameters:

venue ("types.Venue") – Information about the venue

__init__(venue=None)[source]
Parameters:

venue (Venue | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StoryAreaTypeVenue]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StoryAreaType']

classmethod getType()[source]
Return type:

Literal['storyAreaTypeVenue']

to_dict()[source]
Return type:

dict

venue: Optional[Venue]

Information about the venue

class pytdbot.types.StoryAreaTypeWeather(temperature=0.0, emoji='', background_color=0)[source]

Bases: TlObject, StoryAreaType

An area with information about weather

Parameters:
  • 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

__init__(temperature=0.0, emoji='', background_color=0)[source]
Parameters:
  • temperature (float)

  • emoji (str)

  • background_color (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StoryAreaTypeWeather]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StoryAreaType']

classmethod getType()[source]
Return type:

Literal['storyAreaTypeWeather']

to_dict()[source]
Return type:

dict

background_color: int

A color of the area background in the ARGB format

emoji: Optional[str]

Emoji representing the weather

temperature: float

Temperature, in degree Celsius

class pytdbot.types.StoryContent[source]

Bases: object

Contains the content of a story

class pytdbot.types.StoryContentPhoto(photo=None)[source]

Bases: TlObject, StoryContent

A photo story

Parameters:

photo ("types.Photo") – The photo

__init__(photo=None)[source]
Parameters:

photo (Photo | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StoryContentPhoto]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StoryContent']

classmethod getType()[source]
Return type:

Literal['storyContentPhoto']

to_dict()[source]
Return type:

dict

photo: Optional[Photo]

The photo

class pytdbot.types.StoryContentUnsupported[source]

Bases: TlObject, StoryContent

A story content that is not supported in the current TDLib version

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StoryContentUnsupported]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StoryContent']

classmethod getType()[source]
Return type:

Literal['storyContentUnsupported']

to_dict()[source]
Return type:

dict

class pytdbot.types.StoryContentVideo(video=None, alternative_video=None)[source]

Bases: TlObject, StoryContent

A video story

Parameters:
  • video ("types.StoryVideo") – The video in MPEG4 format

  • alternative_video ("types.StoryVideo") – Alternative version of the video in MPEG4 format, encoded with H.264 codec; may be null

__init__(video=None, alternative_video=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StoryContentVideo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StoryContent']

classmethod getType()[source]
Return type:

Literal['storyContentVideo']

to_dict()[source]
Return type:

dict

alternative_video: Optional[StoryVideo]

Alternative version of the video in MPEG4 format, encoded with H.264 codec; may be null

video: Optional[StoryVideo]

The video in MPEG4 format

class pytdbot.types.StoryFullId(poster_chat_id=0, story_id=0)[source]

Bases: TlObject

Contains identifier of a story along with identifier of the chat that posted it

Parameters:
  • poster_chat_id (int) – Identifier of the chat that posted the story

  • story_id (int) – Unique story identifier among stories of the chat

__init__(poster_chat_id=0, story_id=0)[source]
Parameters:
  • poster_chat_id (int)

  • story_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StoryFullId]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StoryFullId']

classmethod getType()[source]
Return type:

Literal['storyFullId']

to_dict()[source]
Return type:

dict

poster_chat_id: int

Identifier of the chat that posted the story

story_id: int

Unique story identifier among stories of the chat

class pytdbot.types.StoryInfo(story_id=0, date=0, is_for_close_friends=False)[source]

Bases: TlObject

Contains basic information about a story

Parameters:
  • story_id (int) – Unique story identifier among stories of the chat

  • date (int) – Point in time (Unix timestamp) when the story was published

  • is_for_close_friends (bool) – True, if the story is available only to close friends

__init__(story_id=0, date=0, is_for_close_friends=False)[source]
Parameters:
  • story_id (int)

  • date (int)

  • is_for_close_friends (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StoryInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StoryInfo']

classmethod getType()[source]
Return type:

Literal['storyInfo']

to_dict()[source]
Return type:

dict

date: int

Point in time (Unix timestamp) when the story was published

is_for_close_friends: bool

True, if the story is available only to close friends

story_id: int

Unique story identifier among stories of the chat

class pytdbot.types.StoryInteraction(actor_id=None, interaction_date=0, block_list=None, type=None)[source]

Bases: TlObject

Represents interaction with a story

Parameters:
  • actor_id ("types.MessageSender") – Identifier of the user or chat that made the interaction

  • interaction_date (int) – Approximate point in time (Unix timestamp) when the interaction happened

  • block_list ("types.BlockList") – Block list to which the actor is added; may be null if none or for chat stories

  • type ("types.StoryInteractionType") – Type of the interaction

__init__(actor_id=None, interaction_date=0, block_list=None, type=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StoryInteraction]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StoryInteraction']

classmethod getType()[source]
Return type:

Literal['storyInteraction']

to_dict()[source]
Return type:

dict

actor_id: Union[MessageSenderUser, MessageSenderChat, None]

Identifier of the user or chat that made the interaction

block_list: Union[BlockListMain, BlockListStories, None]

Block list to which the actor is added; may be null if none or for chat stories

interaction_date: int

Approximate point in time (Unix timestamp) when the interaction happened

type: Union[StoryInteractionTypeView, StoryInteractionTypeForward, StoryInteractionTypeRepost, None]

Type of the interaction

class pytdbot.types.StoryInteractionInfo(view_count=0, forward_count=0, reaction_count=0, recent_viewer_user_ids=None)[source]

Bases: TlObject

Contains information about interactions with a story

Parameters:
  • view_count (int) – Number of times the story was viewed

  • forward_count (int) – Number of times the story was forwarded; 0 if none or unknown

  • reaction_count (int) – Number of reactions added to the story; 0 if none or unknown

  • recent_viewer_user_ids (List[int]) – Identifiers of at most 3 recent viewers of the story

__init__(view_count=0, forward_count=0, reaction_count=0, recent_viewer_user_ids=None)[source]
Parameters:
  • view_count (int)

  • forward_count (int)

  • reaction_count (int)

  • recent_viewer_user_ids (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StoryInteractionInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StoryInteractionInfo']

classmethod getType()[source]
Return type:

Literal['storyInteractionInfo']

to_dict()[source]
Return type:

dict

forward_count: int

Number of times the story was forwarded; 0 if none or unknown

reaction_count: int

Number of reactions added to the story; 0 if none or unknown

recent_viewer_user_ids: List[int]

Identifiers of at most 3 recent viewers of the story

view_count: int

Number of times the story was viewed

class pytdbot.types.StoryInteractionType[source]

Bases: object

Describes type of interaction with a story

class pytdbot.types.StoryInteractionTypeForward(message=None)[source]

Bases: TlObject, StoryInteractionType

A forward of the story as a message

Parameters:

message ("types.Message") – The message with story forward

__init__(message=None)[source]
Parameters:

message (Message | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StoryInteractionTypeForward]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StoryInteractionType']

classmethod getType()[source]
Return type:

Literal['storyInteractionTypeForward']

to_dict()[source]
Return type:

dict

message: Optional[Message]

The message with story forward

class pytdbot.types.StoryInteractionTypeRepost(story=None)[source]

Bases: TlObject, StoryInteractionType

A repost of the story as a story

Parameters:

story ("types.Story") – The reposted story

__init__(story=None)[source]
Parameters:

story (Story | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StoryInteractionTypeRepost]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StoryInteractionType']

classmethod getType()[source]
Return type:

Literal['storyInteractionTypeRepost']

to_dict()[source]
Return type:

dict

story: Optional[Story]

The reposted story

class pytdbot.types.StoryInteractionTypeView(chosen_reaction_type=None)[source]

Bases: TlObject, StoryInteractionType

A view of the story

Parameters:

chosen_reaction_type ("types.ReactionType") – Type of the reaction that was chosen by the viewer; may be null if none

__init__(chosen_reaction_type=None)[source]
Parameters:

chosen_reaction_type (ReactionType | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StoryInteractionTypeView]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StoryInteractionType']

classmethod getType()[source]
Return type:

Literal['storyInteractionTypeView']

to_dict()[source]
Return type:

dict

chosen_reaction_type: Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid, None]

Type of the reaction that was chosen by the viewer; may be null if none

class pytdbot.types.StoryInteractions(total_count=0, total_forward_count=0, total_reaction_count=0, interactions=None, next_offset='')[source]

Bases: TlObject

Represents a list of interactions with a story

Parameters:
  • total_count (int) – Approximate total number of interactions found

  • total_forward_count (int) – Approximate total number of found forwards and reposts; always 0 for chat stories

  • total_reaction_count (int) – Approximate total number of found reactions; always 0 for chat stories

  • interactions (List["types.StoryInteraction"]) – List of story interactions

  • next_offset (str) – The offset for the next request. If empty, then there are no more results

__init__(total_count=0, total_forward_count=0, total_reaction_count=0, interactions=None, next_offset='')[source]
Parameters:
  • total_count (int)

  • total_forward_count (int)

  • total_reaction_count (int)

  • interactions (List[StoryInteraction] | None)

  • next_offset (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StoryInteractions]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StoryInteractions']

classmethod getType()[source]
Return type:

Literal['storyInteractions']

to_dict()[source]
Return type:

dict

interactions: List[StoryInteraction]

List of story interactions

next_offset: Optional[str]

The offset for the next request. If empty, then there are no more results

total_count: int

Approximate total number of interactions found

total_forward_count: int

Approximate total number of found forwards and reposts; always 0 for chat stories

total_reaction_count: int

Approximate total number of found reactions; always 0 for chat stories

class pytdbot.types.StoryList[source]

Bases: object

Describes a list of stories

class pytdbot.types.StoryListArchive[source]

Bases: TlObject, StoryList

The list of stories, shown in the Arvhive chat list

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StoryListArchive]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StoryList']

classmethod getType()[source]
Return type:

Literal['storyListArchive']

to_dict()[source]
Return type:

dict

class pytdbot.types.StoryListMain[source]

Bases: TlObject, StoryList

The list of stories, shown in the main chat list and folder chat lists

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StoryListMain]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StoryList']

classmethod getType()[source]
Return type:

Literal['storyListMain']

to_dict()[source]
Return type:

dict

class pytdbot.types.StoryOrigin[source]

Bases: object

Contains information about the origin of a story that was reposted

class pytdbot.types.StoryOriginHiddenUser(poster_name='')[source]

Bases: TlObject, StoryOrigin

The original story was posted by an unknown user

Parameters:

poster_name (str) – Name of the user or the chat that posted the story

__init__(poster_name='')[source]
Parameters:

poster_name (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StoryOriginHiddenUser]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StoryOrigin']

classmethod getType()[source]
Return type:

Literal['storyOriginHiddenUser']

to_dict()[source]
Return type:

dict

poster_name: Optional[str]

Name of the user or the chat that posted the story

class pytdbot.types.StoryOriginPublicStory(chat_id=0, story_id=0)[source]

Bases: TlObject, StoryOrigin

The original story was a public story that was posted by a known chat

Parameters:
  • chat_id (int) – Identifier of the chat that posted original story

  • story_id (int) – Story identifier of the original story

__init__(chat_id=0, story_id=0)[source]
Parameters:
  • chat_id (int)

  • story_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StoryOriginPublicStory]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StoryOrigin']

classmethod getType()[source]
Return type:

Literal['storyOriginPublicStory']

to_dict()[source]
Return type:

dict

chat_id: int

Identifier of the chat that posted original story

story_id: int

Story identifier of the original story

class pytdbot.types.StoryPrivacySettings[source]

Bases: object

Describes privacy settings of a story

class pytdbot.types.StoryPrivacySettingsCloseFriends[source]

Bases: TlObject, StoryPrivacySettings

The story can be viewed by all close friends

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StoryPrivacySettingsCloseFriends]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StoryPrivacySettings']

classmethod getType()[source]
Return type:

Literal['storyPrivacySettingsCloseFriends']

to_dict()[source]
Return type:

dict

class pytdbot.types.StoryPrivacySettingsContacts(except_user_ids=None)[source]

Bases: TlObject, StoryPrivacySettings

The story can be viewed by all contacts except chosen users

Parameters:

except_user_ids (List[int]) – User identifiers of the contacts that can’t see the story; always unknown and empty for non-owned stories

__init__(except_user_ids=None)[source]
Parameters:

except_user_ids (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StoryPrivacySettingsContacts]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StoryPrivacySettings']

classmethod getType()[source]
Return type:

Literal['storyPrivacySettingsContacts']

to_dict()[source]
Return type:

dict

except_user_ids: List[int]

User identifiers of the contacts that can’t see the story; always unknown and empty for non-owned stories

class pytdbot.types.StoryPrivacySettingsEveryone(except_user_ids=None)[source]

Bases: TlObject, StoryPrivacySettings

The story can be viewed by everyone

Parameters:

except_user_ids (List[int]) – Identifiers of the users that can’t see the story; always unknown and empty for non-owned stories

__init__(except_user_ids=None)[source]
Parameters:

except_user_ids (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StoryPrivacySettingsEveryone]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StoryPrivacySettings']

classmethod getType()[source]
Return type:

Literal['storyPrivacySettingsEveryone']

to_dict()[source]
Return type:

dict

except_user_ids: List[int]

Identifiers of the users that can’t see the story; always unknown and empty for non-owned stories

class pytdbot.types.StoryPrivacySettingsSelectedUsers(user_ids=None)[source]

Bases: TlObject, StoryPrivacySettings

The story can be viewed by certain specified users

Parameters:

user_ids (List[int]) – Identifiers of the users; always unknown and empty for non-owned stories

__init__(user_ids=None)[source]
Parameters:

user_ids (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StoryPrivacySettingsSelectedUsers]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StoryPrivacySettings']

classmethod getType()[source]
Return type:

Literal['storyPrivacySettingsSelectedUsers']

to_dict()[source]
Return type:

dict

user_ids: List[int]

Identifiers of the users; always unknown and empty for non-owned stories

class pytdbot.types.StoryRepostInfo(origin=None, is_content_modified=False)[source]

Bases: TlObject

Contains information about original story that was reposted

Parameters:
  • origin ("types.StoryOrigin") – Origin of the story that was reposted

  • is_content_modified (bool) – True, if story content was modified during reposting; otherwise, story wasn’t modified

__init__(origin=None, is_content_modified=False)[source]
Parameters:
  • origin (StoryOrigin | None)

  • is_content_modified (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StoryRepostInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StoryRepostInfo']

classmethod getType()[source]
Return type:

Literal['storyRepostInfo']

to_dict()[source]
Return type:

dict

is_content_modified: bool

True, if story content was modified during reposting; otherwise, story wasn’t modified

origin: Union[StoryOriginPublicStory, StoryOriginHiddenUser, None]

Origin of the story that was reposted

class pytdbot.types.StoryStatistics(story_interaction_graph=None, story_reaction_graph=None)[source]

Bases: TlObject

A detailed statistics about a story

Parameters:
  • story_interaction_graph ("types.StatisticalGraph") – A graph containing number of story views and shares

  • story_reaction_graph ("types.StatisticalGraph") – A graph containing number of story reactions

__init__(story_interaction_graph=None, story_reaction_graph=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StoryStatistics]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StoryStatistics']

classmethod getType()[source]
Return type:

Literal['storyStatistics']

to_dict()[source]
Return type:

dict

story_interaction_graph: Union[StatisticalGraphData, StatisticalGraphAsync, StatisticalGraphError, None]

A graph containing number of story views and shares

story_reaction_graph: Union[StatisticalGraphData, StatisticalGraphAsync, StatisticalGraphError, None]

A graph containing number of story reactions

class pytdbot.types.StoryVideo(duration=0.0, width=0, height=0, has_stickers=False, is_animation=False, minithumbnail=None, thumbnail=None, preload_prefix_size=0, cover_frame_timestamp=0.0, video=None)[source]

Bases: TlObject

Describes a video file posted as a story

Parameters:
  • duration (float) – Duration of the video, in seconds

  • width (int) – Video width

  • height (int) – Video height

  • has_stickers (bool) – True, if stickers were added to the video. The list of corresponding sticker sets can be received using getAttachedStickerSets

  • is_animation (bool) – True, if the video has no sound

  • minithumbnail ("types.Minithumbnail") – Video minithumbnail; may be null

  • thumbnail ("types.Thumbnail") – Video thumbnail in JPEG or MPEG4 format; may be null

  • preload_prefix_size (int) – Size of file prefix, which is expected to be preloaded, in bytes

  • cover_frame_timestamp (float) – Timestamp of the frame used as video thumbnail

  • video ("types.File") – File containing the video

__init__(duration=0.0, width=0, height=0, has_stickers=False, is_animation=False, minithumbnail=None, thumbnail=None, preload_prefix_size=0, cover_frame_timestamp=0.0, video=None)[source]
Parameters:
  • duration (float)

  • width (int)

  • height (int)

  • has_stickers (bool)

  • is_animation (bool)

  • minithumbnail (Minithumbnail | None)

  • thumbnail (Thumbnail | None)

  • preload_prefix_size (int)

  • cover_frame_timestamp (float)

  • video (File | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[StoryVideo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['StoryVideo']

classmethod getType()[source]
Return type:

Literal['storyVideo']

to_dict()[source]
Return type:

dict

cover_frame_timestamp: float

Timestamp of the frame used as video thumbnail

duration: float

Duration of the video, in seconds

has_stickers: bool

True, if stickers were added to the video. The list of corresponding sticker sets can be received using getAttachedStickerSets

height: int

Video height

is_animation: bool

True, if the video has no sound

minithumbnail: Optional[Minithumbnail]

Video minithumbnail; may be null

preload_prefix_size: int

Size of file prefix, which is expected to be preloaded, in bytes

thumbnail: Optional[Thumbnail]

Video thumbnail in JPEG or MPEG4 format; may be null

video: Optional[File]

File containing the video

width: int

Video width

class pytdbot.types.SuggestedAction[source]

Bases: object

Describes an action suggested to the current user

class pytdbot.types.SuggestedActionCheckPassword[source]

Bases: TlObject, SuggestedAction

Suggests the user to check whether they still remember their 2-step verification password

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SuggestedActionCheckPassword]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SuggestedAction']

classmethod getType()[source]
Return type:

Literal['suggestedActionCheckPassword']

to_dict()[source]
Return type:

dict

class pytdbot.types.SuggestedActionCheckPhoneNumber[source]

Bases: TlObject, SuggestedAction

Suggests the user to check whether authorization phone number is correct and change the phone number if it is inaccessible

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SuggestedActionCheckPhoneNumber]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SuggestedAction']

classmethod getType()[source]
Return type:

Literal['suggestedActionCheckPhoneNumber']

to_dict()[source]
Return type:

dict

class pytdbot.types.SuggestedActionConvertToBroadcastGroup(supergroup_id=0)[source]

Bases: TlObject, SuggestedAction

Suggests the user to convert specified supergroup to a broadcast group

Parameters:

supergroup_id (int) – Supergroup identifier

__init__(supergroup_id=0)[source]
Parameters:

supergroup_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SuggestedActionConvertToBroadcastGroup]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SuggestedAction']

classmethod getType()[source]
Return type:

Literal['suggestedActionConvertToBroadcastGroup']

to_dict()[source]
Return type:

dict

supergroup_id: int

Supergroup identifier

class pytdbot.types.SuggestedActionCustom(name='', title=None, description=None, url='')[source]

Bases: TlObject, SuggestedAction

A custom suggestion to be shown at the top of the chat list

Parameters:
  • name (str) – Unique name of the suggestion

  • title ("types.FormattedText") – Title of the suggestion

  • description ("types.FormattedText") – Description of the suggestion

  • url (str) – The link to open when the suggestion is clicked

__init__(name='', title=None, description=None, url='')[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SuggestedActionCustom]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SuggestedAction']

classmethod getType()[source]
Return type:

Literal['suggestedActionCustom']

to_dict()[source]
Return type:

dict

description: Optional[FormattedText]

Description of the suggestion

name: Optional[str]

Unique name of the suggestion

title: Optional[FormattedText]

Title of the suggestion

url: Optional[str]

The link to open when the suggestion is clicked

class pytdbot.types.SuggestedActionEnableArchiveAndMuteNewChats[source]

Bases: TlObject, SuggestedAction

Suggests the user to enable archive_and_mute_new_chats_from_unknown_users setting in archiveChatListSettings

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SuggestedActionEnableArchiveAndMuteNewChats]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SuggestedAction']

classmethod getType()[source]
Return type:

Literal['suggestedActionEnableArchiveAndMuteNewChats']

to_dict()[source]
Return type:

dict

class pytdbot.types.SuggestedActionExtendPremium(manage_premium_subscription_url='')[source]

Bases: TlObject, SuggestedAction

Suggests the user to extend their expiring Telegram Premium subscription

Parameters:

manage_premium_subscription_url (str) – A URL for managing Telegram Premium subscription

__init__(manage_premium_subscription_url='')[source]
Parameters:

manage_premium_subscription_url (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SuggestedActionExtendPremium]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SuggestedAction']

classmethod getType()[source]
Return type:

Literal['suggestedActionExtendPremium']

to_dict()[source]
Return type:

dict

manage_premium_subscription_url: Optional[str]

A URL for managing Telegram Premium subscription

class pytdbot.types.SuggestedActionExtendStarSubscriptions[source]

Bases: TlObject, SuggestedAction

Suggests the user to extend their expiring Telegram Star subscriptions. Call getStarSubscriptions with only_expiring == true to get the number of expiring subscriptions and the number of required to buy Telegram Stars

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SuggestedActionExtendStarSubscriptions]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SuggestedAction']

classmethod getType()[source]
Return type:

Literal['suggestedActionExtendStarSubscriptions']

to_dict()[source]
Return type:

dict

class pytdbot.types.SuggestedActionGiftPremiumForChristmas[source]

Bases: TlObject, SuggestedAction

Suggests the user to gift Telegram Premium to friends for Christmas

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SuggestedActionGiftPremiumForChristmas]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SuggestedAction']

classmethod getType()[source]
Return type:

Literal['suggestedActionGiftPremiumForChristmas']

to_dict()[source]
Return type:

dict

class pytdbot.types.SuggestedActionRestorePremium[source]

Bases: TlObject, SuggestedAction

Suggests the user to restore a recently expired Premium subscription

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SuggestedActionRestorePremium]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SuggestedAction']

classmethod getType()[source]
Return type:

Literal['suggestedActionRestorePremium']

to_dict()[source]
Return type:

dict

class pytdbot.types.SuggestedActionSetBirthdate[source]

Bases: TlObject, SuggestedAction

Suggests the user to set birthdate

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SuggestedActionSetBirthdate]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SuggestedAction']

classmethod getType()[source]
Return type:

Literal['suggestedActionSetBirthdate']

to_dict()[source]
Return type:

dict

class pytdbot.types.SuggestedActionSetPassword(authorization_delay=0)[source]

Bases: TlObject, SuggestedAction

Suggests the user to set a 2-step verification password to be able to log in again

Parameters:

authorization_delay (int) – The number of days to pass between consecutive authorizations if the user declines to set password; if 0, then the user is advised to set the password for security reasons

__init__(authorization_delay=0)[source]
Parameters:

authorization_delay (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SuggestedActionSetPassword]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SuggestedAction']

classmethod getType()[source]
Return type:

Literal['suggestedActionSetPassword']

to_dict()[source]
Return type:

dict

authorization_delay: int

The number of days to pass between consecutive authorizations if the user declines to set password; if 0, then the user is advised to set the password for security reasons

class pytdbot.types.SuggestedActionSetProfilePhoto[source]

Bases: TlObject, SuggestedAction

Suggests the user to set profile photo

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SuggestedActionSetProfilePhoto]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SuggestedAction']

classmethod getType()[source]
Return type:

Literal['suggestedActionSetProfilePhoto']

to_dict()[source]
Return type:

dict

class pytdbot.types.SuggestedActionSubscribeToAnnualPremium[source]

Bases: TlObject, SuggestedAction

Suggests the user to subscribe to the Premium subscription with annual payments

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SuggestedActionSubscribeToAnnualPremium]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SuggestedAction']

classmethod getType()[source]
Return type:

Literal['suggestedActionSubscribeToAnnualPremium']

to_dict()[source]
Return type:

dict

class pytdbot.types.SuggestedActionUpgradePremium[source]

Bases: TlObject, SuggestedAction

Suggests the user to upgrade the Premium subscription from monthly payments to annual payments

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SuggestedActionUpgradePremium]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SuggestedAction']

classmethod getType()[source]
Return type:

Literal['suggestedActionUpgradePremium']

to_dict()[source]
Return type:

dict

class pytdbot.types.SuggestedActionViewChecksHint[source]

Bases: TlObject, SuggestedAction

Suggests the user to view a hint about the meaning of one and two check marks on sent messages

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SuggestedActionViewChecksHint]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SuggestedAction']

classmethod getType()[source]
Return type:

Literal['suggestedActionViewChecksHint']

to_dict()[source]
Return type:

dict

class pytdbot.types.SuggestedPostInfo(price=None, send_date=0, state=None, can_be_approved=False, can_be_declined=False)[source]

Bases: TlObject

Contains information about a suggested post. If the post can be approved or declined, then changes to the post can be also suggested. Use sendMessage with reply to the message and suggested post information to suggest message changes. Use addOffer to suggest price or time changes

Parameters:
  • price ("types.SuggestedPostPrice") – Price of the suggested post; may be null if the post is non-paid

  • send_date (int) – Point in time (Unix timestamp) when the post is expected to be published; 0 if the specific date isn’t set yet

  • state ("types.SuggestedPostState") – State of the post

  • can_be_approved (bool) – True, if the suggested post can be approved by the current user using approveSuggestedPost; updates aren’t sent when value of this field changes

  • can_be_declined (bool) – True, if the suggested post can be declined by the current user using declineSuggestedPost; updates aren’t sent when value of this field changes

__init__(price=None, send_date=0, state=None, can_be_approved=False, can_be_declined=False)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SuggestedPostInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SuggestedPostInfo']

classmethod getType()[source]
Return type:

Literal['suggestedPostInfo']

to_dict()[source]
Return type:

dict

can_be_approved: bool

True, if the suggested post can be approved by the current user using approveSuggestedPost; updates aren’t sent when value of this field changes

can_be_declined: bool

True, if the suggested post can be declined by the current user using declineSuggestedPost; updates aren’t sent when value of this field changes

price: Union[SuggestedPostPriceStar, SuggestedPostPriceTon, None]

Price of the suggested post; may be null if the post is non-paid

send_date: int

Point in time (Unix timestamp) when the post is expected to be published; 0 if the specific date isn’t set yet

state: Union[SuggestedPostStatePending, SuggestedPostStateApproved, SuggestedPostStateDeclined, None]

State of the post

class pytdbot.types.SuggestedPostPrice[source]

Bases: object

Describes price of a suggested post

class pytdbot.types.SuggestedPostPriceStar(star_count=0)[source]

Bases: TlObject, SuggestedPostPrice

Describes price of a suggested post in Telegram Stars

Parameters:

star_count (int) – The amount of Telegram Stars expected to be paid for the post; getOption("suggested_post_star_count_min")-getOption("suggested_post_star_count_max")

__init__(star_count=0)[source]
Parameters:

star_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SuggestedPostPriceStar]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SuggestedPostPrice']

classmethod getType()[source]
Return type:

Literal['suggestedPostPriceStar']

to_dict()[source]
Return type:

dict

star_count: int

The amount of Telegram Stars expected to be paid for the post; getOption("suggested_post_star_count_min")-getOption("suggested_post_star_count_max")

class pytdbot.types.SuggestedPostPriceTon(toncoin_cent_count=0)[source]

Bases: TlObject, SuggestedPostPrice

Describes price of a suggested post in Toncoins

Parameters:

toncoin_cent_count (int) – The amount of 1/100 of Toncoin expected to be paid for the post; getOption("suggested_post_toncoin_cent_count_min")-getOption("suggested_post_toncoin_cent_count_max")

__init__(toncoin_cent_count=0)[source]
Parameters:

toncoin_cent_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SuggestedPostPriceTon]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SuggestedPostPrice']

classmethod getType()[source]
Return type:

Literal['suggestedPostPriceTon']

to_dict()[source]
Return type:

dict

toncoin_cent_count: int

The amount of 1/100 of Toncoin expected to be paid for the post; getOption("suggested_post_toncoin_cent_count_min")-getOption("suggested_post_toncoin_cent_count_max")

class pytdbot.types.SuggestedPostRefundReason[source]

Bases: object

Describes reason for refund of the payment for a suggested post

class pytdbot.types.SuggestedPostRefundReasonPaymentRefunded[source]

Bases: TlObject, SuggestedPostRefundReason

The post was refunded, because the payment for the post was refunded

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SuggestedPostRefundReasonPaymentRefunded]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SuggestedPostRefundReason']

classmethod getType()[source]
Return type:

Literal['suggestedPostRefundReasonPaymentRefunded']

to_dict()[source]
Return type:

dict

class pytdbot.types.SuggestedPostRefundReasonPostDeleted[source]

Bases: TlObject, SuggestedPostRefundReason

The post was refunded, because it was deleted by channel administrators in less than getOption("suggested_post_lifetime_min") seconds

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SuggestedPostRefundReasonPostDeleted]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SuggestedPostRefundReason']

classmethod getType()[source]
Return type:

Literal['suggestedPostRefundReasonPostDeleted']

to_dict()[source]
Return type:

dict

class pytdbot.types.SuggestedPostState[source]

Bases: object

Describes state of a suggested post

class pytdbot.types.SuggestedPostStateApproved[source]

Bases: TlObject, SuggestedPostState

The post was approved

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SuggestedPostStateApproved]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SuggestedPostState']

classmethod getType()[source]
Return type:

Literal['suggestedPostStateApproved']

to_dict()[source]
Return type:

dict

class pytdbot.types.SuggestedPostStateDeclined[source]

Bases: TlObject, SuggestedPostState

The post was declined

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SuggestedPostStateDeclined]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SuggestedPostState']

classmethod getType()[source]
Return type:

Literal['suggestedPostStateDeclined']

to_dict()[source]
Return type:

dict

class pytdbot.types.SuggestedPostStatePending[source]

Bases: TlObject, SuggestedPostState

The post must be approved or declined

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SuggestedPostStatePending]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SuggestedPostState']

classmethod getType()[source]
Return type:

Literal['suggestedPostStatePending']

to_dict()[source]
Return type:

dict

class pytdbot.types.Supergroup(id=0, usernames=None, date=0, status=None, member_count=0, boost_level=0, has_automatic_translation=False, has_linked_chat=False, has_location=False, sign_messages=False, show_message_sender=False, join_to_send_messages=False, join_by_request=False, is_slow_mode_enabled=False, is_channel=False, is_broadcast_group=False, is_forum=False, is_direct_messages_group=False, is_administered_direct_messages_group=False, verification_status=None, has_direct_messages_group=False, has_forum_tabs=False, restriction_info=None, paid_message_star_count=0, has_active_stories=False, has_unread_active_stories=False)[source]

Bases: TlObject

Represents a supergroup or channel with zero or more members (subscribers in the case of channels). From the point of view of the system, a channel is a special kind of a supergroup: only administrators can post and see the list of members, and posts from all administrators use the name and photo of the channel instead of individual names and profile photos. Unlike supergroups, channels can have an unlimited number of subscribers

Parameters:
  • id (int) – Supergroup or channel identifier

  • usernames ("types.Usernames") – Usernames of the supergroup or channel; may be null

  • date (int) – Point in time (Unix timestamp) when the current user joined, or the point in time when the supergroup or channel was created, in case the user is not a member

  • status ("types.ChatMemberStatus") – Status of the current user in the supergroup or channel; custom title will always be empty

  • member_count (int) – Number of members in the supergroup or channel; 0 if unknown. Currently, it is guaranteed to be known only if the supergroup or channel was received through getChatSimilarChats, getChatsToPostStories, getCreatedPublicChats, getGroupsInCommon, getInactiveSupergroupChats, getRecommendedChats, getSuitableDiscussionChats, getUserPrivacySettingRules, getVideoChatAvailableParticipants, searchPublicChats, or in chatFolderInviteLinkInfo.missing_chat_ids, or in userFullInfo.personal_chat_id, or for chats with messages or stories from publicForwards and foundStories

  • boost_level (int) – Approximate boost level for the chat

  • has_automatic_translation (bool) – True, if automatic translation of messages is enabled in the channel

  • has_linked_chat (bool) – True, if the channel has a discussion group, or the supergroup is the designated discussion group for a channel

  • has_location (bool) – True, if the supergroup is connected to a location, i.e. the supergroup is a location-based supergroup

  • sign_messages (bool) – True, if messages sent to the channel contains name of the sender. This field is only applicable to channels

  • show_message_sender (bool) – True, if messages sent to the channel have information about the sender user. This field is only applicable to channels

  • join_to_send_messages (bool) – True, if users need to join the supergroup before they can send messages. May be false only for discussion supergroups and channel direct messages groups

  • join_by_request (bool) – True, if all users directly joining the supergroup need to be approved by supergroup administrators. Always false for channels and supergroups without username, location, or a linked chat

  • is_slow_mode_enabled (bool) – True, if the slow mode is enabled in the supergroup

  • is_channel (bool) – True, if the supergroup is a channel

  • is_broadcast_group (bool) – True, if the supergroup is a broadcast group, i.e. only administrators can send messages and there is no limit on the number of members

  • is_forum (bool) – True, if the supergroup is a forum with topics

  • is_direct_messages_group (bool) – True, if the supergroup is a direct message group for a channel chat

  • is_administered_direct_messages_group (bool) – True, if the supergroup is a direct messages group for a channel chat that is administered by the current user

  • verification_status ("types.VerificationStatus") – Information about verification status of the supergroup or channel; may be null if none

  • has_direct_messages_group (bool) – True, if the channel has direct messages group

  • has_forum_tabs (bool) – True, if the supergroup is a forum, which topics are shown in the same way as in channel direct messages groups

  • restriction_info ("types.RestrictionInfo") – Information about the restrictions that must be applied to the corresponding supergroup or channel chat; may be null if none

  • paid_message_star_count (int) – Number of Telegram Stars that must be paid by non-administrator users of the supergroup chat for each sent message

  • has_active_stories (bool) – True, if the supergroup or channel has non-expired stories available to the current user

  • has_unread_active_stories (bool) – True, if the supergroup or channel has unread non-expired stories available to the current user

__init__(id=0, usernames=None, date=0, status=None, member_count=0, boost_level=0, has_automatic_translation=False, has_linked_chat=False, has_location=False, sign_messages=False, show_message_sender=False, join_to_send_messages=False, join_by_request=False, is_slow_mode_enabled=False, is_channel=False, is_broadcast_group=False, is_forum=False, is_direct_messages_group=False, is_administered_direct_messages_group=False, verification_status=None, has_direct_messages_group=False, has_forum_tabs=False, restriction_info=None, paid_message_star_count=0, has_active_stories=False, has_unread_active_stories=False)[source]
Parameters:
  • id (int)

  • usernames (Usernames | None)

  • date (int)

  • status (ChatMemberStatus | None)

  • member_count (int)

  • boost_level (int)

  • has_automatic_translation (bool)

  • has_linked_chat (bool)

  • has_location (bool)

  • sign_messages (bool)

  • show_message_sender (bool)

  • join_to_send_messages (bool)

  • join_by_request (bool)

  • is_slow_mode_enabled (bool)

  • is_channel (bool)

  • is_broadcast_group (bool)

  • is_forum (bool)

  • is_direct_messages_group (bool)

  • is_administered_direct_messages_group (bool)

  • verification_status (VerificationStatus | None)

  • has_direct_messages_group (bool)

  • has_forum_tabs (bool)

  • restriction_info (RestrictionInfo | None)

  • paid_message_star_count (int)

  • has_active_stories (bool)

  • has_unread_active_stories (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Supergroup]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Supergroup']

classmethod getType()[source]
Return type:

Literal['supergroup']

to_dict()[source]
Return type:

dict

boost_level: int

Approximate boost level for the chat

date: int

Point in time (Unix timestamp) when the current user joined, or the point in time when the supergroup or channel was created, in case the user is not a member

has_active_stories: bool

True, if the supergroup or channel has non-expired stories available to the current user

has_automatic_translation: bool

True, if automatic translation of messages is enabled in the channel

has_direct_messages_group: bool

True, if the channel has direct messages group

has_forum_tabs: bool

True, if the supergroup is a forum, which topics are shown in the same way as in channel direct messages groups

has_linked_chat: bool

True, if the channel has a discussion group, or the supergroup is the designated discussion group for a channel

has_location: bool

True, if the supergroup is connected to a location, i.e. the supergroup is a location-based supergroup

has_unread_active_stories: bool

True, if the supergroup or channel has unread non-expired stories available to the current user

id: int

Supergroup or channel identifier

is_administered_direct_messages_group: bool

True, if the supergroup is a direct messages group for a channel chat that is administered by the current user

is_broadcast_group: bool

True, if the supergroup is a broadcast group, i.e. only administrators can send messages and there is no limit on the number of members

is_channel: bool

True, if the supergroup is a channel

is_direct_messages_group: bool

True, if the supergroup is a direct message group for a channel chat

is_forum: bool

True, if the supergroup is a forum with topics

is_slow_mode_enabled: bool

True, if the slow mode is enabled in the supergroup

join_by_request: bool

True, if all users directly joining the supergroup need to be approved by supergroup administrators. Always false for channels and supergroups without username, location, or a linked chat

join_to_send_messages: bool

True, if users need to join the supergroup before they can send messages. May be false only for discussion supergroups and channel direct messages groups

member_count: int

Number of members in the supergroup or channel; 0 if unknown. Currently, it is guaranteed to be known only if the supergroup or channel was received through getChatSimilarChats, getChatsToPostStories, getCreatedPublicChats, getGroupsInCommon, getInactiveSupergroupChats, getRecommendedChats, getSuitableDiscussionChats, getUserPrivacySettingRules, getVideoChatAvailableParticipants, searchPublicChats, or in chatFolderInviteLinkInfo.missing_chat_ids, or in userFullInfo.personal_chat_id, or for chats with messages or stories from publicForwards and foundStories

paid_message_star_count: int

Number of Telegram Stars that must be paid by non-administrator users of the supergroup chat for each sent message

restriction_info: Optional[RestrictionInfo]

Information about the restrictions that must be applied to the corresponding supergroup or channel chat; may be null if none

show_message_sender: bool

True, if messages sent to the channel have information about the sender user. This field is only applicable to channels

sign_messages: bool

True, if messages sent to the channel contains name of the sender. This field is only applicable to channels

status: Union[ChatMemberStatusCreator, ChatMemberStatusAdministrator, ChatMemberStatusMember, ChatMemberStatusRestricted, ChatMemberStatusLeft, ChatMemberStatusBanned, None]

Status of the current user in the supergroup or channel; custom title will always be empty

usernames: Optional[Usernames]

Usernames of the supergroup or channel; may be null

verification_status: Optional[VerificationStatus]

Information about verification status of the supergroup or channel; may be null if none

class pytdbot.types.SupergroupFullInfo(photo=None, description='', member_count=0, administrator_count=0, restricted_count=0, banned_count=0, linked_chat_id=0, direct_messages_chat_id=0, slow_mode_delay=0, slow_mode_delay_expires_in=0.0, can_enable_paid_messages=False, can_enable_paid_reaction=False, can_get_members=False, has_hidden_members=False, can_hide_members=False, can_set_sticker_set=False, can_set_location=False, can_get_statistics=False, can_get_revenue_statistics=False, can_get_star_revenue_statistics=False, can_send_gift=False, can_toggle_aggressive_anti_spam=False, is_all_history_available=False, can_have_sponsored_messages=False, has_aggressive_anti_spam_enabled=False, has_paid_media_allowed=False, has_pinned_stories=False, gift_count=0, my_boost_count=0, unrestrict_boost_count=0, outgoing_paid_message_star_count=0, sticker_set_id=0, custom_emoji_sticker_set_id=0, location=None, invite_link=None, bot_commands=None, bot_verification=None, main_profile_tab=None, upgraded_from_basic_group_id=0, upgraded_from_max_message_id=0)[source]

Bases: TlObject

Contains full information about a supergroup or channel

Parameters:
  • photo ("types.ChatPhoto") – Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo

  • description (str) – Supergroup or channel description

  • member_count (int) – Number of members in the supergroup or channel; 0 if unknown

  • administrator_count (int) – Number of privileged users in the supergroup or channel; 0 if unknown

  • restricted_count (int) – Number of restricted users in the supergroup; 0 if unknown

  • banned_count (int) – Number of users banned from chat; 0 if unknown

  • linked_chat_id (int) – Chat identifier of a discussion group for the channel, or a channel, for which the supergroup is the designated discussion group; 0 if none or unknown

  • direct_messages_chat_id (int) – Chat identifier of a direct messages group for the channel, or a channel, for which the supergroup is the designated direct messages group; 0 if none

  • slow_mode_delay (int) – Delay between consecutive sent messages for non-administrator supergroup members, in seconds

  • slow_mode_delay_expires_in (float) – Time left before next message can be sent in the supergroup, in seconds. An updateSupergroupFullInfo update is not triggered when value of this field changes, but both new and old values are non-zero

  • can_enable_paid_messages (bool) – True, if paid messages can be enabled in the supergroup chat; for supergroup only

  • can_enable_paid_reaction (bool) – True, if paid reaction can be enabled in the channel chat; for channels only

  • can_get_members (bool) – True, if members of the chat can be retrieved via getSupergroupMembers or searchChatMembers

  • has_hidden_members (bool) – True, if non-administrators can receive only administrators and bots using getSupergroupMembers or searchChatMembers

  • can_hide_members (bool) – True, if non-administrators and non-bots can be hidden in responses to getSupergroupMembers and searchChatMembers for non-administrators

  • can_set_sticker_set (bool) – True, if the supergroup sticker set can be changed

  • can_set_location (bool) – True, if the supergroup location can be changed

  • can_get_statistics (bool) – True, if the supergroup or channel statistics are available

  • can_get_revenue_statistics (bool) – True, if the supergroup or channel revenue statistics are available

  • can_get_star_revenue_statistics (bool) – True, if the supergroup or channel Telegram Star revenue statistics are available

  • can_send_gift (bool) – True, if the user can send a gift to the supergroup or channel using sendGift or transferGift

  • can_toggle_aggressive_anti_spam (bool) – True, if aggressive anti-spam checks can be enabled or disabled in the supergroup

  • is_all_history_available (bool) – True, if new chat members will have access to old messages. In public, discussion, of forum groups and all channels, old messages are always available, so this option affects only private non-forum supergroups without a linked chat. The value of this field is only available to chat administrators

  • can_have_sponsored_messages (bool) – True, if the chat can have sponsored messages. The value of this field is only available to the owner of the chat

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

  • has_paid_media_allowed (bool) – True, if paid media can be sent and forwarded to the channel chat; for channels only

  • has_pinned_stories (bool) – True, if the supergroup or channel has pinned stories

  • gift_count (int) – Number of saved to profile gifts for channels without can_post_messages administrator right, otherwise, the total number of received gifts

  • my_boost_count (int) – Number of times the current user boosted the supergroup or channel

  • unrestrict_boost_count (int) – Number of times the supergroup must be boosted by a user to ignore slow mode and chat permission restrictions; 0 if unspecified

  • outgoing_paid_message_star_count (int) – Number of Telegram Stars that must be paid by the current user for each sent message to the supergroup

  • sticker_set_id (int) – Identifier of the supergroup sticker set that must be shown before user sticker sets; 0 if none

  • custom_emoji_sticker_set_id (int) – Identifier of the custom emoji sticker set that can be used in the supergroup without Telegram Premium subscription; 0 if none

  • location ("types.ChatLocation") – Location to which the supergroup is connected; may be null if none

  • invite_link ("types.ChatInviteLink") – Primary invite link for the chat; may be null. For chat administrators with can_invite_users right only

  • bot_commands (List["types.BotCommands"]) – List of commands of bots in the group

  • bot_verification ("types.BotVerification") – Information about verification status of the supergroup or the channel provided by a bot; may be null if none or unknown

  • main_profile_tab ("types.ProfileTab") – The main tab chosen by the administrators of the channel; may be null if not chosen manually

  • upgraded_from_basic_group_id (int) – Identifier of the basic group from which supergroup was upgraded; 0 if none

  • upgraded_from_max_message_id (int) – Identifier of the last message in the basic group from which supergroup was upgraded; 0 if none

__init__(photo=None, description='', member_count=0, administrator_count=0, restricted_count=0, banned_count=0, linked_chat_id=0, direct_messages_chat_id=0, slow_mode_delay=0, slow_mode_delay_expires_in=0.0, can_enable_paid_messages=False, can_enable_paid_reaction=False, can_get_members=False, has_hidden_members=False, can_hide_members=False, can_set_sticker_set=False, can_set_location=False, can_get_statistics=False, can_get_revenue_statistics=False, can_get_star_revenue_statistics=False, can_send_gift=False, can_toggle_aggressive_anti_spam=False, is_all_history_available=False, can_have_sponsored_messages=False, has_aggressive_anti_spam_enabled=False, has_paid_media_allowed=False, has_pinned_stories=False, gift_count=0, my_boost_count=0, unrestrict_boost_count=0, outgoing_paid_message_star_count=0, sticker_set_id=0, custom_emoji_sticker_set_id=0, location=None, invite_link=None, bot_commands=None, bot_verification=None, main_profile_tab=None, upgraded_from_basic_group_id=0, upgraded_from_max_message_id=0)[source]
Parameters:
  • photo (ChatPhoto | None)

  • description (str)

  • member_count (int)

  • administrator_count (int)

  • restricted_count (int)

  • banned_count (int)

  • linked_chat_id (int)

  • direct_messages_chat_id (int)

  • slow_mode_delay (int)

  • slow_mode_delay_expires_in (float)

  • can_enable_paid_messages (bool)

  • can_enable_paid_reaction (bool)

  • can_get_members (bool)

  • has_hidden_members (bool)

  • can_hide_members (bool)

  • can_set_sticker_set (bool)

  • can_set_location (bool)

  • can_get_statistics (bool)

  • can_get_revenue_statistics (bool)

  • can_get_star_revenue_statistics (bool)

  • can_send_gift (bool)

  • can_toggle_aggressive_anti_spam (bool)

  • is_all_history_available (bool)

  • can_have_sponsored_messages (bool)

  • has_aggressive_anti_spam_enabled (bool)

  • has_paid_media_allowed (bool)

  • has_pinned_stories (bool)

  • gift_count (int)

  • my_boost_count (int)

  • unrestrict_boost_count (int)

  • outgoing_paid_message_star_count (int)

  • sticker_set_id (int)

  • custom_emoji_sticker_set_id (int)

  • location (ChatLocation | None)

  • invite_link (ChatInviteLink | None)

  • bot_commands (List[BotCommands] | None)

  • bot_verification (BotVerification | None)

  • main_profile_tab (ProfileTab | None)

  • upgraded_from_basic_group_id (int)

  • upgraded_from_max_message_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SupergroupFullInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SupergroupFullInfo']

classmethod getType()[source]
Return type:

Literal['supergroupFullInfo']

to_dict()[source]
Return type:

dict

administrator_count: int

Number of privileged users in the supergroup or channel; 0 if unknown

banned_count: int

Number of users banned from chat; 0 if unknown

bot_commands: List[BotCommands]

List of commands of bots in the group

bot_verification: Optional[BotVerification]

Information about verification status of the supergroup or the channel provided by a bot; may be null if none or unknown

can_enable_paid_messages: bool

True, if paid messages can be enabled in the supergroup chat; for supergroup only

can_enable_paid_reaction: bool

True, if paid reaction can be enabled in the channel chat; for channels only

can_get_members: bool

True, if members of the chat can be retrieved via getSupergroupMembers or searchChatMembers

can_get_revenue_statistics: bool

True, if the supergroup or channel revenue statistics are available

can_get_star_revenue_statistics: bool

True, if the supergroup or channel Telegram Star revenue statistics are available

can_get_statistics: bool

True, if the supergroup or channel statistics are available

can_have_sponsored_messages: bool

True, if the chat can have sponsored messages. The value of this field is only available to the owner of the chat

can_hide_members: bool

True, if non-administrators and non-bots can be hidden in responses to getSupergroupMembers and searchChatMembers for non-administrators

can_send_gift: bool

True, if the user can send a gift to the supergroup or channel using sendGift or transferGift

can_set_location: bool

True, if the supergroup location can be changed

can_set_sticker_set: bool

True, if the supergroup sticker set can be changed

can_toggle_aggressive_anti_spam: bool

True, if aggressive anti-spam checks can be enabled or disabled in the supergroup

custom_emoji_sticker_set_id: int

Identifier of the custom emoji sticker set that can be used in the supergroup without Telegram Premium subscription; 0 if none

description: Optional[str]

Supergroup or channel description

direct_messages_chat_id: int

Chat identifier of a direct messages group for the channel, or a channel, for which the supergroup is the designated direct messages group; 0 if none

gift_count: int

Number of saved to profile gifts for channels without can_post_messages administrator right, otherwise, the total number of received gifts

has_aggressive_anti_spam_enabled: bool

True, if aggressive anti-spam checks are enabled in the supergroup. The value of this field is only available to chat administrators

has_hidden_members: bool

True, if non-administrators can receive only administrators and bots using getSupergroupMembers or searchChatMembers

has_paid_media_allowed: bool

True, if paid media can be sent and forwarded to the channel chat; for channels only

has_pinned_stories: bool

True, if the supergroup or channel has pinned stories

invite_link: Optional[ChatInviteLink]

Primary invite link for the chat; may be null. For chat administrators with can_invite_users right only

is_all_history_available: bool

True, if new chat members will have access to old messages. In public, discussion, of forum groups and all channels, old messages are always available, so this option affects only private non-forum supergroups without a linked chat. The value of this field is only available to chat administrators

linked_chat_id: int

Chat identifier of a discussion group for the channel, or a channel, for which the supergroup is the designated discussion group; 0 if none or unknown

location: Optional[ChatLocation]

Location to which the supergroup is connected; may be null if none

main_profile_tab: Union[ProfileTabPosts, ProfileTabGifts, ProfileTabMedia, ProfileTabFiles, ProfileTabLinks, ProfileTabMusic, ProfileTabVoice, ProfileTabGifs, None]

The main tab chosen by the administrators of the channel; may be null if not chosen manually

member_count: int

Number of members in the supergroup or channel; 0 if unknown

my_boost_count: int

Number of times the current user boosted the supergroup or channel

outgoing_paid_message_star_count: int

Number of Telegram Stars that must be paid by the current user for each sent message to the supergroup

photo: Optional[ChatPhoto]

Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo

restricted_count: int

Number of restricted users in the supergroup; 0 if unknown

slow_mode_delay: int

Delay between consecutive sent messages for non-administrator supergroup members, in seconds

slow_mode_delay_expires_in: float

Time left before next message can be sent in the supergroup, in seconds. An updateSupergroupFullInfo update is not triggered when value of this field changes, but both new and old values are non-zero

sticker_set_id: int

Identifier of the supergroup sticker set that must be shown before user sticker sets; 0 if none

unrestrict_boost_count: int

Number of times the supergroup must be boosted by a user to ignore slow mode and chat permission restrictions; 0 if unspecified

upgraded_from_basic_group_id: int

Identifier of the basic group from which supergroup was upgraded; 0 if none

upgraded_from_max_message_id: int

Identifier of the last message in the basic group from which supergroup was upgraded; 0 if none

class pytdbot.types.SupergroupMembersFilter[source]

Bases: object

Specifies the kind of chat members to return in getSupergroupMembers

class pytdbot.types.SupergroupMembersFilterAdministrators[source]

Bases: TlObject, SupergroupMembersFilter

Returns the owner and administrators

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SupergroupMembersFilterAdministrators]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SupergroupMembersFilter']

classmethod getType()[source]
Return type:

Literal['supergroupMembersFilterAdministrators']

to_dict()[source]
Return type:

dict

class pytdbot.types.SupergroupMembersFilterBanned(query='')[source]

Bases: TlObject, SupergroupMembersFilter

Returns users banned from the supergroup or channel; can be used only by administrators

Parameters:

query (str) – Query to search for

__init__(query='')[source]
Parameters:

query (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SupergroupMembersFilterBanned]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SupergroupMembersFilter']

classmethod getType()[source]
Return type:

Literal['supergroupMembersFilterBanned']

to_dict()[source]
Return type:

dict

query: Optional[str]

Query to search for

class pytdbot.types.SupergroupMembersFilterBots[source]

Bases: TlObject, SupergroupMembersFilter

Returns bot members of the supergroup or channel

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SupergroupMembersFilterBots]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SupergroupMembersFilter']

classmethod getType()[source]
Return type:

Literal['supergroupMembersFilterBots']

to_dict()[source]
Return type:

dict

class pytdbot.types.SupergroupMembersFilterContacts(query='')[source]

Bases: TlObject, SupergroupMembersFilter

Returns contacts of the user, which are members of the supergroup or channel

Parameters:

query (str) – Query to search for

__init__(query='')[source]
Parameters:

query (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SupergroupMembersFilterContacts]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SupergroupMembersFilter']

classmethod getType()[source]
Return type:

Literal['supergroupMembersFilterContacts']

to_dict()[source]
Return type:

dict

query: Optional[str]

Query to search for

class pytdbot.types.SupergroupMembersFilterMention(query='', message_thread_id=0)[source]

Bases: TlObject, SupergroupMembersFilter

Returns users which can be mentioned in the supergroup

Parameters:
  • query (str) – Query to search for

  • message_thread_id (int) – If non-zero, the identifier of the current message thread

__init__(query='', message_thread_id=0)[source]
Parameters:
  • query (str)

  • message_thread_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SupergroupMembersFilterMention]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SupergroupMembersFilter']

classmethod getType()[source]
Return type:

Literal['supergroupMembersFilterMention']

to_dict()[source]
Return type:

dict

message_thread_id: int

If non-zero, the identifier of the current message thread

query: Optional[str]

Query to search for

class pytdbot.types.SupergroupMembersFilterRecent[source]

Bases: TlObject, SupergroupMembersFilter

Returns recently active users in reverse chronological order

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SupergroupMembersFilterRecent]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SupergroupMembersFilter']

classmethod getType()[source]
Return type:

Literal['supergroupMembersFilterRecent']

to_dict()[source]
Return type:

dict

class pytdbot.types.SupergroupMembersFilterRestricted(query='')[source]

Bases: TlObject, SupergroupMembersFilter

Returns restricted supergroup members; can be used only by administrators

Parameters:

query (str) – Query to search for

__init__(query='')[source]
Parameters:

query (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SupergroupMembersFilterRestricted]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SupergroupMembersFilter']

classmethod getType()[source]
Return type:

Literal['supergroupMembersFilterRestricted']

to_dict()[source]
Return type:

dict

query: Optional[str]

Query to search for

class pytdbot.types.SupergroupMembersFilterSearch(query='')[source]

Bases: TlObject, SupergroupMembersFilter

Used to search for supergroup or channel members via a (string) query

Parameters:

query (str) – Query to search for

__init__(query='')[source]
Parameters:

query (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[SupergroupMembersFilterSearch]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['SupergroupMembersFilter']

classmethod getType()[source]
Return type:

Literal['supergroupMembersFilterSearch']

to_dict()[source]
Return type:

dict

query: Optional[str]

Query to search for

class pytdbot.types.TMeUrl(url='', type=None)[source]

Bases: TlObject

Represents a URL linking to an internal Telegram entity

Parameters:
  • url (str) – URL

  • type ("types.TMeUrlType") – Type of the URL

__init__(url='', type=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TMeUrl]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TMeUrl']

classmethod getType()[source]
Return type:

Literal['tMeUrl']

to_dict()[source]
Return type:

dict

type: Union[TMeUrlTypeUser, TMeUrlTypeSupergroup, TMeUrlTypeChatInvite, TMeUrlTypeStickerSet, None]

Type of the URL

url: Optional[str]

URL

class pytdbot.types.TMeUrlType[source]

Bases: object

Describes the type of URL linking to an internal Telegram entity

class pytdbot.types.TMeUrlTypeChatInvite(info=None)[source]

Bases: TlObject, TMeUrlType

A chat invite link

Parameters:

info ("types.ChatInviteLinkInfo") – Information about the chat invite link

__init__(info=None)[source]
Parameters:

info (ChatInviteLinkInfo | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TMeUrlTypeChatInvite]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TMeUrlType']

classmethod getType()[source]
Return type:

Literal['tMeUrlTypeChatInvite']

to_dict()[source]
Return type:

dict

info: Optional[ChatInviteLinkInfo]

Information about the chat invite link

class pytdbot.types.TMeUrlTypeStickerSet(sticker_set_id=0)[source]

Bases: TlObject, TMeUrlType

A URL linking to a sticker set

Parameters:

sticker_set_id (int) – Identifier of the sticker set

__init__(sticker_set_id=0)[source]
Parameters:

sticker_set_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TMeUrlTypeStickerSet]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TMeUrlType']

classmethod getType()[source]
Return type:

Literal['tMeUrlTypeStickerSet']

to_dict()[source]
Return type:

dict

sticker_set_id: int

Identifier of the sticker set

class pytdbot.types.TMeUrlTypeSupergroup(supergroup_id=0)[source]

Bases: TlObject, TMeUrlType

A URL linking to a public supergroup or channel

Parameters:

supergroup_id (int) – Identifier of the supergroup or channel

__init__(supergroup_id=0)[source]
Parameters:

supergroup_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TMeUrlTypeSupergroup]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TMeUrlType']

classmethod getType()[source]
Return type:

Literal['tMeUrlTypeSupergroup']

to_dict()[source]
Return type:

dict

supergroup_id: int

Identifier of the supergroup or channel

class pytdbot.types.TMeUrlTypeUser(user_id=0)[source]

Bases: TlObject, TMeUrlType

A URL linking to a user

Parameters:

user_id (int) – Identifier of the user

__init__(user_id=0)[source]
Parameters:

user_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TMeUrlTypeUser]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TMeUrlType']

classmethod getType()[source]
Return type:

Literal['tMeUrlTypeUser']

to_dict()[source]
Return type:

dict

user_id: int

Identifier of the user

class pytdbot.types.TMeUrls(urls=None)[source]

Bases: TlObject

Contains a list of t.me URLs

Parameters:

urls (List["types.TMeUrl"]) – List of URLs

__init__(urls=None)[source]
Parameters:

urls (List[TMeUrl] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TMeUrls]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TMeUrls']

classmethod getType()[source]
Return type:

Literal['tMeUrls']

to_dict()[source]
Return type:

dict

urls: List[TMeUrl]

List of URLs

class pytdbot.types.TargetChat[source]

Bases: object

Describes the target chat to be opened

class pytdbot.types.TargetChatChosen(types=None)[source]

Bases: TlObject, TargetChat

The chat needs to be chosen by the user among chats of the specified types

Parameters:

types ("types.TargetChatTypes") – Allowed types for the chat

__init__(types=None)[source]
Parameters:

types (TargetChatTypes | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TargetChatChosen]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TargetChat']

classmethod getType()[source]
Return type:

Literal['targetChatChosen']

to_dict()[source]
Return type:

dict

types: Optional[TargetChatTypes]

Allowed types for the chat

class pytdbot.types.TargetChatCurrent[source]

Bases: TlObject, TargetChat

The currently opened chat and forum topic must be kept

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TargetChatCurrent]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TargetChat']

classmethod getType()[source]
Return type:

Literal['targetChatCurrent']

to_dict()[source]
Return type:

dict

class pytdbot.types.TargetChatInternalLink(link=None)[source]

Bases: TlObject, TargetChat

The chat needs to be open with the provided internal link

Parameters:

link ("types.InternalLinkType") – An internal link pointing to the chat

__init__(link=None)[source]
Parameters:

link (InternalLinkType | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TargetChatInternalLink]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TargetChat']

classmethod getType()[source]
Return type:

Literal['targetChatInternalLink']

to_dict()[source]
Return type:

dict

link: Union[InternalLinkTypeActiveSessions, InternalLinkTypeAttachmentMenuBot, InternalLinkTypeAuthenticationCode, InternalLinkTypeBackground, InternalLinkTypeBotAddToChannel, InternalLinkTypeBotStart, InternalLinkTypeBotStartInGroup, InternalLinkTypeBusinessChat, InternalLinkTypeBuyStars, InternalLinkTypeChangePhoneNumber, InternalLinkTypeChatAffiliateProgram, InternalLinkTypeChatBoost, InternalLinkTypeChatFolderInvite, InternalLinkTypeChatFolderSettings, InternalLinkTypeChatInvite, InternalLinkTypeDefaultMessageAutoDeleteTimerSettings, InternalLinkTypeDirectMessagesChat, InternalLinkTypeEditProfileSettings, InternalLinkTypeGame, InternalLinkTypeGiftCollection, InternalLinkTypeGroupCall, InternalLinkTypeInstantView, InternalLinkTypeInvoice, InternalLinkTypeLanguagePack, InternalLinkTypeLanguageSettings, InternalLinkTypeMainWebApp, InternalLinkTypeMessage, InternalLinkTypeMessageDraft, InternalLinkTypeMyStars, InternalLinkTypeMyToncoins, InternalLinkTypePassportDataRequest, InternalLinkTypePhoneNumberConfirmation, InternalLinkTypePremiumFeatures, InternalLinkTypePremiumGift, InternalLinkTypePremiumGiftCode, InternalLinkTypePrivacyAndSecuritySettings, InternalLinkTypeProxy, InternalLinkTypePublicChat, InternalLinkTypeQrCodeAuthentication, InternalLinkTypeRestorePurchases, InternalLinkTypeSettings, InternalLinkTypeStickerSet, InternalLinkTypeStory, InternalLinkTypeStoryAlbum, InternalLinkTypeTheme, InternalLinkTypeThemeSettings, InternalLinkTypeUnknownDeepLink, InternalLinkTypeUnsupportedProxy, InternalLinkTypeUpgradedGift, InternalLinkTypeUserPhoneNumber, InternalLinkTypeUserToken, InternalLinkTypeVideoChat, InternalLinkTypeWebApp, None]

An internal link pointing to the chat

class pytdbot.types.TargetChatTypes(allow_user_chats=False, allow_bot_chats=False, allow_group_chats=False, allow_channel_chats=False)[source]

Bases: TlObject

Describes allowed types for the target chat

Parameters:
  • allow_user_chats (bool) – True, if private chats with ordinary users are allowed

  • allow_bot_chats (bool) – True, if private chats with other bots are allowed

  • allow_group_chats (bool) – True, if basic group and supergroup chats are allowed

  • allow_channel_chats (bool) – True, if channel chats are allowed

__init__(allow_user_chats=False, allow_bot_chats=False, allow_group_chats=False, allow_channel_chats=False)[source]
Parameters:
  • allow_user_chats (bool)

  • allow_bot_chats (bool)

  • allow_group_chats (bool)

  • allow_channel_chats (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TargetChatTypes]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TargetChatTypes']

classmethod getType()[source]
Return type:

Literal['targetChatTypes']

to_dict()[source]
Return type:

dict

allow_bot_chats: bool

True, if private chats with other bots are allowed

allow_channel_chats: bool

True, if channel chats are allowed

allow_group_chats: bool

True, if basic group and supergroup chats are allowed

allow_user_chats: bool

True, if private chats with ordinary users are allowed

class pytdbot.types.TelegramPaymentPurpose[source]

Bases: object

Describes a purpose of a payment toward Telegram

class pytdbot.types.TelegramPaymentPurposeGiftedStars(user_id=0, currency='', amount=0, star_count=0)[source]

Bases: TlObject, TelegramPaymentPurpose

The user buying Telegram Stars for other users

Parameters:
  • user_id (int) – Identifier of the user to which Telegram Stars are gifted

  • currency (str) – ISO 4217 currency code of the payment currency

  • amount (int) – Paid amount, in the smallest units of the currency

  • star_count (int) – Number of bought Telegram Stars

__init__(user_id=0, currency='', amount=0, star_count=0)[source]
Parameters:
  • user_id (int)

  • currency (str)

  • amount (int)

  • star_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TelegramPaymentPurposeGiftedStars]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TelegramPaymentPurpose']

classmethod getType()[source]
Return type:

Literal['telegramPaymentPurposeGiftedStars']

to_dict()[source]
Return type:

dict

amount: int

Paid amount, in the smallest units of the currency

currency: Optional[str]

ISO 4217 currency code of the payment currency

star_count: int

Number of bought Telegram Stars

user_id: int

Identifier of the user to which Telegram Stars are gifted

class pytdbot.types.TelegramPaymentPurposeJoinChat(invite_link='')[source]

Bases: TlObject, TelegramPaymentPurpose

The user joins a chat and subscribes to regular payments in Telegram Stars

Parameters:

invite_link (str) – Invite link to use

__init__(invite_link='')[source]
Parameters:

invite_link (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TelegramPaymentPurposeJoinChat]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TelegramPaymentPurpose']

classmethod getType()[source]
Return type:

Literal['telegramPaymentPurposeJoinChat']

to_dict()[source]
Return type:

dict

invite_link: Optional[str]

Invite link to use

class pytdbot.types.TelegramPaymentPurposePremiumGift(currency='', amount=0, user_id=0, month_count=0, text=None)[source]

Bases: TlObject, TelegramPaymentPurpose

The user gifting Telegram Premium to another user

Parameters:
  • currency (str) – ISO 4217 currency code of the payment currency, or "XTR" for payments in Telegram Stars

  • amount (int) – Paid amount, in the smallest units of the currency

  • user_id (int) – Identifier of the user which will receive Telegram Premium

  • month_count (int) – Number of months the Telegram Premium subscription will be active for the user

  • text ("types.FormattedText") – Text to show to the user receiving Telegram Premium; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed

__init__(currency='', amount=0, user_id=0, month_count=0, text=None)[source]
Parameters:
  • currency (str)

  • amount (int)

  • user_id (int)

  • month_count (int)

  • text (FormattedText | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TelegramPaymentPurposePremiumGift]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TelegramPaymentPurpose']

classmethod getType()[source]
Return type:

Literal['telegramPaymentPurposePremiumGift']

to_dict()[source]
Return type:

dict

amount: int

Paid amount, in the smallest units of the currency

currency: Optional[str]

ISO 4217 currency code of the payment currency, or "XTR" for payments in Telegram Stars

month_count: int

Number of months the Telegram Premium subscription will be active for the user

text: Optional[FormattedText]

Text to show to the user receiving Telegram Premium; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed

user_id: int

Identifier of the user which will receive Telegram Premium

class pytdbot.types.TelegramPaymentPurposePremiumGiftCodes(boosted_chat_id=0, currency='', amount=0, user_ids=None, month_count=0, text=None)[source]

Bases: TlObject, TelegramPaymentPurpose

The user boosting a chat by creating Telegram Premium gift codes for other users

Parameters:
  • boosted_chat_id (int) – Identifier of the supergroup or channel chat, which will be automatically boosted by the users for duration of the Premium subscription and which is administered by the user

  • currency (str) – ISO 4217 currency code of the payment currency

  • amount (int) – Paid amount, in the smallest units of the currency

  • user_ids (List[int]) – Identifiers of the users which can activate the gift codes

  • month_count (int) – Number of months the Telegram Premium subscription will be active for the users

  • text ("types.FormattedText") – Text to show along with the gift codes; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed

__init__(boosted_chat_id=0, currency='', amount=0, user_ids=None, month_count=0, text=None)[source]
Parameters:
  • boosted_chat_id (int)

  • currency (str)

  • amount (int)

  • user_ids (List[int] | None)

  • month_count (int)

  • text (FormattedText | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TelegramPaymentPurposePremiumGiftCodes]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TelegramPaymentPurpose']

classmethod getType()[source]
Return type:

Literal['telegramPaymentPurposePremiumGiftCodes']

to_dict()[source]
Return type:

dict

amount: int

Paid amount, in the smallest units of the currency

boosted_chat_id: int

Identifier of the supergroup or channel chat, which will be automatically boosted by the users for duration of the Premium subscription and which is administered by the user

currency: Optional[str]

ISO 4217 currency code of the payment currency

month_count: int

Number of months the Telegram Premium subscription will be active for the users

text: Optional[FormattedText]

Text to show along with the gift codes; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed

user_ids: List[int]

Identifiers of the users which can activate the gift codes

class pytdbot.types.TelegramPaymentPurposePremiumGiveaway(parameters=None, currency='', amount=0, winner_count=0, month_count=0)[source]

Bases: TlObject, TelegramPaymentPurpose

The user creating a Telegram Premium giveaway

Parameters:
  • parameters ("types.GiveawayParameters") – Giveaway parameters

  • currency (str) – ISO 4217 currency code of the payment currency

  • amount (int) – Paid amount, in the smallest units of the currency

  • winner_count (int) – Number of users which will be able to activate the gift codes

  • month_count (int) – Number of months the Telegram Premium subscription will be active for the users

__init__(parameters=None, currency='', amount=0, winner_count=0, month_count=0)[source]
Parameters:
  • parameters (GiveawayParameters | None)

  • currency (str)

  • amount (int)

  • winner_count (int)

  • month_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TelegramPaymentPurposePremiumGiveaway]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TelegramPaymentPurpose']

classmethod getType()[source]
Return type:

Literal['telegramPaymentPurposePremiumGiveaway']

to_dict()[source]
Return type:

dict

amount: int

Paid amount, in the smallest units of the currency

currency: Optional[str]

ISO 4217 currency code of the payment currency

month_count: int

Number of months the Telegram Premium subscription will be active for the users

parameters: Optional[GiveawayParameters]

Giveaway parameters

winner_count: int

Number of users which will be able to activate the gift codes

class pytdbot.types.TelegramPaymentPurposeStarGiveaway(parameters=None, currency='', amount=0, winner_count=0, star_count=0)[source]

Bases: TlObject, TelegramPaymentPurpose

The user creating a Telegram Star giveaway

Parameters:
  • parameters ("types.GiveawayParameters") – Giveaway parameters

  • currency (str) – ISO 4217 currency code of the payment currency

  • amount (int) – Paid amount, in the smallest units of the currency

  • winner_count (int) – The number of users to receive Telegram Stars

  • star_count (int) – The number of Telegram Stars to be distributed through the giveaway

__init__(parameters=None, currency='', amount=0, winner_count=0, star_count=0)[source]
Parameters:
  • parameters (GiveawayParameters | None)

  • currency (str)

  • amount (int)

  • winner_count (int)

  • star_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TelegramPaymentPurposeStarGiveaway]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TelegramPaymentPurpose']

classmethod getType()[source]
Return type:

Literal['telegramPaymentPurposeStarGiveaway']

to_dict()[source]
Return type:

dict

amount: int

Paid amount, in the smallest units of the currency

currency: Optional[str]

ISO 4217 currency code of the payment currency

parameters: Optional[GiveawayParameters]

Giveaway parameters

star_count: int

The number of Telegram Stars to be distributed through the giveaway

winner_count: int

The number of users to receive Telegram Stars

class pytdbot.types.TelegramPaymentPurposeStars(currency='', amount=0, star_count=0, chat_id=0)[source]

Bases: TlObject, TelegramPaymentPurpose

The user buying Telegram Stars

Parameters:
  • currency (str) – ISO 4217 currency code of the payment currency

  • amount (int) – Paid amount, in the smallest units of the currency

  • star_count (int) – Number of bought Telegram Stars

  • chat_id (int) – Identifier of the chat that is supposed to receive the Telegram Stars; pass 0 if none

__init__(currency='', amount=0, star_count=0, chat_id=0)[source]
Parameters:
  • currency (str)

  • amount (int)

  • star_count (int)

  • chat_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TelegramPaymentPurposeStars]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TelegramPaymentPurpose']

classmethod getType()[source]
Return type:

Literal['telegramPaymentPurposeStars']

to_dict()[source]
Return type:

dict

amount: int

Paid amount, in the smallest units of the currency

chat_id: int

Identifier of the chat that is supposed to receive the Telegram Stars; pass 0 if none

currency: Optional[str]

ISO 4217 currency code of the payment currency

star_count: int

Number of bought Telegram Stars

class pytdbot.types.TemporaryPasswordState(has_password=False, valid_for=0)[source]

Bases: TlObject

Returns information about the availability of a temporary password, which can be used for payments

Parameters:
  • has_password (bool) – True, if a temporary password is available

  • valid_for (int) – Time left before the temporary password expires, in seconds

__init__(has_password=False, valid_for=0)[source]
Parameters:
  • has_password (bool)

  • valid_for (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TemporaryPasswordState]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TemporaryPasswordState']

classmethod getType()[source]
Return type:

Literal['temporaryPasswordState']

to_dict()[source]
Return type:

dict

has_password: bool

True, if a temporary password is available

valid_for: int

Time left before the temporary password expires, in seconds

class pytdbot.types.TermsOfService(text=None, min_user_age=0, show_popup=False)[source]

Bases: TlObject

Contains Telegram terms of service

Parameters:
  • text ("types.FormattedText") – Text of the terms of service

  • min_user_age (int) – The minimum age of a user to be able to accept the terms; 0 if age isn’t restricted

  • show_popup (bool) – True, if a blocking popup with terms of service must be shown to the user

__init__(text=None, min_user_age=0, show_popup=False)[source]
Parameters:
  • text (FormattedText | None)

  • min_user_age (int)

  • show_popup (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TermsOfService]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TermsOfService']

classmethod getType()[source]
Return type:

Literal['termsOfService']

to_dict()[source]
Return type:

dict

min_user_age: int

The minimum age of a user to be able to accept the terms; 0 if age isn’t restricted

show_popup: bool

True, if a blocking popup with terms of service must be shown to the user

text: Optional[FormattedText]

Text of the terms of service

class pytdbot.types.TestBytes(value=b'')[source]

Bases: TlObject

A simple object containing a sequence of bytes; for testing only

Parameters:

value (bytes) – Bytes

__init__(value=b'')[source]
Parameters:

value (bytes)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TestBytes]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TestBytes']

classmethod getType()[source]
Return type:

Literal['testBytes']

to_dict()[source]
Return type:

dict

value: Optional[bytes]

Bytes

class pytdbot.types.TestInt(value=0)[source]

Bases: TlObject

A simple object containing a number; for testing only

Parameters:

value (int) – Number

__init__(value=0)[source]
Parameters:

value (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TestInt]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TestInt']

classmethod getType()[source]
Return type:

Literal['testInt']

to_dict()[source]
Return type:

dict

value: int

Number

class pytdbot.types.TestString(value='')[source]

Bases: TlObject

A simple object containing a string; for testing only

Parameters:

value (str) – String

__init__(value='')[source]
Parameters:

value (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TestString]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TestString']

classmethod getType()[source]
Return type:

Literal['testString']

to_dict()[source]
Return type:

dict

value: Optional[str]

String

class pytdbot.types.TestVectorInt(value=None)[source]

Bases: TlObject

A simple object containing a vector of numbers; for testing only

Parameters:

value (List[int]) – Vector of numbers

__init__(value=None)[source]
Parameters:

value (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TestVectorInt]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TestVectorInt']

classmethod getType()[source]
Return type:

Literal['testVectorInt']

to_dict()[source]
Return type:

dict

value: List[int]

Vector of numbers

class pytdbot.types.TestVectorIntObject(value=None)[source]

Bases: TlObject

A simple object containing a vector of objects that hold a number; for testing only

Parameters:

value (List["types.TestInt"]) – Vector of objects

__init__(value=None)[source]
Parameters:

value (List[TestInt] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TestVectorIntObject]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TestVectorIntObject']

classmethod getType()[source]
Return type:

Literal['testVectorIntObject']

to_dict()[source]
Return type:

dict

value: List[TestInt]

Vector of objects

class pytdbot.types.TestVectorString(value=None)[source]

Bases: TlObject

A simple object containing a vector of strings; for testing only

Parameters:

value (List[str]) – Vector of strings

__init__(value=None)[source]
Parameters:

value (List[str] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TestVectorString]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TestVectorString']

classmethod getType()[source]
Return type:

Literal['testVectorString']

to_dict()[source]
Return type:

dict

value: List[str]

Vector of strings

class pytdbot.types.TestVectorStringObject(value=None)[source]

Bases: TlObject

A simple object containing a vector of objects that hold a string; for testing only

Parameters:

value (List["types.TestString"]) – Vector of objects

__init__(value=None)[source]
Parameters:

value (List[TestString] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TestVectorStringObject]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TestVectorStringObject']

classmethod getType()[source]
Return type:

Literal['testVectorStringObject']

to_dict()[source]
Return type:

dict

value: List[TestString]

Vector of objects

class pytdbot.types.Text(text='')[source]

Bases: TlObject

Contains some text

Parameters:

text (str) – Text

__init__(text='')[source]
Parameters:

text (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Text]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Text']

classmethod getType()[source]
Return type:

Literal['text']

to_dict()[source]
Return type:

dict

text: Optional[str]

Text

class pytdbot.types.TextEntities(entities=None)[source]

Bases: TlObject

Contains a list of text entities

Parameters:

entities (List["types.TextEntity"]) – List of text entities

__init__(entities=None)[source]
Parameters:

entities (List[TextEntity] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TextEntities]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TextEntities']

classmethod getType()[source]
Return type:

Literal['textEntities']

to_dict()[source]
Return type:

dict

entities: List[TextEntity]

List of text entities

class pytdbot.types.TextEntity(offset=0, length=0, type=None)[source]

Bases: TlObject

Represents a part of the text that needs to be formatted in some unusual way

Parameters:
  • offset (int) – Offset of the entity, in UTF-16 code units

  • length (int) – Length of the entity, in UTF-16 code units

  • type ("types.TextEntityType") – Type of the entity

__init__(offset=0, length=0, type=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TextEntity]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TextEntity']

classmethod getType()[source]
Return type:

Literal['textEntity']

to_dict()[source]
Return type:

dict

length: int

Length of the entity, in UTF-16 code units

offset: int

Offset of the entity, in UTF-16 code units

type: Union[TextEntityTypeMention, TextEntityTypeHashtag, TextEntityTypeCashtag, TextEntityTypeBotCommand, TextEntityTypeUrl, TextEntityTypeEmailAddress, TextEntityTypePhoneNumber, TextEntityTypeBankCardNumber, TextEntityTypeBold, TextEntityTypeItalic, TextEntityTypeUnderline, TextEntityTypeStrikethrough, TextEntityTypeSpoiler, TextEntityTypeCode, TextEntityTypePre, TextEntityTypePreCode, TextEntityTypeBlockQuote, TextEntityTypeExpandableBlockQuote, TextEntityTypeTextUrl, TextEntityTypeMentionName, TextEntityTypeCustomEmoji, TextEntityTypeMediaTimestamp, None]

Type of the entity

class pytdbot.types.TextEntityType[source]

Bases: object

Represents a part of the text which must be formatted differently

class pytdbot.types.TextEntityTypeBankCardNumber[source]

Bases: TlObject, TextEntityType

A bank card number. The getBankCardInfo method can be used to get information about the bank card

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TextEntityTypeBankCardNumber]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TextEntityType']

classmethod getType()[source]
Return type:

Literal['textEntityTypeBankCardNumber']

to_dict()[source]
Return type:

dict

class pytdbot.types.TextEntityTypeBlockQuote[source]

Bases: TlObject, TextEntityType

Text that must be formatted as if inside a blockquote HTML tag; not supported in secret chats

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TextEntityTypeBlockQuote]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TextEntityType']

classmethod getType()[source]
Return type:

Literal['textEntityTypeBlockQuote']

to_dict()[source]
Return type:

dict

class pytdbot.types.TextEntityTypeBold[source]

Bases: TlObject, TextEntityType

A bold text

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TextEntityTypeBold]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TextEntityType']

classmethod getType()[source]
Return type:

Literal['textEntityTypeBold']

to_dict()[source]
Return type:

dict

class pytdbot.types.TextEntityTypeBotCommand[source]

Bases: TlObject, TextEntityType

A bot command, beginning with "/"

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TextEntityTypeBotCommand]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TextEntityType']

classmethod getType()[source]
Return type:

Literal['textEntityTypeBotCommand']

to_dict()[source]
Return type:

dict

class pytdbot.types.TextEntityTypeCashtag[source]

Bases: TlObject, TextEntityType

A cashtag text, beginning with "$", consisting of capital English letters (e.g., "$USD"), and optionally containing a chat username at the end

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TextEntityTypeCashtag]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TextEntityType']

classmethod getType()[source]
Return type:

Literal['textEntityTypeCashtag']

to_dict()[source]
Return type:

dict

class pytdbot.types.TextEntityTypeCode[source]

Bases: TlObject, TextEntityType

Text that must be formatted as if inside a code HTML tag

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TextEntityTypeCode]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TextEntityType']

classmethod getType()[source]
Return type:

Literal['textEntityTypeCode']

to_dict()[source]
Return type:

dict

class pytdbot.types.TextEntityTypeCustomEmoji(custom_emoji_id=0)[source]

Bases: TlObject, TextEntityType

A custom emoji. The text behind a custom emoji must be an emoji. Only premium users can use premium custom emoji

Parameters:

custom_emoji_id (int) – Unique identifier of the custom emoji

__init__(custom_emoji_id=0)[source]
Parameters:

custom_emoji_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TextEntityTypeCustomEmoji]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TextEntityType']

classmethod getType()[source]
Return type:

Literal['textEntityTypeCustomEmoji']

to_dict()[source]
Return type:

dict

custom_emoji_id: int

Unique identifier of the custom emoji

class pytdbot.types.TextEntityTypeEmailAddress[source]

Bases: TlObject, TextEntityType

An email address

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TextEntityTypeEmailAddress]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TextEntityType']

classmethod getType()[source]
Return type:

Literal['textEntityTypeEmailAddress']

to_dict()[source]
Return type:

dict

class pytdbot.types.TextEntityTypeExpandableBlockQuote[source]

Bases: TlObject, TextEntityType

Text that must be formatted as if inside a blockquote HTML tag and collapsed by default to 3 lines with the ability to show full text; not supported in secret chats

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TextEntityTypeExpandableBlockQuote]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TextEntityType']

classmethod getType()[source]
Return type:

Literal['textEntityTypeExpandableBlockQuote']

to_dict()[source]
Return type:

dict

class pytdbot.types.TextEntityTypeHashtag[source]

Bases: TlObject, TextEntityType

A hashtag text, beginning with "#" and optionally containing a chat username at the end

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TextEntityTypeHashtag]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TextEntityType']

classmethod getType()[source]
Return type:

Literal['textEntityTypeHashtag']

to_dict()[source]
Return type:

dict

class pytdbot.types.TextEntityTypeItalic[source]

Bases: TlObject, TextEntityType

An italic text

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TextEntityTypeItalic]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TextEntityType']

classmethod getType()[source]
Return type:

Literal['textEntityTypeItalic']

to_dict()[source]
Return type:

dict

class pytdbot.types.TextEntityTypeMediaTimestamp(media_timestamp=0)[source]

Bases: TlObject, TextEntityType

A media timestamp

Parameters:

media_timestamp (int) – Timestamp from which a video/audio/video note/voice note/story playing must start, in seconds. The media can be in the content or the link preview of the current message, or in the same places in the replied message

__init__(media_timestamp=0)[source]
Parameters:

media_timestamp (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TextEntityTypeMediaTimestamp]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TextEntityType']

classmethod getType()[source]
Return type:

Literal['textEntityTypeMediaTimestamp']

to_dict()[source]
Return type:

dict

media_timestamp: int

Timestamp from which a video/audio/video note/voice note/story playing must start, in seconds. The media can be in the content or the link preview of the current message, or in the same places in the replied message

class pytdbot.types.TextEntityTypeMention[source]

Bases: TlObject, TextEntityType

A mention of a user, a supergroup, or a channel by their username

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TextEntityTypeMention]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TextEntityType']

classmethod getType()[source]
Return type:

Literal['textEntityTypeMention']

to_dict()[source]
Return type:

dict

class pytdbot.types.TextEntityTypeMentionName(user_id=0)[source]

Bases: TlObject, TextEntityType

A text shows instead of a raw mention of the user (e.g., when the user has no username)

Parameters:

user_id (int) – Identifier of the mentioned user

__init__(user_id=0)[source]
Parameters:

user_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TextEntityTypeMentionName]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TextEntityType']

classmethod getType()[source]
Return type:

Literal['textEntityTypeMentionName']

to_dict()[source]
Return type:

dict

user_id: int

Identifier of the mentioned user

class pytdbot.types.TextEntityTypePhoneNumber[source]

Bases: TlObject, TextEntityType

A phone number

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TextEntityTypePhoneNumber]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TextEntityType']

classmethod getType()[source]
Return type:

Literal['textEntityTypePhoneNumber']

to_dict()[source]
Return type:

dict

class pytdbot.types.TextEntityTypePre[source]

Bases: TlObject, TextEntityType

Text that must be formatted as if inside a pre HTML tag

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TextEntityTypePre]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TextEntityType']

classmethod getType()[source]
Return type:

Literal['textEntityTypePre']

to_dict()[source]
Return type:

dict

class pytdbot.types.TextEntityTypePreCode(language='')[source]

Bases: TlObject, TextEntityType

Text that must be formatted as if inside pre, and code HTML tags

Parameters:

language (str) – Programming language of the code; as defined by the sender

__init__(language='')[source]
Parameters:

language (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TextEntityTypePreCode]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TextEntityType']

classmethod getType()[source]
Return type:

Literal['textEntityTypePreCode']

to_dict()[source]
Return type:

dict

language: Optional[str]

Programming language of the code; as defined by the sender

class pytdbot.types.TextEntityTypeSpoiler[source]

Bases: TlObject, TextEntityType

A spoiler text

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TextEntityTypeSpoiler]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TextEntityType']

classmethod getType()[source]
Return type:

Literal['textEntityTypeSpoiler']

to_dict()[source]
Return type:

dict

class pytdbot.types.TextEntityTypeStrikethrough[source]

Bases: TlObject, TextEntityType

A strikethrough text

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TextEntityTypeStrikethrough]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TextEntityType']

classmethod getType()[source]
Return type:

Literal['textEntityTypeStrikethrough']

to_dict()[source]
Return type:

dict

class pytdbot.types.TextEntityTypeTextUrl(url='')[source]

Bases: TlObject, TextEntityType

A text description shown instead of a raw URL

Parameters:

url (str) – HTTP or tg:// URL to be opened when the link is clicked

__init__(url='')[source]
Parameters:

url (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TextEntityTypeTextUrl]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TextEntityType']

classmethod getType()[source]
Return type:

Literal['textEntityTypeTextUrl']

to_dict()[source]
Return type:

dict

url: Optional[str]

// URL to be opened when the link is clicked

Type:

HTTP or tg

class pytdbot.types.TextEntityTypeUnderline[source]

Bases: TlObject, TextEntityType

An underlined text

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TextEntityTypeUnderline]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TextEntityType']

classmethod getType()[source]
Return type:

Literal['textEntityTypeUnderline']

to_dict()[source]
Return type:

dict

class pytdbot.types.TextEntityTypeUrl[source]

Bases: TlObject, TextEntityType

An HTTP URL

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TextEntityTypeUrl]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TextEntityType']

classmethod getType()[source]
Return type:

Literal['textEntityTypeUrl']

to_dict()[source]
Return type:

dict

class pytdbot.types.TextParseMode[source]

Bases: object

Describes the way the text needs to be parsed for text entities

class pytdbot.types.TextParseModeHTML[source]

Bases: TlObject, TextParseMode

The text uses HTML-style formatting. The same as Telegram Bot API "HTML" parse mode

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TextParseModeHTML]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TextParseMode']

classmethod getType()[source]
Return type:

Literal['textParseModeHTML']

to_dict()[source]
Return type:

dict

class pytdbot.types.TextParseModeMarkdown(version=0)[source]

Bases: TlObject, TextParseMode

The text uses Markdown-style formatting

Parameters:

version (int) – Version of the parser: 0 or 1 - Telegram Bot API "Markdown" parse mode, 2 - Telegram Bot API "MarkdownV2" parse mode

__init__(version=0)[source]
Parameters:

version (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TextParseModeMarkdown]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TextParseMode']

classmethod getType()[source]
Return type:

Literal['textParseModeMarkdown']

to_dict()[source]
Return type:

dict

version: int

0 or 1 - Telegram Bot API "Markdown" parse mode, 2 - Telegram Bot API "MarkdownV2" parse mode

Type:

Version of the parser

class pytdbot.types.TextQuote(text=None, position=0, is_manual=False)[source]

Bases: TlObject

Describes manually or automatically chosen quote from another message

Parameters:
  • text ("types.FormattedText") – Text of the quote. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities can be present in the text

  • position (int) – Approximate quote position in the original message in UTF-16 code units as specified by the message sender

  • is_manual (bool) – True, if the quote was manually chosen by the message sender

__init__(text=None, position=0, is_manual=False)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TextQuote]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TextQuote']

classmethod getType()[source]
Return type:

Literal['textQuote']

to_dict()[source]
Return type:

dict

is_manual: bool

True, if the quote was manually chosen by the message sender

position: int

Approximate quote position in the original message in UTF-16 code units as specified by the message sender

text: Optional[FormattedText]

Text of the quote. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities can be present in the text

class pytdbot.types.ThemeParameters(background_color=0, secondary_background_color=0, header_background_color=0, bottom_bar_background_color=0, section_background_color=0, section_separator_color=0, text_color=0, accent_text_color=0, section_header_text_color=0, subtitle_text_color=0, destructive_text_color=0, hint_color=0, link_color=0, button_color=0, button_text_color=0)[source]

Bases: TlObject

Contains parameters of the application theme

Parameters:
  • background_color (int) – A color of the background in the RGB format

  • secondary_background_color (int) – A secondary color for the background in the RGB format

  • header_background_color (int) – A color of the header background in the RGB format

  • bottom_bar_background_color (int) – A color of the bottom bar background in the RGB format

  • section_background_color (int) – A color of the section background in the RGB format

  • section_separator_color (int) – A color of the section separator in the RGB format

  • text_color (int) – A color of text in the RGB format

  • accent_text_color (int) – An accent color of the text in the RGB format

  • section_header_text_color (int) – A color of text on the section headers in the RGB format

  • subtitle_text_color (int) – A color of the subtitle text in the RGB format

  • destructive_text_color (int) – A color of the text for destructive actions in the RGB format

  • hint_color (int) – A color of hints in the RGB format

  • link_color (int) – A color of links in the RGB format

  • button_color (int) – A color of the buttons in the RGB format

  • button_text_color (int) – A color of text on the buttons in the RGB format

__init__(background_color=0, secondary_background_color=0, header_background_color=0, bottom_bar_background_color=0, section_background_color=0, section_separator_color=0, text_color=0, accent_text_color=0, section_header_text_color=0, subtitle_text_color=0, destructive_text_color=0, hint_color=0, link_color=0, button_color=0, button_text_color=0)[source]
Parameters:
  • background_color (int)

  • secondary_background_color (int)

  • header_background_color (int)

  • bottom_bar_background_color (int)

  • section_background_color (int)

  • section_separator_color (int)

  • text_color (int)

  • accent_text_color (int)

  • section_header_text_color (int)

  • subtitle_text_color (int)

  • destructive_text_color (int)

  • hint_color (int)

  • link_color (int)

  • button_color (int)

  • button_text_color (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ThemeParameters]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ThemeParameters']

classmethod getType()[source]
Return type:

Literal['themeParameters']

to_dict()[source]
Return type:

dict

accent_text_color: int

An accent color of the text in the RGB format

background_color: int

A color of the background in the RGB format

bottom_bar_background_color: int

A color of the bottom bar background in the RGB format

button_color: int

A color of the buttons in the RGB format

button_text_color: int

A color of text on the buttons in the RGB format

destructive_text_color: int

A color of the text for destructive actions in the RGB format

header_background_color: int

A color of the header background in the RGB format

hint_color: int

A color of hints in the RGB format

link_color: int

A color of links in the RGB format

secondary_background_color: int

A secondary color for the background in the RGB format

section_background_color: int

A color of the section background in the RGB format

section_header_text_color: int

A color of text on the section headers in the RGB format

section_separator_color: int

A color of the section separator in the RGB format

subtitle_text_color: int

A color of the subtitle text in the RGB format

text_color: int

A color of text in the RGB format

class pytdbot.types.ThemeSettings(base_theme=None, accent_color=0, background=None, outgoing_message_fill=None, animate_outgoing_message_fill=False, outgoing_message_accent_color=0)[source]

Bases: TlObject

Describes theme settings

Parameters:
  • base_theme ("types.BuiltInTheme") – Base theme for this theme

  • accent_color (int) – Theme accent color in ARGB format

  • background ("types.Background") – The background to be used in chats; may be null

  • outgoing_message_fill ("types.BackgroundFill") – The fill to be used as a background for outgoing messages; may be null if the fill from the base theme must be used instead

  • animate_outgoing_message_fill (bool) – If true, the freeform gradient fill needs to be animated on every sent message

  • outgoing_message_accent_color (int) – Accent color of outgoing messages in ARGB format

__init__(base_theme=None, accent_color=0, background=None, outgoing_message_fill=None, animate_outgoing_message_fill=False, outgoing_message_accent_color=0)[source]
Parameters:
  • base_theme (BuiltInTheme | None)

  • accent_color (int)

  • background (Background | None)

  • outgoing_message_fill (BackgroundFill | None)

  • animate_outgoing_message_fill (bool)

  • outgoing_message_accent_color (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ThemeSettings]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ThemeSettings']

classmethod getType()[source]
Return type:

Literal['themeSettings']

to_dict()[source]
Return type:

dict

accent_color: int

Theme accent color in ARGB format

animate_outgoing_message_fill: bool

If true, the freeform gradient fill needs to be animated on every sent message

background: Optional[Background]

The background to be used in chats; may be null

base_theme: Union[BuiltInThemeClassic, BuiltInThemeDay, BuiltInThemeNight, BuiltInThemeTinted, BuiltInThemeArctic, None]

Base theme for this theme

outgoing_message_accent_color: int

Accent color of outgoing messages in ARGB format

outgoing_message_fill: Union[BackgroundFillSolid, BackgroundFillGradient, BackgroundFillFreeformGradient, None]

The fill to be used as a background for outgoing messages; may be null if the fill from the base theme must be used instead

class pytdbot.types.Thumbnail(format=None, width=0, height=0, file=None)[source]

Bases: TlObject

Represents a thumbnail

Parameters:
  • format ("types.ThumbnailFormat") – Thumbnail format

  • width (int) – Thumbnail width

  • height (int) – Thumbnail height

  • file ("types.File") – The thumbnail

__init__(format=None, width=0, height=0, file=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Thumbnail]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Thumbnail']

classmethod getType()[source]
Return type:

Literal['thumbnail']

to_dict()[source]
Return type:

dict

file: Optional[File]

The thumbnail

format: Union[ThumbnailFormatJpeg, ThumbnailFormatGif, ThumbnailFormatMpeg4, ThumbnailFormatPng, ThumbnailFormatTgs, ThumbnailFormatWebm, ThumbnailFormatWebp, None]

Thumbnail format

height: int

Thumbnail height

width: int

Thumbnail width

class pytdbot.types.ThumbnailFormat[source]

Bases: object

Describes format of a thumbnail

class pytdbot.types.ThumbnailFormatGif[source]

Bases: TlObject, ThumbnailFormat

The thumbnail is in static GIF format. It will be used only for some bot inline query results

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ThumbnailFormatGif]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ThumbnailFormat']

classmethod getType()[source]
Return type:

Literal['thumbnailFormatGif']

to_dict()[source]
Return type:

dict

class pytdbot.types.ThumbnailFormatJpeg[source]

Bases: TlObject, ThumbnailFormat

The thumbnail is in JPEG format

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ThumbnailFormatJpeg]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ThumbnailFormat']

classmethod getType()[source]
Return type:

Literal['thumbnailFormatJpeg']

to_dict()[source]
Return type:

dict

class pytdbot.types.ThumbnailFormatMpeg4[source]

Bases: TlObject, ThumbnailFormat

The thumbnail is in MPEG4 format. It will be used only for some animations and videos

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ThumbnailFormatMpeg4]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ThumbnailFormat']

classmethod getType()[source]
Return type:

Literal['thumbnailFormatMpeg4']

to_dict()[source]
Return type:

dict

class pytdbot.types.ThumbnailFormatPng[source]

Bases: TlObject, ThumbnailFormat

The thumbnail is in PNG format. It will be used only for background patterns

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ThumbnailFormatPng]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ThumbnailFormat']

classmethod getType()[source]
Return type:

Literal['thumbnailFormatPng']

to_dict()[source]
Return type:

dict

class pytdbot.types.ThumbnailFormatTgs[source]

Bases: TlObject, ThumbnailFormat

The thumbnail is in TGS format. It will be used only for sticker sets

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ThumbnailFormatTgs]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ThumbnailFormat']

classmethod getType()[source]
Return type:

Literal['thumbnailFormatTgs']

to_dict()[source]
Return type:

dict

class pytdbot.types.ThumbnailFormatWebm[source]

Bases: TlObject, ThumbnailFormat

The thumbnail is in WEBM format. It will be used only for sticker sets

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ThumbnailFormatWebm]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ThumbnailFormat']

classmethod getType()[source]
Return type:

Literal['thumbnailFormatWebm']

to_dict()[source]
Return type:

dict

class pytdbot.types.ThumbnailFormatWebp[source]

Bases: TlObject, ThumbnailFormat

The thumbnail is in WEBP format. It will be used only for some stickers and sticker sets

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ThumbnailFormatWebp]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ThumbnailFormat']

classmethod getType()[source]
Return type:

Literal['thumbnailFormatWebp']

to_dict()[source]
Return type:

dict

class pytdbot.types.TimeZone(id='', name='', utc_time_offset=0)[source]

Bases: TlObject

Describes a time zone

Parameters:
  • id (str) – Unique time zone identifier

  • name (str) – Time zone name

  • utc_time_offset (int) – Current UTC time offset for the time zone

__init__(id='', name='', utc_time_offset=0)[source]
Parameters:
  • id (str)

  • name (str)

  • utc_time_offset (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TimeZone]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TimeZone']

classmethod getType()[source]
Return type:

Literal['timeZone']

to_dict()[source]
Return type:

dict

id: Optional[str]

Unique time zone identifier

name: Optional[str]

Time zone name

utc_time_offset: int

Current UTC time offset for the time zone

class pytdbot.types.TimeZones(time_zones=None)[source]

Bases: TlObject

Contains a list of time zones

Parameters:

time_zones (List["types.TimeZone"]) – A list of time zones

__init__(time_zones=None)[source]
Parameters:

time_zones (List[TimeZone] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TimeZones]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TimeZones']

classmethod getType()[source]
Return type:

Literal['timeZones']

to_dict()[source]
Return type:

dict

time_zones: List[TimeZone]

A list of time zones

class pytdbot.types.TlObject[source]

Bases: object

Base class for TL Objects

classmethod from_dict(data)[source]
Parameters:

data (dict)

classmethod getClass()[source]
classmethod getType()[source]
to_dict()[source]
Return type:

dict

property is_error
property limited_seconds
class pytdbot.types.TonRevenueStatistics(revenue_by_day_graph=None, status=None, usd_rate=0.0)[source]

Bases: TlObject

A detailed statistics about Toncoins earned by the current user

Parameters:
  • revenue_by_day_graph ("types.StatisticalGraph") – A graph containing amount of revenue in a given day

  • status ("types.TonRevenueStatus") – Amount of earned revenue

  • usd_rate (float) – Current conversion rate of nanotoncoin to USD cents

__init__(revenue_by_day_graph=None, status=None, usd_rate=0.0)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TonRevenueStatistics]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TonRevenueStatistics']

classmethod getType()[source]
Return type:

Literal['tonRevenueStatistics']

to_dict()[source]
Return type:

dict

revenue_by_day_graph: Union[StatisticalGraphData, StatisticalGraphAsync, StatisticalGraphError, None]

A graph containing amount of revenue in a given day

status: Optional[TonRevenueStatus]

Amount of earned revenue

usd_rate: float

Current conversion rate of nanotoncoin to USD cents

class pytdbot.types.TonRevenueStatus(total_amount=0, balance_amount=0, available_amount=0, withdrawal_enabled=False)[source]

Bases: TlObject

Contains information about Toncoins earned by the current user

Parameters:
  • total_amount (int) – Total amount of Toncoins earned; in the smallest units of the cryptocurrency

  • balance_amount (int) – Amount of Toncoins that aren’t withdrawn yet; in the smallest units of the cryptocurrency

  • available_amount (int) – Amount of Toncoins that are available for withdrawal; in the smallest units of the cryptocurrency

  • withdrawal_enabled (bool) – True, if Toncoins can be withdrawn

__init__(total_amount=0, balance_amount=0, available_amount=0, withdrawal_enabled=False)[source]
Parameters:
  • total_amount (int)

  • balance_amount (int)

  • available_amount (int)

  • withdrawal_enabled (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TonRevenueStatus]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TonRevenueStatus']

classmethod getType()[source]
Return type:

Literal['tonRevenueStatus']

to_dict()[source]
Return type:

dict

available_amount: int

Amount of Toncoins that are available for withdrawal; in the smallest units of the cryptocurrency

balance_amount: int

Amount of Toncoins that aren’t withdrawn yet; in the smallest units of the cryptocurrency

total_amount: int

Total amount of Toncoins earned; in the smallest units of the cryptocurrency

withdrawal_enabled: bool

True, if Toncoins can be withdrawn

class pytdbot.types.TonTransaction(id='', ton_amount=0, is_refund=False, date=0, type=None)[source]

Bases: TlObject

Represents a transaction changing the amount of owned Toncoins

Parameters:
  • id (str) – Unique identifier of the transaction

  • ton_amount (int) – The amount of added owned Toncoins; negative for outgoing transactions

  • is_refund (bool) – True, if the transaction is a refund of a previous transaction

  • date (int) – Point in time (Unix timestamp) when the transaction was completed

  • type ("types.TonTransactionType") – Type of the transaction

__init__(id='', ton_amount=0, is_refund=False, date=0, type=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TonTransaction]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TonTransaction']

classmethod getType()[source]
Return type:

Literal['tonTransaction']

to_dict()[source]
Return type:

dict

date: int

Point in time (Unix timestamp) when the transaction was completed

id: Optional[str]

Unique identifier of the transaction

is_refund: bool

True, if the transaction is a refund of a previous transaction

ton_amount: int

The amount of added owned Toncoins; negative for outgoing transactions

type: Union[TonTransactionTypeFragmentDeposit, TonTransactionTypeSuggestedPostPayment, TonTransactionTypeUpgradedGiftPurchase, TonTransactionTypeUpgradedGiftSale, TonTransactionTypeUnsupported, None]

Type of the transaction

class pytdbot.types.TonTransactionType[source]

Bases: object

Describes type of transaction with Toncoins

class pytdbot.types.TonTransactionTypeFragmentDeposit(is_gift=False, sticker=None)[source]

Bases: TlObject, TonTransactionType

The transaction is a deposit of Toncoins from Fragment

Parameters:
  • is_gift (bool) – True, if the transaction is a gift from another user

  • sticker ("types.Sticker") – The sticker to be shown in the transaction information; may be null if unknown

__init__(is_gift=False, sticker=None)[source]
Parameters:
  • is_gift (bool)

  • sticker (Sticker | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TonTransactionTypeFragmentDeposit]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TonTransactionType']

classmethod getType()[source]
Return type:

Literal['tonTransactionTypeFragmentDeposit']

to_dict()[source]
Return type:

dict

is_gift: bool

True, if the transaction is a gift from another user

sticker: Optional[Sticker]

The sticker to be shown in the transaction information; may be null if unknown

class pytdbot.types.TonTransactionTypeSuggestedPostPayment(chat_id=0)[source]

Bases: TlObject, TonTransactionType

The transaction is a payment for a suggested post

Parameters:

chat_id (int) – Identifier of the channel chat that posted the post

__init__(chat_id=0)[source]
Parameters:

chat_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TonTransactionTypeSuggestedPostPayment]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TonTransactionType']

classmethod getType()[source]
Return type:

Literal['tonTransactionTypeSuggestedPostPayment']

to_dict()[source]
Return type:

dict

chat_id: int

Identifier of the channel chat that posted the post

class pytdbot.types.TonTransactionTypeUnsupported[source]

Bases: TlObject, TonTransactionType

The transaction is a transaction of an unsupported type

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TonTransactionTypeUnsupported]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TonTransactionType']

classmethod getType()[source]
Return type:

Literal['tonTransactionTypeUnsupported']

to_dict()[source]
Return type:

dict

class pytdbot.types.TonTransactionTypeUpgradedGiftPurchase(user_id=0, gift=None)[source]

Bases: TlObject, TonTransactionType

The transaction is a purchase of an upgraded gift for some user or channel; for regular users only

Parameters:
  • user_id (int) – Identifier of the user that sold the gift

  • gift ("types.UpgradedGift") – The gift

__init__(user_id=0, gift=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TonTransactionTypeUpgradedGiftPurchase]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TonTransactionType']

classmethod getType()[source]
Return type:

Literal['tonTransactionTypeUpgradedGiftPurchase']

to_dict()[source]
Return type:

dict

gift: Optional[UpgradedGift]

The gift

user_id: int

Identifier of the user that sold the gift

class pytdbot.types.TonTransactionTypeUpgradedGiftSale(user_id=0, gift=None, commission_per_mille=0, commission_toncoin_amount=0)[source]

Bases: TlObject, TonTransactionType

The transaction is a sale of an upgraded gift; for regular users only

Parameters:
  • user_id (int) – Identifier of the user that bought the gift

  • gift ("types.UpgradedGift") – The gift

  • commission_per_mille (int) – The number of Toncoins received by the Telegram for each 1000 Toncoins received by the seller of the gift

  • commission_toncoin_amount (int) – The amount of Toncoins that were received by the Telegram; in the smallest units of the currency

__init__(user_id=0, gift=None, commission_per_mille=0, commission_toncoin_amount=0)[source]
Parameters:
  • user_id (int)

  • gift (UpgradedGift | None)

  • commission_per_mille (int)

  • commission_toncoin_amount (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TonTransactionTypeUpgradedGiftSale]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TonTransactionType']

classmethod getType()[source]
Return type:

Literal['tonTransactionTypeUpgradedGiftSale']

to_dict()[source]
Return type:

dict

commission_per_mille: int

The number of Toncoins received by the Telegram for each 1000 Toncoins received by the seller of the gift

commission_toncoin_amount: int

The amount of Toncoins that were received by the Telegram; in the smallest units of the currency

gift: Optional[UpgradedGift]

The gift

user_id: int

Identifier of the user that bought the gift

class pytdbot.types.TonTransactions(ton_amount=0, transactions=None, next_offset='')[source]

Bases: TlObject

Represents a list of Toncoin transactions

Parameters:
  • ton_amount (int) – The total amount of owned Toncoins

  • transactions (List["types.TonTransaction"]) – List of Toncoin transactions

  • next_offset (str) – The offset for the next request. If empty, then there are no more results

__init__(ton_amount=0, transactions=None, next_offset='')[source]
Parameters:
  • ton_amount (int)

  • transactions (List[TonTransaction] | None)

  • next_offset (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TonTransactions]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TonTransactions']

classmethod getType()[source]
Return type:

Literal['tonTransactions']

to_dict()[source]
Return type:

dict

next_offset: Optional[str]

The offset for the next request. If empty, then there are no more results

ton_amount: int

The total amount of owned Toncoins

transactions: List[TonTransaction]

List of Toncoin transactions

class pytdbot.types.TopChatCategory[source]

Bases: object

Represents the categories of chats for which a list of frequently used chats can be retrieved

class pytdbot.types.TopChatCategoryBots[source]

Bases: TlObject, TopChatCategory

A category containing frequently used private chats with bot users

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TopChatCategoryBots]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TopChatCategory']

classmethod getType()[source]
Return type:

Literal['topChatCategoryBots']

to_dict()[source]
Return type:

dict

class pytdbot.types.TopChatCategoryCalls[source]

Bases: TlObject, TopChatCategory

A category containing frequently used chats used for calls

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TopChatCategoryCalls]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TopChatCategory']

classmethod getType()[source]
Return type:

Literal['topChatCategoryCalls']

to_dict()[source]
Return type:

dict

class pytdbot.types.TopChatCategoryChannels[source]

Bases: TlObject, TopChatCategory

A category containing frequently used channels

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TopChatCategoryChannels]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TopChatCategory']

classmethod getType()[source]
Return type:

Literal['topChatCategoryChannels']

to_dict()[source]
Return type:

dict

class pytdbot.types.TopChatCategoryForwardChats[source]

Bases: TlObject, TopChatCategory

A category containing frequently used chats used to forward messages

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TopChatCategoryForwardChats]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TopChatCategory']

classmethod getType()[source]
Return type:

Literal['topChatCategoryForwardChats']

to_dict()[source]
Return type:

dict

class pytdbot.types.TopChatCategoryGroups[source]

Bases: TlObject, TopChatCategory

A category containing frequently used basic groups and supergroups

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TopChatCategoryGroups]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TopChatCategory']

classmethod getType()[source]
Return type:

Literal['topChatCategoryGroups']

to_dict()[source]
Return type:

dict

class pytdbot.types.TopChatCategoryInlineBots[source]

Bases: TlObject, TopChatCategory

A category containing frequently used chats with inline bots sorted by their usage in inline mode

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TopChatCategoryInlineBots]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TopChatCategory']

classmethod getType()[source]
Return type:

Literal['topChatCategoryInlineBots']

to_dict()[source]
Return type:

dict

class pytdbot.types.TopChatCategoryUsers[source]

Bases: TlObject, TopChatCategory

A category containing frequently used private chats with non-bot users

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TopChatCategoryUsers]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TopChatCategory']

classmethod getType()[source]
Return type:

Literal['topChatCategoryUsers']

to_dict()[source]
Return type:

dict

class pytdbot.types.TopChatCategoryWebAppBots[source]

Bases: TlObject, TopChatCategory

A category containing frequently used chats with bots, which Web Apps were opened

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TopChatCategoryWebAppBots]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TopChatCategory']

classmethod getType()[source]
Return type:

Literal['topChatCategoryWebAppBots']

to_dict()[source]
Return type:

dict

class pytdbot.types.TransactionDirection[source]

Bases: object

Describes direction of transactions in a transaction list

class pytdbot.types.TransactionDirectionIncoming[source]

Bases: TlObject, TransactionDirection

The transaction is incoming and increases the amount of owned currency

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TransactionDirectionIncoming]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TransactionDirection']

classmethod getType()[source]
Return type:

Literal['transactionDirectionIncoming']

to_dict()[source]
Return type:

dict

class pytdbot.types.TransactionDirectionOutgoing[source]

Bases: TlObject, TransactionDirection

The transaction is outgoing and decreases the amount of owned currency

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TransactionDirectionOutgoing]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TransactionDirection']

classmethod getType()[source]
Return type:

Literal['transactionDirectionOutgoing']

to_dict()[source]
Return type:

dict

class pytdbot.types.TrendingStickerSets(total_count=0, sets=None, is_premium=False)[source]

Bases: TlObject

Represents a list of trending sticker sets

Parameters:
  • total_count (int) – Approximate total number of trending sticker sets

  • sets (List["types.StickerSetInfo"]) – List of trending sticker sets

  • is_premium (bool) – True, if the list contains sticker sets with premium stickers

__init__(total_count=0, sets=None, is_premium=False)[source]
Parameters:
  • total_count (int)

  • sets (List[StickerSetInfo] | None)

  • is_premium (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[TrendingStickerSets]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['TrendingStickerSets']

classmethod getType()[source]
Return type:

Literal['trendingStickerSets']

to_dict()[source]
Return type:

dict

is_premium: bool

True, if the list contains sticker sets with premium stickers

sets: List[StickerSetInfo]

List of trending sticker sets

total_count: int

Approximate total number of trending sticker sets

class pytdbot.types.UnconfirmedSession(id=0, log_in_date=0, device_model='', location='')[source]

Bases: TlObject

Contains information about an unconfirmed session

Parameters:
  • id (int) – Session identifier

  • log_in_date (int) – Point in time (Unix timestamp) when the user has logged in

  • device_model (str) – Model of the device that was used for the session creation, as provided by the application

  • location (str) – A human-readable description of the location from which the session was created, based on the IP address

__init__(id=0, log_in_date=0, device_model='', location='')[source]
Parameters:
  • id (int)

  • log_in_date (int)

  • device_model (str)

  • location (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UnconfirmedSession]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UnconfirmedSession']

classmethod getType()[source]
Return type:

Literal['unconfirmedSession']

to_dict()[source]
Return type:

dict

device_model: Optional[str]

Model of the device that was used for the session creation, as provided by the application

id: int

Session identifier

location: Optional[str]

A human-readable description of the location from which the session was created, based on the IP address

log_in_date: int

Point in time (Unix timestamp) when the user has logged in

class pytdbot.types.UnreadReaction(type=None, sender_id=None, is_big=False)[source]

Bases: TlObject

Contains information about an unread reaction to a message

Parameters:
  • type ("types.ReactionType") – Type of the reaction

  • sender_id ("types.MessageSender") – Identifier of the sender, added the reaction

  • is_big (bool) – True, if the reaction was added with a big animation

__init__(type=None, sender_id=None, is_big=False)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UnreadReaction]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UnreadReaction']

classmethod getType()[source]
Return type:

Literal['unreadReaction']

to_dict()[source]
Return type:

dict

is_big: bool

True, if the reaction was added with a big animation

sender_id: Union[MessageSenderUser, MessageSenderChat, None]

Identifier of the sender, added the reaction

type: Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid, None]

Type of the reaction

class pytdbot.types.Update[source]

Bases: object

Contains notifications about data changes

class pytdbot.types.UpdateAccentColors(colors=None, available_accent_color_ids=None)[source]

Bases: TlObject, Update

The list of supported accent colors has changed

Parameters:
  • colors (List["types.AccentColor"]) – Information about supported colors; colors with identifiers 0 (red), 1 (orange), 2 (purple/violet), 3 (green), 4 (cyan), 5 (blue), 6 (pink) must always be supported and aren’t included in the list. The exact colors for the accent colors with identifiers 0-6 must be taken from the app theme

  • available_accent_color_ids (List[int]) – The list of accent color identifiers, which can be set through setAccentColor and setChatAccentColor. The colors must be shown in the specified order

__init__(colors=None, available_accent_color_ids=None)[source]
Parameters:
  • colors (List[AccentColor] | None)

  • available_accent_color_ids (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateAccentColors]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateAccentColors']

to_dict()[source]
Return type:

dict

available_accent_color_ids: List[int]

The list of accent color identifiers, which can be set through setAccentColor and setChatAccentColor. The colors must be shown in the specified order

colors: List[AccentColor]

Information about supported colors; colors with identifiers 0 (red), 1 (orange), 2 (purple/violet), 3 (green), 4 (cyan), 5 (blue), 6 (pink) must always be supported and aren’t included in the list. The exact colors for the accent colors with identifiers 0-6 must be taken from the app theme

class pytdbot.types.UpdateActiveEmojiReactions(emojis=None)[source]

Bases: TlObject, Update

The list of active emoji reactions has changed

Parameters:

emojis (List[str]) – The new list of active emoji reactions

__init__(emojis=None)[source]
Parameters:

emojis (List[str] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateActiveEmojiReactions]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateActiveEmojiReactions']

to_dict()[source]
Return type:

dict

emojis: List[str]

The new list of active emoji reactions

class pytdbot.types.UpdateActiveLiveLocationMessages(messages=None)[source]

Bases: TlObject, Update

The list of messages with active live location that need to be updated by the application has changed. The list is persistent across application restarts only if the message database is used

Parameters:

messages (List["types.Message"]) – The list of messages with active live locations

__init__(messages=None)[source]
Parameters:

messages (List[Message] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateActiveLiveLocationMessages]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateActiveLiveLocationMessages']

to_dict()[source]
Return type:

dict

messages: List[Message]

The list of messages with active live locations

class pytdbot.types.UpdateActiveNotifications(groups=None)[source]

Bases: TlObject, Update

Contains active notifications that were shown on previous application launches. This update is sent only if the message database is used. In that case it comes once before any updateNotification and updateNotificationGroup update

Parameters:

groups (List["types.NotificationGroup"]) – Lists of active notification groups

__init__(groups=None)[source]
Parameters:

groups (List[NotificationGroup] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateActiveNotifications]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateActiveNotifications']

to_dict()[source]
Return type:

dict

groups: List[NotificationGroup]

Lists of active notification groups

class pytdbot.types.UpdateAgeVerificationParameters(parameters=None)[source]

Bases: TlObject, Update

The parameters for age verification of the current user’s account has changed

Parameters:

parameters ("types.AgeVerificationParameters") – Parameters for the age verification; may be null if age verification isn’t needed

__init__(parameters=None)[source]
Parameters:

parameters (AgeVerificationParameters | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateAgeVerificationParameters]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateAgeVerificationParameters']

to_dict()[source]
Return type:

dict

parameters: Optional[AgeVerificationParameters]

Parameters for the age verification; may be null if age verification isn’t needed

class pytdbot.types.UpdateAnimatedEmojiMessageClicked(chat_id=0, message_id=0, sticker=None)[source]

Bases: TlObject, Update

Some animated emoji message was clicked and a big animated sticker must be played if the message is visible on the screen. chatActionWatchingAnimations with the text of the message needs to be sent if the sticker is played

Parameters:
  • chat_id (int) – Chat identifier

  • message_id (int) – Message identifier

  • sticker ("types.Sticker") – The animated sticker to be played

__init__(chat_id=0, message_id=0, sticker=None)[source]
Parameters:
  • chat_id (int)

  • message_id (int)

  • sticker (Sticker | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateAnimatedEmojiMessageClicked]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateAnimatedEmojiMessageClicked']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

message_id: int

Message identifier

sticker: Optional[Sticker]

The animated sticker to be played

class pytdbot.types.UpdateAnimationSearchParameters(provider='', emojis=None)[source]

Bases: TlObject, Update

The parameters of animation search through getOption("animation_search_bot_username") bot has changed

Parameters:
  • provider (str) – Name of the animation search provider

  • emojis (List[str]) – The new list of emojis suggested for searching

__init__(provider='', emojis=None)[source]
Parameters:
  • provider (str)

  • emojis (List[str] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateAnimationSearchParameters]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateAnimationSearchParameters']

to_dict()[source]
Return type:

dict

emojis: List[str]

The new list of emojis suggested for searching

provider: Optional[str]

Name of the animation search provider

class pytdbot.types.UpdateApplicationRecaptchaVerificationRequired(verification_id=0, action='', recaptcha_key_id='')[source]

Bases: TlObject, Update

A request can’t be completed unless reCAPTCHA verification is performed; for official mobile applications only. The method setApplicationVerificationToken must be called once the verification is completed or failed

Parameters:
  • verification_id (int) – Unique identifier for the verification process

  • action (str) – The action for the check

  • recaptcha_key_id (str) – Identifier of the reCAPTCHA key

__init__(verification_id=0, action='', recaptcha_key_id='')[source]
Parameters:
  • verification_id (int)

  • action (str)

  • recaptcha_key_id (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateApplicationRecaptchaVerificationRequired]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateApplicationRecaptchaVerificationRequired']

to_dict()[source]
Return type:

dict

action: Optional[str]

The action for the check

recaptcha_key_id: Optional[str]

Identifier of the reCAPTCHA key

verification_id: int

Unique identifier for the verification process

class pytdbot.types.UpdateApplicationVerificationRequired(verification_id=0, nonce='', cloud_project_number=0)[source]

Bases: TlObject, Update

A request can’t be completed unless application verification is performed; for official mobile applications only. The method setApplicationVerificationToken must be called once the verification is completed or failed

Parameters:
  • verification_id (int) – Unique identifier for the verification process

  • nonce (str) – Unique base64url-encoded nonce for the classic Play Integrity verification (https://developer.android.com/google/play/integrity/classic) for Android, or a unique string to compare with verify_nonce field from a push notification for iOS

  • cloud_project_number (int) – Cloud project number to pass to the Play Integrity API on Android

__init__(verification_id=0, nonce='', cloud_project_number=0)[source]
Parameters:
  • verification_id (int)

  • nonce (str)

  • cloud_project_number (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateApplicationVerificationRequired]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateApplicationVerificationRequired']

to_dict()[source]
Return type:

dict

cloud_project_number: int

Cloud project number to pass to the Play Integrity API on Android

nonce: Optional[str]

//developer.android.com/google/play/integrity/classic) for Android, or a unique string to compare with verify_nonce field from a push notification for iOS

Type:

Unique base64url-encoded nonce for the classic Play Integrity verification (https

verification_id: int

Unique identifier for the verification process

class pytdbot.types.UpdateAttachmentMenuBots(bots=None)[source]

Bases: TlObject, Update

The list of bots added to attachment or side menu has changed

Parameters:

bots (List["types.AttachmentMenuBot"]) – The new list of bots. The bots must not be shown on scheduled messages screen

__init__(bots=None)[source]
Parameters:

bots (List[AttachmentMenuBot] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateAttachmentMenuBots]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateAttachmentMenuBots']

to_dict()[source]
Return type:

dict

bots: List[AttachmentMenuBot]

The new list of bots. The bots must not be shown on scheduled messages screen

class pytdbot.types.UpdateAuthorizationState(authorization_state=None)[source]

Bases: TlObject, Update

The user authorization state has changed

Parameters:

authorization_state ("types.AuthorizationState") – New authorization state

__init__(authorization_state=None)[source]
Parameters:

authorization_state (AuthorizationState | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateAuthorizationState]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateAuthorizationState']

to_dict()[source]
Return type:

dict

authorization_state: Union[AuthorizationStateWaitTdlibParameters, AuthorizationStateWaitPhoneNumber, AuthorizationStateWaitPremiumPurchase, AuthorizationStateWaitEmailAddress, AuthorizationStateWaitEmailCode, AuthorizationStateWaitCode, AuthorizationStateWaitOtherDeviceConfirmation, AuthorizationStateWaitRegistration, AuthorizationStateWaitPassword, AuthorizationStateReady, AuthorizationStateLoggingOut, AuthorizationStateClosing, AuthorizationStateClosed, None]

New authorization state

class pytdbot.types.UpdateAutosaveSettings(scope=None, settings=None)[source]

Bases: TlObject, Update

Autosave settings for some type of chats were updated

Parameters:
  • scope ("types.AutosaveSettingsScope") – Type of chats for which autosave settings were updated

  • settings ("types.ScopeAutosaveSettings") – The new autosave settings; may be null if the settings are reset to default

__init__(scope=None, settings=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateAutosaveSettings]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateAutosaveSettings']

to_dict()[source]
Return type:

dict

scope: Union[AutosaveSettingsScopePrivateChats, AutosaveSettingsScopeGroupChats, AutosaveSettingsScopeChannelChats, AutosaveSettingsScopeChat, None]

Type of chats for which autosave settings were updated

settings: Optional[ScopeAutosaveSettings]

The new autosave settings; may be null if the settings are reset to default

class pytdbot.types.UpdateAvailableMessageEffects(reaction_effect_ids=None, sticker_effect_ids=None)[source]

Bases: TlObject, Update

The list of available message effects has changed

Parameters:
  • reaction_effect_ids (List[int]) – The new list of available message effects from emoji reactions

  • sticker_effect_ids (List[int]) – The new list of available message effects from Premium stickers

__init__(reaction_effect_ids=None, sticker_effect_ids=None)[source]
Parameters:
  • reaction_effect_ids (List[int] | None)

  • sticker_effect_ids (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateAvailableMessageEffects]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateAvailableMessageEffects']

to_dict()[source]
Return type:

dict

reaction_effect_ids: List[int]

The new list of available message effects from emoji reactions

sticker_effect_ids: List[int]

The new list of available message effects from Premium stickers

class pytdbot.types.UpdateBasicGroup(basic_group=None)[source]

Bases: TlObject, Update

Some data of a basic group has changed. This update is guaranteed to come before the basic group identifier is returned to the application

Parameters:

basic_group ("types.BasicGroup") – New data about the group

__init__(basic_group=None)[source]
Parameters:

basic_group (BasicGroup | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateBasicGroup]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateBasicGroup']

to_dict()[source]
Return type:

dict

basic_group: Optional[BasicGroup]

New data about the group

class pytdbot.types.UpdateBasicGroupFullInfo(basic_group_id=0, basic_group_full_info=None)[source]

Bases: TlObject, Update

Some data in basicGroupFullInfo has been changed

Parameters:
  • basic_group_id (int) – Identifier of a basic group

  • basic_group_full_info ("types.BasicGroupFullInfo") – New full information about the group

__init__(basic_group_id=0, basic_group_full_info=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateBasicGroupFullInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateBasicGroupFullInfo']

to_dict()[source]
Return type:

dict

basic_group_full_info: Optional[BasicGroupFullInfo]

New full information about the group

basic_group_id: int

Identifier of a basic group

class pytdbot.types.UpdateBusinessConnection(connection=None)[source]

Bases: TlObject, Update

A business connection has changed; for bots only

Parameters:

connection ("types.BusinessConnection") – New data about the connection

__init__(connection=None)[source]
Parameters:

connection (BusinessConnection | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateBusinessConnection]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateBusinessConnection']

to_dict()[source]
Return type:

dict

connection: Optional[BusinessConnection]

New data about the connection

class pytdbot.types.UpdateBusinessMessageEdited(connection_id='', message=None)[source]

Bases: TlObject, Update

A message in a business account was edited; for bots only

Parameters:
  • connection_id (str) – Unique identifier of the business connection

  • message ("types.BusinessMessage") – The edited message

__init__(connection_id='', message=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateBusinessMessageEdited]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateBusinessMessageEdited']

to_dict()[source]
Return type:

dict

connection_id: Optional[str]

Unique identifier of the business connection

message: Optional[BusinessMessage]

The edited message

class pytdbot.types.UpdateBusinessMessagesDeleted(connection_id='', chat_id=0, message_ids=None)[source]

Bases: TlObject, Update

Messages in a business account were deleted; for bots only

Parameters:
  • connection_id (str) – Unique identifier of the business connection

  • chat_id (int) – Identifier of a chat in the business account in which messages were deleted

  • message_ids (List[int]) – Unique message identifiers of the deleted messages

__init__(connection_id='', chat_id=0, message_ids=None)[source]
Parameters:
  • connection_id (str)

  • chat_id (int)

  • message_ids (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateBusinessMessagesDeleted]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateBusinessMessagesDeleted']

to_dict()[source]
Return type:

dict

chat_id: int

Identifier of a chat in the business account in which messages were deleted

connection_id: Optional[str]

Unique identifier of the business connection

message_ids: List[int]

Unique message identifiers of the deleted messages

class pytdbot.types.UpdateCall(call=None)[source]

Bases: TlObject, Update

New call was created or information about a call was updated

Parameters:

call ("types.Call") – New data about a call

__init__(call=None)[source]
Parameters:

call (Call | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateCall]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateCall']

to_dict()[source]
Return type:

dict

call: Optional[Call]

New data about a call

class pytdbot.types.UpdateChatAccentColors(chat_id=0, accent_color_id=0, background_custom_emoji_id=0, profile_accent_color_id=0, profile_background_custom_emoji_id=0)[source]

Bases: TlObject, Update

Chat accent colors have changed

Parameters:
  • chat_id (int) – Chat identifier

  • accent_color_id (int) – The new chat accent color identifier

  • background_custom_emoji_id (int) – The new identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none

  • profile_accent_color_id (int) – The new chat profile accent color identifier; -1 if none

  • profile_background_custom_emoji_id (int) – The new identifier of a custom emoji to be shown on the profile background; 0 if none

__init__(chat_id=0, accent_color_id=0, background_custom_emoji_id=0, profile_accent_color_id=0, profile_background_custom_emoji_id=0)[source]
Parameters:
  • chat_id (int)

  • accent_color_id (int)

  • background_custom_emoji_id (int)

  • profile_accent_color_id (int)

  • profile_background_custom_emoji_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatAccentColors]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatAccentColors']

to_dict()[source]
Return type:

dict

accent_color_id: int

The new chat accent color identifier

background_custom_emoji_id: int

The new identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none

chat_id: int

Chat identifier

profile_accent_color_id: int

The new chat profile accent color identifier; -1 if none

profile_background_custom_emoji_id: int

The new identifier of a custom emoji to be shown on the profile background; 0 if none

class pytdbot.types.UpdateChatAction(chat_id=0, message_thread_id=0, sender_id=None, action=None)[source]

Bases: TlObject, Update

A message sender activity in the chat has changed

Parameters:
  • chat_id (int) – Chat identifier

  • message_thread_id (int) – If not 0, the message thread identifier in which the action was performed

  • sender_id ("types.MessageSender") – Identifier of a message sender performing the action

  • action ("types.ChatAction") – The action

__init__(chat_id=0, message_thread_id=0, sender_id=None, action=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatAction]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatAction']

to_dict()[source]
Return type:

dict

action: Union[ChatActionTyping, ChatActionRecordingVideo, ChatActionUploadingVideo, ChatActionRecordingVoiceNote, ChatActionUploadingVoiceNote, ChatActionUploadingPhoto, ChatActionUploadingDocument, ChatActionChoosingSticker, ChatActionChoosingLocation, ChatActionChoosingContact, ChatActionStartPlayingGame, ChatActionRecordingVideoNote, ChatActionUploadingVideoNote, ChatActionWatchingAnimations, ChatActionCancel, None]

The action

chat_id: int

Chat identifier

message_thread_id: int

If not 0, the message thread identifier in which the action was performed

sender_id: Union[MessageSenderUser, MessageSenderChat, None]

Identifier of a message sender performing the action

class pytdbot.types.UpdateChatActionBar(chat_id=0, action_bar=None)[source]

Bases: TlObject, Update

The chat action bar was changed

Parameters:
  • chat_id (int) – Chat identifier

  • action_bar ("types.ChatActionBar") – The new value of the action bar; may be null

__init__(chat_id=0, action_bar=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatActionBar]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatActionBar']

to_dict()[source]
Return type:

dict

action_bar: Union[ChatActionBarReportSpam, ChatActionBarInviteMembers, ChatActionBarReportAddBlock, ChatActionBarAddContact, ChatActionBarSharePhoneNumber, ChatActionBarJoinRequest, None]

The new value of the action bar; may be null

chat_id: int

Chat identifier

class pytdbot.types.UpdateChatActiveStories(active_stories=None)[source]

Bases: TlObject, Update

The list of active stories posted by a specific chat has changed

Parameters:

active_stories ("types.ChatActiveStories") – The new list of active stories

__init__(active_stories=None)[source]
Parameters:

active_stories (ChatActiveStories | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatActiveStories]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatActiveStories']

to_dict()[source]
Return type:

dict

active_stories: Optional[ChatActiveStories]

The new list of active stories

class pytdbot.types.UpdateChatAddedToList(chat_id=0, chat_list=None)[source]

Bases: TlObject, Update

A chat was added to a chat list

Parameters:
  • chat_id (int) – Chat identifier

  • chat_list ("types.ChatList") – The chat list to which the chat was added

__init__(chat_id=0, chat_list=None)[source]
Parameters:
  • chat_id (int)

  • chat_list (ChatList | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatAddedToList]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatAddedToList']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

chat_list: Union[ChatListMain, ChatListArchive, ChatListFolder, None]

The chat list to which the chat was added

class pytdbot.types.UpdateChatAvailableReactions(chat_id=0, available_reactions=None)[source]

Bases: TlObject, Update

The chat available reactions were changed

Parameters:
  • chat_id (int) – Chat identifier

  • available_reactions ("types.ChatAvailableReactions") – The new reactions, available in the chat

__init__(chat_id=0, available_reactions=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatAvailableReactions]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatAvailableReactions']

to_dict()[source]
Return type:

dict

available_reactions: Union[ChatAvailableReactionsAll, ChatAvailableReactionsSome, None]

The new reactions, available in the chat

chat_id: int

Chat identifier

class pytdbot.types.UpdateChatBackground(chat_id=0, background=None)[source]

Bases: TlObject, Update

The chat background was changed

Parameters:
  • chat_id (int) – Chat identifier

  • background ("types.ChatBackground") – The new chat background; may be null if background was reset to default

__init__(chat_id=0, background=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatBackground]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatBackground']

to_dict()[source]
Return type:

dict

background: Optional[ChatBackground]

The new chat background; may be null if background was reset to default

chat_id: int

Chat identifier

class pytdbot.types.UpdateChatBlockList(chat_id=0, block_list=None)[source]

Bases: TlObject, Update

A chat was blocked or unblocked

Parameters:
  • chat_id (int) – Chat identifier

  • block_list ("types.BlockList") – Block list to which the chat is added; may be null if none

__init__(chat_id=0, block_list=None)[source]
Parameters:
  • chat_id (int)

  • block_list (BlockList | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatBlockList]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatBlockList']

to_dict()[source]
Return type:

dict

block_list: Union[BlockListMain, BlockListStories, None]

Block list to which the chat is added; may be null if none

chat_id: int

Chat identifier

class pytdbot.types.UpdateChatBoost(chat_id=0, boost=None)[source]

Bases: TlObject, Update

A chat boost has changed; for bots only

Parameters:
  • chat_id (int) – Chat identifier

  • boost ("types.ChatBoost") – New information about the boost

__init__(chat_id=0, boost=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatBoost]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatBoost']

to_dict()[source]
Return type:

dict

boost: Optional[ChatBoost]

New information about the boost

chat_id: int

Chat identifier

class pytdbot.types.UpdateChatBusinessBotManageBar(chat_id=0, business_bot_manage_bar=None)[source]

Bases: TlObject, Update

The bar for managing business bot was changed in a chat

Parameters:
  • chat_id (int) – Chat identifier

  • business_bot_manage_bar ("types.BusinessBotManageBar") – The new value of the business bot manage bar; may be null

__init__(chat_id=0, business_bot_manage_bar=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatBusinessBotManageBar]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatBusinessBotManageBar']

to_dict()[source]
Return type:

dict

business_bot_manage_bar: Optional[BusinessBotManageBar]

The new value of the business bot manage bar; may be null

chat_id: int

Chat identifier

class pytdbot.types.UpdateChatDefaultDisableNotification(chat_id=0, default_disable_notification=False)[source]

Bases: TlObject, Update

The value of the default disable_notification parameter, used when a message is sent to the chat, was changed

Parameters:
  • chat_id (int) – Chat identifier

  • default_disable_notification (bool) – The new default_disable_notification value

__init__(chat_id=0, default_disable_notification=False)[source]
Parameters:
  • chat_id (int)

  • default_disable_notification (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatDefaultDisableNotification]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatDefaultDisableNotification']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

default_disable_notification: bool

The new default_disable_notification value

class pytdbot.types.UpdateChatDraftMessage(chat_id=0, draft_message=None, positions=None)[source]

Bases: TlObject, Update

A chat draft has changed. Be aware that the update may come in the currently opened chat but with old content of the draft. If the user has changed the content of the draft, this update mustn’t be applied

Parameters:
  • chat_id (int) – Chat identifier

  • draft_message ("types.DraftMessage") – The new draft message; may be null if none

  • positions (List["types.ChatPosition"]) – The new chat positions in the chat lists

__init__(chat_id=0, draft_message=None, positions=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatDraftMessage]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatDraftMessage']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

draft_message: Optional[DraftMessage]

The new draft message; may be null if none

positions: List[ChatPosition]

The new chat positions in the chat lists

class pytdbot.types.UpdateChatEmojiStatus(chat_id=0, emoji_status=None)[source]

Bases: TlObject, Update

Chat emoji status has changed

Parameters:
  • chat_id (int) – Chat identifier

  • emoji_status ("types.EmojiStatus") – The new chat emoji status; may be null

__init__(chat_id=0, emoji_status=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatEmojiStatus]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatEmojiStatus']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

emoji_status: Optional[EmojiStatus]

The new chat emoji status; may be null

class pytdbot.types.UpdateChatFolders(chat_folders=None, main_chat_list_position=0, are_tags_enabled=False)[source]

Bases: TlObject, Update

The list of chat folders or a chat folder has changed

Parameters:
  • chat_folders (List["types.ChatFolderInfo"]) – The new list of chat folders

  • main_chat_list_position (int) – Position of the main chat list among chat folders, 0-based

  • are_tags_enabled (bool) – True, if folder tags are enabled

__init__(chat_folders=None, main_chat_list_position=0, are_tags_enabled=False)[source]
Parameters:
  • chat_folders (List[ChatFolderInfo] | None)

  • main_chat_list_position (int)

  • are_tags_enabled (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatFolders]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatFolders']

to_dict()[source]
Return type:

dict

are_tags_enabled: bool

True, if folder tags are enabled

chat_folders: List[ChatFolderInfo]

The new list of chat folders

main_chat_list_position: int

Position of the main chat list among chat folders, 0-based

class pytdbot.types.UpdateChatHasProtectedContent(chat_id=0, has_protected_content=False)[source]

Bases: TlObject, Update

A chat content was allowed or restricted for saving

Parameters:
  • chat_id (int) – Chat identifier

  • has_protected_content (bool) – New value of has_protected_content

__init__(chat_id=0, has_protected_content=False)[source]
Parameters:
  • chat_id (int)

  • has_protected_content (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatHasProtectedContent]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatHasProtectedContent']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

has_protected_content: bool

New value of has_protected_content

class pytdbot.types.UpdateChatHasScheduledMessages(chat_id=0, has_scheduled_messages=False)[source]

Bases: TlObject, Update

A chat’s has_scheduled_messages field has changed

Parameters:
  • chat_id (int) – Chat identifier

  • has_scheduled_messages (bool) – New value of has_scheduled_messages

__init__(chat_id=0, has_scheduled_messages=False)[source]
Parameters:
  • chat_id (int)

  • has_scheduled_messages (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatHasScheduledMessages]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatHasScheduledMessages']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

has_scheduled_messages: bool

New value of has_scheduled_messages

class pytdbot.types.UpdateChatIsMarkedAsUnread(chat_id=0, is_marked_as_unread=False)[source]

Bases: TlObject, Update

A chat was marked as unread or was read

Parameters:
  • chat_id (int) – Chat identifier

  • is_marked_as_unread (bool) – New value of is_marked_as_unread

__init__(chat_id=0, is_marked_as_unread=False)[source]
Parameters:
  • chat_id (int)

  • is_marked_as_unread (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatIsMarkedAsUnread]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatIsMarkedAsUnread']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

is_marked_as_unread: bool

New value of is_marked_as_unread

class pytdbot.types.UpdateChatIsTranslatable(chat_id=0, is_translatable=False)[source]

Bases: TlObject, Update

Translation of chat messages was enabled or disabled

Parameters:
  • chat_id (int) – Chat identifier

  • is_translatable (bool) – New value of is_translatable

__init__(chat_id=0, is_translatable=False)[source]
Parameters:
  • chat_id (int)

  • is_translatable (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatIsTranslatable]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatIsTranslatable']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

is_translatable: bool

New value of is_translatable

class pytdbot.types.UpdateChatLastMessage(chat_id=0, last_message=None, positions=None)[source]

Bases: TlObject, Update

The last message of a chat was changed

Parameters:
  • chat_id (int) – Chat identifier

  • last_message ("types.Message") – The new last message in the chat; may be null if the last message became unknown. While the last message is unknown, new messages can be added to the chat without corresponding updateNewMessage update

  • positions (List["types.ChatPosition"]) – The new chat positions in the chat lists

__init__(chat_id=0, last_message=None, positions=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatLastMessage]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatLastMessage']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

last_message: Optional[Message]

The new last message in the chat; may be null if the last message became unknown. While the last message is unknown, new messages can be added to the chat without corresponding updateNewMessage update

positions: List[ChatPosition]

The new chat positions in the chat lists

class pytdbot.types.UpdateChatMember(chat_id=0, actor_user_id=0, date=0, invite_link=None, via_join_request=False, via_chat_folder_invite_link=False, old_chat_member=None, new_chat_member=None)[source]

Bases: TlObject, Update

User rights changed in a chat; for bots only

Parameters:
  • chat_id (int) – Chat identifier

  • actor_user_id (int) – Identifier of the user, changing the rights

  • date (int) – Point in time (Unix timestamp) when the user rights were changed

  • invite_link ("types.ChatInviteLink") – If user has joined the chat using an invite link, the invite link; may be null

  • via_join_request (bool) – True, if the user has joined the chat after sending a join request and being approved by an administrator

  • via_chat_folder_invite_link (bool) – True, if the user has joined the chat using an invite link for a chat folder

  • old_chat_member ("types.ChatMember") – Previous chat member

  • new_chat_member ("types.ChatMember") – New chat member

__init__(chat_id=0, actor_user_id=0, date=0, invite_link=None, via_join_request=False, via_chat_folder_invite_link=False, old_chat_member=None, new_chat_member=None)[source]
Parameters:
  • chat_id (int)

  • actor_user_id (int)

  • date (int)

  • invite_link (ChatInviteLink | None)

  • via_join_request (bool)

  • via_chat_folder_invite_link (bool)

  • old_chat_member (ChatMember | None)

  • new_chat_member (ChatMember | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatMember]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatMember']

to_dict()[source]
Return type:

dict

actor_user_id: int

Identifier of the user, changing the rights

chat_id: int

Chat identifier

date: int

Point in time (Unix timestamp) when the user rights were changed

invite_link: Optional[ChatInviteLink]

If user has joined the chat using an invite link, the invite link; may be null

new_chat_member: Optional[ChatMember]

New chat member

old_chat_member: Optional[ChatMember]

Previous chat member

via_chat_folder_invite_link: bool

True, if the user has joined the chat using an invite link for a chat folder

via_join_request: bool

True, if the user has joined the chat after sending a join request and being approved by an administrator

class pytdbot.types.UpdateChatMessageAutoDeleteTime(chat_id=0, message_auto_delete_time=0)[source]

Bases: TlObject, Update

The message auto-delete or self-destruct timer setting for a chat was changed

Parameters:
  • chat_id (int) – Chat identifier

  • message_auto_delete_time (int) – New value of message_auto_delete_time

__init__(chat_id=0, message_auto_delete_time=0)[source]
Parameters:
  • chat_id (int)

  • message_auto_delete_time (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatMessageAutoDeleteTime]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatMessageAutoDeleteTime']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

message_auto_delete_time: int

New value of message_auto_delete_time

class pytdbot.types.UpdateChatMessageSender(chat_id=0, message_sender_id=None)[source]

Bases: TlObject, Update

The message sender that is selected to send messages in a chat has changed

Parameters:
  • chat_id (int) – Chat identifier

  • message_sender_id ("types.MessageSender") – New value of message_sender_id; may be null if the user can’t change message sender

__init__(chat_id=0, message_sender_id=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatMessageSender]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatMessageSender']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

message_sender_id: Union[MessageSenderUser, MessageSenderChat, None]

New value of message_sender_id; may be null if the user can’t change message sender

class pytdbot.types.UpdateChatNotificationSettings(chat_id=0, notification_settings=None)[source]

Bases: TlObject, Update

Notification settings for a chat were changed

Parameters:
  • chat_id (int) – Chat identifier

  • notification_settings ("types.ChatNotificationSettings") – The new notification settings

__init__(chat_id=0, notification_settings=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatNotificationSettings]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatNotificationSettings']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

notification_settings: Optional[ChatNotificationSettings]

The new notification settings

class pytdbot.types.UpdateChatOnlineMemberCount(chat_id=0, online_member_count=0)[source]

Bases: TlObject, Update

The number of online group members has changed. This update with non-zero number of online group members is sent only for currently opened chats. There is no guarantee that it is sent just after the number of online users has changed

Parameters:
  • chat_id (int) – Identifier of the chat

  • online_member_count (int) – New number of online members in the chat, or 0 if unknown

__init__(chat_id=0, online_member_count=0)[source]
Parameters:
  • chat_id (int)

  • online_member_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatOnlineMemberCount]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatOnlineMemberCount']

to_dict()[source]
Return type:

dict

chat_id: int

Identifier of the chat

online_member_count: int

New number of online members in the chat, or 0 if unknown

class pytdbot.types.UpdateChatPendingJoinRequests(chat_id=0, pending_join_requests=None)[source]

Bases: TlObject, Update

The chat pending join requests were changed

Parameters:
  • chat_id (int) – Chat identifier

  • pending_join_requests ("types.ChatJoinRequestsInfo") – The new data about pending join requests; may be null

__init__(chat_id=0, pending_join_requests=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatPendingJoinRequests]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatPendingJoinRequests']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

pending_join_requests: Optional[ChatJoinRequestsInfo]

The new data about pending join requests; may be null

class pytdbot.types.UpdateChatPermissions(chat_id=0, permissions=None)[source]

Bases: TlObject, Update

Chat permissions were changed

Parameters:
  • chat_id (int) – Chat identifier

  • permissions ("types.ChatPermissions") – The new chat permissions

__init__(chat_id=0, permissions=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatPermissions]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatPermissions']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

permissions: Optional[ChatPermissions]

The new chat permissions

class pytdbot.types.UpdateChatPhoto(chat_id=0, photo=None)[source]

Bases: TlObject, Update

A chat photo was changed

Parameters:
  • chat_id (int) – Chat identifier

  • photo ("types.ChatPhotoInfo") – The new chat photo; may be null

__init__(chat_id=0, photo=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatPhoto]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatPhoto']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

photo: Optional[ChatPhotoInfo]

The new chat photo; may be null

class pytdbot.types.UpdateChatPosition(chat_id=0, position=None)[source]

Bases: TlObject, Update

The position of a chat in a chat list has changed. An updateChatLastMessage or updateChatDraftMessage update might be sent instead of the update

Parameters:
  • chat_id (int) – Chat identifier

  • position ("types.ChatPosition") – New chat position. If new order is 0, then the chat needs to be removed from the list

__init__(chat_id=0, position=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatPosition]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatPosition']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

position: Optional[ChatPosition]

New chat position. If new order is 0, then the chat needs to be removed from the list

class pytdbot.types.UpdateChatReadInbox(chat_id=0, last_read_inbox_message_id=0, unread_count=0)[source]

Bases: TlObject, Update

Incoming messages were read or the number of unread messages has been changed

Parameters:
  • chat_id (int) – Chat identifier

  • last_read_inbox_message_id (int) – Identifier of the last read incoming message

  • unread_count (int) – The number of unread messages left in the chat

__init__(chat_id=0, last_read_inbox_message_id=0, unread_count=0)[source]
Parameters:
  • chat_id (int)

  • last_read_inbox_message_id (int)

  • unread_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatReadInbox]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatReadInbox']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

last_read_inbox_message_id: int

Identifier of the last read incoming message

unread_count: int

The number of unread messages left in the chat

class pytdbot.types.UpdateChatReadOutbox(chat_id=0, last_read_outbox_message_id=0)[source]

Bases: TlObject, Update

Outgoing messages were read

Parameters:
  • chat_id (int) – Chat identifier

  • last_read_outbox_message_id (int) – Identifier of last read outgoing message

__init__(chat_id=0, last_read_outbox_message_id=0)[source]
Parameters:
  • chat_id (int)

  • last_read_outbox_message_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatReadOutbox]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatReadOutbox']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

last_read_outbox_message_id: int

Identifier of last read outgoing message

class pytdbot.types.UpdateChatRemovedFromList(chat_id=0, chat_list=None)[source]

Bases: TlObject, Update

A chat was removed from a chat list

Parameters:
  • chat_id (int) – Chat identifier

  • chat_list ("types.ChatList") – The chat list from which the chat was removed

__init__(chat_id=0, chat_list=None)[source]
Parameters:
  • chat_id (int)

  • chat_list (ChatList | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatRemovedFromList]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatRemovedFromList']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

chat_list: Union[ChatListMain, ChatListArchive, ChatListFolder, None]

The chat list from which the chat was removed

class pytdbot.types.UpdateChatReplyMarkup(chat_id=0, reply_markup_message_id=0)[source]

Bases: TlObject, Update

The default chat reply markup was changed. Can occur because new messages with reply markup were received or because an old reply markup was hidden by the user

Parameters:
  • chat_id (int) – Chat identifier

  • reply_markup_message_id (int) – Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat

__init__(chat_id=0, reply_markup_message_id=0)[source]
Parameters:
  • chat_id (int)

  • reply_markup_message_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatReplyMarkup]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatReplyMarkup']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

reply_markup_message_id: int

Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat

class pytdbot.types.UpdateChatRevenueAmount(chat_id=0, revenue_amount=None)[source]

Bases: TlObject, Update

The revenue earned from sponsored messages in a chat has changed. If chat revenue screen is opened, then getChatRevenueTransactions may be called to fetch new transactions

Parameters:
  • chat_id (int) – Identifier of the chat

  • revenue_amount ("types.ChatRevenueAmount") – New amount of earned revenue

__init__(chat_id=0, revenue_amount=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatRevenueAmount]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatRevenueAmount']

to_dict()[source]
Return type:

dict

chat_id: int

Identifier of the chat

revenue_amount: Optional[ChatRevenueAmount]

New amount of earned revenue

class pytdbot.types.UpdateChatTheme(chat_id=0, theme=None)[source]

Bases: TlObject, Update

The chat theme was changed

Parameters:
  • chat_id (int) – Chat identifier

  • theme ("types.ChatTheme") – The new theme of the chat; may be null if theme was reset to default

__init__(chat_id=0, theme=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatTheme]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatTheme']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

theme: Union[ChatThemeEmoji, ChatThemeGift, None]

The new theme of the chat; may be null if theme was reset to default

class pytdbot.types.UpdateChatTitle(chat_id=0, title='')[source]

Bases: TlObject, Update

The title of a chat was changed

Parameters:
  • chat_id (int) – Chat identifier

  • title (str) – The new chat title

__init__(chat_id=0, title='')[source]
Parameters:
  • chat_id (int)

  • title (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatTitle]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatTitle']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

title: Optional[str]

The new chat title

class pytdbot.types.UpdateChatUnreadMentionCount(chat_id=0, unread_mention_count=0)[source]

Bases: TlObject, Update

The chat unread_mention_count has changed

Parameters:
  • chat_id (int) – Chat identifier

  • unread_mention_count (int) – The number of unread mention messages left in the chat

__init__(chat_id=0, unread_mention_count=0)[source]
Parameters:
  • chat_id (int)

  • unread_mention_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatUnreadMentionCount]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatUnreadMentionCount']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

unread_mention_count: int

The number of unread mention messages left in the chat

class pytdbot.types.UpdateChatUnreadReactionCount(chat_id=0, unread_reaction_count=0)[source]

Bases: TlObject, Update

The chat unread_reaction_count has changed

Parameters:
  • chat_id (int) – Chat identifier

  • unread_reaction_count (int) – The number of messages with unread reactions left in the chat

__init__(chat_id=0, unread_reaction_count=0)[source]
Parameters:
  • chat_id (int)

  • unread_reaction_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatUnreadReactionCount]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatUnreadReactionCount']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

unread_reaction_count: int

The number of messages with unread reactions left in the chat

class pytdbot.types.UpdateChatVideoChat(chat_id=0, video_chat=None)[source]

Bases: TlObject, Update

A chat video chat state has changed

Parameters:
  • chat_id (int) – Chat identifier

  • video_chat ("types.VideoChat") – New value of video_chat

__init__(chat_id=0, video_chat=None)[source]
Parameters:
  • chat_id (int)

  • video_chat (VideoChat | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatVideoChat]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatVideoChat']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

video_chat: Optional[VideoChat]

New value of video_chat

class pytdbot.types.UpdateChatViewAsTopics(chat_id=0, view_as_topics=False)[source]

Bases: TlObject, Update

A chat default appearance has changed

Parameters:
  • chat_id (int) – Chat identifier

  • view_as_topics (bool) – New value of view_as_topics

__init__(chat_id=0, view_as_topics=False)[source]
Parameters:
  • chat_id (int)

  • view_as_topics (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateChatViewAsTopics]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateChatViewAsTopics']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

view_as_topics: bool

New value of view_as_topics

class pytdbot.types.UpdateConnectionState(state=None)[source]

Bases: TlObject, Update

The connection state has changed. This update must be used only to show a human-readable description of the connection state

Parameters:

state ("types.ConnectionState") – The new connection state

__init__(state=None)[source]
Parameters:

state (ConnectionState | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateConnectionState]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateConnectionState']

to_dict()[source]
Return type:

dict

state: Union[ConnectionStateWaitingForNetwork, ConnectionStateConnectingToProxy, ConnectionStateConnecting, ConnectionStateUpdating, ConnectionStateReady, None]

The new connection state

class pytdbot.types.UpdateContactCloseBirthdays(close_birthday_users=None)[source]

Bases: TlObject, Update

The list of contacts that had birthdays recently or will have birthday soon has changed

Parameters:

close_birthday_users (List["types.CloseBirthdayUser"]) – List of contact users with close birthday

__init__(close_birthday_users=None)[source]
Parameters:

close_birthday_users (List[CloseBirthdayUser] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateContactCloseBirthdays]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateContactCloseBirthdays']

to_dict()[source]
Return type:

dict

close_birthday_users: List[CloseBirthdayUser]

List of contact users with close birthday

class pytdbot.types.UpdateDefaultBackground(for_dark_theme=False, background=None)[source]

Bases: TlObject, Update

The default background has changed

Parameters:
  • for_dark_theme (bool) – True, if default background for dark theme has changed

  • background ("types.Background") – The new default background; may be null

__init__(for_dark_theme=False, background=None)[source]
Parameters:
  • for_dark_theme (bool)

  • background (Background | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateDefaultBackground]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateDefaultBackground']

to_dict()[source]
Return type:

dict

background: Optional[Background]

The new default background; may be null

for_dark_theme: bool

True, if default background for dark theme has changed

class pytdbot.types.UpdateDefaultPaidReactionType(type=None)[source]

Bases: TlObject, Update

The type of default paid reaction has changed

Parameters:

type ("types.PaidReactionType") – The new type of the default paid reaction

__init__(type=None)[source]
Parameters:

type (PaidReactionType | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateDefaultPaidReactionType]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateDefaultPaidReactionType']

to_dict()[source]
Return type:

dict

type: Union[PaidReactionTypeRegular, PaidReactionTypeAnonymous, PaidReactionTypeChat, None]

The new type of the default paid reaction

class pytdbot.types.UpdateDefaultReactionType(reaction_type=None)[source]

Bases: TlObject, Update

The type of default reaction has changed

Parameters:

reaction_type ("types.ReactionType") – The new type of the default reaction

__init__(reaction_type=None)[source]
Parameters:

reaction_type (ReactionType | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateDefaultReactionType]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateDefaultReactionType']

to_dict()[source]
Return type:

dict

reaction_type: Union[ReactionTypeEmoji, ReactionTypeCustomEmoji, ReactionTypePaid, None]

The new type of the default reaction

class pytdbot.types.UpdateDeleteMessages(chat_id=0, message_ids=None, is_permanent=False, from_cache=False)[source]

Bases: TlObject, Update

Some messages were deleted

Parameters:
  • chat_id (int) – Chat identifier

  • message_ids (List[int]) – Identifiers of the deleted messages

  • is_permanent (bool) – True, if the messages are permanently deleted by a user (as opposed to just becoming inaccessible)

  • from_cache (bool) – True, if the messages are deleted only from the cache and can possibly be retrieved again in the future

__init__(chat_id=0, message_ids=None, is_permanent=False, from_cache=False)[source]
Parameters:
  • chat_id (int)

  • message_ids (List[int] | None)

  • is_permanent (bool)

  • from_cache (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateDeleteMessages]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateDeleteMessages']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

from_cache: bool

True, if the messages are deleted only from the cache and can possibly be retrieved again in the future

is_permanent: bool

True, if the messages are permanently deleted by a user (as opposed to just becoming inaccessible)

message_ids: List[int]

Identifiers of the deleted messages

class pytdbot.types.UpdateDiceEmojis(emojis=None)[source]

Bases: TlObject, Update

The list of supported dice emojis has changed

Parameters:

emojis (List[str]) – The new list of supported dice emojis

__init__(emojis=None)[source]
Parameters:

emojis (List[str] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateDiceEmojis]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateDiceEmojis']

to_dict()[source]
Return type:

dict

emojis: List[str]

The new list of supported dice emojis

class pytdbot.types.UpdateDirectMessagesChatTopic(topic=None)[source]

Bases: TlObject, Update

Basic information about a topic in a channel direct messages chat administered by the current user has changed. This update is guaranteed to come before the topic identifier is returned to the application

Parameters:

topic ("types.DirectMessagesChatTopic") – New data about the topic

__init__(topic=None)[source]
Parameters:

topic (DirectMessagesChatTopic | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateDirectMessagesChatTopic]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateDirectMessagesChatTopic']

to_dict()[source]
Return type:

dict

topic: Optional[DirectMessagesChatTopic]

New data about the topic

class pytdbot.types.UpdateEmojiChatThemes(chat_themes=None)[source]

Bases: TlObject, Update

The list of available emoji chat themes has changed

Parameters:

chat_themes (List["types.EmojiChatTheme"]) – The new list of emoji chat themes

__init__(chat_themes=None)[source]
Parameters:

chat_themes (List[EmojiChatTheme] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateEmojiChatThemes]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateEmojiChatThemes']

to_dict()[source]
Return type:

dict

chat_themes: List[EmojiChatTheme]

The new list of emoji chat themes

class pytdbot.types.UpdateFavoriteStickers(sticker_ids=None)[source]

Bases: TlObject, Update

The list of favorite stickers was updated

Parameters:

sticker_ids (List[int]) – The new list of file identifiers of favorite stickers

__init__(sticker_ids=None)[source]
Parameters:

sticker_ids (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateFavoriteStickers]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateFavoriteStickers']

to_dict()[source]
Return type:

dict

sticker_ids: List[int]

The new list of file identifiers of favorite stickers

class pytdbot.types.UpdateFile(file=None)[source]

Bases: TlObject, Update

Information about a file was updated

Parameters:

file ("types.File") – New data about the file

__init__(file=None)[source]
Parameters:

file (File | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateFile]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateFile']

to_dict()[source]
Return type:

dict

file: Optional[File]

New data about the file

class pytdbot.types.UpdateFileAddedToDownloads(file_download=None, counts=None)[source]

Bases: TlObject, Update

A file was added to the file download list. This update is sent only after file download list is loaded for the first time

Parameters:
  • file_download ("types.FileDownload") – The added file download

  • counts ("types.DownloadedFileCounts") – New number of being downloaded and recently downloaded files found

__init__(file_download=None, counts=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateFileAddedToDownloads]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateFileAddedToDownloads']

to_dict()[source]
Return type:

dict

counts: Optional[DownloadedFileCounts]

New number of being downloaded and recently downloaded files found

file_download: Optional[FileDownload]

The added file download

class pytdbot.types.UpdateFileDownload(file_id=0, complete_date=0, is_paused=False, counts=None)[source]

Bases: TlObject, Update

A file download was changed. This update is sent only after file download list is loaded for the first time

Parameters:
  • file_id (int) – File identifier

  • complete_date (int) – Point in time (Unix timestamp) when the file downloading was completed; 0 if the file downloading isn’t completed

  • is_paused (bool) – True, if downloading of the file is paused

  • counts ("types.DownloadedFileCounts") – New number of being downloaded and recently downloaded files found

__init__(file_id=0, complete_date=0, is_paused=False, counts=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateFileDownload]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateFileDownload']

to_dict()[source]
Return type:

dict

complete_date: int

Point in time (Unix timestamp) when the file downloading was completed; 0 if the file downloading isn’t completed

counts: Optional[DownloadedFileCounts]

New number of being downloaded and recently downloaded files found

file_id: int

File identifier

is_paused: bool

True, if downloading of the file is paused

class pytdbot.types.UpdateFileDownloads(total_size=0, total_count=0, downloaded_size=0)[source]

Bases: TlObject, Update

The state of the file download list has changed

Parameters:
  • total_size (int) – Total size of files in the file download list, in bytes

  • total_count (int) – Total number of files in the file download list

  • downloaded_size (int) – Total downloaded size of files in the file download list, in bytes

__init__(total_size=0, total_count=0, downloaded_size=0)[source]
Parameters:
  • total_size (int)

  • total_count (int)

  • downloaded_size (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateFileDownloads]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateFileDownloads']

to_dict()[source]
Return type:

dict

downloaded_size: int

Total downloaded size of files in the file download list, in bytes

total_count: int

Total number of files in the file download list

total_size: int

Total size of files in the file download list, in bytes

class pytdbot.types.UpdateFileGenerationStart(generation_id=0, original_path='', destination_path='', conversion='')[source]

Bases: TlObject, Update

The file generation process needs to be started by the application. Use setFileGenerationProgress and finishFileGeneration to generate the file

Parameters:
  • generation_id (int) – Unique identifier for the generation process

  • original_path (str) – The original path specified by the application in inputFileGenerated

  • destination_path (str) – The path to a file that must be created and where the new file must be generated by the application. If the application has no access to the path, it can use writeGeneratedFilePart to generate the file

  • conversion (str) – If the conversion is "#url#" than original_path contains an HTTP/HTTPS URL of a file that must be downloaded by the application. Otherwise, this is the conversion specified by the application in inputFileGenerated

__init__(generation_id=0, original_path='', destination_path='', conversion='')[source]
Parameters:
  • generation_id (int)

  • original_path (str)

  • destination_path (str)

  • conversion (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateFileGenerationStart]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateFileGenerationStart']

to_dict()[source]
Return type:

dict

conversion: Optional[str]

If the conversion is "#url#" than original_path contains an HTTP/HTTPS URL of a file that must be downloaded by the application. Otherwise, this is the conversion specified by the application in inputFileGenerated

destination_path: Optional[str]

The path to a file that must be created and where the new file must be generated by the application. If the application has no access to the path, it can use writeGeneratedFilePart to generate the file

generation_id: int

Unique identifier for the generation process

original_path: Optional[str]

The original path specified by the application in inputFileGenerated

class pytdbot.types.UpdateFileGenerationStop(generation_id=0)[source]

Bases: TlObject, Update

File generation is no longer needed

Parameters:

generation_id (int) – Unique identifier for the generation process

__init__(generation_id=0)[source]
Parameters:

generation_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateFileGenerationStop]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateFileGenerationStop']

to_dict()[source]
Return type:

dict

generation_id: int

Unique identifier for the generation process

class pytdbot.types.UpdateFileRemovedFromDownloads(file_id=0, counts=None)[source]

Bases: TlObject, Update

A file was removed from the file download list. This update is sent only after file download list is loaded for the first time

Parameters:
  • file_id (int) – File identifier

  • counts ("types.DownloadedFileCounts") – New number of being downloaded and recently downloaded files found

__init__(file_id=0, counts=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateFileRemovedFromDownloads]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateFileRemovedFromDownloads']

to_dict()[source]
Return type:

dict

counts: Optional[DownloadedFileCounts]

New number of being downloaded and recently downloaded files found

file_id: int

File identifier

class pytdbot.types.UpdateForumTopic(chat_id=0, message_thread_id=0, is_pinned=False, last_read_inbox_message_id=0, last_read_outbox_message_id=0, unread_mention_count=0, unread_reaction_count=0, notification_settings=None)[source]

Bases: TlObject, Update

Information about a topic in a forum chat was changed

Parameters:
  • chat_id (int) – Chat identifier

  • message_thread_id (int) – Message thread identifier of the topic

  • is_pinned (bool) – True, if the topic is pinned in the topic list

  • last_read_inbox_message_id (int) – Identifier of the last read incoming message

  • last_read_outbox_message_id (int) – Identifier of the last read outgoing message

  • unread_mention_count (int) – Number of unread messages with a mention/reply in the topic

  • unread_reaction_count (int) – Number of messages with unread reactions in the topic

  • notification_settings ("types.ChatNotificationSettings") – Notification settings for the topic

__init__(chat_id=0, message_thread_id=0, is_pinned=False, last_read_inbox_message_id=0, last_read_outbox_message_id=0, unread_mention_count=0, unread_reaction_count=0, notification_settings=None)[source]
Parameters:
  • chat_id (int)

  • message_thread_id (int)

  • is_pinned (bool)

  • last_read_inbox_message_id (int)

  • last_read_outbox_message_id (int)

  • unread_mention_count (int)

  • unread_reaction_count (int)

  • notification_settings (ChatNotificationSettings | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateForumTopic]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateForumTopic']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

is_pinned: bool

True, if the topic is pinned in the topic list

last_read_inbox_message_id: int

Identifier of the last read incoming message

last_read_outbox_message_id: int

Identifier of the last read outgoing message

message_thread_id: int

Message thread identifier of the topic

notification_settings: Optional[ChatNotificationSettings]

Notification settings for the topic

unread_mention_count: int

Number of unread messages with a mention/reply in the topic

unread_reaction_count: int

Number of messages with unread reactions in the topic

class pytdbot.types.UpdateForumTopicInfo(info=None)[source]

Bases: TlObject, Update

Basic information about a topic in a forum chat was changed

Parameters:

info ("types.ForumTopicInfo") – New information about the topic

__init__(info=None)[source]
Parameters:

info (ForumTopicInfo | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateForumTopicInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateForumTopicInfo']

to_dict()[source]
Return type:

dict

info: Optional[ForumTopicInfo]

New information about the topic

class pytdbot.types.UpdateFreezeState(is_frozen=False, freezing_date=0, deletion_date=0, appeal_link='')[source]

Bases: TlObject, Update

The freeze state of the current user’s account has changed

Parameters:
  • is_frozen (bool) – True, if the account is frozen

  • freezing_date (int) – Point in time (Unix timestamp) when the account was frozen; 0 if the account isn’t frozen

  • deletion_date (int) – Point in time (Unix timestamp) when the account will be deleted and can’t be unfrozen; 0 if the account isn’t frozen

  • appeal_link (str) – The link to open to send an appeal to unfreeze the account

__init__(is_frozen=False, freezing_date=0, deletion_date=0, appeal_link='')[source]
Parameters:
  • is_frozen (bool)

  • freezing_date (int)

  • deletion_date (int)

  • appeal_link (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateFreezeState]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateFreezeState']

to_dict()[source]
Return type:

dict

appeal_link: Optional[str]

The link to open to send an appeal to unfreeze the account

deletion_date: int

Point in time (Unix timestamp) when the account will be deleted and can’t be unfrozen; 0 if the account isn’t frozen

freezing_date: int

Point in time (Unix timestamp) when the account was frozen; 0 if the account isn’t frozen

is_frozen: bool

True, if the account is frozen

class pytdbot.types.UpdateGroupCall(group_call=None)[source]

Bases: TlObject, Update

Information about a group call was updated

Parameters:

group_call ("types.GroupCall") – New data about the group call

__init__(group_call=None)[source]
Parameters:

group_call (GroupCall | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateGroupCall]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateGroupCall']

to_dict()[source]
Return type:

dict

group_call: Optional[GroupCall]

New data about the group call

class pytdbot.types.UpdateGroupCallParticipant(group_call_id=0, participant=None)[source]

Bases: TlObject, Update

Information about a group call participant was changed. The updates are sent only after the group call is received through getGroupCall and only if the call is joined or being joined

Parameters:
  • group_call_id (int) – Identifier of the group call

  • participant ("types.GroupCallParticipant") – New data about the participant

__init__(group_call_id=0, participant=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateGroupCallParticipant]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateGroupCallParticipant']

to_dict()[source]
Return type:

dict

group_call_id: int

Identifier of the group call

participant: Optional[GroupCallParticipant]

New data about the participant

class pytdbot.types.UpdateGroupCallParticipants(group_call_id=0, participant_user_ids=None)[source]

Bases: TlObject, Update

The list of group call participants that can send and receive encrypted call data has changed; for group calls not bound to a chat only

Parameters:
  • group_call_id (int) – Identifier of the group call

  • participant_user_ids (List[int]) – New list of group call participant user identifiers. The identifiers may be invalid or the corresponding users may be unknown. The participants must be shown in the list of group call participants even if there is no information about them

__init__(group_call_id=0, participant_user_ids=None)[source]
Parameters:
  • group_call_id (int)

  • participant_user_ids (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateGroupCallParticipants]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateGroupCallParticipants']

to_dict()[source]
Return type:

dict

group_call_id: int

Identifier of the group call

participant_user_ids: List[int]

New list of group call participant user identifiers. The identifiers may be invalid or the corresponding users may be unknown. The participants must be shown in the list of group call participants even if there is no information about them

class pytdbot.types.UpdateGroupCallVerificationState(group_call_id=0, generation=0, emojis=None)[source]

Bases: TlObject, Update

The verification state of an encrypted group call has changed; for group calls not bound to a chat only

Parameters:
  • group_call_id (int) – Identifier of the group call

  • generation (int) – The call state generation to which the emoji corresponds. If generation is different for two users, then their emoji may be also different

  • emojis (List[str]) – Group call state fingerprint represented as 4 emoji; may be empty if the state isn’t verified yet

__init__(group_call_id=0, generation=0, emojis=None)[source]
Parameters:
  • group_call_id (int)

  • generation (int)

  • emojis (List[str] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateGroupCallVerificationState]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateGroupCallVerificationState']

to_dict()[source]
Return type:

dict

emojis: List[str]

Group call state fingerprint represented as 4 emoji; may be empty if the state isn’t verified yet

generation: int

The call state generation to which the emoji corresponds. If generation is different for two users, then their emoji may be also different

group_call_id: int

Identifier of the group call

class pytdbot.types.UpdateHavePendingNotifications(have_delayed_notifications=False, have_unreceived_notifications=False)[source]

Bases: TlObject, Update

Describes whether there are some pending notification updates. Can be used to prevent application from killing, while there are some pending notifications

Parameters:
  • have_delayed_notifications (bool) – True, if there are some delayed notification updates, which will be sent soon

  • have_unreceived_notifications (bool) – True, if there can be some yet unreceived notifications, which are being fetched from the server

__init__(have_delayed_notifications=False, have_unreceived_notifications=False)[source]
Parameters:
  • have_delayed_notifications (bool)

  • have_unreceived_notifications (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateHavePendingNotifications]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateHavePendingNotifications']

to_dict()[source]
Return type:

dict

have_delayed_notifications: bool

True, if there are some delayed notification updates, which will be sent soon

have_unreceived_notifications: bool

True, if there can be some yet unreceived notifications, which are being fetched from the server

class pytdbot.types.UpdateInstalledStickerSets(sticker_type=None, sticker_set_ids=None)[source]

Bases: TlObject, Update

The list of installed sticker sets was updated

Parameters:
  • sticker_type ("types.StickerType") – Type of the affected stickers

  • sticker_set_ids (List[int]) – The new list of installed ordinary sticker sets

__init__(sticker_type=None, sticker_set_ids=None)[source]
Parameters:
  • sticker_type (StickerType | None)

  • sticker_set_ids (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateInstalledStickerSets]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateInstalledStickerSets']

to_dict()[source]
Return type:

dict

sticker_set_ids: List[int]

The new list of installed ordinary sticker sets

sticker_type: Union[StickerTypeRegular, StickerTypeMask, StickerTypeCustomEmoji, None]

Type of the affected stickers

class pytdbot.types.UpdateLanguagePackStrings(localization_target='', language_pack_id='', strings=None)[source]

Bases: TlObject, Update

Some language pack strings have been updated

Parameters:
  • localization_target (str) – Localization target to which the language pack belongs

  • language_pack_id (str) – Identifier of the updated language pack

  • strings (List["types.LanguagePackString"]) – List of changed language pack strings; empty if all strings have changed

__init__(localization_target='', language_pack_id='', strings=None)[source]
Parameters:
  • localization_target (str)

  • language_pack_id (str)

  • strings (List[LanguagePackString] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateLanguagePackStrings]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateLanguagePackStrings']

to_dict()[source]
Return type:

dict

language_pack_id: Optional[str]

Identifier of the updated language pack

localization_target: Optional[str]

Localization target to which the language pack belongs

strings: List[LanguagePackString]

List of changed language pack strings; empty if all strings have changed

class pytdbot.types.UpdateMessageContent(chat_id=0, message_id=0, new_content=None)[source]

Bases: TlObject, Update

The message content has changed

Parameters:
  • chat_id (int) – Chat identifier

  • message_id (int) – Message identifier

  • new_content ("types.MessageContent") – New message content

__init__(chat_id=0, message_id=0, new_content=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateMessageContent]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateMessageContent']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

message_id: int

Message identifier

new_content: Union[MessageText, MessageAnimation, MessageAudio, MessageDocument, MessagePaidMedia, MessagePhoto, MessageSticker, MessageVideo, MessageVideoNote, MessageVoiceNote, MessageExpiredPhoto, MessageExpiredVideo, MessageExpiredVideoNote, MessageExpiredVoiceNote, MessageLocation, MessageVenue, MessageContact, MessageAnimatedEmoji, MessageDice, MessageGame, MessagePoll, MessageStory, MessageChecklist, MessageInvoice, MessageCall, MessageGroupCall, MessageVideoChatScheduled, MessageVideoChatStarted, MessageVideoChatEnded, MessageInviteVideoChatParticipants, MessageBasicGroupChatCreate, MessageSupergroupChatCreate, MessageChatChangeTitle, MessageChatChangePhoto, MessageChatDeletePhoto, MessageChatAddMembers, MessageChatJoinByLink, MessageChatJoinByRequest, MessageChatDeleteMember, MessageChatUpgradeTo, MessageChatUpgradeFrom, MessagePinMessage, MessageScreenshotTaken, MessageChatSetBackground, MessageChatSetTheme, MessageChatSetMessageAutoDeleteTime, MessageChatBoost, MessageForumTopicCreated, MessageForumTopicEdited, MessageForumTopicIsClosedToggled, MessageForumTopicIsHiddenToggled, MessageSuggestProfilePhoto, MessageCustomServiceAction, MessageGameScore, MessagePaymentSuccessful, MessagePaymentSuccessfulBot, MessagePaymentRefunded, MessageGiftedPremium, MessagePremiumGiftCode, MessageGiveawayCreated, MessageGiveaway, MessageGiveawayCompleted, MessageGiveawayWinners, MessageGiftedStars, MessageGiftedTon, MessageGiveawayPrizeStars, MessageGift, MessageUpgradedGift, MessageRefundedUpgradedGift, MessagePaidMessagesRefunded, MessagePaidMessagePriceChanged, MessageDirectMessagePriceChanged, MessageChecklistTasksDone, MessageChecklistTasksAdded, MessageSuggestedPostApprovalFailed, MessageSuggestedPostApproved, MessageSuggestedPostDeclined, MessageSuggestedPostPaid, MessageSuggestedPostRefunded, MessageContactRegistered, MessageUsersShared, MessageChatShared, MessageBotWriteAccessAllowed, MessageWebAppDataSent, MessageWebAppDataReceived, MessagePassportDataSent, MessagePassportDataReceived, MessageProximityAlertTriggered, MessageUnsupported, None]

New message content

class pytdbot.types.UpdateMessageContentOpened(chat_id=0, message_id=0)[source]

Bases: TlObject, Update

The message content was opened. Updates voice note messages to "listened", video note messages to "viewed" and starts the self-destruct timer

Parameters:
  • chat_id (int) – Chat identifier

  • message_id (int) – Message identifier

__init__(chat_id=0, message_id=0)[source]
Parameters:
  • chat_id (int)

  • message_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateMessageContentOpened]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateMessageContentOpened']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

message_id: int

Message identifier

class pytdbot.types.UpdateMessageEdited(chat_id=0, message_id=0, edit_date=0, reply_markup=None)[source]

Bases: TlObject, Update

A message was edited. Changes in the message content will come in a separate updateMessageContent

Parameters:
  • chat_id (int) – Chat identifier

  • message_id (int) – Message identifier

  • edit_date (int) – Point in time (Unix timestamp) when the message was edited

  • reply_markup ("types.ReplyMarkup") – New message reply markup; may be null

__init__(chat_id=0, message_id=0, edit_date=0, reply_markup=None)[source]
Parameters:
  • chat_id (int)

  • message_id (int)

  • edit_date (int)

  • reply_markup (ReplyMarkup | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateMessageEdited]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateMessageEdited']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

edit_date: int

Point in time (Unix timestamp) when the message was edited

message_id: int

Message identifier

reply_markup: Union[ReplyMarkupRemoveKeyboard, ReplyMarkupForceReply, ReplyMarkupShowKeyboard, ReplyMarkupInlineKeyboard, None]

New message reply markup; may be null

class pytdbot.types.UpdateMessageFactCheck(chat_id=0, message_id=0, fact_check=None)[source]

Bases: TlObject, Update

A fact-check added to a message was changed

Parameters:
  • chat_id (int) – Chat identifier

  • message_id (int) – Message identifier

  • fact_check ("types.FactCheck") – The new fact-check

__init__(chat_id=0, message_id=0, fact_check=None)[source]
Parameters:
  • chat_id (int)

  • message_id (int)

  • fact_check (FactCheck | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateMessageFactCheck]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateMessageFactCheck']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

fact_check: Optional[FactCheck]

The new fact-check

message_id: int

Message identifier

class pytdbot.types.UpdateMessageInteractionInfo(chat_id=0, message_id=0, interaction_info=None)[source]

Bases: TlObject, Update

The information about interactions with a message has changed

Parameters:
  • chat_id (int) – Chat identifier

  • message_id (int) – Message identifier

  • interaction_info ("types.MessageInteractionInfo") – New information about interactions with the message; may be null

__init__(chat_id=0, message_id=0, interaction_info=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateMessageInteractionInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateMessageInteractionInfo']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

interaction_info: Optional[MessageInteractionInfo]

New information about interactions with the message; may be null

message_id: int

Message identifier

class pytdbot.types.UpdateMessageIsPinned(chat_id=0, message_id=0, is_pinned=False)[source]

Bases: TlObject, Update

The message pinned state was changed

Parameters:
  • chat_id (int) – Chat identifier

  • message_id (int) – The message identifier

  • is_pinned (bool) – True, if the message is pinned

__init__(chat_id=0, message_id=0, is_pinned=False)[source]
Parameters:
  • chat_id (int)

  • message_id (int)

  • is_pinned (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateMessageIsPinned]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateMessageIsPinned']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

is_pinned: bool

True, if the message is pinned

message_id: int

The message identifier

class pytdbot.types.UpdateMessageLiveLocationViewed(chat_id=0, message_id=0)[source]

Bases: TlObject, Update

A message with a live location was viewed. When the update is received, the application is expected to update the live location

Parameters:
  • chat_id (int) – Identifier of the chat with the live location message

  • message_id (int) – Identifier of the message with live location

__init__(chat_id=0, message_id=0)[source]
Parameters:
  • chat_id (int)

  • message_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateMessageLiveLocationViewed]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateMessageLiveLocationViewed']

to_dict()[source]
Return type:

dict

chat_id: int

Identifier of the chat with the live location message

message_id: int

Identifier of the message with live location

class pytdbot.types.UpdateMessageMentionRead(chat_id=0, message_id=0, unread_mention_count=0)[source]

Bases: TlObject, Update

A message with an unread mention was read

Parameters:
  • chat_id (int) – Chat identifier

  • message_id (int) – Message identifier

  • unread_mention_count (int) – The new number of unread mention messages left in the chat

__init__(chat_id=0, message_id=0, unread_mention_count=0)[source]
Parameters:
  • chat_id (int)

  • message_id (int)

  • unread_mention_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateMessageMentionRead]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateMessageMentionRead']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

message_id: int

Message identifier

unread_mention_count: int

The new number of unread mention messages left in the chat

class pytdbot.types.UpdateMessageReaction(chat_id=0, message_id=0, actor_id=None, date=0, old_reaction_types=None, new_reaction_types=None)[source]

Bases: TlObject, Update

User changed its reactions on a message with public reactions; for bots only

Parameters:
  • chat_id (int) – Chat identifier

  • message_id (int) – Message identifier

  • actor_id ("types.MessageSender") – Identifier of the user or chat that changed reactions

  • date (int) – Point in time (Unix timestamp) when the reactions were changed

  • old_reaction_types (List["types.ReactionType"]) – Old list of chosen reactions

  • new_reaction_types (List["types.ReactionType"]) – New list of chosen reactions

__init__(chat_id=0, message_id=0, actor_id=None, date=0, old_reaction_types=None, new_reaction_types=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateMessageReaction]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateMessageReaction']

to_dict()[source]
Return type:

dict

actor_id: Union[MessageSenderUser, MessageSenderChat, None]

Identifier of the user or chat that changed reactions

chat_id: int

Chat identifier

date: int

Point in time (Unix timestamp) when the reactions were changed

message_id: int

Message identifier

new_reaction_types: List[ReactionType]

New list of chosen reactions

old_reaction_types: List[ReactionType]

Old list of chosen reactions

class pytdbot.types.UpdateMessageReactions(chat_id=0, message_id=0, date=0, reactions=None)[source]

Bases: TlObject, Update

Reactions added to a message with anonymous reactions have changed; for bots only

Parameters:
  • chat_id (int) – Chat identifier

  • message_id (int) – Message identifier

  • date (int) – Point in time (Unix timestamp) when the reactions were changed

  • reactions (List["types.MessageReaction"]) – The list of reactions added to the message

__init__(chat_id=0, message_id=0, date=0, reactions=None)[source]
Parameters:
  • chat_id (int)

  • message_id (int)

  • date (int)

  • reactions (List[MessageReaction] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateMessageReactions]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateMessageReactions']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

date: int

Point in time (Unix timestamp) when the reactions were changed

message_id: int

Message identifier

reactions: List[MessageReaction]

The list of reactions added to the message

class pytdbot.types.UpdateMessageSendAcknowledged(chat_id=0, message_id=0)[source]

Bases: TlObject, Update

A request to send a message has reached the Telegram server. This doesn’t mean that the message will be sent successfully. This update is sent only if the option "use_quick_ack" is set to true. This update may be sent multiple times for the same message

Parameters:
  • chat_id (int) – The chat identifier of the sent message

  • message_id (int) – A temporary message identifier

__init__(chat_id=0, message_id=0)[source]
Parameters:
  • chat_id (int)

  • message_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateMessageSendAcknowledged]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateMessageSendAcknowledged']

to_dict()[source]
Return type:

dict

chat_id: int

The chat identifier of the sent message

message_id: int

A temporary message identifier

class pytdbot.types.UpdateMessageSendFailed(message=None, old_message_id=0, error=None)[source]

Bases: TlObject, Update

A message failed to send. Be aware that some messages being sent can be irrecoverably deleted, in which case updateDeleteMessages will be received instead of this update

Parameters:
  • message ("types.Message") – The failed to send message

  • old_message_id (int) – The previous temporary message identifier

  • error ("types.Error") – The cause of the message sending failure

__init__(message=None, old_message_id=0, error=None)[source]
Parameters:
  • message (Message | None)

  • old_message_id (int)

  • error (Error | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateMessageSendFailed]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateMessageSendFailed']

to_dict()[source]
Return type:

dict

error: Optional[Error]

The cause of the message sending failure

message: Optional[Message]

The failed to send message

old_message_id: int

The previous temporary message identifier

class pytdbot.types.UpdateMessageSendSucceeded(message=None, old_message_id=0)[source]

Bases: TlObject, Update

A message has been successfully sent

Parameters:
  • message ("types.Message") – The sent message. Almost any field of the new message can be different from the corresponding field of the original message. For example, the field scheduling_state may change, making the message scheduled, or non-scheduled

  • old_message_id (int) – The previous temporary message identifier

__init__(message=None, old_message_id=0)[source]
Parameters:
  • message (Message | None)

  • old_message_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateMessageSendSucceeded]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateMessageSendSucceeded']

to_dict()[source]
Return type:

dict

message: Optional[Message]

The sent message. Almost any field of the new message can be different from the corresponding field of the original message. For example, the field scheduling_state may change, making the message scheduled, or non-scheduled

old_message_id: int

The previous temporary message identifier

class pytdbot.types.UpdateMessageSuggestedPostInfo(chat_id=0, message_id=0, suggested_post_info=None)[source]

Bases: TlObject, Update

Information about suggested post of a message was changed

Parameters:
  • chat_id (int) – Chat identifier

  • message_id (int) – Message identifier

  • suggested_post_info ("types.SuggestedPostInfo") – The new information about the suggested post

__init__(chat_id=0, message_id=0, suggested_post_info=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateMessageSuggestedPostInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateMessageSuggestedPostInfo']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

message_id: int

Message identifier

suggested_post_info: Optional[SuggestedPostInfo]

The new information about the suggested post

class pytdbot.types.UpdateMessageUnreadReactions(chat_id=0, message_id=0, unread_reactions=None, unread_reaction_count=0)[source]

Bases: TlObject, Update

The list of unread reactions added to a message was changed

Parameters:
  • chat_id (int) – Chat identifier

  • message_id (int) – Message identifier

  • unread_reactions (List["types.UnreadReaction"]) – The new list of unread reactions

  • unread_reaction_count (int) – The new number of messages with unread reactions left in the chat

__init__(chat_id=0, message_id=0, unread_reactions=None, unread_reaction_count=0)[source]
Parameters:
  • chat_id (int)

  • message_id (int)

  • unread_reactions (List[UnreadReaction] | None)

  • unread_reaction_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateMessageUnreadReactions]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateMessageUnreadReactions']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

message_id: int

Message identifier

unread_reaction_count: int

The new number of messages with unread reactions left in the chat

unread_reactions: List[UnreadReaction]

The new list of unread reactions

class pytdbot.types.UpdateNewBusinessCallbackQuery(id=0, sender_user_id=0, connection_id='', message=None, chat_instance=0, payload=None)[source]

Bases: TlObject, Update

A new incoming callback query from a business message; for bots only

Parameters:
  • id (int) – Unique query identifier

  • sender_user_id (int) – Identifier of the user who sent the query

  • connection_id (str) – Unique identifier of the business connection

  • message ("types.BusinessMessage") – The message from the business account from which the query originated

  • chat_instance (int) – An identifier uniquely corresponding to the chat a message was sent to

  • payload ("types.CallbackQueryPayload") – Query payload

__init__(id=0, sender_user_id=0, connection_id='', message=None, chat_instance=0, payload=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateNewBusinessCallbackQuery]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateNewBusinessCallbackQuery']

to_dict()[source]
Return type:

dict

chat_instance: int

An identifier uniquely corresponding to the chat a message was sent to

connection_id: Optional[str]

Unique identifier of the business connection

id: int

Unique query identifier

message: Optional[BusinessMessage]

The message from the business account from which the query originated

payload: Union[CallbackQueryPayloadData, CallbackQueryPayloadDataWithPassword, CallbackQueryPayloadGame, None]

Query payload

sender_user_id: int

Identifier of the user who sent the query

class pytdbot.types.UpdateNewBusinessMessage(connection_id='', message=None)[source]

Bases: TlObject, Update

A new message was added to a business account; for bots only

Parameters:
  • connection_id (str) – Unique identifier of the business connection

  • message ("types.BusinessMessage") – The new message

__init__(connection_id='', message=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateNewBusinessMessage]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateNewBusinessMessage']

to_dict()[source]
Return type:

dict

connection_id: Optional[str]

Unique identifier of the business connection

message: Optional[BusinessMessage]

The new message

class pytdbot.types.UpdateNewCallSignalingData(call_id=0, data=b'')[source]

Bases: TlObject, Update

New call signaling data arrived

Parameters:
  • call_id (int) – The call identifier

  • data (bytes) – The data

__init__(call_id=0, data=b'')[source]
Parameters:
  • call_id (int)

  • data (bytes)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateNewCallSignalingData]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateNewCallSignalingData']

to_dict()[source]
Return type:

dict

call_id: int

The call identifier

data: Optional[bytes]

The data

class pytdbot.types.UpdateNewCallbackQuery(id=0, sender_user_id=0, chat_id=0, message_id=0, chat_instance=0, payload=None)[source]

Bases: TlObject, Update, CallbackQueryBoundMethods

A new incoming callback query; for bots only

Parameters:
  • id (int) – Unique query identifier

  • sender_user_id (int) – Identifier of the user who sent the query

  • chat_id (int) – Identifier of the chat where the query was sent

  • message_id (int) – Identifier of the message from which the query originated

  • chat_instance (int) – Identifier that uniquely corresponds to the chat to which the message was sent

  • payload ("types.CallbackQueryPayload") – Query payload

__init__(id=0, sender_user_id=0, chat_id=0, message_id=0, chat_instance=0, payload=None)[source]
Parameters:
  • id (int)

  • sender_user_id (int)

  • chat_id (int)

  • message_id (int)

  • chat_instance (int)

  • payload (CallbackQueryPayload | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateNewCallbackQuery]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateNewCallbackQuery']

to_dict()[source]
Return type:

dict

chat_id: int

Identifier of the chat where the query was sent

chat_instance: int

Identifier that uniquely corresponds to the chat to which the message was sent

id: int

Unique query identifier

message_id: int

Identifier of the message from which the query originated

payload: Union[CallbackQueryPayloadData, CallbackQueryPayloadDataWithPassword, CallbackQueryPayloadGame, None]

Query payload

sender_user_id: int

Identifier of the user who sent the query

class pytdbot.types.UpdateNewChat(chat=None)[source]

Bases: TlObject, Update

A new chat has been loaded/created. This update is guaranteed to come before the chat identifier is returned to the application. The chat field changes will be reported through separate updates

Parameters:

chat ("types.Chat") – The chat

__init__(chat=None)[source]
Parameters:

chat (Chat | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateNewChat]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateNewChat']

to_dict()[source]
Return type:

dict

chat: Optional[Chat]

The chat

class pytdbot.types.UpdateNewChatJoinRequest(chat_id=0, request=None, user_chat_id=0, invite_link=None)[source]

Bases: TlObject, Update

A user sent a join request to a chat; for bots only

Parameters:
  • chat_id (int) – Chat identifier

  • request ("types.ChatJoinRequest") – Join request

  • user_chat_id (int) – Chat identifier of the private chat with the user

  • invite_link ("types.ChatInviteLink") – The invite link, which was used to send join request; may be null

__init__(chat_id=0, request=None, user_chat_id=0, invite_link=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateNewChatJoinRequest]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateNewChatJoinRequest']

to_dict()[source]
Return type:

dict

chat_id: int

Chat identifier

invite_link: Optional[ChatInviteLink]

The invite link, which was used to send join request; may be null

request: Optional[ChatJoinRequest]

Join request

user_chat_id: int

Chat identifier of the private chat with the user

class pytdbot.types.UpdateNewChosenInlineResult(sender_user_id=0, user_location=None, query='', result_id='', inline_message_id='')[source]

Bases: TlObject, Update

The user has chosen a result of an inline query; for bots only

Parameters:
  • sender_user_id (int) – Identifier of the user who sent the query

  • user_location ("types.Location") – User location; may be null

  • query (str) – Text of the query

  • result_id (str) – Identifier of the chosen result

  • inline_message_id (str) – Identifier of the sent inline message, if known

__init__(sender_user_id=0, user_location=None, query='', result_id='', inline_message_id='')[source]
Parameters:
  • sender_user_id (int)

  • user_location (Location | None)

  • query (str)

  • result_id (str)

  • inline_message_id (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateNewChosenInlineResult]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateNewChosenInlineResult']

to_dict()[source]
Return type:

dict

inline_message_id: Optional[str]

Identifier of the sent inline message, if known

query: Optional[str]

Text of the query

result_id: Optional[str]

Identifier of the chosen result

sender_user_id: int

Identifier of the user who sent the query

user_location: Optional[Location]

User location; may be null

class pytdbot.types.UpdateNewCustomEvent(event='')[source]

Bases: TlObject, Update

A new incoming event; for bots only

Parameters:

event (str) – A JSON-serialized event

__init__(event='')[source]
Parameters:

event (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateNewCustomEvent]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateNewCustomEvent']

to_dict()[source]
Return type:

dict

event: Optional[str]

A JSON-serialized event

class pytdbot.types.UpdateNewCustomQuery(id=0, data='', timeout=0)[source]

Bases: TlObject, Update

A new incoming query; for bots only

Parameters:
  • id (int) – The query identifier

  • data (str) – JSON-serialized query data

  • timeout (int) – Query timeout

__init__(id=0, data='', timeout=0)[source]
Parameters:
  • id (int)

  • data (str)

  • timeout (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateNewCustomQuery]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateNewCustomQuery']

to_dict()[source]
Return type:

dict

data: Optional[str]

JSON-serialized query data

id: int

The query identifier

timeout: int

Query timeout

class pytdbot.types.UpdateNewInlineCallbackQuery(id=0, sender_user_id=0, inline_message_id='', chat_instance=0, payload=None)[source]

Bases: TlObject, Update

A new incoming callback query from a message sent via a bot; for bots only

Parameters:
  • id (int) – Unique query identifier

  • sender_user_id (int) – Identifier of the user who sent the query

  • inline_message_id (str) – Identifier of the inline message from which the query originated

  • chat_instance (int) – An identifier uniquely corresponding to the chat a message was sent to

  • payload ("types.CallbackQueryPayload") – Query payload

__init__(id=0, sender_user_id=0, inline_message_id='', chat_instance=0, payload=None)[source]
Parameters:
  • id (int)

  • sender_user_id (int)

  • inline_message_id (str)

  • chat_instance (int)

  • payload (CallbackQueryPayload | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateNewInlineCallbackQuery]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateNewInlineCallbackQuery']

to_dict()[source]
Return type:

dict

chat_instance: int

An identifier uniquely corresponding to the chat a message was sent to

id: int

Unique query identifier

inline_message_id: Optional[str]

Identifier of the inline message from which the query originated

payload: Union[CallbackQueryPayloadData, CallbackQueryPayloadDataWithPassword, CallbackQueryPayloadGame, None]

Query payload

sender_user_id: int

Identifier of the user who sent the query

class pytdbot.types.UpdateNewInlineQuery(id=0, sender_user_id=0, user_location=None, chat_type=None, query='', offset='')[source]

Bases: TlObject, Update

A new incoming inline query; for bots only

Parameters:
  • id (int) – Unique query identifier

  • sender_user_id (int) – Identifier of the user who sent the query

  • user_location ("types.Location") – User location; may be null

  • chat_type ("types.ChatType") – The type of the chat from which the query originated; may be null if unknown

  • query (str) – Text of the query

  • offset (str) – Offset of the first entry to return

__init__(id=0, sender_user_id=0, user_location=None, chat_type=None, query='', offset='')[source]
Parameters:
  • id (int)

  • sender_user_id (int)

  • user_location (Location | None)

  • chat_type (ChatType | None)

  • query (str)

  • offset (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateNewInlineQuery]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateNewInlineQuery']

to_dict()[source]
Return type:

dict

chat_type: Union[ChatTypePrivate, ChatTypeBasicGroup, ChatTypeSupergroup, ChatTypeSecret, None]

The type of the chat from which the query originated; may be null if unknown

id: int

Unique query identifier

offset: Optional[str]

Offset of the first entry to return

query: Optional[str]

Text of the query

sender_user_id: int

Identifier of the user who sent the query

user_location: Optional[Location]

User location; may be null

class pytdbot.types.UpdateNewMessage(message=None)[source]

Bases: TlObject, Update

A new message was received; can also be an outgoing message

Parameters:

message ("types.Message") – The new message

__init__(message=None)[source]
Parameters:

message (Message | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateNewMessage]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateNewMessage']

to_dict()[source]
Return type:

dict

message: Optional[Message]

The new message

class pytdbot.types.UpdateNewPreCheckoutQuery(id=0, sender_user_id=0, currency='', total_amount=0, invoice_payload=b'', shipping_option_id='', order_info=None)[source]

Bases: TlObject, Update

A new incoming pre-checkout query; for bots only. Contains full information about a checkout

Parameters:
  • id (int) – Unique query identifier

  • sender_user_id (int) – Identifier of the user who sent the query

  • currency (str) – Currency for the product price

  • total_amount (int) – Total price for the product, in the smallest units of the currency

  • invoice_payload (bytes) – Invoice payload

  • shipping_option_id (str) – Identifier of a shipping option chosen by the user; may be empty if not applicable

  • order_info ("types.OrderInfo") – Information about the order; may be null

__init__(id=0, sender_user_id=0, currency='', total_amount=0, invoice_payload=b'', shipping_option_id='', order_info=None)[source]
Parameters:
  • id (int)

  • sender_user_id (int)

  • currency (str)

  • total_amount (int)

  • invoice_payload (bytes)

  • shipping_option_id (str)

  • order_info (OrderInfo | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateNewPreCheckoutQuery]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateNewPreCheckoutQuery']

to_dict()[source]
Return type:

dict

currency: Optional[str]

Currency for the product price

id: int

Unique query identifier

invoice_payload: Optional[bytes]

Invoice payload

order_info: Optional[OrderInfo]

Information about the order; may be null

sender_user_id: int

Identifier of the user who sent the query

shipping_option_id: Optional[str]

Identifier of a shipping option chosen by the user; may be empty if not applicable

total_amount: int

Total price for the product, in the smallest units of the currency

class pytdbot.types.UpdateNewShippingQuery(id=0, sender_user_id=0, invoice_payload='', shipping_address=None)[source]

Bases: TlObject, Update

A new incoming shipping query; for bots only. Only for invoices with flexible price

Parameters:
  • id (int) – Unique query identifier

  • sender_user_id (int) – Identifier of the user who sent the query

  • invoice_payload (str) – Invoice payload

  • shipping_address ("types.Address") – User shipping address

__init__(id=0, sender_user_id=0, invoice_payload='', shipping_address=None)[source]
Parameters:
  • id (int)

  • sender_user_id (int)

  • invoice_payload (str)

  • shipping_address (Address | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateNewShippingQuery]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateNewShippingQuery']

to_dict()[source]
Return type:

dict

id: int

Unique query identifier

invoice_payload: Optional[str]

Invoice payload

sender_user_id: int

Identifier of the user who sent the query

shipping_address: Optional[Address]

User shipping address

class pytdbot.types.UpdateNotification(notification_group_id=0, notification=None)[source]

Bases: TlObject, Update

A notification was changed

Parameters:
  • notification_group_id (int) – Unique notification group identifier

  • notification ("types.Notification") – Changed notification

__init__(notification_group_id=0, notification=None)[source]
Parameters:
  • notification_group_id (int)

  • notification (Notification | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateNotification]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateNotification']

to_dict()[source]
Return type:

dict

notification: Optional[Notification]

Changed notification

notification_group_id: int

Unique notification group identifier

class pytdbot.types.UpdateNotificationGroup(notification_group_id=0, type=None, chat_id=0, notification_settings_chat_id=0, notification_sound_id=0, total_count=0, added_notifications=None, removed_notification_ids=None)[source]

Bases: TlObject, Update

A list of active notifications in a notification group has changed

Parameters:
  • notification_group_id (int) – Unique notification group identifier

  • type ("types.NotificationGroupType") – New type of the notification group

  • chat_id (int) – Identifier of a chat to which all notifications in the group belong

  • notification_settings_chat_id (int) – Chat identifier, which notification settings must be applied to the added notifications

  • notification_sound_id (int) – Identifier of the notification sound to be played; 0 if sound is disabled

  • total_count (int) – Total number of unread notifications in the group, can be bigger than number of active notifications

  • added_notifications (List["types.Notification"]) – List of added group notifications, sorted by notification identifier

  • removed_notification_ids (List[int]) – Identifiers of removed group notifications, sorted by notification identifier

__init__(notification_group_id=0, type=None, chat_id=0, notification_settings_chat_id=0, notification_sound_id=0, total_count=0, added_notifications=None, removed_notification_ids=None)[source]
Parameters:
  • notification_group_id (int)

  • type (NotificationGroupType | None)

  • chat_id (int)

  • notification_settings_chat_id (int)

  • notification_sound_id (int)

  • total_count (int)

  • added_notifications (List[Notification] | None)

  • removed_notification_ids (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateNotificationGroup]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateNotificationGroup']

to_dict()[source]
Return type:

dict

added_notifications: List[Notification]

List of added group notifications, sorted by notification identifier

chat_id: int

Identifier of a chat to which all notifications in the group belong

notification_group_id: int

Unique notification group identifier

notification_settings_chat_id: int

Chat identifier, which notification settings must be applied to the added notifications

notification_sound_id: int

Identifier of the notification sound to be played; 0 if sound is disabled

removed_notification_ids: List[int]

Identifiers of removed group notifications, sorted by notification identifier

total_count: int

Total number of unread notifications in the group, can be bigger than number of active notifications

type: Union[NotificationGroupTypeMessages, NotificationGroupTypeMentions, NotificationGroupTypeSecretChat, NotificationGroupTypeCalls, None]

New type of the notification group

class pytdbot.types.UpdateOption(name='', value=None)[source]

Bases: TlObject, Update

An option changed its value

Parameters:
  • name (str) – The option name

  • value ("types.OptionValue") – The new option value

__init__(name='', value=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateOption]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateOption']

to_dict()[source]
Return type:

dict

name: Optional[str]

The option name

value: Union[OptionValueBoolean, OptionValueEmpty, OptionValueInteger, OptionValueString, None]

The new option value

class pytdbot.types.UpdateOwnedStarCount(star_amount=None)[source]

Bases: TlObject, Update

The number of Telegram Stars owned by the current user has changed

Parameters:

star_amount ("types.StarAmount") – The new amount of owned Telegram Stars

__init__(star_amount=None)[source]
Parameters:

star_amount (StarAmount | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateOwnedStarCount]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateOwnedStarCount']

to_dict()[source]
Return type:

dict

star_amount: Optional[StarAmount]

The new amount of owned Telegram Stars

class pytdbot.types.UpdateOwnedTonCount(ton_amount=0)[source]

Bases: TlObject, Update

The number of Toncoins owned by the current user has changed

Parameters:

ton_amount (int) – The new amount of owned Toncoins; in the smallest units of the cryptocurrency

__init__(ton_amount=0)[source]
Parameters:

ton_amount (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateOwnedTonCount]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateOwnedTonCount']

to_dict()[source]
Return type:

dict

ton_amount: int

The new amount of owned Toncoins; in the smallest units of the cryptocurrency

class pytdbot.types.UpdatePaidMediaPurchased(user_id=0, payload='')[source]

Bases: TlObject, Update

Paid media were purchased by a user; for bots only

Parameters:
  • user_id (int) – User identifier

  • payload (str) – Bot-specified payload for the paid media

__init__(user_id=0, payload='')[source]
Parameters:
  • user_id (int)

  • payload (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdatePaidMediaPurchased]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updatePaidMediaPurchased']

to_dict()[source]
Return type:

dict

payload: Optional[str]

Bot-specified payload for the paid media

user_id: int

User identifier

class pytdbot.types.UpdatePoll(poll=None)[source]

Bases: TlObject, Update

A poll was updated; for bots only

Parameters:

poll ("types.Poll") – New data about the poll

__init__(poll=None)[source]
Parameters:

poll (Poll | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdatePoll]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updatePoll']

to_dict()[source]
Return type:

dict

poll: Optional[Poll]

New data about the poll

class pytdbot.types.UpdatePollAnswer(poll_id=0, voter_id=None, option_ids=None)[source]

Bases: TlObject, Update

A user changed the answer to a poll; for bots only

Parameters:
  • poll_id (int) – Unique poll identifier

  • voter_id ("types.MessageSender") – Identifier of the message sender that changed the answer to the poll

  • option_ids (List[int]) – 0-based identifiers of answer options, chosen by the user

__init__(poll_id=0, voter_id=None, option_ids=None)[source]
Parameters:
  • poll_id (int)

  • voter_id (MessageSender | None)

  • option_ids (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdatePollAnswer]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updatePollAnswer']

to_dict()[source]
Return type:

dict

option_ids: List[int]

0-based identifiers of answer options, chosen by the user

poll_id: int

Unique poll identifier

voter_id: Union[MessageSenderUser, MessageSenderChat, None]

Identifier of the message sender that changed the answer to the poll

class pytdbot.types.UpdateProfileAccentColors(colors=None, available_accent_color_ids=None)[source]

Bases: TlObject, Update

The list of supported accent colors for user profiles has changed

Parameters:
  • colors (List["types.ProfileAccentColor"]) – Information about supported colors

  • available_accent_color_ids (List[int]) – The list of accent color identifiers, which can be set through setProfileAccentColor and setChatProfileAccentColor. The colors must be shown in the specified order

__init__(colors=None, available_accent_color_ids=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateProfileAccentColors]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateProfileAccentColors']

to_dict()[source]
Return type:

dict

available_accent_color_ids: List[int]

The list of accent color identifiers, which can be set through setProfileAccentColor and setChatProfileAccentColor. The colors must be shown in the specified order

colors: List[ProfileAccentColor]

Information about supported colors

class pytdbot.types.UpdateQuickReplyShortcut(shortcut=None)[source]

Bases: TlObject, Update

Basic information about a quick reply shortcut has changed. This update is guaranteed to come before the quick shortcut name is returned to the application

Parameters:

shortcut ("types.QuickReplyShortcut") – New data about the shortcut

__init__(shortcut=None)[source]
Parameters:

shortcut (QuickReplyShortcut | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateQuickReplyShortcut]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateQuickReplyShortcut']

to_dict()[source]
Return type:

dict

shortcut: Optional[QuickReplyShortcut]

New data about the shortcut

class pytdbot.types.UpdateQuickReplyShortcutDeleted(shortcut_id=0)[source]

Bases: TlObject, Update

A quick reply shortcut and all its messages were deleted

Parameters:

shortcut_id (int) – The identifier of the deleted shortcut

__init__(shortcut_id=0)[source]
Parameters:

shortcut_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateQuickReplyShortcutDeleted]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateQuickReplyShortcutDeleted']

to_dict()[source]
Return type:

dict

shortcut_id: int

The identifier of the deleted shortcut

class pytdbot.types.UpdateQuickReplyShortcutMessages(shortcut_id=0, messages=None)[source]

Bases: TlObject, Update

The list of quick reply shortcut messages has changed

Parameters:
  • shortcut_id (int) – The identifier of the shortcut

  • messages (List["types.QuickReplyMessage"]) – The new list of quick reply messages for the shortcut in order from the first to the last sent

__init__(shortcut_id=0, messages=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateQuickReplyShortcutMessages]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateQuickReplyShortcutMessages']

to_dict()[source]
Return type:

dict

messages: List[QuickReplyMessage]

The new list of quick reply messages for the shortcut in order from the first to the last sent

shortcut_id: int

The identifier of the shortcut

class pytdbot.types.UpdateQuickReplyShortcuts(shortcut_ids=None)[source]

Bases: TlObject, Update

The list of quick reply shortcuts has changed

Parameters:

shortcut_ids (List[int]) – The new list of identifiers of quick reply shortcuts

__init__(shortcut_ids=None)[source]
Parameters:

shortcut_ids (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateQuickReplyShortcuts]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateQuickReplyShortcuts']

to_dict()[source]
Return type:

dict

shortcut_ids: List[int]

The new list of identifiers of quick reply shortcuts

class pytdbot.types.UpdateReactionNotificationSettings(notification_settings=None)[source]

Bases: TlObject, Update

Notification settings for reactions were updated

Parameters:

notification_settings ("types.ReactionNotificationSettings") – The new notification settings

__init__(notification_settings=None)[source]
Parameters:

notification_settings (ReactionNotificationSettings | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateReactionNotificationSettings]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateReactionNotificationSettings']

to_dict()[source]
Return type:

dict

notification_settings: Optional[ReactionNotificationSettings]

The new notification settings

class pytdbot.types.UpdateRecentStickers(is_attached=False, sticker_ids=None)[source]

Bases: TlObject, Update

The list of recently used stickers was updated

Parameters:
  • is_attached (bool) – True, if the list of stickers attached to photo or video files was updated; otherwise, the list of sent stickers is updated

  • sticker_ids (List[int]) – The new list of file identifiers of recently used stickers

__init__(is_attached=False, sticker_ids=None)[source]
Parameters:
  • is_attached (bool)

  • sticker_ids (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateRecentStickers]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateRecentStickers']

to_dict()[source]
Return type:

dict

is_attached: bool

True, if the list of stickers attached to photo or video files was updated; otherwise, the list of sent stickers is updated

sticker_ids: List[int]

The new list of file identifiers of recently used stickers

class pytdbot.types.UpdateSavedAnimations(animation_ids=None)[source]

Bases: TlObject, Update

The list of saved animations was updated

Parameters:

animation_ids (List[int]) – The new list of file identifiers of saved animations

__init__(animation_ids=None)[source]
Parameters:

animation_ids (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateSavedAnimations]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateSavedAnimations']

to_dict()[source]
Return type:

dict

animation_ids: List[int]

The new list of file identifiers of saved animations

class pytdbot.types.UpdateSavedMessagesTags(saved_messages_topic_id=0, tags=None)[source]

Bases: TlObject, Update

Tags used in Saved Messages or a Saved Messages topic have changed

Parameters:
  • saved_messages_topic_id (int) – Identifier of Saved Messages topic which tags were changed; 0 if tags for the whole chat has changed

  • tags ("types.SavedMessagesTags") – The new tags

__init__(saved_messages_topic_id=0, tags=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateSavedMessagesTags]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateSavedMessagesTags']

to_dict()[source]
Return type:

dict

saved_messages_topic_id: int

Identifier of Saved Messages topic which tags were changed; 0 if tags for the whole chat has changed

tags: Optional[SavedMessagesTags]

The new tags

class pytdbot.types.UpdateSavedMessagesTopic(topic=None)[source]

Bases: TlObject, Update

Basic information about a Saved Messages topic has changed. This update is guaranteed to come before the topic identifier is returned to the application

Parameters:

topic ("types.SavedMessagesTopic") – New data about the topic

__init__(topic=None)[source]
Parameters:

topic (SavedMessagesTopic | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateSavedMessagesTopic]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateSavedMessagesTopic']

to_dict()[source]
Return type:

dict

topic: Optional[SavedMessagesTopic]

New data about the topic

class pytdbot.types.UpdateSavedMessagesTopicCount(topic_count=0)[source]

Bases: TlObject, Update

Number of Saved Messages topics has changed

Parameters:

topic_count (int) – Approximate total number of Saved Messages topics

__init__(topic_count=0)[source]
Parameters:

topic_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateSavedMessagesTopicCount]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateSavedMessagesTopicCount']

to_dict()[source]
Return type:

dict

topic_count: int

Approximate total number of Saved Messages topics

class pytdbot.types.UpdateSavedNotificationSounds(notification_sound_ids=None)[source]

Bases: TlObject, Update

The list of saved notification sounds was updated. This update may not be sent until information about a notification sound was requested for the first time

Parameters:

notification_sound_ids (List[int]) – The new list of identifiers of saved notification sounds

__init__(notification_sound_ids=None)[source]
Parameters:

notification_sound_ids (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateSavedNotificationSounds]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateSavedNotificationSounds']

to_dict()[source]
Return type:

dict

notification_sound_ids: List[int]

The new list of identifiers of saved notification sounds

class pytdbot.types.UpdateScheduledEvent(name='', event_id=0, payload='')[source]

Bases: object

A scheduled event

Parameters:
  • name (str) – Event name

  • event_id (int) – Unique identifier of the scheduled event

  • payload (str) – Event payload

__init__(name='', event_id=0, payload='')[source]
Parameters:
  • name (str)

  • event_id (int)

  • payload (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateScheduledEvent]

Parameters:

data (dict)

getClass()[source]
Return type:

Literal['UpdateScheduledEvent']

getType()[source]
Return type:

Literal['updateScheduledEvent']

to_dict()[source]
Return type:

dict

event_id

Unique identifier of the scheduled event

name

Event name

payload

Event payload

class pytdbot.types.UpdateScopeNotificationSettings(scope=None, notification_settings=None)[source]

Bases: TlObject, Update

Notification settings for some type of chats were updated

Parameters:
  • scope ("types.NotificationSettingsScope") – Types of chats for which notification settings were updated

  • notification_settings ("types.ScopeNotificationSettings") – The new notification settings

__init__(scope=None, notification_settings=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateScopeNotificationSettings]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateScopeNotificationSettings']

to_dict()[source]
Return type:

dict

notification_settings: Optional[ScopeNotificationSettings]

The new notification settings

scope: Union[NotificationSettingsScopePrivateChats, NotificationSettingsScopeGroupChats, NotificationSettingsScopeChannelChats, None]

Types of chats for which notification settings were updated

class pytdbot.types.UpdateSecretChat(secret_chat=None)[source]

Bases: TlObject, Update

Some data of a secret chat has changed. This update is guaranteed to come before the secret chat identifier is returned to the application

Parameters:

secret_chat ("types.SecretChat") – New data about the secret chat

__init__(secret_chat=None)[source]
Parameters:

secret_chat (SecretChat | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateSecretChat]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateSecretChat']

to_dict()[source]
Return type:

dict

secret_chat: Optional[SecretChat]

New data about the secret chat

class pytdbot.types.UpdateServiceNotification(type='', content=None)[source]

Bases: TlObject, Update

A service notification from the server was received. Upon receiving this the application must show a popup with the content of the notification

Parameters:
  • type (str) – Notification type. If type begins with "AUTH_KEY_DROP_", then two buttons "Cancel" and "Log out" must be shown under notification; if user presses the second, all local data must be destroyed using Destroy method

  • content ("types.MessageContent") – Notification content

__init__(type='', content=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateServiceNotification]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateServiceNotification']

to_dict()[source]
Return type:

dict

content: Union[MessageText, MessageAnimation, MessageAudio, MessageDocument, MessagePaidMedia, MessagePhoto, MessageSticker, MessageVideo, MessageVideoNote, MessageVoiceNote, MessageExpiredPhoto, MessageExpiredVideo, MessageExpiredVideoNote, MessageExpiredVoiceNote, MessageLocation, MessageVenue, MessageContact, MessageAnimatedEmoji, MessageDice, MessageGame, MessagePoll, MessageStory, MessageChecklist, MessageInvoice, MessageCall, MessageGroupCall, MessageVideoChatScheduled, MessageVideoChatStarted, MessageVideoChatEnded, MessageInviteVideoChatParticipants, MessageBasicGroupChatCreate, MessageSupergroupChatCreate, MessageChatChangeTitle, MessageChatChangePhoto, MessageChatDeletePhoto, MessageChatAddMembers, MessageChatJoinByLink, MessageChatJoinByRequest, MessageChatDeleteMember, MessageChatUpgradeTo, MessageChatUpgradeFrom, MessagePinMessage, MessageScreenshotTaken, MessageChatSetBackground, MessageChatSetTheme, MessageChatSetMessageAutoDeleteTime, MessageChatBoost, MessageForumTopicCreated, MessageForumTopicEdited, MessageForumTopicIsClosedToggled, MessageForumTopicIsHiddenToggled, MessageSuggestProfilePhoto, MessageCustomServiceAction, MessageGameScore, MessagePaymentSuccessful, MessagePaymentSuccessfulBot, MessagePaymentRefunded, MessageGiftedPremium, MessagePremiumGiftCode, MessageGiveawayCreated, MessageGiveaway, MessageGiveawayCompleted, MessageGiveawayWinners, MessageGiftedStars, MessageGiftedTon, MessageGiveawayPrizeStars, MessageGift, MessageUpgradedGift, MessageRefundedUpgradedGift, MessagePaidMessagesRefunded, MessagePaidMessagePriceChanged, MessageDirectMessagePriceChanged, MessageChecklistTasksDone, MessageChecklistTasksAdded, MessageSuggestedPostApprovalFailed, MessageSuggestedPostApproved, MessageSuggestedPostDeclined, MessageSuggestedPostPaid, MessageSuggestedPostRefunded, MessageContactRegistered, MessageUsersShared, MessageChatShared, MessageBotWriteAccessAllowed, MessageWebAppDataSent, MessageWebAppDataReceived, MessagePassportDataSent, MessagePassportDataReceived, MessageProximityAlertTriggered, MessageUnsupported, None]

Notification content

type: Optional[str]

Notification type. If type begins with "AUTH_KEY_DROP_", then two buttons "Cancel" and "Log out" must be shown under notification; if user presses the second, all local data must be destroyed using Destroy method

class pytdbot.types.UpdateSpeechRecognitionTrial(max_media_duration=0, weekly_count=0, left_count=0, next_reset_date=0)[source]

Bases: TlObject, Update

The parameters of speech recognition without Telegram Premium subscription has changed

Parameters:
  • max_media_duration (int) – The maximum allowed duration of media for speech recognition without Telegram Premium subscription, in seconds

  • weekly_count (int) – The total number of allowed speech recognitions per week; 0 if none

  • left_count (int) – Number of left speech recognition attempts this week

  • next_reset_date (int) – Point in time (Unix timestamp) when the weekly number of tries will reset; 0 if unknown

__init__(max_media_duration=0, weekly_count=0, left_count=0, next_reset_date=0)[source]
Parameters:
  • max_media_duration (int)

  • weekly_count (int)

  • left_count (int)

  • next_reset_date (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateSpeechRecognitionTrial]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateSpeechRecognitionTrial']

to_dict()[source]
Return type:

dict

left_count: int

Number of left speech recognition attempts this week

max_media_duration: int

The maximum allowed duration of media for speech recognition without Telegram Premium subscription, in seconds

next_reset_date: int

Point in time (Unix timestamp) when the weekly number of tries will reset; 0 if unknown

weekly_count: int

The total number of allowed speech recognitions per week; 0 if none

class pytdbot.types.UpdateSpeedLimitNotification(is_upload=False)[source]

Bases: TlObject, Update

Download or upload file speed for the user was limited, but it can be restored by subscription to Telegram Premium. The notification can be postponed until a being downloaded or uploaded file is visible to the user. Use getOption("premium_download_speedup") or getOption("premium_upload_speedup") to get expected speedup after subscription to Telegram Premium

Parameters:

is_upload (bool) – True, if upload speed was limited; false, if download speed was limited

__init__(is_upload=False)[source]
Parameters:

is_upload (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateSpeedLimitNotification]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateSpeedLimitNotification']

to_dict()[source]
Return type:

dict

is_upload: bool

True, if upload speed was limited; false, if download speed was limited

class pytdbot.types.UpdateStarRevenueStatus(owner_id=None, status=None)[source]

Bases: TlObject, Update

The Telegram Star revenue earned by a user or a chat has changed. If Telegram Star transaction screen of the chat is opened, then getStarTransactions may be called to fetch new transactions

Parameters:
  • owner_id ("types.MessageSender") – Identifier of the owner of the Telegram Stars

  • status ("types.StarRevenueStatus") – New Telegram Star revenue status

__init__(owner_id=None, status=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateStarRevenueStatus]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateStarRevenueStatus']

to_dict()[source]
Return type:

dict

owner_id: Union[MessageSenderUser, MessageSenderChat, None]

Identifier of the owner of the Telegram Stars

status: Optional[StarRevenueStatus]

New Telegram Star revenue status

class pytdbot.types.UpdateStickerSet(sticker_set=None)[source]

Bases: TlObject, Update

A sticker set has changed

Parameters:

sticker_set ("types.StickerSet") – The sticker set

__init__(sticker_set=None)[source]
Parameters:

sticker_set (StickerSet | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateStickerSet]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateStickerSet']

to_dict()[source]
Return type:

dict

sticker_set: Optional[StickerSet]

The sticker set

class pytdbot.types.UpdateStory(story=None)[source]

Bases: TlObject, Update

A story was changed

Parameters:

story ("types.Story") – The new information about the story

__init__(story=None)[source]
Parameters:

story (Story | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateStory]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateStory']

to_dict()[source]
Return type:

dict

story: Optional[Story]

The new information about the story

class pytdbot.types.UpdateStoryDeleted(story_poster_chat_id=0, story_id=0)[source]

Bases: TlObject, Update

A story became inaccessible

Parameters:
  • story_poster_chat_id (int) – Identifier of the chat that posted the story

  • story_id (int) – Story identifier

__init__(story_poster_chat_id=0, story_id=0)[source]
Parameters:
  • story_poster_chat_id (int)

  • story_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateStoryDeleted]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateStoryDeleted']

to_dict()[source]
Return type:

dict

story_id: int

Story identifier

story_poster_chat_id: int

Identifier of the chat that posted the story

class pytdbot.types.UpdateStoryListChatCount(story_list=None, chat_count=0)[source]

Bases: TlObject, Update

Number of chats in a story list has changed

Parameters:
  • story_list ("types.StoryList") – The story list

  • chat_count (int) – Approximate total number of chats with active stories in the list

__init__(story_list=None, chat_count=0)[source]
Parameters:
  • story_list (StoryList | None)

  • chat_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateStoryListChatCount]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateStoryListChatCount']

to_dict()[source]
Return type:

dict

chat_count: int

Approximate total number of chats with active stories in the list

story_list: Union[StoryListMain, StoryListArchive, None]

The story list

class pytdbot.types.UpdateStoryPostFailed(story=None, error=None, error_type=None)[source]

Bases: TlObject, Update

A story failed to post. If the story posting is canceled, then updateStoryDeleted will be received instead of this update

Parameters:
  • story ("types.Story") – The failed to post story

  • error ("types.Error") – The cause of the story posting failure

  • error_type ("types.CanPostStoryResult") – Type of the error; may be null if unknown

__init__(story=None, error=None, error_type=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateStoryPostFailed]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateStoryPostFailed']

to_dict()[source]
Return type:

dict

error: Optional[Error]

The cause of the story posting failure

error_type: Union[CanPostStoryResultOk, CanPostStoryResultPremiumNeeded, CanPostStoryResultBoostNeeded, CanPostStoryResultActiveStoryLimitExceeded, CanPostStoryResultWeeklyLimitExceeded, CanPostStoryResultMonthlyLimitExceeded, None]

Type of the error; may be null if unknown

story: Optional[Story]

The failed to post story

class pytdbot.types.UpdateStoryPostSucceeded(story=None, old_story_id=0)[source]

Bases: TlObject, Update

A story has been successfully posted

Parameters:
  • story ("types.Story") – The posted story

  • old_story_id (int) – The previous temporary story identifier

__init__(story=None, old_story_id=0)[source]
Parameters:
  • story (Story | None)

  • old_story_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateStoryPostSucceeded]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateStoryPostSucceeded']

to_dict()[source]
Return type:

dict

old_story_id: int

The previous temporary story identifier

story: Optional[Story]

The posted story

class pytdbot.types.UpdateStoryStealthMode(active_until_date=0, cooldown_until_date=0)[source]

Bases: TlObject, Update

Story stealth mode settings have changed

Parameters:
  • active_until_date (int) – Point in time (Unix timestamp) until stealth mode is active; 0 if it is disabled

  • cooldown_until_date (int) – Point in time (Unix timestamp) when stealth mode can be enabled again; 0 if there is no active cooldown

__init__(active_until_date=0, cooldown_until_date=0)[source]
Parameters:
  • active_until_date (int)

  • cooldown_until_date (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateStoryStealthMode]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateStoryStealthMode']

to_dict()[source]
Return type:

dict

active_until_date: int

Point in time (Unix timestamp) until stealth mode is active; 0 if it is disabled

cooldown_until_date: int

Point in time (Unix timestamp) when stealth mode can be enabled again; 0 if there is no active cooldown

class pytdbot.types.UpdateSuggestedActions(added_actions=None, removed_actions=None)[source]

Bases: TlObject, Update

The list of suggested to the user actions has changed

Parameters:
  • added_actions (List["types.SuggestedAction"]) – Added suggested actions

  • removed_actions (List["types.SuggestedAction"]) – Removed suggested actions

__init__(added_actions=None, removed_actions=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateSuggestedActions]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateSuggestedActions']

to_dict()[source]
Return type:

dict

added_actions: List[SuggestedAction]

Added suggested actions

removed_actions: List[SuggestedAction]

Removed suggested actions

class pytdbot.types.UpdateSupergroup(supergroup=None)[source]

Bases: TlObject, Update

Some data of a supergroup or a channel has changed. This update is guaranteed to come before the supergroup identifier is returned to the application

Parameters:

supergroup ("types.Supergroup") – New data about the supergroup

__init__(supergroup=None)[source]
Parameters:

supergroup (Supergroup | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateSupergroup]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateSupergroup']

to_dict()[source]
Return type:

dict

supergroup: Optional[Supergroup]

New data about the supergroup

class pytdbot.types.UpdateSupergroupFullInfo(supergroup_id=0, supergroup_full_info=None)[source]

Bases: TlObject, Update

Some data in supergroupFullInfo has been changed

Parameters:
  • supergroup_id (int) – Identifier of the supergroup or channel

  • supergroup_full_info ("types.SupergroupFullInfo") – New full information about the supergroup

__init__(supergroup_id=0, supergroup_full_info=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateSupergroupFullInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateSupergroupFullInfo']

to_dict()[source]
Return type:

dict

supergroup_full_info: Optional[SupergroupFullInfo]

New full information about the supergroup

supergroup_id: int

Identifier of the supergroup or channel

class pytdbot.types.UpdateTermsOfService(terms_of_service_id='', terms_of_service=None)[source]

Bases: TlObject, Update

New terms of service must be accepted by the user. If the terms of service are declined, then the deleteAccount method must be called with the reason "Decline ToS update"

Parameters:
  • terms_of_service_id (str) – Identifier of the terms of service

  • terms_of_service ("types.TermsOfService") – The new terms of service

__init__(terms_of_service_id='', terms_of_service=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateTermsOfService]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateTermsOfService']

to_dict()[source]
Return type:

dict

terms_of_service: Optional[TermsOfService]

The new terms of service

terms_of_service_id: Optional[str]

Identifier of the terms of service

class pytdbot.types.UpdateTonRevenueStatus(status=None)[source]

Bases: TlObject, Update

The Toncoin revenue earned by the current user has changed. If Toncoin transaction screen of the chat is opened, then getTonTransactions may be called to fetch new transactions

Parameters:

status ("types.TonRevenueStatus") – New Toncoin revenue status

__init__(status=None)[source]
Parameters:

status (TonRevenueStatus | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateTonRevenueStatus]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateTonRevenueStatus']

to_dict()[source]
Return type:

dict

status: Optional[TonRevenueStatus]

New Toncoin revenue status

class pytdbot.types.UpdateTopicMessageCount(chat_id=0, topic_id=None, message_count=0)[source]

Bases: TlObject, Update

Number of messages in a topic has changed; for Saved Messages and channel direct messages chat topics only

Parameters:
  • chat_id (int) – Identifier of the chat in topic of which the number of messages has changed

  • topic_id ("types.MessageTopic") – Identifier of the topic

  • message_count (int) – Approximate number of messages in the topic

__init__(chat_id=0, topic_id=None, message_count=0)[source]
Parameters:
  • chat_id (int)

  • topic_id (MessageTopic | None)

  • message_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateTopicMessageCount]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateTopicMessageCount']

to_dict()[source]
Return type:

dict

chat_id: int

Identifier of the chat in topic of which the number of messages has changed

message_count: int

Approximate number of messages in the topic

topic_id: Union[MessageTopicForum, MessageTopicDirectMessages, MessageTopicSavedMessages, None]

Identifier of the topic

class pytdbot.types.UpdateTrendingStickerSets(sticker_type=None, sticker_sets=None)[source]

Bases: TlObject, Update

The list of trending sticker sets was updated or some of them were viewed

Parameters:
  • sticker_type ("types.StickerType") – Type of the affected stickers

  • sticker_sets ("types.TrendingStickerSets") – The prefix of the list of trending sticker sets with the newest trending sticker sets

__init__(sticker_type=None, sticker_sets=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateTrendingStickerSets]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateTrendingStickerSets']

to_dict()[source]
Return type:

dict

sticker_sets: Optional[TrendingStickerSets]

The prefix of the list of trending sticker sets with the newest trending sticker sets

sticker_type: Union[StickerTypeRegular, StickerTypeMask, StickerTypeCustomEmoji, None]

Type of the affected stickers

class pytdbot.types.UpdateUnconfirmedSession(session=None)[source]

Bases: TlObject, Update

The first unconfirmed session has changed

Parameters:

session ("types.UnconfirmedSession") – The unconfirmed session; may be null if none

__init__(session=None)[source]
Parameters:

session (UnconfirmedSession | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateUnconfirmedSession]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateUnconfirmedSession']

to_dict()[source]
Return type:

dict

session: Optional[UnconfirmedSession]

The unconfirmed session; may be null if none

class pytdbot.types.UpdateUnreadChatCount(chat_list=None, total_count=0, unread_count=0, unread_unmuted_count=0, marked_as_unread_count=0, marked_as_unread_unmuted_count=0)[source]

Bases: TlObject, Update

Number of unread chats, i.e. with unread messages or marked as unread, has changed. This update is sent only if the message database is used

Parameters:
  • chat_list ("types.ChatList") – The chat list with changed number of unread messages

  • total_count (int) – Approximate total number of chats in the chat list

  • unread_count (int) – Total number of unread chats

  • unread_unmuted_count (int) – Total number of unread unmuted chats

  • marked_as_unread_count (int) – Total number of chats marked as unread

  • marked_as_unread_unmuted_count (int) – Total number of unmuted chats marked as unread

__init__(chat_list=None, total_count=0, unread_count=0, unread_unmuted_count=0, marked_as_unread_count=0, marked_as_unread_unmuted_count=0)[source]
Parameters:
  • chat_list (ChatList | None)

  • total_count (int)

  • unread_count (int)

  • unread_unmuted_count (int)

  • marked_as_unread_count (int)

  • marked_as_unread_unmuted_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateUnreadChatCount]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateUnreadChatCount']

to_dict()[source]
Return type:

dict

chat_list: Union[ChatListMain, ChatListArchive, ChatListFolder, None]

The chat list with changed number of unread messages

marked_as_unread_count: int

Total number of chats marked as unread

marked_as_unread_unmuted_count: int

Total number of unmuted chats marked as unread

total_count: int

Approximate total number of chats in the chat list

unread_count: int

Total number of unread chats

unread_unmuted_count: int

Total number of unread unmuted chats

class pytdbot.types.UpdateUnreadMessageCount(chat_list=None, unread_count=0, unread_unmuted_count=0)[source]

Bases: TlObject, Update

Number of unread messages in a chat list has changed. This update is sent only if the message database is used

Parameters:
  • chat_list ("types.ChatList") – The chat list with changed number of unread messages

  • unread_count (int) – Total number of unread messages

  • unread_unmuted_count (int) – Total number of unread messages in unmuted chats

__init__(chat_list=None, unread_count=0, unread_unmuted_count=0)[source]
Parameters:
  • chat_list (ChatList | None)

  • unread_count (int)

  • unread_unmuted_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateUnreadMessageCount]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateUnreadMessageCount']

to_dict()[source]
Return type:

dict

chat_list: Union[ChatListMain, ChatListArchive, ChatListFolder, None]

The chat list with changed number of unread messages

unread_count: int

Total number of unread messages

unread_unmuted_count: int

Total number of unread messages in unmuted chats

class pytdbot.types.UpdateUser(user=None)[source]

Bases: TlObject, Update

Some data of a user has changed. This update is guaranteed to come before the user identifier is returned to the application

Parameters:

user ("types.User") – New data about the user

__init__(user=None)[source]
Parameters:

user (User | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateUser]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateUser']

to_dict()[source]
Return type:

dict

user: Optional[User]

New data about the user

class pytdbot.types.UpdateUserFullInfo(user_id=0, user_full_info=None)[source]

Bases: TlObject, Update

Some data in userFullInfo has been changed

Parameters:
  • user_id (int) – User identifier

  • user_full_info ("types.UserFullInfo") – New full information about the user

__init__(user_id=0, user_full_info=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateUserFullInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateUserFullInfo']

to_dict()[source]
Return type:

dict

user_full_info: Optional[UserFullInfo]

New full information about the user

user_id: int

User identifier

class pytdbot.types.UpdateUserPrivacySettingRules(setting=None, rules=None)[source]

Bases: TlObject, Update

Some privacy setting rules have been changed

Parameters:
  • setting ("types.UserPrivacySetting") – The privacy setting

  • rules ("types.UserPrivacySettingRules") – New privacy rules

__init__(setting=None, rules=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateUserPrivacySettingRules]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateUserPrivacySettingRules']

to_dict()[source]
Return type:

dict

rules: Optional[UserPrivacySettingRules]

New privacy rules

setting: Union[UserPrivacySettingShowStatus, UserPrivacySettingShowProfilePhoto, UserPrivacySettingShowLinkInForwardedMessages, UserPrivacySettingShowPhoneNumber, UserPrivacySettingShowBio, UserPrivacySettingShowBirthdate, UserPrivacySettingAllowChatInvites, UserPrivacySettingAllowCalls, UserPrivacySettingAllowPeerToPeerCalls, UserPrivacySettingAllowFindingByPhoneNumber, UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages, UserPrivacySettingAutosaveGifts, UserPrivacySettingAllowUnpaidMessages, None]

The privacy setting

class pytdbot.types.UpdateUserStatus(user_id=0, status=None)[source]

Bases: TlObject, Update

The user went online or offline

Parameters:
  • user_id (int) – User identifier

  • status ("types.UserStatus") – New status of the user

__init__(user_id=0, status=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateUserStatus]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateUserStatus']

to_dict()[source]
Return type:

dict

status: Union[UserStatusEmpty, UserStatusOnline, UserStatusOffline, UserStatusRecently, UserStatusLastWeek, UserStatusLastMonth, None]

New status of the user

user_id: int

User identifier

class pytdbot.types.UpdateVideoPublished(chat_id=0, message_id=0)[source]

Bases: TlObject, Update

An automatically scheduled message with video has been successfully sent after conversion

Parameters:
  • chat_id (int) – Identifier of the chat with the message

  • message_id (int) – Identifier of the sent message

__init__(chat_id=0, message_id=0)[source]
Parameters:
  • chat_id (int)

  • message_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateVideoPublished]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateVideoPublished']

to_dict()[source]
Return type:

dict

chat_id: int

Identifier of the chat with the message

message_id: int

Identifier of the sent message

class pytdbot.types.UpdateWebAppMessageSent(web_app_launch_id=0)[source]

Bases: TlObject, Update

A message was sent by an opened Web App, so the Web App needs to be closed

Parameters:

web_app_launch_id (int) – Identifier of Web App launch

__init__(web_app_launch_id=0)[source]
Parameters:

web_app_launch_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpdateWebAppMessageSent]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Update']

classmethod getType()[source]
Return type:

Literal['updateWebAppMessageSent']

to_dict()[source]
Return type:

dict

web_app_launch_id: int

Identifier of Web App launch

class pytdbot.types.Updates(updates=None)[source]

Bases: TlObject

Contains a list of updates

Parameters:

updates (List["types.Update"]) – List of updates

__init__(updates=None)[source]
Parameters:

updates (List[Update] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Updates]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Updates']

classmethod getType()[source]
Return type:

Literal['updates']

to_dict()[source]
Return type:

dict

updates: List[Update]

List of updates

class pytdbot.types.UpgradeGiftResult(gift=None, received_gift_id='', is_saved=False, can_be_transferred=False, transfer_star_count=0, next_transfer_date=0, next_resale_date=0, export_date=0)[source]

Bases: TlObject

Contains result of gift upgrading

Parameters:
  • gift ("types.UpgradedGift") – The upgraded gift

  • received_gift_id (str) – Unique identifier of the received gift for the current user

  • is_saved (bool) – True, if the gift is displayed on the user’s or the channel’s profile page

  • can_be_transferred (bool) – True, if the gift can be transferred to another owner

  • transfer_star_count (int) – Number of Telegram Stars that must be paid to transfer the upgraded gift

  • next_transfer_date (int) – Point in time (Unix timestamp) when the gift can be transferred to another owner; can be in the past; 0 if the gift can be transferred immediately or transfer isn’t possible

  • next_resale_date (int) – Point in time (Unix timestamp) when the gift can be resold to another user; can be in the past; 0 if the gift can’t be resold; only for the receiver of the gift

  • export_date (int) – Point in time (Unix timestamp) when the gift can be transferred to the TON blockchain as an NFT; can be in the past

__init__(gift=None, received_gift_id='', is_saved=False, can_be_transferred=False, transfer_star_count=0, next_transfer_date=0, next_resale_date=0, export_date=0)[source]
Parameters:
  • gift (UpgradedGift | None)

  • received_gift_id (str)

  • is_saved (bool)

  • can_be_transferred (bool)

  • transfer_star_count (int)

  • next_transfer_date (int)

  • next_resale_date (int)

  • export_date (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpgradeGiftResult]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UpgradeGiftResult']

classmethod getType()[source]
Return type:

Literal['upgradeGiftResult']

to_dict()[source]
Return type:

dict

can_be_transferred: bool

True, if the gift can be transferred to another owner

export_date: int

Point in time (Unix timestamp) when the gift can be transferred to the TON blockchain as an NFT; can be in the past

gift: Optional[UpgradedGift]

The upgraded gift

is_saved: bool

True, if the gift is displayed on the user’s or the channel’s profile page

next_resale_date: int

Point in time (Unix timestamp) when the gift can be resold to another user; can be in the past; 0 if the gift can’t be resold; only for the receiver of the gift

next_transfer_date: int

Point in time (Unix timestamp) when the gift can be transferred to another owner; can be in the past; 0 if the gift can be transferred immediately or transfer isn’t possible

received_gift_id: Optional[str]

Unique identifier of the received gift for the current user

transfer_star_count: int

Number of Telegram Stars that must be paid to transfer the upgraded gift

class pytdbot.types.UpgradedGift(id=0, regular_gift_id=0, publisher_chat_id=0, title='', name='', number=0, total_upgraded_count=0, max_upgraded_count=0, is_premium=False, is_theme_available=False, used_theme_chat_id=0, owner_id=None, owner_address='', owner_name='', gift_address='', model=None, symbol=None, backdrop=None, original_details=None, resale_parameters=None, value_currency='', value_amount=0)[source]

Bases: TlObject

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

Parameters:
  • id (int) – Unique identifier of the gift

  • regular_gift_id (int) – Unique identifier of the regular gift from which the gift was upgraded; may be 0 for short period of time for old gifts from database

  • publisher_chat_id (int) – Identifier of the chat that published the gift; 0 if none

  • title (str) – The title of the upgraded gift

  • name (str) – Unique name of the upgraded gift that can be used with internalLinkTypeUpgradedGift or sendResoldGift

  • number (int) – Unique number of the upgraded gift among gifts upgraded from the same gift

  • total_upgraded_count (int) – Total number of gifts that were upgraded from the same gift

  • max_upgraded_count (int) – The maximum number of gifts that can be upgraded from the same gift

  • is_premium (bool) – True, if the original gift could have been bought only by Telegram Premium subscribers

  • is_theme_available (bool) – True, if the gift can be used to set a theme in a chat

  • used_theme_chat_id (int) – Identifier of the chat for which the gift is used to set a theme; 0 if none or the gift isn’t owned by the current user

  • owner_id ("types.MessageSender") – Identifier of the user or the chat that owns the upgraded gift; may be null if none or unknown

  • owner_address (str) – Address of the gift NFT owner in TON blockchain; may be empty if none. Append the address to getOption("ton_blockchain_explorer_url") to get a link with information about the address

  • owner_name (str) – Name of the owner for the case when owner identifier and address aren’t known

  • gift_address (str) – Address of the gift NFT in TON blockchain; may be empty if none. Append the address to getOption("ton_blockchain_explorer_url") to get a link with information about the address

  • model ("types.UpgradedGiftModel") – Model of the upgraded gift

  • symbol ("types.UpgradedGiftSymbol") – Symbol of the upgraded gift

  • backdrop ("types.UpgradedGiftBackdrop") – Backdrop of the upgraded gift

  • original_details ("types.UpgradedGiftOriginalDetails") – Information about the originally sent gift; may be null if unknown

  • resale_parameters ("types.GiftResaleParameters") – Resale parameters of the gift; may be null if resale isn’t possible

  • value_currency (str) – ISO 4217 currency code of the currency in which value of the gift is represented; may be empty if unavailable

  • value_amount (int) – Estimated value of the gift; in the smallest units of the currency; 0 if unavailable

__init__(id=0, regular_gift_id=0, publisher_chat_id=0, title='', name='', number=0, total_upgraded_count=0, max_upgraded_count=0, is_premium=False, is_theme_available=False, used_theme_chat_id=0, owner_id=None, owner_address='', owner_name='', gift_address='', model=None, symbol=None, backdrop=None, original_details=None, resale_parameters=None, value_currency='', value_amount=0)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpgradedGift]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UpgradedGift']

classmethod getType()[source]
Return type:

Literal['upgradedGift']

to_dict()[source]
Return type:

dict

backdrop: Optional[UpgradedGiftBackdrop]

Backdrop of the upgraded gift

gift_address: Optional[str]

Address of the gift NFT in TON blockchain; may be empty if none. Append the address to getOption("ton_blockchain_explorer_url") to get a link with information about the address

id: int

Unique identifier of the gift

is_premium: bool

True, if the original gift could have been bought only by Telegram Premium subscribers

is_theme_available: bool

True, if the gift can be used to set a theme in a chat

max_upgraded_count: int

The maximum number of gifts that can be upgraded from the same gift

model: Optional[UpgradedGiftModel]

Model of the upgraded gift

name: Optional[str]

Unique name of the upgraded gift that can be used with internalLinkTypeUpgradedGift or sendResoldGift

number: int

Unique number of the upgraded gift among gifts upgraded from the same gift

original_details: Optional[UpgradedGiftOriginalDetails]

Information about the originally sent gift; may be null if unknown

owner_address: Optional[str]

Address of the gift NFT owner in TON blockchain; may be empty if none. Append the address to getOption("ton_blockchain_explorer_url") to get a link with information about the address

owner_id: Union[MessageSenderUser, MessageSenderChat, None]

Identifier of the user or the chat that owns the upgraded gift; may be null if none or unknown

owner_name: Optional[str]

Name of the owner for the case when owner identifier and address aren’t known

publisher_chat_id: int

Identifier of the chat that published the gift; 0 if none

regular_gift_id: int

Unique identifier of the regular gift from which the gift was upgraded; may be 0 for short period of time for old gifts from database

resale_parameters: Optional[GiftResaleParameters]

Resale parameters of the gift; may be null if resale isn’t possible

symbol: Optional[UpgradedGiftSymbol]

Symbol of the upgraded gift

title: Optional[str]

The title of the upgraded gift

total_upgraded_count: int

Total number of gifts that were upgraded from the same gift

used_theme_chat_id: int

Identifier of the chat for which the gift is used to set a theme; 0 if none or the gift isn’t owned by the current user

value_amount: int

Estimated value of the gift; in the smallest units of the currency; 0 if unavailable

value_currency: Optional[str]

ISO 4217 currency code of the currency in which value of the gift is represented; may be empty if unavailable

class pytdbot.types.UpgradedGiftAttributeId[source]

Bases: object

Contains identifier of an upgraded gift attribute to search for

class pytdbot.types.UpgradedGiftAttributeIdBackdrop(backdrop_id=0)[source]

Bases: TlObject, UpgradedGiftAttributeId

Identifier of a gift backdrop

Parameters:

backdrop_id (int) – Identifier of the backdrop

__init__(backdrop_id=0)[source]
Parameters:

backdrop_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpgradedGiftAttributeIdBackdrop]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UpgradedGiftAttributeId']

classmethod getType()[source]
Return type:

Literal['upgradedGiftAttributeIdBackdrop']

to_dict()[source]
Return type:

dict

backdrop_id: int

Identifier of the backdrop

class pytdbot.types.UpgradedGiftAttributeIdModel(sticker_id=0)[source]

Bases: TlObject, UpgradedGiftAttributeId

Identifier of a gift model

Parameters:

sticker_id (int) – Identifier of the sticker representing the model

__init__(sticker_id=0)[source]
Parameters:

sticker_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpgradedGiftAttributeIdModel]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UpgradedGiftAttributeId']

classmethod getType()[source]
Return type:

Literal['upgradedGiftAttributeIdModel']

to_dict()[source]
Return type:

dict

sticker_id: int

Identifier of the sticker representing the model

class pytdbot.types.UpgradedGiftAttributeIdSymbol(sticker_id=0)[source]

Bases: TlObject, UpgradedGiftAttributeId

Identifier of a gift symbol

Parameters:

sticker_id (int) – Identifier of the sticker representing the symbol

__init__(sticker_id=0)[source]
Parameters:

sticker_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpgradedGiftAttributeIdSymbol]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UpgradedGiftAttributeId']

classmethod getType()[source]
Return type:

Literal['upgradedGiftAttributeIdSymbol']

to_dict()[source]
Return type:

dict

sticker_id: int

Identifier of the sticker representing the symbol

class pytdbot.types.UpgradedGiftBackdrop(id=0, name='', colors=None, rarity_per_mille=0)[source]

Bases: TlObject

Describes a backdrop of an upgraded gift

Parameters:
  • id (int) – Unique identifier of the backdrop

  • name (str) – Name of the backdrop

  • colors ("types.UpgradedGiftBackdropColors") – Colors of the backdrop

  • rarity_per_mille (int) – The number of upgraded gifts that receive this backdrop for each 1000 gifts upgraded

__init__(id=0, name='', colors=None, rarity_per_mille=0)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpgradedGiftBackdrop]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UpgradedGiftBackdrop']

classmethod getType()[source]
Return type:

Literal['upgradedGiftBackdrop']

to_dict()[source]
Return type:

dict

colors: Optional[UpgradedGiftBackdropColors]

Colors of the backdrop

id: int

Unique identifier of the backdrop

name: Optional[str]

Name of the backdrop

rarity_per_mille: int

The number of upgraded gifts that receive this backdrop for each 1000 gifts upgraded

class pytdbot.types.UpgradedGiftBackdropColors(center_color=0, edge_color=0, symbol_color=0, text_color=0)[source]

Bases: TlObject

Describes colors of a backdrop of an upgraded gift

Parameters:
  • center_color (int) – A color in the center of the backdrop in the RGB format

  • edge_color (int) – A color on the edges of the backdrop in the RGB format

  • symbol_color (int) – A color to be applied for the symbol in the RGB format

  • text_color (int) – A color for the text on the backdrop in the RGB format

__init__(center_color=0, edge_color=0, symbol_color=0, text_color=0)[source]
Parameters:
  • center_color (int)

  • edge_color (int)

  • symbol_color (int)

  • text_color (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpgradedGiftBackdropColors]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UpgradedGiftBackdropColors']

classmethod getType()[source]
Return type:

Literal['upgradedGiftBackdropColors']

to_dict()[source]
Return type:

dict

center_color: int

A color in the center of the backdrop in the RGB format

edge_color: int

A color on the edges of the backdrop in the RGB format

symbol_color: int

A color to be applied for the symbol in the RGB format

text_color: int

A color for the text on the backdrop in the RGB format

class pytdbot.types.UpgradedGiftBackdropCount(backdrop=None, total_count=0)[source]

Bases: TlObject

Describes a backdrop of an upgraded gift

Parameters:
  • backdrop ("types.UpgradedGiftBackdrop") – The backdrop

  • total_count (int) – Total number of gifts with the symbol

__init__(backdrop=None, total_count=0)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpgradedGiftBackdropCount]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UpgradedGiftBackdropCount']

classmethod getType()[source]
Return type:

Literal['upgradedGiftBackdropCount']

to_dict()[source]
Return type:

dict

backdrop: Optional[UpgradedGiftBackdrop]

The backdrop

total_count: int

Total number of gifts with the symbol

class pytdbot.types.UpgradedGiftModel(name='', sticker=None, rarity_per_mille=0)[source]

Bases: TlObject

Describes a model of an upgraded gift

Parameters:
  • name (str) – Name of the model

  • sticker ("types.Sticker") – The sticker representing the upgraded gift

  • rarity_per_mille (int) – The number of upgraded gifts that receive this model for each 1000 gifts upgraded

__init__(name='', sticker=None, rarity_per_mille=0)[source]
Parameters:
  • name (str)

  • sticker (Sticker | None)

  • rarity_per_mille (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpgradedGiftModel]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UpgradedGiftModel']

classmethod getType()[source]
Return type:

Literal['upgradedGiftModel']

to_dict()[source]
Return type:

dict

name: Optional[str]

Name of the model

rarity_per_mille: int

The number of upgraded gifts that receive this model for each 1000 gifts upgraded

sticker: Optional[Sticker]

The sticker representing the upgraded gift

class pytdbot.types.UpgradedGiftModelCount(model=None, total_count=0)[source]

Bases: TlObject

Describes a model of an upgraded gift with the number of gifts found

Parameters:
  • model ("types.UpgradedGiftModel") – The model

  • total_count (int) – Total number of gifts with the model

__init__(model=None, total_count=0)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpgradedGiftModelCount]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UpgradedGiftModelCount']

classmethod getType()[source]
Return type:

Literal['upgradedGiftModelCount']

to_dict()[source]
Return type:

dict

model: Optional[UpgradedGiftModel]

The model

total_count: int

Total number of gifts with the model

class pytdbot.types.UpgradedGiftOrigin[source]

Bases: object

Describes origin from which the upgraded gift was obtained

class pytdbot.types.UpgradedGiftOriginPrepaidUpgrade[source]

Bases: TlObject, UpgradedGiftOrigin

The sender or receiver of the message has paid for upgraid of the gift, which has been completed

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpgradedGiftOriginPrepaidUpgrade]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UpgradedGiftOrigin']

classmethod getType()[source]
Return type:

Literal['upgradedGiftOriginPrepaidUpgrade']

to_dict()[source]
Return type:

dict

class pytdbot.types.UpgradedGiftOriginResale(price=None)[source]

Bases: TlObject, UpgradedGiftOrigin

The gift was bought from another user

Parameters:

price ("types.GiftResalePrice") – Price paid by the sender for the gift

__init__(price=None)[source]
Parameters:

price (GiftResalePrice | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpgradedGiftOriginResale]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UpgradedGiftOrigin']

classmethod getType()[source]
Return type:

Literal['upgradedGiftOriginResale']

to_dict()[source]
Return type:

dict

price: Union[GiftResalePriceStar, GiftResalePriceTon, None]

Price paid by the sender for the gift

class pytdbot.types.UpgradedGiftOriginTransfer[source]

Bases: TlObject, UpgradedGiftOrigin

The gift was transferred from another owner

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpgradedGiftOriginTransfer]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UpgradedGiftOrigin']

classmethod getType()[source]
Return type:

Literal['upgradedGiftOriginTransfer']

to_dict()[source]
Return type:

dict

class pytdbot.types.UpgradedGiftOriginUpgrade(gift_message_id=0)[source]

Bases: TlObject, UpgradedGiftOrigin

The gift was obtained by upgrading of a previously received gift

Parameters:

gift_message_id (int) – Identifier of the message with the regular gift that was upgraded; can be 0 or an identifier of a deleted message

__init__(gift_message_id=0)[source]
Parameters:

gift_message_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpgradedGiftOriginUpgrade]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UpgradedGiftOrigin']

classmethod getType()[source]
Return type:

Literal['upgradedGiftOriginUpgrade']

to_dict()[source]
Return type:

dict

gift_message_id: int

Identifier of the message with the regular gift that was upgraded; can be 0 or an identifier of a deleted message

class pytdbot.types.UpgradedGiftOriginalDetails(sender_id=None, receiver_id=None, text=None, date=0)[source]

Bases: TlObject

Describes the original details about the gift

Parameters:
  • sender_id ("types.MessageSender") – Identifier of the user or the chat that sent the gift; may be null if the gift was private

  • receiver_id ("types.MessageSender") – Identifier of the user or the chat that received the gift

  • text ("types.FormattedText") – Message added to the gift

  • date (int) – Point in time (Unix timestamp) when the gift was sent

__init__(sender_id=None, receiver_id=None, text=None, date=0)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpgradedGiftOriginalDetails]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UpgradedGiftOriginalDetails']

classmethod getType()[source]
Return type:

Literal['upgradedGiftOriginalDetails']

to_dict()[source]
Return type:

dict

date: int

Point in time (Unix timestamp) when the gift was sent

receiver_id: Union[MessageSenderUser, MessageSenderChat, None]

Identifier of the user or the chat that received the gift

sender_id: Union[MessageSenderUser, MessageSenderChat, None]

Identifier of the user or the chat that sent the gift; may be null if the gift was private

text: Optional[FormattedText]

Message added to the gift

class pytdbot.types.UpgradedGiftSymbol(name='', sticker=None, rarity_per_mille=0)[source]

Bases: TlObject

Describes a symbol shown on the pattern of an upgraded gift

Parameters:
  • name (str) – Name of the symbol

  • sticker ("types.Sticker") – The sticker representing the symbol

  • rarity_per_mille (int) – The number of upgraded gifts that receive this symbol for each 1000 gifts upgraded

__init__(name='', sticker=None, rarity_per_mille=0)[source]
Parameters:
  • name (str)

  • sticker (Sticker | None)

  • rarity_per_mille (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpgradedGiftSymbol]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UpgradedGiftSymbol']

classmethod getType()[source]
Return type:

Literal['upgradedGiftSymbol']

to_dict()[source]
Return type:

dict

name: Optional[str]

Name of the symbol

rarity_per_mille: int

The number of upgraded gifts that receive this symbol for each 1000 gifts upgraded

sticker: Optional[Sticker]

The sticker representing the symbol

class pytdbot.types.UpgradedGiftSymbolCount(symbol=None, total_count=0)[source]

Bases: TlObject

Describes a symbol shown on the pattern of an upgraded gift

Parameters:
  • symbol ("types.UpgradedGiftSymbol") – The symbol

  • total_count (int) – Total number of gifts with the symbol

__init__(symbol=None, total_count=0)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpgradedGiftSymbolCount]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UpgradedGiftSymbolCount']

classmethod getType()[source]
Return type:

Literal['upgradedGiftSymbolCount']

to_dict()[source]
Return type:

dict

symbol: Optional[UpgradedGiftSymbol]

The symbol

total_count: int

Total number of gifts with the symbol

class pytdbot.types.UpgradedGiftValueInfo(currency='', value=0, is_value_average=False, initial_sale_date=0, initial_sale_star_count=0, initial_sale_price=0, last_sale_date=0, last_sale_price=0, is_last_sale_on_fragment=False, minimum_price=0, average_sale_price=0, telegram_listed_gift_count=0, fragment_listed_gift_count=0, fragment_url='')[source]

Bases: TlObject

Contains information about value of an upgraded gift

Parameters:
  • currency (str) – ISO 4217 currency code of the currency in which the prices are represented

  • value (int) – Estimated value of the gift; in the smallest units of the currency

  • is_value_average (bool) – True, if the value is calculated as average value of similar sold gifts. Otherwise, it is based on the sale price of the gift

  • initial_sale_date (int) – Point in time (Unix timestamp) when the corresponding regular gift was originally purchased

  • initial_sale_star_count (int) – Amount of Telegram Stars that were paid for the gift

  • initial_sale_price (int) – Initial price of the gift; in the smallest units of the currency

  • last_sale_date (int) – Point in time (Unix timestamp) when the upgraded gift was purchased last time; 0 if never

  • last_sale_price (int) – Last purchase price of the gift; in the smallest units of the currency; 0 if the gift has never been resold

  • is_last_sale_on_fragment (bool) – True, if the last sale was completed on Fragment

  • minimum_price (int) – The current minimum price of gifts upgraded from the same gift; in the smallest units of the currency; 0 if there are no such gifts

  • average_sale_price (int) – The average sale price in the last month of gifts upgraded from the same gift; in the smallest units of the currency; 0 if there were no such sales

  • telegram_listed_gift_count (int) – Number of gifts upgraded from the same gift being resold on Telegram

  • fragment_listed_gift_count (int) – Number of gifts upgraded from the same gift being resold on Fragment

  • fragment_url (str) – The HTTPS link to the Fragment for the gift; may be empty if there are no such gifts being sold on Fragment

__init__(currency='', value=0, is_value_average=False, initial_sale_date=0, initial_sale_star_count=0, initial_sale_price=0, last_sale_date=0, last_sale_price=0, is_last_sale_on_fragment=False, minimum_price=0, average_sale_price=0, telegram_listed_gift_count=0, fragment_listed_gift_count=0, fragment_url='')[source]
Parameters:
  • currency (str)

  • value (int)

  • is_value_average (bool)

  • initial_sale_date (int)

  • initial_sale_star_count (int)

  • initial_sale_price (int)

  • last_sale_date (int)

  • last_sale_price (int)

  • is_last_sale_on_fragment (bool)

  • minimum_price (int)

  • average_sale_price (int)

  • telegram_listed_gift_count (int)

  • fragment_listed_gift_count (int)

  • fragment_url (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UpgradedGiftValueInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UpgradedGiftValueInfo']

classmethod getType()[source]
Return type:

Literal['upgradedGiftValueInfo']

to_dict()[source]
Return type:

dict

average_sale_price: int

The average sale price in the last month of gifts upgraded from the same gift; in the smallest units of the currency; 0 if there were no such sales

currency: Optional[str]

ISO 4217 currency code of the currency in which the prices are represented

fragment_listed_gift_count: int

Number of gifts upgraded from the same gift being resold on Fragment

fragment_url: Optional[str]

The HTTPS link to the Fragment for the gift; may be empty if there are no such gifts being sold on Fragment

initial_sale_date: int

Point in time (Unix timestamp) when the corresponding regular gift was originally purchased

initial_sale_price: int

Initial price of the gift; in the smallest units of the currency

initial_sale_star_count: int

Amount of Telegram Stars that were paid for the gift

is_last_sale_on_fragment: bool

True, if the last sale was completed on Fragment

is_value_average: bool

True, if the value is calculated as average value of similar sold gifts. Otherwise, it is based on the sale price of the gift

last_sale_date: int

Point in time (Unix timestamp) when the upgraded gift was purchased last time; 0 if never

last_sale_price: int

Last purchase price of the gift; in the smallest units of the currency; 0 if the gift has never been resold

minimum_price: int

The current minimum price of gifts upgraded from the same gift; in the smallest units of the currency; 0 if there are no such gifts

telegram_listed_gift_count: int

Number of gifts upgraded from the same gift being resold on Telegram

value: int

Estimated value of the gift; in the smallest units of the currency

class pytdbot.types.User(id=0, first_name='', last_name='', usernames=None, phone_number='', status=None, profile_photo=None, accent_color_id=0, background_custom_emoji_id=0, profile_accent_color_id=0, profile_background_custom_emoji_id=0, emoji_status=None, is_contact=False, is_mutual_contact=False, is_close_friend=False, verification_status=None, is_premium=False, is_support=False, restriction_info=None, has_active_stories=False, has_unread_active_stories=False, restricts_new_chats=False, paid_message_star_count=0, have_access=False, type=None, language_code='', added_to_attachment_menu=False)[source]

Bases: TlObject

Represents a user

Parameters:
  • id (int) – User identifier

  • first_name (str) – First name of the user

  • last_name (str) – Last name of the user

  • usernames ("types.Usernames") – Usernames of the user; may be null

  • phone_number (str) – Phone number of the user

  • status ("types.UserStatus") – Current online status of the user

  • profile_photo ("types.ProfilePhoto") – Profile photo of the user; may be null

  • accent_color_id (int) – Identifier of the accent color for name, and backgrounds of profile photo, reply header, and link preview

  • background_custom_emoji_id (int) – Identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none

  • profile_accent_color_id (int) – Identifier of the accent color for the user’s profile; -1 if none

  • profile_background_custom_emoji_id (int) – Identifier of a custom emoji to be shown on the background of the user’s profile; 0 if none

  • emoji_status ("types.EmojiStatus") – Emoji status to be shown instead of the default Telegram Premium badge; may be null

  • is_contact (bool) – The user is a contact of the current user

  • is_mutual_contact (bool) – The user is a contact of the current user and the current user is a contact of the user

  • is_close_friend (bool) – The user is a close friend of the current user; implies that the user is a contact

  • verification_status ("types.VerificationStatus") – Information about verification status of the user; may be null if none

  • is_premium (bool) – True, if the user is a Telegram Premium user

  • is_support (bool) – True, if the user is Telegram support account

  • restriction_info ("types.RestrictionInfo") – Information about restrictions that must be applied to the corresponding private chat; may be null if none

  • has_active_stories (bool) – True, if the user has non-expired stories available to the current user

  • has_unread_active_stories (bool) – True, if the user has unread non-expired stories available to the current user

  • restricts_new_chats (bool) – True, if the user may restrict new chats with non-contacts. Use canSendMessageToUser to check whether the current user can message the user or try to create a chat with them

  • paid_message_star_count (int) – Number of Telegram Stars that must be paid by general user for each sent message to the user. If positive and userFullInfo is unknown, use canSendMessageToUser to check whether the current user must pay

  • have_access (bool) – If false, the user is inaccessible, and the only information known about the user is inside this class. Identifier of the user can’t be passed to any method

  • type ("types.UserType") – Type of the user

  • language_code (str) – IETF language tag of the user’s language; only available to bots

  • added_to_attachment_menu (bool) – True, if the user added the current bot to attachment menu; only available to bots

__init__(id=0, first_name='', last_name='', usernames=None, phone_number='', status=None, profile_photo=None, accent_color_id=0, background_custom_emoji_id=0, profile_accent_color_id=0, profile_background_custom_emoji_id=0, emoji_status=None, is_contact=False, is_mutual_contact=False, is_close_friend=False, verification_status=None, is_premium=False, is_support=False, restriction_info=None, has_active_stories=False, has_unread_active_stories=False, restricts_new_chats=False, paid_message_star_count=0, have_access=False, type=None, language_code='', added_to_attachment_menu=False)[source]
Parameters:
  • id (int)

  • first_name (str)

  • last_name (str)

  • usernames (Usernames | None)

  • phone_number (str)

  • status (UserStatus | None)

  • profile_photo (ProfilePhoto | None)

  • accent_color_id (int)

  • background_custom_emoji_id (int)

  • profile_accent_color_id (int)

  • profile_background_custom_emoji_id (int)

  • emoji_status (EmojiStatus | None)

  • is_contact (bool)

  • is_mutual_contact (bool)

  • is_close_friend (bool)

  • verification_status (VerificationStatus | None)

  • is_premium (bool)

  • is_support (bool)

  • restriction_info (RestrictionInfo | None)

  • has_active_stories (bool)

  • has_unread_active_stories (bool)

  • restricts_new_chats (bool)

  • paid_message_star_count (int)

  • have_access (bool)

  • type (UserType | None)

  • language_code (str)

  • added_to_attachment_menu (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[User]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['User']

classmethod getType()[source]
Return type:

Literal['user']

to_dict()[source]
Return type:

dict

accent_color_id: int

Identifier of the accent color for name, and backgrounds of profile photo, reply header, and link preview

added_to_attachment_menu: bool

True, if the user added the current bot to attachment menu; only available to bots

background_custom_emoji_id: int

Identifier of a custom emoji to be shown on the reply header and link preview background; 0 if none

emoji_status: Optional[EmojiStatus]

Emoji status to be shown instead of the default Telegram Premium badge; may be null

first_name: Optional[str]

First name of the user

has_active_stories: bool

True, if the user has non-expired stories available to the current user

has_unread_active_stories: bool

True, if the user has unread non-expired stories available to the current user

have_access: bool

If false, the user is inaccessible, and the only information known about the user is inside this class. Identifier of the user can’t be passed to any method

id: int

User identifier

is_close_friend: bool

The user is a close friend of the current user; implies that the user is a contact

is_contact: bool

The user is a contact of the current user

is_mutual_contact: bool

The user is a contact of the current user and the current user is a contact of the user

is_premium: bool

True, if the user is a Telegram Premium user

is_support: bool

True, if the user is Telegram support account

language_code: Optional[str]

IETF language tag of the user’s language; only available to bots

last_name: Optional[str]

Last name of the user

paid_message_star_count: int

Number of Telegram Stars that must be paid by general user for each sent message to the user. If positive and userFullInfo is unknown, use canSendMessageToUser to check whether the current user must pay

phone_number: Optional[str]

Phone number of the user

profile_accent_color_id: int

Identifier of the accent color for the user’s profile; -1 if none

profile_background_custom_emoji_id: int

Identifier of a custom emoji to be shown on the background of the user’s profile; 0 if none

profile_photo: Optional[ProfilePhoto]

Profile photo of the user; may be null

restriction_info: Optional[RestrictionInfo]

Information about restrictions that must be applied to the corresponding private chat; may be null if none

restricts_new_chats: bool

True, if the user may restrict new chats with non-contacts. Use canSendMessageToUser to check whether the current user can message the user or try to create a chat with them

status: Union[UserStatusEmpty, UserStatusOnline, UserStatusOffline, UserStatusRecently, UserStatusLastWeek, UserStatusLastMonth, None]

Current online status of the user

type: Union[UserTypeRegular, UserTypeDeleted, UserTypeBot, UserTypeUnknown, None]

Type of the user

usernames: Optional[Usernames]

Usernames of the user; may be null

verification_status: Optional[VerificationStatus]

Information about verification status of the user; may be null if none

class pytdbot.types.UserFullInfo(personal_photo=None, photo=None, public_photo=None, block_list=None, can_be_called=False, supports_video_calls=False, has_private_calls=False, has_private_forwards=False, has_restricted_voice_and_video_note_messages=False, has_posted_to_profile_stories=False, has_sponsored_messages_enabled=False, need_phone_number_privacy_exception=False, set_chat_background=False, bio=None, birthdate=None, personal_chat_id=0, gift_count=0, group_in_common_count=0, incoming_paid_message_star_count=0, outgoing_paid_message_star_count=0, gift_settings=None, bot_verification=None, main_profile_tab=None, first_profile_audio=None, rating=None, pending_rating=None, pending_rating_date=0, business_info=None, bot_info=None)[source]

Bases: TlObject

Contains full information about a user

Parameters:
  • personal_photo ("types.ChatPhoto") – User profile photo set by the current user for the contact; may be null. If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown. If non-null, then it is the same photo as in user.profile_photo and chat.photo. This photo isn’t returned in the list of user photos

  • photo ("types.ChatPhoto") – User profile photo; may be null. If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown. If non-null and personal_photo is null, then it is the same photo as in user.profile_photo and chat.photo

  • public_photo ("types.ChatPhoto") – User profile photo visible if the main photo is hidden by privacy settings; may be null. If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown. If non-null and both photo and personal_photo are null, then it is the same photo as in user.profile_photo and chat.photo. This photo isn’t returned in the list of user photos

  • block_list ("types.BlockList") – Block list to which the user is added; may be null if none

  • can_be_called (bool) – True, if the user can be called

  • supports_video_calls (bool) – True, if a video call can be created with the user

  • has_private_calls (bool) – True, if the user can’t be called due to their privacy settings

  • has_private_forwards (bool) – True, if the user can’t be linked in forwarded messages due to their privacy settings

  • has_restricted_voice_and_video_note_messages (bool) – True, if voice and video notes can’t be sent or forwarded to the user

  • has_posted_to_profile_stories (bool) – True, if the user has posted to profile stories

  • has_sponsored_messages_enabled (bool) – True, if the user always enabled sponsored messages; known only for the current user

  • need_phone_number_privacy_exception (bool) – True, if the current user needs to explicitly allow to share their phone number with the user when the method addContact is used

  • set_chat_background (bool) – True, if the user set chat background for both chat users and it wasn’t reverted yet

  • bio ("types.FormattedText") – A short user bio; may be null for bots

  • birthdate ("types.Birthdate") – Birthdate of the user; may be null if unknown

  • personal_chat_id (int) – Identifier of the personal chat of the user; 0 if none

  • gift_count (int) – Number of saved to profile gifts for other users or the total number of received gifts for the current user

  • group_in_common_count (int) – Number of group chats where both the other user and the current user are a member; 0 for the current user

  • incoming_paid_message_star_count (int) – Number of Telegram Stars that must be paid by the user for each sent message to the current user

  • outgoing_paid_message_star_count (int) – Number of Telegram Stars that must be paid by the current user for each sent message to the user

  • gift_settings ("types.GiftSettings") – Settings for gift receiving for the user

  • bot_verification ("types.BotVerification") – Information about verification status of the user provided by a bot; may be null if none or unknown

  • main_profile_tab ("types.ProfileTab") – The main tab chosen by the user; may be null if not chosen manually

  • first_profile_audio ("types.Audio") – The first audio file added to the user’s profile; may be null if none

  • rating ("types.UserRating") – The current rating of the user; may be null if none

  • pending_rating ("types.UserRating") – The rating of the user after the next change; may be null if the user isn’t the current user or there are no pending rating changes

  • pending_rating_date (int) – Unix timestamp when rating of the user will change to pending_rating; 0 if the user isn’t the current user or there are no pending rating changes

  • business_info ("types.BusinessInfo") – Information about business settings for Telegram Business accounts; may be null if none

  • bot_info ("types.BotInfo") – For bots, information about the bot; may be null if the user isn’t a bot

__init__(personal_photo=None, photo=None, public_photo=None, block_list=None, can_be_called=False, supports_video_calls=False, has_private_calls=False, has_private_forwards=False, has_restricted_voice_and_video_note_messages=False, has_posted_to_profile_stories=False, has_sponsored_messages_enabled=False, need_phone_number_privacy_exception=False, set_chat_background=False, bio=None, birthdate=None, personal_chat_id=0, gift_count=0, group_in_common_count=0, incoming_paid_message_star_count=0, outgoing_paid_message_star_count=0, gift_settings=None, bot_verification=None, main_profile_tab=None, first_profile_audio=None, rating=None, pending_rating=None, pending_rating_date=0, business_info=None, bot_info=None)[source]
Parameters:
  • personal_photo (ChatPhoto | None)

  • photo (ChatPhoto | None)

  • public_photo (ChatPhoto | None)

  • block_list (BlockList | None)

  • can_be_called (bool)

  • supports_video_calls (bool)

  • has_private_calls (bool)

  • has_private_forwards (bool)

  • has_restricted_voice_and_video_note_messages (bool)

  • has_posted_to_profile_stories (bool)

  • has_sponsored_messages_enabled (bool)

  • need_phone_number_privacy_exception (bool)

  • set_chat_background (bool)

  • bio (FormattedText | None)

  • birthdate (Birthdate | None)

  • personal_chat_id (int)

  • gift_count (int)

  • group_in_common_count (int)

  • incoming_paid_message_star_count (int)

  • outgoing_paid_message_star_count (int)

  • gift_settings (GiftSettings | None)

  • bot_verification (BotVerification | None)

  • main_profile_tab (ProfileTab | None)

  • first_profile_audio (Audio | None)

  • rating (UserRating | None)

  • pending_rating (UserRating | None)

  • pending_rating_date (int)

  • business_info (BusinessInfo | None)

  • bot_info (BotInfo | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserFullInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserFullInfo']

classmethod getType()[source]
Return type:

Literal['userFullInfo']

to_dict()[source]
Return type:

dict

bio: Optional[FormattedText]

A short user bio; may be null for bots

birthdate: Optional[Birthdate]

Birthdate of the user; may be null if unknown

block_list: Union[BlockListMain, BlockListStories, None]

Block list to which the user is added; may be null if none

bot_info: Optional[BotInfo]

For bots, information about the bot; may be null if the user isn’t a bot

bot_verification: Optional[BotVerification]

Information about verification status of the user provided by a bot; may be null if none or unknown

business_info: Optional[BusinessInfo]

Information about business settings for Telegram Business accounts; may be null if none

can_be_called: bool

True, if the user can be called

first_profile_audio: Optional[Audio]

The first audio file added to the user’s profile; may be null if none

gift_count: int

Number of saved to profile gifts for other users or the total number of received gifts for the current user

gift_settings: Optional[GiftSettings]

Settings for gift receiving for the user

group_in_common_count: int

Number of group chats where both the other user and the current user are a member; 0 for the current user

has_posted_to_profile_stories: bool

True, if the user has posted to profile stories

has_private_calls: bool

True, if the user can’t be called due to their privacy settings

has_private_forwards: bool

True, if the user can’t be linked in forwarded messages due to their privacy settings

has_restricted_voice_and_video_note_messages: bool

True, if voice and video notes can’t be sent or forwarded to the user

has_sponsored_messages_enabled: bool

True, if the user always enabled sponsored messages; known only for the current user

incoming_paid_message_star_count: int

Number of Telegram Stars that must be paid by the user for each sent message to the current user

main_profile_tab: Union[ProfileTabPosts, ProfileTabGifts, ProfileTabMedia, ProfileTabFiles, ProfileTabLinks, ProfileTabMusic, ProfileTabVoice, ProfileTabGifs, None]

The main tab chosen by the user; may be null if not chosen manually

need_phone_number_privacy_exception: bool

True, if the current user needs to explicitly allow to share their phone number with the user when the method addContact is used

outgoing_paid_message_star_count: int

Number of Telegram Stars that must be paid by the current user for each sent message to the user

pending_rating: Optional[UserRating]

The rating of the user after the next change; may be null if the user isn’t the current user or there are no pending rating changes

pending_rating_date: int

Unix timestamp when rating of the user will change to pending_rating; 0 if the user isn’t the current user or there are no pending rating changes

personal_chat_id: int

Identifier of the personal chat of the user; 0 if none

personal_photo: Optional[ChatPhoto]

User profile photo set by the current user for the contact; may be null. If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown. If non-null, then it is the same photo as in user.profile_photo and chat.photo. This photo isn’t returned in the list of user photos

photo: Optional[ChatPhoto]

User profile photo; may be null. If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown. If non-null and personal_photo is null, then it is the same photo as in user.profile_photo and chat.photo

public_photo: Optional[ChatPhoto]

User profile photo visible if the main photo is hidden by privacy settings; may be null. If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown. If non-null and both photo and personal_photo are null, then it is the same photo as in user.profile_photo and chat.photo. This photo isn’t returned in the list of user photos

rating: Optional[UserRating]

The current rating of the user; may be null if none

set_chat_background: bool

True, if the user set chat background for both chat users and it wasn’t reverted yet

supports_video_calls: bool

True, if a video call can be created with the user

class pytdbot.types.UserLink(url='', expires_in=0)[source]

Bases: TlObject

Contains an HTTPS URL, which can be used to get information about a user

Parameters:
  • url (str) – The URL

  • expires_in (int) – Left time for which the link is valid, in seconds; 0 if the link is a public username link

__init__(url='', expires_in=0)[source]
Parameters:
  • url (str)

  • expires_in (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserLink]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserLink']

classmethod getType()[source]
Return type:

Literal['userLink']

to_dict()[source]
Return type:

dict

expires_in: int

Left time for which the link is valid, in seconds; 0 if the link is a public username link

url: Optional[str]

The URL

class pytdbot.types.UserPrivacySetting[source]

Bases: object

Describes available user privacy settings

class pytdbot.types.UserPrivacySettingAllowCalls[source]

Bases: TlObject, UserPrivacySetting

A privacy setting for managing whether the user can be called

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserPrivacySettingAllowCalls]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserPrivacySetting']

classmethod getType()[source]
Return type:

Literal['userPrivacySettingAllowCalls']

to_dict()[source]
Return type:

dict

class pytdbot.types.UserPrivacySettingAllowChatInvites[source]

Bases: TlObject, UserPrivacySetting

A privacy setting for managing whether the user can be invited to chats

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserPrivacySettingAllowChatInvites]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserPrivacySetting']

classmethod getType()[source]
Return type:

Literal['userPrivacySettingAllowChatInvites']

to_dict()[source]
Return type:

dict

class pytdbot.types.UserPrivacySettingAllowFindingByPhoneNumber[source]

Bases: TlObject, UserPrivacySetting

A privacy setting for managing whether the user can be found by their phone number. Checked only if the phone number is not known to the other user. Can be set only to "Allow contacts" or "Allow all"

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserPrivacySettingAllowFindingByPhoneNumber]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserPrivacySetting']

classmethod getType()[source]
Return type:

Literal['userPrivacySettingAllowFindingByPhoneNumber']

to_dict()[source]
Return type:

dict

class pytdbot.types.UserPrivacySettingAllowPeerToPeerCalls[source]

Bases: TlObject, UserPrivacySetting

A privacy setting for managing whether peer-to-peer connections can be used for calls

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserPrivacySettingAllowPeerToPeerCalls]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserPrivacySetting']

classmethod getType()[source]
Return type:

Literal['userPrivacySettingAllowPeerToPeerCalls']

to_dict()[source]
Return type:

dict

class pytdbot.types.UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages[source]

Bases: TlObject, UserPrivacySetting

A privacy setting for managing whether the user can receive voice and video messages in private chats; for Telegram Premium users only

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserPrivacySetting']

classmethod getType()[source]
Return type:

Literal['userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages']

to_dict()[source]
Return type:

dict

class pytdbot.types.UserPrivacySettingAllowUnpaidMessages[source]

Bases: TlObject, UserPrivacySetting

A privacy setting for managing whether the user can receive messages without additional payment

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserPrivacySettingAllowUnpaidMessages]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserPrivacySetting']

classmethod getType()[source]
Return type:

Literal['userPrivacySettingAllowUnpaidMessages']

to_dict()[source]
Return type:

dict

class pytdbot.types.UserPrivacySettingAutosaveGifts[source]

Bases: TlObject, UserPrivacySetting

A privacy setting for managing whether received gifts are automatically shown on the user’s profile page

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserPrivacySettingAutosaveGifts]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserPrivacySetting']

classmethod getType()[source]
Return type:

Literal['userPrivacySettingAutosaveGifts']

to_dict()[source]
Return type:

dict

class pytdbot.types.UserPrivacySettingRule[source]

Bases: object

Represents a single rule for managing user privacy settings

class pytdbot.types.UserPrivacySettingRuleAllowAll[source]

Bases: TlObject, UserPrivacySettingRule

A rule to allow all users to do something

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserPrivacySettingRuleAllowAll]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserPrivacySettingRule']

classmethod getType()[source]
Return type:

Literal['userPrivacySettingRuleAllowAll']

to_dict()[source]
Return type:

dict

class pytdbot.types.UserPrivacySettingRuleAllowBots[source]

Bases: TlObject, UserPrivacySettingRule

A rule to allow all bots to do something

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserPrivacySettingRuleAllowBots]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserPrivacySettingRule']

classmethod getType()[source]
Return type:

Literal['userPrivacySettingRuleAllowBots']

to_dict()[source]
Return type:

dict

class pytdbot.types.UserPrivacySettingRuleAllowChatMembers(chat_ids=None)[source]

Bases: TlObject, UserPrivacySettingRule

A rule to allow all members of certain specified basic groups and supergroups to doing something

Parameters:

chat_ids (List[int]) – The chat identifiers, total number of chats in all rules must not exceed 20

__init__(chat_ids=None)[source]
Parameters:

chat_ids (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserPrivacySettingRuleAllowChatMembers]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserPrivacySettingRule']

classmethod getType()[source]
Return type:

Literal['userPrivacySettingRuleAllowChatMembers']

to_dict()[source]
Return type:

dict

chat_ids: List[int]

The chat identifiers, total number of chats in all rules must not exceed 20

class pytdbot.types.UserPrivacySettingRuleAllowContacts[source]

Bases: TlObject, UserPrivacySettingRule

A rule to allow all contacts of the user to do something

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserPrivacySettingRuleAllowContacts]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserPrivacySettingRule']

classmethod getType()[source]
Return type:

Literal['userPrivacySettingRuleAllowContacts']

to_dict()[source]
Return type:

dict

class pytdbot.types.UserPrivacySettingRuleAllowPremiumUsers[source]

Bases: TlObject, UserPrivacySettingRule

A rule to allow all Premium Users to do something; currently, allowed only for userPrivacySettingAllowChatInvites

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserPrivacySettingRuleAllowPremiumUsers]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserPrivacySettingRule']

classmethod getType()[source]
Return type:

Literal['userPrivacySettingRuleAllowPremiumUsers']

to_dict()[source]
Return type:

dict

class pytdbot.types.UserPrivacySettingRuleAllowUsers(user_ids=None)[source]

Bases: TlObject, UserPrivacySettingRule

A rule to allow certain specified users to do something

Parameters:

user_ids (List[int]) – The user identifiers, total number of users in all rules must not exceed 1000

__init__(user_ids=None)[source]
Parameters:

user_ids (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserPrivacySettingRuleAllowUsers]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserPrivacySettingRule']

classmethod getType()[source]
Return type:

Literal['userPrivacySettingRuleAllowUsers']

to_dict()[source]
Return type:

dict

user_ids: List[int]

The user identifiers, total number of users in all rules must not exceed 1000

class pytdbot.types.UserPrivacySettingRuleRestrictAll[source]

Bases: TlObject, UserPrivacySettingRule

A rule to restrict all users from doing something

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserPrivacySettingRuleRestrictAll]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserPrivacySettingRule']

classmethod getType()[source]
Return type:

Literal['userPrivacySettingRuleRestrictAll']

to_dict()[source]
Return type:

dict

class pytdbot.types.UserPrivacySettingRuleRestrictBots[source]

Bases: TlObject, UserPrivacySettingRule

A rule to restrict all bots from doing something

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserPrivacySettingRuleRestrictBots]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserPrivacySettingRule']

classmethod getType()[source]
Return type:

Literal['userPrivacySettingRuleRestrictBots']

to_dict()[source]
Return type:

dict

class pytdbot.types.UserPrivacySettingRuleRestrictChatMembers(chat_ids=None)[source]

Bases: TlObject, UserPrivacySettingRule

A rule to restrict all members of specified basic groups and supergroups from doing something

Parameters:

chat_ids (List[int]) – The chat identifiers, total number of chats in all rules must not exceed 20

__init__(chat_ids=None)[source]
Parameters:

chat_ids (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserPrivacySettingRuleRestrictChatMembers]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserPrivacySettingRule']

classmethod getType()[source]
Return type:

Literal['userPrivacySettingRuleRestrictChatMembers']

to_dict()[source]
Return type:

dict

chat_ids: List[int]

The chat identifiers, total number of chats in all rules must not exceed 20

class pytdbot.types.UserPrivacySettingRuleRestrictContacts[source]

Bases: TlObject, UserPrivacySettingRule

A rule to restrict all contacts of the user from doing something

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserPrivacySettingRuleRestrictContacts]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserPrivacySettingRule']

classmethod getType()[source]
Return type:

Literal['userPrivacySettingRuleRestrictContacts']

to_dict()[source]
Return type:

dict

class pytdbot.types.UserPrivacySettingRuleRestrictUsers(user_ids=None)[source]

Bases: TlObject, UserPrivacySettingRule

A rule to restrict all specified users from doing something

Parameters:

user_ids (List[int]) – The user identifiers, total number of users in all rules must not exceed 1000

__init__(user_ids=None)[source]
Parameters:

user_ids (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserPrivacySettingRuleRestrictUsers]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserPrivacySettingRule']

classmethod getType()[source]
Return type:

Literal['userPrivacySettingRuleRestrictUsers']

to_dict()[source]
Return type:

dict

user_ids: List[int]

The user identifiers, total number of users in all rules must not exceed 1000

class pytdbot.types.UserPrivacySettingRules(rules=None)[source]

Bases: TlObject

A list of privacy rules. Rules are matched in the specified order. The first matched rule defines the privacy setting for a given user. If no rule matches, the action is not allowed

Parameters:

rules (List["types.UserPrivacySettingRule"]) – A list of rules

__init__(rules=None)[source]
Parameters:

rules (List[UserPrivacySettingRule] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserPrivacySettingRules]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserPrivacySettingRules']

classmethod getType()[source]
Return type:

Literal['userPrivacySettingRules']

to_dict()[source]
Return type:

dict

rules: List[UserPrivacySettingRule]

A list of rules

class pytdbot.types.UserPrivacySettingShowBio[source]

Bases: TlObject, UserPrivacySetting

A privacy setting for managing whether the user’s bio is visible

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserPrivacySettingShowBio]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserPrivacySetting']

classmethod getType()[source]
Return type:

Literal['userPrivacySettingShowBio']

to_dict()[source]
Return type:

dict

class pytdbot.types.UserPrivacySettingShowBirthdate[source]

Bases: TlObject, UserPrivacySetting

A privacy setting for managing whether the user’s birthdate is visible

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserPrivacySettingShowBirthdate]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserPrivacySetting']

classmethod getType()[source]
Return type:

Literal['userPrivacySettingShowBirthdate']

to_dict()[source]
Return type:

dict

class pytdbot.types.UserPrivacySettingShowLinkInForwardedMessages[source]

Bases: TlObject, UserPrivacySetting

A privacy setting for managing whether a link to the user’s account is included in forwarded messages

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserPrivacySettingShowLinkInForwardedMessages]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserPrivacySetting']

classmethod getType()[source]
Return type:

Literal['userPrivacySettingShowLinkInForwardedMessages']

to_dict()[source]
Return type:

dict

class pytdbot.types.UserPrivacySettingShowPhoneNumber[source]

Bases: TlObject, UserPrivacySetting

A privacy setting for managing whether the user’s phone number is visible

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserPrivacySettingShowPhoneNumber]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserPrivacySetting']

classmethod getType()[source]
Return type:

Literal['userPrivacySettingShowPhoneNumber']

to_dict()[source]
Return type:

dict

class pytdbot.types.UserPrivacySettingShowProfilePhoto[source]

Bases: TlObject, UserPrivacySetting

A privacy setting for managing whether the user’s profile photo is visible

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserPrivacySettingShowProfilePhoto]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserPrivacySetting']

classmethod getType()[source]
Return type:

Literal['userPrivacySettingShowProfilePhoto']

to_dict()[source]
Return type:

dict

class pytdbot.types.UserPrivacySettingShowStatus[source]

Bases: TlObject, UserPrivacySetting

A privacy setting for managing whether the user’s online status is visible

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserPrivacySettingShowStatus]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserPrivacySetting']

classmethod getType()[source]
Return type:

Literal['userPrivacySettingShowStatus']

to_dict()[source]
Return type:

dict

class pytdbot.types.UserRating(level=0, is_maximum_level_reached=False, rating=0, current_level_rating=0, next_level_rating=0)[source]

Bases: TlObject

Contains description of user rating

Parameters:
  • level (int) – The level of the user; may be negative

  • is_maximum_level_reached (bool) – True, if the maximum level is reached

  • rating (int) – Numerical value of the rating

  • current_level_rating (int) – The rating required for the current level

  • next_level_rating (int) – The rating required for the next level; 0 if the maximum level is reached

__init__(level=0, is_maximum_level_reached=False, rating=0, current_level_rating=0, next_level_rating=0)[source]
Parameters:
  • level (int)

  • is_maximum_level_reached (bool)

  • rating (int)

  • current_level_rating (int)

  • next_level_rating (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserRating]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserRating']

classmethod getType()[source]
Return type:

Literal['userRating']

to_dict()[source]
Return type:

dict

current_level_rating: int

The rating required for the current level

is_maximum_level_reached: bool

True, if the maximum level is reached

level: int

The level of the user; may be negative

next_level_rating: int

The rating required for the next level; 0 if the maximum level is reached

rating: int

Numerical value of the rating

class pytdbot.types.UserStatus[source]

Bases: object

Describes the last time the user was online

class pytdbot.types.UserStatusEmpty[source]

Bases: TlObject, UserStatus

The user’s status has never been changed

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserStatusEmpty]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserStatus']

classmethod getType()[source]
Return type:

Literal['userStatusEmpty']

to_dict()[source]
Return type:

dict

class pytdbot.types.UserStatusLastMonth(by_my_privacy_settings=False)[source]

Bases: TlObject, UserStatus

The user is offline, but was online last month

Parameters:

by_my_privacy_settings (bool) – Exact user’s status is hidden because the current user enabled userPrivacySettingShowStatus privacy setting for the user and has no Telegram Premium

__init__(by_my_privacy_settings=False)[source]
Parameters:

by_my_privacy_settings (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserStatusLastMonth]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserStatus']

classmethod getType()[source]
Return type:

Literal['userStatusLastMonth']

to_dict()[source]
Return type:

dict

by_my_privacy_settings: bool

Exact user’s status is hidden because the current user enabled userPrivacySettingShowStatus privacy setting for the user and has no Telegram Premium

class pytdbot.types.UserStatusLastWeek(by_my_privacy_settings=False)[source]

Bases: TlObject, UserStatus

The user is offline, but was online last week

Parameters:

by_my_privacy_settings (bool) – Exact user’s status is hidden because the current user enabled userPrivacySettingShowStatus privacy setting for the user and has no Telegram Premium

__init__(by_my_privacy_settings=False)[source]
Parameters:

by_my_privacy_settings (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserStatusLastWeek]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserStatus']

classmethod getType()[source]
Return type:

Literal['userStatusLastWeek']

to_dict()[source]
Return type:

dict

by_my_privacy_settings: bool

Exact user’s status is hidden because the current user enabled userPrivacySettingShowStatus privacy setting for the user and has no Telegram Premium

class pytdbot.types.UserStatusOffline(was_online=0)[source]

Bases: TlObject, UserStatus

The user is offline

Parameters:

was_online (int) – Point in time (Unix timestamp) when the user was last online

__init__(was_online=0)[source]
Parameters:

was_online (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserStatusOffline]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserStatus']

classmethod getType()[source]
Return type:

Literal['userStatusOffline']

to_dict()[source]
Return type:

dict

was_online: int

Point in time (Unix timestamp) when the user was last online

class pytdbot.types.UserStatusOnline(expires=0)[source]

Bases: TlObject, UserStatus

The user is online

Parameters:

expires (int) – Point in time (Unix timestamp) when the user’s online status will expire

__init__(expires=0)[source]
Parameters:

expires (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserStatusOnline]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserStatus']

classmethod getType()[source]
Return type:

Literal['userStatusOnline']

to_dict()[source]
Return type:

dict

expires: int

Point in time (Unix timestamp) when the user’s online status will expire

class pytdbot.types.UserStatusRecently(by_my_privacy_settings=False)[source]

Bases: TlObject, UserStatus

The user was online recently

Parameters:

by_my_privacy_settings (bool) – Exact user’s status is hidden because the current user enabled userPrivacySettingShowStatus privacy setting for the user and has no Telegram Premium

__init__(by_my_privacy_settings=False)[source]
Parameters:

by_my_privacy_settings (bool)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserStatusRecently]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserStatus']

classmethod getType()[source]
Return type:

Literal['userStatusRecently']

to_dict()[source]
Return type:

dict

by_my_privacy_settings: bool

Exact user’s status is hidden because the current user enabled userPrivacySettingShowStatus privacy setting for the user and has no Telegram Premium

class pytdbot.types.UserSupportInfo(message=None, author='', date=0)[source]

Bases: TlObject

Contains custom information about the user

Parameters:
  • message ("types.FormattedText") – Information message

  • author (str) – Information author

  • date (int) – Information change date

__init__(message=None, author='', date=0)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserSupportInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserSupportInfo']

classmethod getType()[source]
Return type:

Literal['userSupportInfo']

to_dict()[source]
Return type:

dict

author: Optional[str]

Information author

date: int

Information change date

message: Optional[FormattedText]

Information message

class pytdbot.types.UserType[source]

Bases: object

Represents the type of user. The following types are possible: regular users, deleted users and bots

class pytdbot.types.UserTypeBot(can_be_edited=False, can_join_groups=False, can_read_all_group_messages=False, has_main_web_app=False, is_inline=False, inline_query_placeholder='', need_location=False, can_connect_to_business=False, can_be_added_to_attachment_menu=False, active_user_count=0)[source]

Bases: TlObject, UserType

A bot (see https://core.telegram.org/bots)

Parameters:
  • can_be_edited (bool) – True, if the bot is owned by the current user and can be edited using the methods toggleBotUsernameIsActive, reorderBotActiveUsernames, setBotProfilePhoto, setBotName, setBotInfoDescription, and setBotInfoShortDescription

  • can_join_groups (bool) – True, if the bot can be invited to basic group and supergroup chats

  • can_read_all_group_messages (bool) – True, if the bot can read all messages in basic group or supergroup chats and not just those addressed to the bot. In private and channel chats a bot can always read all messages

  • has_main_web_app (bool) – True, if the bot has the main Web App

  • is_inline (bool) – True, if the bot supports inline queries

  • inline_query_placeholder (str) – Placeholder for inline queries (displayed on the application input field)

  • need_location (bool) – True, if the location of the user is expected to be sent with every inline query to this bot

  • can_connect_to_business (bool) – True, if the bot supports connection to Telegram Business accounts

  • can_be_added_to_attachment_menu (bool) – True, if the bot can be added to attachment or side menu

  • active_user_count (int) – The number of recently active users of the bot

__init__(can_be_edited=False, can_join_groups=False, can_read_all_group_messages=False, has_main_web_app=False, is_inline=False, inline_query_placeholder='', need_location=False, can_connect_to_business=False, can_be_added_to_attachment_menu=False, active_user_count=0)[source]
Parameters:
  • can_be_edited (bool)

  • can_join_groups (bool)

  • can_read_all_group_messages (bool)

  • has_main_web_app (bool)

  • is_inline (bool)

  • inline_query_placeholder (str)

  • need_location (bool)

  • can_connect_to_business (bool)

  • can_be_added_to_attachment_menu (bool)

  • active_user_count (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserTypeBot]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserType']

classmethod getType()[source]
Return type:

Literal['userTypeBot']

to_dict()[source]
Return type:

dict

active_user_count: int

The number of recently active users of the bot

can_be_added_to_attachment_menu: bool

True, if the bot can be added to attachment or side menu

can_be_edited: bool

True, if the bot is owned by the current user and can be edited using the methods toggleBotUsernameIsActive, reorderBotActiveUsernames, setBotProfilePhoto, setBotName, setBotInfoDescription, and setBotInfoShortDescription

can_connect_to_business: bool

True, if the bot supports connection to Telegram Business accounts

can_join_groups: bool

True, if the bot can be invited to basic group and supergroup chats

can_read_all_group_messages: bool

True, if the bot can read all messages in basic group or supergroup chats and not just those addressed to the bot. In private and channel chats a bot can always read all messages

has_main_web_app: bool

True, if the bot has the main Web App

inline_query_placeholder: Optional[str]

Placeholder for inline queries (displayed on the application input field)

is_inline: bool

True, if the bot supports inline queries

need_location: bool

True, if the location of the user is expected to be sent with every inline query to this bot

class pytdbot.types.UserTypeDeleted[source]

Bases: TlObject, UserType

A deleted user or deleted bot. No information on the user besides the user identifier is available. It is not possible to perform any active actions on this type of user

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserTypeDeleted]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserType']

classmethod getType()[source]
Return type:

Literal['userTypeDeleted']

to_dict()[source]
Return type:

dict

class pytdbot.types.UserTypeRegular[source]

Bases: TlObject, UserType

A regular user

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserTypeRegular]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserType']

classmethod getType()[source]
Return type:

Literal['userTypeRegular']

to_dict()[source]
Return type:

dict

class pytdbot.types.UserTypeUnknown[source]

Bases: TlObject, UserType

No information on the user besides the user identifier is available, yet this user has not been deleted. This object is extremely rare and must be handled like a deleted user. It is not possible to perform any actions on users of this type

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[UserTypeUnknown]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['UserType']

classmethod getType()[source]
Return type:

Literal['userTypeUnknown']

to_dict()[source]
Return type:

dict

class pytdbot.types.Usernames(active_usernames=None, disabled_usernames=None, editable_username='')[source]

Bases: TlObject

Describes usernames assigned to a user, a supergroup, or a channel

Parameters:
  • active_usernames (List[str]) – List of active usernames; the first one must be shown as the primary username. The order of active usernames can be changed with reorderActiveUsernames, reorderBotActiveUsernames or reorderSupergroupActiveUsernames

  • disabled_usernames (List[str]) – List of currently disabled usernames; the username can be activated with toggleUsernameIsActive, toggleBotUsernameIsActive, or toggleSupergroupUsernameIsActive

  • editable_username (str) – The active username, which can be changed with setUsername or setSupergroupUsername. Information about other active usernames can be received using getCollectibleItemInfo

__init__(active_usernames=None, disabled_usernames=None, editable_username='')[source]
Parameters:
  • active_usernames (List[str] | None)

  • disabled_usernames (List[str] | None)

  • editable_username (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Usernames]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Usernames']

classmethod getType()[source]
Return type:

Literal['usernames']

to_dict()[source]
Return type:

dict

active_usernames: List[str]

List of active usernames; the first one must be shown as the primary username. The order of active usernames can be changed with reorderActiveUsernames, reorderBotActiveUsernames or reorderSupergroupActiveUsernames

disabled_usernames: List[str]

List of currently disabled usernames; the username can be activated with toggleUsernameIsActive, toggleBotUsernameIsActive, or toggleSupergroupUsernameIsActive

editable_username: Optional[str]

The active username, which can be changed with setUsername or setSupergroupUsername. Information about other active usernames can be received using getCollectibleItemInfo

class pytdbot.types.Users(total_count=0, user_ids=None)[source]

Bases: TlObject

Represents a list of users

Parameters:
  • total_count (int) – Approximate total number of users found

  • user_ids (List[int]) – A list of user identifiers

__init__(total_count=0, user_ids=None)[source]
Parameters:
  • total_count (int)

  • user_ids (List[int] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Users]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Users']

classmethod getType()[source]
Return type:

Literal['users']

to_dict()[source]
Return type:

dict

total_count: int

Approximate total number of users found

user_ids: List[int]

A list of user identifiers

class pytdbot.types.ValidatedOrderInfo(order_info_id='', shipping_options=None)[source]

Bases: TlObject

Contains a temporary identifier of validated order information, which is stored for one hour, and the available shipping options

Parameters:
  • order_info_id (str) – Temporary identifier of the order information

  • shipping_options (List["types.ShippingOption"]) – Available shipping options

__init__(order_info_id='', shipping_options=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[ValidatedOrderInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['ValidatedOrderInfo']

classmethod getType()[source]
Return type:

Literal['validatedOrderInfo']

to_dict()[source]
Return type:

dict

order_info_id: Optional[str]

Temporary identifier of the order information

shipping_options: List[ShippingOption]

Available shipping options

class pytdbot.types.VectorPathCommand[source]

Bases: object

Represents a vector path command

class pytdbot.types.VectorPathCommandCubicBezierCurve(start_control_point=None, end_control_point=None, end_point=None)[source]

Bases: TlObject, VectorPathCommand

A cubic Bézier curve to a given point

Parameters:
  • start_control_point ("types.Point") – The start control point of the curve

  • end_control_point ("types.Point") – The end control point of the curve

  • end_point ("types.Point") – The end point of the curve

__init__(start_control_point=None, end_control_point=None, end_point=None)[source]
Parameters:
  • start_control_point (Point | None)

  • end_control_point (Point | None)

  • end_point (Point | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[VectorPathCommandCubicBezierCurve]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['VectorPathCommand']

classmethod getType()[source]
Return type:

Literal['vectorPathCommandCubicBezierCurve']

to_dict()[source]
Return type:

dict

end_control_point: Optional[Point]

The end control point of the curve

end_point: Optional[Point]

The end point of the curve

start_control_point: Optional[Point]

The start control point of the curve

class pytdbot.types.VectorPathCommandLine(end_point=None)[source]

Bases: TlObject, VectorPathCommand

A straight line to a given point

Parameters:

end_point ("types.Point") – The end point of the straight line

__init__(end_point=None)[source]
Parameters:

end_point (Point | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[VectorPathCommandLine]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['VectorPathCommand']

classmethod getType()[source]
Return type:

Literal['vectorPathCommandLine']

to_dict()[source]
Return type:

dict

end_point: Optional[Point]

The end point of the straight line

class pytdbot.types.Venue(location=None, title='', address='', provider='', id='', type='')[source]

Bases: TlObject

Describes a venue

Parameters:
  • location ("types.Location") – Venue location; as defined by the sender

  • title (str) – Venue name; as defined by the sender

  • address (str) – Venue address; as defined by the sender

  • provider (str) – Provider of the venue database; as defined by the sender. Currently, only "foursquare" and "gplaces" (Google Places) need to be supported

  • id (str) – Identifier of the venue in the provider database; as defined by the sender

  • type (str) – Type of the venue in the provider database; as defined by the sender

__init__(location=None, title='', address='', provider='', id='', type='')[source]
Parameters:
  • location (Location | None)

  • title (str)

  • address (str)

  • provider (str)

  • id (str)

  • type (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Venue]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Venue']

classmethod getType()[source]
Return type:

Literal['venue']

to_dict()[source]
Return type:

dict

address: Optional[str]

Venue address; as defined by the sender

id: Optional[str]

Identifier of the venue in the provider database; as defined by the sender

location: Optional[Location]

Venue location; as defined by the sender

provider: Optional[str]

Provider of the venue database; as defined by the sender. Currently, only "foursquare" and "gplaces" (Google Places) need to be supported

title: Optional[str]

Venue name; as defined by the sender

type: Optional[str]

Type of the venue in the provider database; as defined by the sender

class pytdbot.types.VerificationStatus(is_verified=False, is_scam=False, is_fake=False, bot_verification_icon_custom_emoji_id=0)[source]

Bases: TlObject

Contains information about verification status of a chat or a user

Parameters:
  • is_verified (bool) – True, if the chat or the user is verified by Telegram

  • is_scam (bool) – True, if the chat or the user is marked as scam by Telegram

  • is_fake (bool) – True, if the chat or the user is marked as fake by Telegram

  • bot_verification_icon_custom_emoji_id (int) – Identifier of the custom emoji to be shown as verification sign provided by a bot for the user; 0 if none

__init__(is_verified=False, is_scam=False, is_fake=False, bot_verification_icon_custom_emoji_id=0)[source]
Parameters:
  • is_verified (bool)

  • is_scam (bool)

  • is_fake (bool)

  • bot_verification_icon_custom_emoji_id (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[VerificationStatus]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['VerificationStatus']

classmethod getType()[source]
Return type:

Literal['verificationStatus']

to_dict()[source]
Return type:

dict

bot_verification_icon_custom_emoji_id: int

Identifier of the custom emoji to be shown as verification sign provided by a bot for the user; 0 if none

is_fake: bool

True, if the chat or the user is marked as fake by Telegram

is_scam: bool

True, if the chat or the user is marked as scam by Telegram

is_verified: bool

True, if the chat or the user is verified by Telegram

class pytdbot.types.Video(duration=0, width=0, height=0, file_name='', mime_type='', has_stickers=False, supports_streaming=False, minithumbnail=None, thumbnail=None, video=None)[source]

Bases: TlObject

Describes a video file

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

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

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

  • file_name (str) – Original name of the file; as defined by the sender

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

  • has_stickers (bool) – True, if stickers were added to the video. The list of corresponding sticker sets can be received using getAttachedStickerSets

  • supports_streaming (bool) – True, if the video is expected to be streamed

  • minithumbnail ("types.Minithumbnail") – Video minithumbnail; may be null

  • thumbnail ("types.Thumbnail") – Video thumbnail in JPEG or MPEG4 format; as defined by the sender; may be null

  • video ("types.File") – File containing the video

__init__(duration=0, width=0, height=0, file_name='', mime_type='', has_stickers=False, supports_streaming=False, minithumbnail=None, thumbnail=None, video=None)[source]
Parameters:
  • duration (int)

  • width (int)

  • height (int)

  • file_name (str)

  • mime_type (str)

  • has_stickers (bool)

  • supports_streaming (bool)

  • minithumbnail (Minithumbnail | None)

  • thumbnail (Thumbnail | None)

  • video (File | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[Video]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['Video']

classmethod getType()[source]
Return type:

Literal['video']

to_dict()[source]
Return type:

dict

duration: int

Duration of the video, in seconds; as defined by the sender

file_name: Optional[str]

Original name of the file; as defined by the sender

has_stickers: bool

True, if stickers were added to the video. The list of corresponding sticker sets can be received using getAttachedStickerSets

height: int

Video height; as defined by the sender

mime_type: Optional[str]

MIME type of the file; as defined by the sender

minithumbnail: Optional[Minithumbnail]

Video minithumbnail; may be null

supports_streaming: bool

True, if the video is expected to be streamed

thumbnail: Optional[Thumbnail]

Video thumbnail in JPEG or MPEG4 format; as defined by the sender; may be null

video: Optional[File]

File containing the video

width: int

Video width; as defined by the sender

class pytdbot.types.VideoChat(group_call_id=0, has_participants=False, default_participant_id=None)[source]

Bases: TlObject

Describes a video chat, i.e. a group call bound to a chat

Parameters:
  • group_call_id (int) – Group call identifier of an active video chat; 0 if none. Full information about the video chat can be received through the method getGroupCall

  • has_participants (bool) – True, if the video chat has participants

  • default_participant_id ("types.MessageSender") – Default group call participant identifier to join the video chat; may be null

__init__(group_call_id=0, has_participants=False, default_participant_id=None)[source]
Parameters:
  • group_call_id (int)

  • has_participants (bool)

  • default_participant_id (MessageSender | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[VideoChat]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['VideoChat']

classmethod getType()[source]
Return type:

Literal['videoChat']

to_dict()[source]
Return type:

dict

default_participant_id: Union[MessageSenderUser, MessageSenderChat, None]

Default group call participant identifier to join the video chat; may be null

group_call_id: int

Group call identifier of an active video chat; 0 if none. Full information about the video chat can be received through the method getGroupCall

has_participants: bool

True, if the video chat has participants

class pytdbot.types.VideoChatStream(channel_id=0, scale=0, time_offset=0)[source]

Bases: TlObject

Describes an available stream in a video chat

Parameters:
  • channel_id (int) – Identifier of an audio/video channel

  • scale (int) – Scale of segment durations in the stream. The duration is 1000/(2**scale) milliseconds

  • time_offset (int) – Point in time when the stream currently ends; Unix timestamp in milliseconds

__init__(channel_id=0, scale=0, time_offset=0)[source]
Parameters:
  • channel_id (int)

  • scale (int)

  • time_offset (int)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[VideoChatStream]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['VideoChatStream']

classmethod getType()[source]
Return type:

Literal['videoChatStream']

to_dict()[source]
Return type:

dict

channel_id: int

Identifier of an audio/video channel

scale: int

Scale of segment durations in the stream. The duration is 1000/(2**scale) milliseconds

time_offset: int

Point in time when the stream currently ends; Unix timestamp in milliseconds

class pytdbot.types.VideoChatStreams(streams=None)[source]

Bases: TlObject

Represents a list of video chat streams

Parameters:

streams (List["types.VideoChatStream"]) – A list of video chat streams

__init__(streams=None)[source]
Parameters:

streams (List[VideoChatStream] | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[VideoChatStreams]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['VideoChatStreams']

classmethod getType()[source]
Return type:

Literal['videoChatStreams']

to_dict()[source]
Return type:

dict

streams: List[VideoChatStream]

A list of video chat streams

class pytdbot.types.VideoMessageAdvertisement(unique_id=0, text='', min_display_duration=0, max_display_duration=0, can_be_reported=False, sponsor=None, title='', additional_info='')[source]

Bases: TlObject

Describes an advertisent to be shown while a video from a message is watched

Parameters:
  • unique_id (int) – Unique identifier of this result

  • text (str) – Text of the advertisement

  • min_display_duration (int) – The minimum amount of time the advertisement must be displayed before it can be hidden by the user, in seconds

  • max_display_duration (int) – The maximum amount of time the advertisement must be displayed before it must be automatically hidden, in seconds

  • can_be_reported (bool) – True, if the advertisement can be reported to Telegram moderators through reportVideoMessageAdvertisement

  • sponsor ("types.AdvertisementSponsor") – Information about the sponsor of the advertisement

  • title (str) – Title of the sponsored message

  • additional_info (str) – If non-empty, additional information about the sponsored message to be shown along with the message

__init__(unique_id=0, text='', min_display_duration=0, max_display_duration=0, can_be_reported=False, sponsor=None, title='', additional_info='')[source]
Parameters:
  • unique_id (int)

  • text (str)

  • min_display_duration (int)

  • max_display_duration (int)

  • can_be_reported (bool)

  • sponsor (AdvertisementSponsor | None)

  • title (str)

  • additional_info (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[VideoMessageAdvertisement]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['VideoMessageAdvertisement']

classmethod getType()[source]
Return type:

Literal['videoMessageAdvertisement']

to_dict()[source]
Return type:

dict

additional_info: Optional[str]

If non-empty, additional information about the sponsored message to be shown along with the message

can_be_reported: bool

True, if the advertisement can be reported to Telegram moderators through reportVideoMessageAdvertisement

max_display_duration: int

The maximum amount of time the advertisement must be displayed before it must be automatically hidden, in seconds

min_display_duration: int

The minimum amount of time the advertisement must be displayed before it can be hidden by the user, in seconds

sponsor: Optional[AdvertisementSponsor]

Information about the sponsor of the advertisement

text: Optional[str]

Text of the advertisement

title: Optional[str]

Title of the sponsored message

unique_id: int

Unique identifier of this result

class pytdbot.types.VideoMessageAdvertisements(advertisements=None, start_delay=0, between_delay=0)[source]

Bases: TlObject

Contains a list of advertisements to be shown while a video from a message is watched

Parameters:
  • advertisements (List["types.VideoMessageAdvertisement"]) – List of advertisements

  • start_delay (int) – Delay before the first advertisement is shown, in seconds

  • between_delay (int) – Delay between consecutive advertisements, in seconds

__init__(advertisements=None, start_delay=0, between_delay=0)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[VideoMessageAdvertisements]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['VideoMessageAdvertisements']

classmethod getType()[source]
Return type:

Literal['videoMessageAdvertisements']

to_dict()[source]
Return type:

dict

advertisements: List[VideoMessageAdvertisement]

List of advertisements

between_delay: int

Delay between consecutive advertisements, in seconds

start_delay: int

Delay before the first advertisement is shown, in seconds

class pytdbot.types.VideoNote(duration=0, waveform=b'', length=0, minithumbnail=None, thumbnail=None, speech_recognition_result=None, video=None)[source]

Bases: TlObject

Describes a video note. The video must be equal in width and height, cropped to a circle, and stored in MPEG4 format

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

  • waveform (bytes) – A waveform representation of the video note’s audio in 5-bit format; may be empty if unknown

  • length (int) – Video width and height; as defined by the sender

  • minithumbnail ("types.Minithumbnail") – Video minithumbnail; may be null

  • thumbnail ("types.Thumbnail") – Video thumbnail in JPEG format; as defined by the sender; may be null

  • speech_recognition_result ("types.SpeechRecognitionResult") – Result of speech recognition in the video note; may be null

  • video ("types.File") – File containing the video

__init__(duration=0, waveform=b'', length=0, minithumbnail=None, thumbnail=None, speech_recognition_result=None, video=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[VideoNote]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['VideoNote']

classmethod getType()[source]
Return type:

Literal['videoNote']

to_dict()[source]
Return type:

dict

duration: int

Duration of the video, in seconds; as defined by the sender

length: int

Video width and height; as defined by the sender

minithumbnail: Optional[Minithumbnail]

Video minithumbnail; may be null

speech_recognition_result: Union[SpeechRecognitionResultPending, SpeechRecognitionResultText, SpeechRecognitionResultError, None]

Result of speech recognition in the video note; may be null

thumbnail: Optional[Thumbnail]

Video thumbnail in JPEG format; as defined by the sender; may be null

video: Optional[File]

File containing the video

waveform: Optional[bytes]

A waveform representation of the video note’s audio in 5-bit format; may be empty if unknown

class pytdbot.types.VideoStoryboard(storyboard_file=None, width=0, height=0, map_file=None)[source]

Bases: TlObject

Describes a storyboard for a video

Parameters:
  • storyboard_file ("types.File") – A JPEG file that contains tiled previews of video

  • width (int) – Width of a tile

  • height (int) – Height of a tile

  • map_file ("types.File") – File that describes mapping of position in the video to a tile in the JPEG file

__init__(storyboard_file=None, width=0, height=0, map_file=None)[source]
Parameters:
  • storyboard_file (File | None)

  • width (int)

  • height (int)

  • map_file (File | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[VideoStoryboard]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['VideoStoryboard']

classmethod getType()[source]
Return type:

Literal['videoStoryboard']

to_dict()[source]
Return type:

dict

height: int

Height of a tile

map_file: Optional[File]

File that describes mapping of position in the video to a tile in the JPEG file

storyboard_file: Optional[File]

A JPEG file that contains tiled previews of video

width: int

Width of a tile

class pytdbot.types.VoiceNote(duration=0, waveform=b'', mime_type='', speech_recognition_result=None, voice=None)[source]

Bases: TlObject

Describes a voice note

Parameters:
  • duration (int) – Duration of the voice note, in seconds; as defined by the sender

  • waveform (bytes) – A waveform representation of the voice note in 5-bit format

  • mime_type (str) – MIME type of the file; as defined by the sender. Usually, one of "audio/ogg" for Opus in an OGG container, "audio/mpeg" for an MP3 audio, or "audio/mp4" for an M4A audio

  • speech_recognition_result ("types.SpeechRecognitionResult") – Result of speech recognition in the voice note; may be null

  • voice ("types.File") – File containing the voice note

__init__(duration=0, waveform=b'', mime_type='', speech_recognition_result=None, voice=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[VoiceNote]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['VoiceNote']

classmethod getType()[source]
Return type:

Literal['voiceNote']

to_dict()[source]
Return type:

dict

duration: int

Duration of the voice note, in seconds; as defined by the sender

mime_type: Optional[str]

MIME type of the file; as defined by the sender. Usually, one of "audio/ogg" for Opus in an OGG container, "audio/mpeg" for an MP3 audio, or "audio/mp4" for an M4A audio

speech_recognition_result: Union[SpeechRecognitionResultPending, SpeechRecognitionResultText, SpeechRecognitionResultError, None]

Result of speech recognition in the voice note; may be null

voice: Optional[File]

File containing the voice note

waveform: Optional[bytes]

A waveform representation of the voice note in 5-bit format

class pytdbot.types.WebApp(short_name='', title='', description='', photo=None, animation=None)[source]

Bases: TlObject

Describes a Web App. Use getInternalLink with internalLinkTypeWebApp to share the Web App

Parameters:
  • short_name (str) – Web App short name

  • title (str) – Web App title

  • description (str) – Web App description

  • photo ("types.Photo") – Web App photo

  • animation ("types.Animation") – Web App animation; may be null

__init__(short_name='', title='', description='', photo=None, animation=None)[source]
Parameters:
  • short_name (str)

  • title (str)

  • description (str)

  • photo (Photo | None)

  • animation (Animation | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[WebApp]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['WebApp']

classmethod getType()[source]
Return type:

Literal['webApp']

to_dict()[source]
Return type:

dict

animation: Optional[Animation]

Web App animation; may be null

description: Optional[str]

Web App description

photo: Optional[Photo]

Web App photo

short_name: Optional[str]

Web App short name

title: Optional[str]

Web App title

class pytdbot.types.WebAppInfo(launch_id=0, url='')[source]

Bases: TlObject

Contains information about a Web App

Parameters:
  • launch_id (int) – Unique identifier for the Web App launch

  • url (str) – A Web App URL to open in a web view

__init__(launch_id=0, url='')[source]
Parameters:
  • launch_id (int)

  • url (str)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[WebAppInfo]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['WebAppInfo']

classmethod getType()[source]
Return type:

Literal['webAppInfo']

to_dict()[source]
Return type:

dict

launch_id: int

Unique identifier for the Web App launch

url: Optional[str]

A Web App URL to open in a web view

class pytdbot.types.WebAppOpenMode[source]

Bases: object

Describes mode in which a Web App is opened

class pytdbot.types.WebAppOpenModeCompact[source]

Bases: TlObject, WebAppOpenMode

The Web App is opened in the compact mode

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[WebAppOpenModeCompact]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['WebAppOpenMode']

classmethod getType()[source]
Return type:

Literal['webAppOpenModeCompact']

to_dict()[source]
Return type:

dict

class pytdbot.types.WebAppOpenModeFullScreen[source]

Bases: TlObject, WebAppOpenMode

The Web App is opened in the full-screen mode

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[WebAppOpenModeFullScreen]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['WebAppOpenMode']

classmethod getType()[source]
Return type:

Literal['webAppOpenModeFullScreen']

to_dict()[source]
Return type:

dict

class pytdbot.types.WebAppOpenModeFullSize[source]

Bases: TlObject, WebAppOpenMode

The Web App is opened in the full-size mode

__init__()[source]
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[WebAppOpenModeFullSize]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['WebAppOpenMode']

classmethod getType()[source]
Return type:

Literal['webAppOpenModeFullSize']

to_dict()[source]
Return type:

dict

class pytdbot.types.WebAppOpenParameters(theme=None, application_name='', mode=None)[source]

Bases: TlObject

Options to be used when a Web App is opened

Parameters:
  • theme ("types.ThemeParameters") – Preferred Web App theme; pass null to use the default theme

  • application_name (str) – Short name of the current application; 0-64 English letters, digits, and underscores

  • mode ("types.WebAppOpenMode") – The mode in which the Web App is opened; pass null to open in webAppOpenModeFullSize

__init__(theme=None, application_name='', mode=None)[source]
Parameters:
Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[WebAppOpenParameters]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['WebAppOpenParameters']

classmethod getType()[source]
Return type:

Literal['webAppOpenParameters']

to_dict()[source]
Return type:

dict

application_name: Optional[str]

Short name of the current application; 0-64 English letters, digits, and underscores

mode: Union[WebAppOpenModeCompact, WebAppOpenModeFullSize, WebAppOpenModeFullScreen, None]

The mode in which the Web App is opened; pass null to open in webAppOpenModeFullSize

theme: Optional[ThemeParameters]

Preferred Web App theme; pass null to use the default theme

class pytdbot.types.WebPageInstantView(page_blocks=None, view_count=0, version=0, is_rtl=False, is_full=False, feedback_link=None)[source]

Bases: TlObject

Describes an instant view page for a web page

Parameters:
  • page_blocks (List["types.PageBlock"]) – Content of the instant view page

  • view_count (int) – Number of the instant view views; 0 if unknown

  • version (int) – Version of the instant view; currently, can be 1 or 2

  • is_rtl (bool) – True, if the instant view must be shown from right to left

  • is_full (bool) – True, if the instant view contains the full page. A network request might be needed to get the full instant view

  • feedback_link ("types.InternalLinkType") – An internal link to be opened to leave feedback about the instant view

__init__(page_blocks=None, view_count=0, version=0, is_rtl=False, is_full=False, feedback_link=None)[source]
Parameters:
  • page_blocks (List[PageBlock] | None)

  • view_count (int)

  • version (int)

  • is_rtl (bool)

  • is_full (bool)

  • feedback_link (InternalLinkType | None)

Return type:

None

classmethod from_dict(data)[source]
Return type:

Optional[WebPageInstantView]

Parameters:

data (dict)

classmethod getClass()[source]
Return type:

Literal['WebPageInstantView']

classmethod getType()[source]
Return type:

Literal['webPageInstantView']

to_dict()[source]
Return type:

dict

feedback_link: Union[InternalLinkTypeActiveSessions, InternalLinkTypeAttachmentMenuBot, InternalLinkTypeAuthenticationCode, InternalLinkTypeBackground, InternalLinkTypeBotAddToChannel, InternalLinkTypeBotStart, InternalLinkTypeBotStartInGroup, InternalLinkTypeBusinessChat, InternalLinkTypeBuyStars, InternalLinkTypeChangePhoneNumber, InternalLinkTypeChatAffiliateProgram, InternalLinkTypeChatBoost, InternalLinkTypeChatFolderInvite, InternalLinkTypeChatFolderSettings, InternalLinkTypeChatInvite, InternalLinkTypeDefaultMessageAutoDeleteTimerSettings, InternalLinkTypeDirectMessagesChat, InternalLinkTypeEditProfileSettings, InternalLinkTypeGame, InternalLinkTypeGiftCollection, InternalLinkTypeGroupCall, InternalLinkTypeInstantView, InternalLinkTypeInvoice, InternalLinkTypeLanguagePack, InternalLinkTypeLanguageSettings, InternalLinkTypeMainWebApp, InternalLinkTypeMessage, InternalLinkTypeMessageDraft, InternalLinkTypeMyStars, InternalLinkTypeMyToncoins, InternalLinkTypePassportDataRequest, InternalLinkTypePhoneNumberConfirmation, InternalLinkTypePremiumFeatures, InternalLinkTypePremiumGift, InternalLinkTypePremiumGiftCode, InternalLinkTypePrivacyAndSecuritySettings, InternalLinkTypeProxy, InternalLinkTypePublicChat, InternalLinkTypeQrCodeAuthentication, InternalLinkTypeRestorePurchases, InternalLinkTypeSettings, InternalLinkTypeStickerSet, InternalLinkTypeStory, InternalLinkTypeStoryAlbum, InternalLinkTypeTheme, InternalLinkTypeThemeSettings, InternalLinkTypeUnknownDeepLink, InternalLinkTypeUnsupportedProxy, InternalLinkTypeUpgradedGift, InternalLinkTypeUserPhoneNumber, InternalLinkTypeUserToken, InternalLinkTypeVideoChat, InternalLinkTypeWebApp, None]

An internal link to be opened to leave feedback about the instant view

is_full: bool

True, if the instant view contains the full page. A network request might be needed to get the full instant view

is_rtl: bool

True, if the instant view must be shown from right to left

page_blocks: List[PageBlock]

Content of the instant view page

version: int

Version of the instant view; currently, can be 1 or 2

view_count: int

Number of the instant view views; 0 if unknown

Modules