Skip to content

Objects

Documentation for Objects

Animation

Bases: BaseObject

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

Parameters:

Name Type Description Default
file_id str)

Identifier for this file, which can be used to download or reuse the file

None
file_unique_id str)

Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.

None
width int)

Video width as defined by sender

None
height int)

Video height as defined by sender

None
duration int)

Duration of the video in seconds as defined by sender

None
thumb obj)

Optional. Animation thumbnail as defined by sender

required
file_name str)

Optional. Original animation filename as defined by sender

required
mime_type str)

Optional. MIME type of the file as defined by sender

required
file_size int)

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

required

Documentation for Audio

Audio

Bases: BaseObject

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

Parameters:

Name Type Description Default
file_id str

Unique identifier for this file

None
file_unique_id str

Unique identifier for this file, which is supposed to be the same over time and for different bots.

None
duration int

Optional Duration of the audio in seconds as defined by sender

required
performer str

Optional. Performer of the audio as defined by sender or by audio tags

required
title str

Optional. Title of the audio as defined by sender or by audio tags

required
file_name str

Optional. Original filename as defined by sender

required
mime_type str

Optional. MIME type of the file as defined by sender

required
file_size int

Optional. File size

required
thumb

obj:PhotoSize, optional): Optional. Thumbnail of the album cover to which the music file belongs

required

Documentation for Botcommand

BotCommandScopeAllChatAdministrators

Bases: BaseObject

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

https://core.telegram.org/bots/api#botcommandscopeallchatadministrators

Parameters:

Name Type Description Default
type

obj:str): Scope type, must be all_chat_administrators.

None

BotCommandScopeAllGroupChats

Bases: BaseObject

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

https://core.telegram.org/bots/api#botcommandscopeallgroupchats

Parameters:

Name Type Description Default
type

obj:str): Scope type, must be all_group_chats.

None

BotCommandScopeAllPrivateChats

Bases: BaseObject

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

https://core.telegram.org/bots/api#botcommandscopeallprivatechats

Parameters:

Name Type Description Default
type

obj:str): Scope type, must be all_private_chats.

None

BotCommandScopeChat

Bases: BaseObject

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

https://core.telegram.org/bots/api#botcommandscopechat

Parameters:

Name Type Description Default
type

obj:str): Scope type, must be chat.

None
chat_id

obj:int): Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername).

None

BotCommandScopeChatAdministrators

Bases: BaseObject

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

https://core.telegram.org/bots/api#botcommandscopechatadministrators

Parameters:

Name Type Description Default
type

obj:str): Scope type, must be chat_administrators.

None
chat_id

obj:int): Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername).

None

BotCommandScopeChatMember

Bases: BaseObject

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

https://core.telegram.org/bots/api#botcommandscopechatmember

Parameters:

Name Type Description Default
type

obj:str): Scope type, must be chat_member.

None
chat_id

obj:int): Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername).

None
user_id

obj:int): Unique identifier of the target user.

None

BotCommandScopeDefault

Bases: BaseObject

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

https://core.telegram.org/bots/api#botcommandscopedefault

Parameters:

Name Type Description Default
type

obj:str): Scope type, must be default.

None