Members

(constant) DEFAULT_OPTIONS :Object

Type:
  • Object

(constant) WEBHOOK_REPLY_STUB :WebhookResponse

Methods

KeyboardWrap(btn, index, currentRow) → {boolean}

Keyboard Builder wrapping function used to divide the keyboard into columns.

Parameters:
NameTypeDescription
btnstring

Current button object

indexnumber

Current button index

currentRownumber

Current row

Returns:
Type: 
boolean
Example
Markup.keyboard(['one', 'two', 'three', 'four'], {
  wrap: (btn, index, currentRow) => index % 2 !== 0
})

MarkupCallback(markup)

Markup factory function

Parameters:
NameTypeDescription
markupMarkup

Empty created Markup instance

Example
Extra.markdown().markup((markup) => markup.removeKeyboard())

(async) attachFormMedia(form, media, id, agentopt) → {Promise.<void>}

Used to attach media to form

Parameters:
NameTypeAttributesDescription
formMultipartStream

MultipartStream instance

mediastring | boolean | number | FileToAttach

Value to attach

id*

Form field name

agenthttp.Agent<optional>

HTTP Agent

Returns:
Type: 
Promise.<void>

(async) attachFormValue(form, id, value, agentopt) → {Promise.<void>}

Used to attach primitive values & media to form

Parameters:
NameTypeAttributesDescription
formMultipartStream

MultipartStream instance

id*

Form field name

valuestring | boolean | number | object

Value to attach

agenthttp.Agent<optional>

HTTP Agent

Returns:
Type: 
Promise.<void>

isTelegramError(err) → {boolean}

Checks if the error is a TelegramError

Parameters:
NameTypeDescription
errobject

Error object

Returns:
Type: 
boolean

Type Definitions

Action

Type:
  • 'typing' | 'upload_photo' | 'record_video' | 'upload_video' | 'record_voice' | 'upload_voice' | 'upload_document' | 'choose_sticker' | 'find_location' | 'record_video_note' | 'upload_video_note'

Animation

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

Type:
  • object
Properties
NameTypeAttributesDescription
file_idstring

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

file_unique_idstring

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.

widthnumber

Video width as defined by sender

heightnumber

Video height as defined by sender

durationnumber

Duration of the video in seconds as defined by sender

thumbnailPhotoSize<optional>

Optional. Animation thumbnail as defined by sender

file_namestring<optional>

Optional. Original animation filename as defined by sender

mime_typestring<optional>

Optional. MIME type of the file as defined by sender

file_sizenumber<optional>

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.

AnswerToWebhookOptions

Type:
  • object
Properties
NameTypeAttributesDescription
attachmentAgenthttp.Agent<optional>

HTTP Agent used for attachments

Audio

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

Type:
  • object
Properties
NameTypeAttributesDescription
file_idstring

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

file_unique_idstring

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.

durationnumber

Duration of the audio in seconds as defined by sender

performerstring<optional>

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

titlestring<optional>

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

file_namestring<optional>

Optional. Original filename as defined by sender

mime_typestring<optional>

Optional. MIME type of the file as defined by sender

file_sizenumber<optional>

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.

thumbnailPhotoSize<optional>

Optional. Thumbnail of the album cover to which the music file belongs

BotCommand

This object represents a bot command.

Type:
  • object
Properties
NameTypeDescription
commandstring

Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores.

descriptionstring

Description of the command; 1-256 characters.

BotCommandScope

BotCommandScopeAllChatAdministrators

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

Type:
  • object
Properties
NameTypeDescription
type'all_chat_administrators'

Scope type, must be all_chat_administrators

BotCommandScopeAllGroupChats

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

Type:
  • object
Properties
NameTypeDescription
type'all_group_chats'

Scope type, must be all_group_chats

BotCommandScopeAllPrivateChats

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

Type:
  • object
Properties
NameTypeDescription
type'all_private_chats'

Scope type, must be all_private_chats

BotCommandScopeChat

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

Type:
  • object
Properties
NameTypeDescription
type'chat'

Scope type, must be chat

chat_idnumber | string

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

BotCommandScopeChatAdministrators

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

Type:
  • object
Properties
NameTypeDescription
type'chat_administrators'

Scope type, must be chat_administrators

chat_idnumber | string

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

BotCommandScopeChatMember

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

Type:
  • object
Properties
NameTypeDescription
type'chat_member'

Scope type, must be chat_member

chat_idnumber | string

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

user_idnumber

Unique identifier of the target user

BotCommandScopeDefault

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

Type:
  • object
Properties
NameTypeDescription
type'default'

Scope type, must be default

BotDescription

This object represents the bot's description.

Type:
  • object
Properties
NameTypeDescription
descriptionstring

The bot's description

BotName

This object represents the bot's name.

Type:
  • object
Properties
NameTypeDescription
namestring

The bot's name

BotShortDescription

This object represents the bot's short description.

Type:
  • object
Properties
NameTypeDescription
short_descriptionstring

The bot's short description

CallApiExtra

Type:
  • object
Properties
NameTypeDescription
signalAbortSignal

Optional AbortSignal to cancel the request

CallbackGame

A placeholder, currently holds no information. Use BotFather to set up your game.

Type:
  • *

CallbackQuery

This object represents an incoming callback query from a callback button in an inline keyboard. If the button that originated the query was attached to a message sent by the bot, the field message will be present. If the button was attached to a message sent via the bot (in inline mode), the field inline_message_id will be present. Exactly one of the fields data or game_short_name will be present.

Type:
  • object
Properties
NameTypeAttributesDescription
idstring

Unique identifier for this query

fromUser

Sender

messageMessage<optional>

Optional. Message with the callback button that originated the query. Note that message content and message date will not be available if the message is too old

inline_message_idstring<optional>

Optional. Identifier of the message sent via the bot in inline mode, that originated the query.

chat_instancestring

Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games.

datastring<optional>

Optional. Data associated with the callback button. Be aware that the message originated the query can contain no callback buttons with this data.

game_short_namestring<optional>

Optional. Short name of a Game to be returned, serves as the unique identifier for the game

Chat

This object represents a chat.

Type:
  • object
Properties
NameTypeAttributesDescription
idnumber

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

type'private' | 'group' | 'supergroup' | 'channel'

Type of chat, can be either “private”, “group”, “supergroup” or “channel”

titlestring<optional>

Optional. Title, for supergroups, channels and group chats

usernamestring<optional>

Optional. Username, for private chats, supergroups and channels if available

first_namestring<optional>

Optional. First name of the other party in a private chat

last_namestring<optional>

Optional. Last name of the other party in a private chat

is_forumboolean<optional>

Optional. True, if the supergroup chat is a forum (has topics enabled)

photoChatPhoto<optional>

Optional. Chat photo. Returned only in getChat.

active_usernamesArray.<string><optional>

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

emoji_status_custom_emoji_idstring<optional>

Optional. Custom emoji identifier of emoji status of the other party in a private chat in Unix time, if any. Returned only in getChat.

emoji_status_expiration_datenumber<optional>

Optional. Expiration date of the emoji status of the other party in a private chat, if any. Returned only in getChat.

biostring<optional>

Optional. Bio of the other party in a private chat. Returned only in getChat.

has_private_forwardsboolean<optional>

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

has_restricted_voice_and_video_messagesboolean<optional>

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

join_to_send_messagesboolean<optional>

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

join_by_requestboolean<optional>

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

descriptionstring<optional>

Optional. Description, for groups, supergroups and channel chats. Returned only in getChat.

invite_linkstring<optional>

Optional. Primary invite link, for groups, supergroups and channel chats. Returned only in getChat.

pinned_messageMessage<optional>

Optional. The most recent pinned message (by sending date). Returned only in getChat.

permissionsChatPermissions<optional>

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

slow_mode_delaynumber<optional>

Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user; in seconds. Returned only in getChat.

message_auto_delete_timenumber<optional>

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

has_aggressive_anti_spam_enabledboolean<optional>

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

has_hidden_membersboolean<optional>

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

has_protected_contentboolean<optional>

Optional. True, if messages from the chat can't be forwarded to other chats. Returned only in getChat.

sticker_set_namestring<optional>

Optional. For supergroups, name of group sticker set. Returned only in getChat.

can_set_sticker_setboolean<optional>

Optional. True, if the bot can change the group sticker set. Returned only in getChat.

linked_chat_idnumber<optional>

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

locationChatLocation<optional>

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

ChatAdministratorRights

Represents the rights of an administrator in a chat.

Type:
  • object
Properties
NameTypeAttributesDescription
is_anonymousboolean

True, if the user's presence in the chat is hidden

can_manage_chatboolean

True, if the administrator can access the chat event log, boost list in channels, see channel members, report spam messages, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege

can_delete_messagesboolean

True, if the administrator can delete messages of other users

can_manage_video_chatsboolean

True, if the administrator can manage video chats

can_restrict_membersboolean

True, if the administrator can restrict, ban or unban chat members, or access supergroup statistics

can_promote_membersboolean

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

can_change_infoboolean

True, if the user is allowed to change the chat title, photo and other settings

can_invite_usersboolean

True, if the user is allowed to invite new users to the chat

can_post_messagesboolean<optional>

Optional. True, if the administrator can post messages in the channel, or access channel statistics; channels only

can_edit_messagesboolean<optional>

Optional. True, if the administrator can edit messages of other users and can pin messages; channels only

can_pin_messagesboolean<optional>

Optional. True, if the user is allowed to pin messages; groups and supergroups only

can_post_storiesboolean<optional>

Optional. True, if the administrator can post stories in the channel; channels only

can_edit_storiesboolean<optional>

Optional. True, if the administrator can edit stories posted by other users; channels only

can_delete_storiesboolean<optional>

Optional. True, if the administrator can delete stories posted by other users; channels only

can_manage_topicsboolean<optional>

Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only

Represents an invite link for a chat.

Type:
  • object
Properties
NameTypeAttributesDescription
invite_linkstring

The invite link. If the link was created by another chat administrator, then the second part of the link will be replaced with “…”.

creatorUser

Creator of the link

creates_join_requestboolean

True, if users joining the chat via the link need to be approved by chat administrators

is_primaryboolean

True, if the link is primary

is_revokedboolean

True, if the link is revoked

namestring<optional>

Optional. Invite link name

expire_datenumber<optional>

Optional. Point in time (Unix timestamp) when the link will expire or has been expired

member_limitnumber<optional>

Optional. The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999

pending_join_request_countnumber<optional>

Optional. Number of pending join requests created using this link

ChatJoinRequest

Represents a join request sent to a chat.

Type:
  • object
Properties
NameTypeAttributesDescription
chatChat

Chat to which the request was sent

fromUser

User that sent the join request

user_chat_idnumber

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

datenumber

Date the request was sent in Unix time

biostring<optional>

Optional. Bio of the user.

invite_linkChatInviteLink<optional>

Optional. Chat invite link that was used by the user to send the join request

ChatLocation

Represents a location to which a chat is connected.

Type:
  • object
Properties
NameTypeDescription
locationLocation

The location to which the supergroup is connected. Can't be a live location.

addressstring

Location address; 1-64 characters, as defined by the chat owner

ChatMember

This object contains information about one member of a chat. Currently, the following 6 types of chat members are supported:

ChatMemberOwner

ChatMemberAdministrator

ChatMemberMember

ChatMemberRestricted

ChatMemberLeft

ChatMemberBanned

ChatMemberAdministrator

Represents a chat member that has some additional privileges.

Type:
  • object
Properties
NameTypeAttributesDescription
status'administrator'

The member's status in the chat, always “administrator”

userUser

Information about the user

can_be_editedboolean

True, if the bot is allowed to edit administrator privileges of that user

is_anonymousboolean

True, if the user's presence in the chat is hidden

can_manage_chatboolean

True, if the administrator can access the chat event log, boost list in channels, see channel members, report spam messages, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege

can_delete_messagesboolean

True, if the administrator can delete messages of other users

can_manage_video_chatsboolean

True, if the administrator can manage video chats

can_restrict_membersboolean

True, if the administrator can restrict, ban or unban chat members, or access supergroup statistics

can_promote_membersboolean

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

can_change_infoboolean

True, if the user is allowed to change the chat title, photo and other settings

can_invite_usersboolean

True, if the user is allowed to invite new users to the chat

can_post_messagesboolean<optional>

Optional. True, if the administrator can post messages in the channel, or access channel statistics; channels only

can_edit_messagesboolean<optional>

Optional. True, if the administrator can edit messages of other users and can pin messages; channels only

can_pin_messagesboolean<optional>

Optional. True, if the user is allowed to pin messages; groups and supergroups only

can_post_storiesboolean<optional>

Optional. True, if the administrator can post stories in the channel; channels only

can_edit_storiesboolean<optional>

Optional. True, if the administrator can edit stories posted by other users; channels only

can_delete_storiesboolean<optional>

Optional. True, if the administrator can delete stories posted by other users; channels only

can_manage_topicsboolean<optional>

Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only

custom_titlestring<optional>

Optional. Custom title for this user

ChatMemberBanned

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

Type:
  • object
Properties
NameTypeDescription
status'kicked'

The member's status in the chat, always “kicked”

userUser

Information about the user

until_datenumber

Date when restrictions will be lifted for this user; Unix time. If 0, then the user is banned forever

ChatMemberLeft

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

Type:
  • object
Properties
NameTypeDescription
status'left'

The member's status in the chat, always “left”

userUser

Information about the user

ChatMemberMember

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

Type:
  • object
Properties
NameTypeDescription
status'member'

The member's status in the chat, always “member”

userUser

Information about the user

ChatMemberOwner

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

Type:
  • object
Properties
NameTypeAttributesDescription
status'creator'

The member's status in the chat, always “creator”

userUser

Information about the user

is_anonymousboolean

True, if the user's presence in the chat is hidden

custom_titlestring<optional>

Optional. Custom title for this user

ChatMemberRestricted

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

Type:
  • object
Properties
NameTypeDescription
status'restricted'

The member's status in the chat, always “restricted”

userUser

Information about the user

is_memberboolean

True, if the user is a member of the chat at the moment of the request

can_send_messagesboolean

True, if the user is allowed to send text messages, contacts, invoices, locations and venues

can_send_audiosboolean

True, if the user is allowed to send audios

can_send_documentsboolean

True, if the user is allowed to send documents

can_send_photosboolean

True, if the user is allowed to send photos

can_send_videosboolean

True, if the user is allowed to send videos

can_send_video_notesboolean

True, if the user is allowed to send video notes

can_send_voice_notesboolean

True, if the user is allowed to send voice notes

can_send_pollsboolean

True, if the user is allowed to send polls

can_send_other_messagesboolean

True, if the user is allowed to send animations, games, stickers and use inline bots

can_add_web_page_previewsboolean

True, if the user is allowed to add web page previews to their messages

can_change_infoboolean

True, if the user is allowed to change the chat title, photo and other settings

can_invite_usersboolean

True, if the user is allowed to invite new users to the chat

can_pin_messagesboolean

True, if the user is allowed to pin messages

can_manage_topicsboolean

True, if the user is allowed to create forum topics

can_send_media_messagesboolean

True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes

until_datenumber

Date when restrictions will be lifted for this user; Unix time. If 0, then the user is restricted forever

ChatMemberStatus

Type:
  • 'creator' | 'administrator' | 'member' | 'restricted' | 'left' | 'kicked'

ChatMemberUpdated

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

Type:
  • object
Properties
NameTypeAttributesDescription
chatChat

Chat the user belongs to

fromUser

Performer of the action, which resulted in the change

datenumber

Date the change was done in Unix time

old_chat_memberChatMember

Previous information about the chat member

new_chat_memberChatMember

New information about the chat member

invite_linkChatInviteLink<optional>

Optional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only.

via_chat_folder_invite_linkboolean<optional>

Optional. True, if the user joined the chat via a chat folder invite link

ChatPermissions

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

Type:
  • object
Properties
NameTypeAttributesDescription
can_send_messagesboolean<optional>

Optional. True, if the user is allowed to send text messages, contacts, invoices, locations and venues

can_send_media_messagesboolean<optional>

Optional. True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages

can_send_audiosboolean<optional>

Optional. True, if the user is allowed to send audios

can_send_documentsboolean<optional>

Optional. True, if the user is allowed to send documents

can_send_photosboolean<optional>

Optional. True, if the user is allowed to send photos

can_send_videosboolean<optional>

Optional. True, if the user is allowed to send videos

can_send_video_notesboolean<optional>

Optional. True, if the user is allowed to send video notes

can_send_voice_notesboolean<optional>

Optional. True, if the user is allowed to send voice notes

can_send_pollsboolean<optional>

Optional. True, if the user is allowed to send polls

can_send_other_messagesboolean<optional>

Optional. True, if the user is allowed to send animations, games, stickers and use inline bots

can_add_web_page_previewsboolean<optional>

Optional. True, if the user is allowed to add web page previews to their messages

can_change_infoboolean<optional>

Optional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups

can_invite_usersboolean<optional>

Optional. True, if the user is allowed to invite new users to the chat

can_pin_messagesboolean<optional>

Optional. True, if the user is allowed to pin messages. Ignored in public supergroups

can_manage_topicsboolean<optional>

Optional. True, if the user is allowed to create forum topics. If omitted defaults to the value of can_pin_messages

ChatPhoto

This object represents a chat photo.

Type:
  • object
Properties
NameTypeDescription
small_file_idstring

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

small_file_unique_idstring

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

big_file_idstring

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

big_file_unique_idstring

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

ChatShared

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

Type:
  • object
Properties
NameTypeDescription
request_idnumber

Identifier of the request

chat_idnumber

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

ChatType

Type:
  • 'private' | 'group' | 'supergroup' | 'channel'

ChosenInlineResult

Represents a result of an inline query that was chosen by the user and sent to their chat partner.

Type:
  • object
Properties
NameTypeAttributesDescription
result_idstring

The unique identifier for the result that was chosen

fromUser

The user that chose the result

locationLocation<optional>

Optional. Sender location, only for bots that require user location

inline_message_idstring<optional>

Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. Will be also received in callback queries and can be used to edit the message.

querystring

The query that was used to obtain the result

Contact

This object represents a phone contact.

Type:
  • object
Properties
NameTypeAttributesDescription
phone_numberstring

Contact's phone number

first_namestring

Contact's first name

last_namestring<optional>

Optional. Contact's last name

user_idnumber<optional>

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

vcardstring<optional>

Optional. Additional data about the contact in the form of a vCard

ContextOptions

Type:
  • object
Properties
NameTypeDescription
channelModeboolean

Enable / Disable channel mode, you can find more information about this in Opengram constructor options type

Dice

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

Type:
  • object
Properties
NameTypeDescription
emojistring

Emoji on which the dice throw animation is based

valuenumber

Value of the dice, 1-6 for “🎲”, “🎯” and “🎳” base emoji, 1-5 for “🏀” and “⚽” base emoji, 1-64 for “🎰” base emoji

Document

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

Type:
  • object
Properties
NameTypeAttributesDescription
file_idstring

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

file_unique_idstring

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.

thumbnailPhotoSize<optional>

Optional. Document thumbnail as defined by sender

file_namestring<optional>

Optional. Original filename as defined by sender

mime_typestring<optional>

Optional. MIME type of the file as defined by sender

file_sizenumber<optional>

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.

EncryptedCredentials

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

Type:
  • object
Properties
NameTypeDescription
datastring

Base64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets required for EncryptedPassportElement decryption and authentication

hashstring

Base64-encoded data hash for data authentication

secretstring

Base64-encoded secret, encrypted with the bot's public RSA key, required for data decryption

EncryptedPassportElement

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

Type:
  • object
Properties
NameTypeAttributesDescription
type'personal_details' | 'passport' | 'driver_license' | 'identity_card' | 'internal_passport' | 'address' | 'utility_bill' | 'bank_statement' | 'rental_agreement' | 'passport_registration' | 'temporary_registration' | 'phone_number' | 'email'

Element type. One of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”, “phone_number”, “email”.

datastring<optional>

Optional. Base64-encoded encrypted Telegram Passport element data provided by the user, available for “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport” and “address” types. Can be decrypted and verified using the accompanying EncryptedCredentials.

phone_numberstring<optional>

Optional. User's verified phone number, available only for “phone_number” type

emailstring<optional>

Optional. User's verified email address, available only for “email” type

filesArray.<PassportFile><optional>

Optional. Array of encrypted files with documents provided by the user, available for “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials.

front_sidePassportFile<optional>

Optional. Encrypted file with the front side of the document, provided by the user. Available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials.

reverse_sidePassportFile<optional>

Optional. Encrypted file with the reverse side of the document, provided by the user. Available for “driver_license” and “identity_card”. The file can be decrypted and verified using the accompanying EncryptedCredentials.

selfiePassportFile<optional>

Optional. Encrypted file with the selfie of the user holding a document, provided by the user; available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials.

translationArray.<PassportFile><optional>

Optional. Array of encrypted files with translated versions of documents provided by the user. Available if requested for “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration” and “temporary_registration” types. Files can be decrypted and verified using the accompanying EncryptedCredentials.

hashstring

Base64-encoded element hash for using in PassportElementErrorUnspecified

EntityPredicate

EntityPredicateFn(entityObject, entityText, context) → {boolean}

Parameters:
NameTypeDescription
entityObjectMessageEntity

Entity object

entityTextstring

Entity text

contextOpengramContext

Update context

Returns:
Type: 
boolean

ExtraAddStickerToSet

Type:
  • object
Properties
NameTypeDescription
stickerInputSticker

A JSON-serialized object with information about the added sticker. If exactly the same sticker had already been added to the set, then the set isn't changed.

ExtraAnimation

Type:
  • object
Properties
NameTypeAttributesDescription
message_thread_idnumber<optional>

Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only

durationnumber<optional>

Optional. Duration of sent animation in seconds

widthnumber<optional>

Optional. Animation width

heightnumber<optional>

Optional. Animation height

thumbnailInputFile | FileId<optional>

Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »

captionstring<optional>

Optional. Animation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing

parse_modeParseMode<optional>

Optional. Mode for parsing entities in the animation caption. See formatting options for more details.

caption_entitiesArray.<MessageEntity><optional>

Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode

has_spoilerboolean<optional>

Optional. Pass True if the video needs to be covered with a spoiler animation

disable_notificationboolean<optional>

Optional. Sends the message silently. Users will receive a notification with no sound.

protect_contentboolean<optional>

Optional. Protects the contents of the sent message from forwarding

reply_to_message_idnumber<optional>

Optional. If the message is a reply, ID of the original message

allow_sending_without_replyboolean<optional>

Optional. Pass True if the message should be sent even if the specified replied-to message is not found

reply_markupInlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply<optional>

Optional. InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

ExtraAnswerCbQuery

Type:
  • object
Properties
NameTypeAttributesDescription
urlstring<optional>

Optional. URL that will be opened by the user's client. If you have created a Game and accepted the conditions via @BotFather, specify the URL that opens your game - note that this will only work if the query comes from a callback_game button. Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter.

cache_timenumber<optional>

Optional. The maximum amount of time in seconds that the result of the callback query may be cached client-side. Telegram apps will support caching starting in version 3.14. Defaults to 0.

ExtraAnswerInlineQuery

Type:
  • object
Properties
NameTypeAttributesDescription
cache_timenumber<optional>

Optional. The maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300.

is_personalboolean<optional>

Optional. Pass True if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query

next_offsetstring<optional>

Optional. Pass the offset that a client should send in the next query with the same text to receive more results. Pass an empty string if there are no more results or if you don't support pagination. Offset length can't exceed 64 bytes.

switch_pm_textstring<optional>

Optional. If passed, clients will display a button with specified text that switches the user to a private chat with the bot and sends the bot a start message with the parameter switch_pm_parameter

switch_pm_parameterstring<optional>

Optional. Deep-linking parameter for the /start message sent to the bot when user presses the switch button. 1-64 characters, only A-Z, a-z, 0-9, _ and - are allowed. Example: An inline bot that sends YouTube videos can ask the user to connect the bot to their YouTube account to adapt search results accordingly. To do this, it displays a 'Connect your YouTube account' button above the results, or even before showing any. The user presses the button, switches to a private chat with the bot and, in doing so, passes a start parameter that instructs the bot to return an OAuth link. Once done, the bot can offer a switch_inline button so that the user can easily return to the chat where they wanted to use the bot's inline capabilities.

ExtraAudio

Type:
  • object
Properties
NameTypeAttributesDescription
message_thread_idnumber<optional>

Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only

performerstring<optional>

Performer

titlestring<optional>

Track name

durationnumber<optional>

Optional. Duration of sent audio in seconds

thumbnailInputFile | FileId<optional>

Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »

captionstring<optional>

Optional. Audio caption, 0-1024 characters after entities parsing

parse_modeParseMode<optional>

Optional. Mode for parsing entities in the audio caption. See formatting options for more details.

caption_entitiesArray.<MessageEntity><optional>

Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode

has_spoilerboolean<optional>

Optional. Pass True if the video needs to be covered with a spoiler animation

disable_notificationboolean<optional>

Optional. Sends the message silently. Users will receive a notification with no sound.

protect_contentboolean<optional>

Optional. Protects the contents of the sent message from forwarding

reply_to_message_idnumber<optional>

Optional. If the message is a reply, ID of the original message

allow_sending_without_replyboolean<optional>

Optional. Pass True if the message should be sent even if the specified replied-to message is not found

reply_markupInlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply<optional>

Optional. InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

ExtraBanChatMember

Type:
  • object
Properties
NameTypeAttributesDescription
until_datenumber<optional>

Optional. Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only.

revoke_messagesboolean<optional>

Optional. Pass True to delete all messages from the chat for the user that is being removed. If False, the user will be able to see messages in the group that were sent before the user was removed. Always True for supergroups and channels.

ExtraContact

Type:
  • object
Properties
NameTypeAttributesDescription
message_thread_idnumber<optional>

Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only

last_namestring<optional>

Optional. Contact's last name

vcardstring<optional>

Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes

disable_notificationboolean<optional>

Optional. Sends the message silently. Users will receive a notification with no sound.

protect_contentboolean<optional>

Optional. Protects the contents of the sent message from forwarding

reply_to_message_idnumber<optional>

Optional. If the message is a reply, ID of the original message

allow_sending_without_replyboolean<optional>

Optional. Pass True if the message should be sent even if the specified replied-to message is not found

reply_markupInlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply<optional>

Optional. InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

ExtraCopyMessage

Type:
  • object
Properties
NameTypeAttributesDescription
message_thread_idnumber<optional>

Optional. Unique identifier of a message thread to which the message belongs; for supergroups only

captionstring<optional>

Optional. New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept

parse_modeParseMode<optional>

Optional. Mode for parsing entities in the new caption. See formatting options for more details.

caption_entitiesArray.<MessageEntity><optional>

A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of parse_mode

disable_notificationboolean<optional>

Sends the message silently. Users will receive a notification with no sound.

protect_contentboolean<optional>

Optional. Protects the contents of the forwarded message from forwarding and saving

reply_to_message_idnumber<optional>

Optional. If the message is a reply, ID of the original message

allow_sending_without_replyboolean<optional>

Optional. Pass True, if the message should be sent even if the specified replied-to message is not found

reply_markupForceReply | ReplyKeyboardRemove | ReplyKeyboardMarkup | InlineKeyboardMarkup<optional>

Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

Type:
  • object
Properties
NameTypeAttributesDescription
namestring<optional>

Optional. Invite link name; 0-32 characters

expire_datenumber<optional>

Optional. Point in time (Unix timestamp) when the link will expire |

member_limitnumber<optional>

Optional. The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999 |

creates_join_requestboolean<optional>

Optional. True, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified |

ExtraCreateForumTopic

Type:
  • object
Properties
NameTypeAttributesDescription
icon_colornumber<optional>

Optional. Color of the topic icon in RGB format. Currently, must be one of 7322096 (0x6FB9F0), 16766590 (0xFFD67E), 13338331 (0xCB86DB), 9367192 (0x8EEE98), 16749490 (0xFF93B2), or 16478047 (0xFB6F5F)

icon_custom_emoji_idstring<optional>

Optional. New unique identifier of the custom emoji shown as the topic icon. Use getForumTopicIconStickers to get all allowed custom emoji identifiers. Pass an empty string to remove the icon. If not specified, the current icon will be kept

ExtraCreateNewStickerSet

Type:
  • object
Properties
NameTypeAttributesDescription
stickersArray.<InputSticker>

A JSON-serialized list of 1-50 initial stickers to be added to the sticker set

sticker_format'static' | 'animated' | 'video'

Format of stickers in the set, must be one of static, animated, video

sticker_type'regular' | 'mask' | 'custom_emoji'<optional>

Optional. Type of stickers in the set, pass regular, mask, or custom_emoji. By default, a regular sticker set is created.

needs_repaintingboolean<optional>

Optional. Pass True to request a chat with the bot as a member. Otherwise, no additional restrictions are applied.Pass True if stickers in the sticker set must be repainted to the color of text when used in messages, the accent color if used as emoji status, white on chat photos, or another appropriate color based on context; for custom emoji sticker sets only

ExtraDeleteMyCommands

Type:
  • object
Properties
NameTypeAttributesDescription
language_codestring<optional>

Optional. A two-letter ISO 639-1 language code or an empty string

ExtraDeleteWebhook

Type:
  • object
Properties
NameTypeAttributesDescription
drop_pending_updatesboolean<optional>

Pass True to drop all pending updates

ExtraDice

Type:
  • object
Properties
NameTypeAttributesDefaultDescription
message_thread_idnumber<optional>

Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only

emojistring<optional>
"🎲"

Optional. Emoji on which the dice throw animation is based. Currently, must be one of "🎲", "🎯", "🏀", "⚽", "🎳", or "🎰". Dice can have values 1-6 for "🎲", "🎯" and "🎳", values 1-5 for "🏀" and "⚽", and values 1-64 for "🎰". Defaults to "🎲"

disable_notificationboolean<optional>

Optional. Sends the message silently. Users will receive a notification with no sound.

protect_contentboolean<optional>

Optional. Protects the contents of the sent message from forwarding

reply_to_message_idnumber<optional>

Optional. If the message is a reply, ID of the original message

allow_sending_without_replyboolean<optional>

Optional. Pass True if the message should be sent even if the specified replied-to message is not found

reply_markupInlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply<optional>

Optional. InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

ExtraDocument

Type:
  • object
Properties
NameTypeAttributesDescription
message_thread_idnumber<optional>

Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only

thumbnailInputFile | FileId<optional>

Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »

captionstring<optional>

Optional. Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing

parse_modeParseMode<optional>

Optional. Mode for parsing entities in the document caption. See formatting options for more details.

caption_entitiesArray.<MessageEntity><optional>

Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode

disable_content_type_detectionboolean<optional>

Optional. Disables automatic server-side content type detection for files uploaded using multipart/form-data

disable_notificationboolean<optional>

Optional. Sends the message silently. Users will receive a notification with no sound.

protect_contentboolean<optional>

Optional. Protects the contents of the sent message from forwarding

reply_to_message_idnumber<optional>

Optional. If the message is a reply, ID of the original message

allow_sending_without_replyboolean<optional>

Optional. Pass True if the message should be sent even if the specified replied-to message is not found

reply_markupInlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply<optional>

Optional. InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

Type:
  • object
Properties
NameTypeAttributesDescription
namestring<optional>

Optional Invite link name 0-32 characters

expire_datenumber<optional>

number Optional. Point in time (Unix timestamp) when the link will expire

member_limitnumber<optional>

Optional. The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link 1-99999

creates_join_requestboolean<optional>

Optional .True, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified

ExtraEditForumTopic

Type:
  • object
Properties
NameTypeAttributesDescription
namestring<optional>

Optional. New topic name, 0-128 characters. If not specified or empty, the current name of the topic will be kept

icon_custom_emoji_idstring<optional>

Optional. New unique identifier of the custom emoji shown as the topic icon. Use getForumTopicIconStickers to get all allowed custom emoji identifiers. Pass an empty string to remove the icon. If not specified, the current icon will be kept

ExtraEditMessageCaption

Type:
  • object
Properties
NameTypeAttributesDescription
parse_modeParseMode<optional>

Optional. Mode for parsing entities in the message caption. See formatting options for more details.

caption_entitiesArray.<MessageEntity><optional>

Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode

reply_markupInlineKeyboardMarkup<optional>

Optional A JSON-serialized object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not empty, the first button must be a Pay button.

ExtraEditMessageLiveLocation

Type:
  • object
Properties
NameTypeAttributesDescription
horizontal_accuracynumber<optional>

Optional The radius of uncertainty for the location, measured in meters; 0-1500

headingnumber<optional>

Optional Direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.

proximity_alert_radiusnumber<optional>

OptionalThe maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.

reply_markupInlineKeyboardMarkup<optional>

Optional A JSON-serialized object for a new inline keyboard.

ExtraEditMessageMedia

Type:
  • object
Properties
NameTypeAttributesDescription
captionstring<optional>

Optional. Caption of the media to be sent, 0-1024 characters after entities parsing

parse_modeParseMode<optional>

Optional. Mode for parsing entities in the media caption. See formatting options for more details.

caption_entitiesArray.<MessageEntity><optional>

Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode

has_spoilerboolean<optional>

Optional. Pass True if the video needs to be covered with a spoiler animation

reply_markupInlineKeyboardMarkup<optional>

InlineKeyboardMarkup A JSON-serialized object for a new inline keyboard.

ExtraEditMessageReplyMarkup

Type:
  • object
Properties
NameTypeAttributesDescription
reply_markupInlineKeyboardMarkup<optional>

Optional A JSON-serialized object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not empty, the first button must be a Pay button.

ExtraEditMessageText

Type:
  • object
Properties
NameTypeAttributesDescription
disable_web_page_previewboolean<optional>

Optional. Disables link previews for links in the sent message

parse_modeParseMode<optional>

Optional. Mode for parsing entities in the text. See formatting options for more details.

entitiesArray.<MessageEntity><optional>

Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode

reply_markupInlineKeyboardMarkup<optional>

Optional A JSON-serialized object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not empty, the first button must be a Pay button.

ExtraForwardMessage

Type:
  • object
Properties
NameTypeAttributesDescription
message_thread_idnumber<optional>

Optional. Unique identifier of a message thread to which the message belongs; for supergroups only

protect_contentboolean<optional>

Optional. Protects the contents of the forwarded message from forwarding and saving

disable_notificationboolean<optional>

Optional. Sends the message silently. Users will receive a notification with no sound.

ExtraGame

Type:
  • object
Properties
NameTypeAttributesDescription
message_thread_idnumber<optional>

Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only

disable_notificationboolean<optional>

Optional. Sends the message silently. Users will receive a notification with no sound.

protect_contentboolean<optional>

Optional. Protects the contents of the sent message from forwarding

reply_to_message_idnumber<optional>

Optional. If the message is a reply, ID of the original message

allow_sending_without_replyboolean<optional>

Optional. Pass True if the message should be sent even if the specified replied-to message is not found

reply_markupInlineKeyboardMarkup<optional>

InlineKeyboardMarkup A JSON-serialized object for a new inline keyboard.

ExtraGetMyCommands

Type:
  • object
Properties
NameTypeAttributesDescription
language_codestring<optional>

Optional. A two-letter ISO 639-1 language code or an empty string

ExtraInvoice

Type:
  • object
Properties
NameTypeAttributesDescription
message_thread_idnumber<optional>

Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only

start_parameterstring<optional>

Optional. Unique deep-linking parameter. If left empty, forwarded copies of the sent message will have a Pay button, allowing multiple users to pay directly from the forwarded message, using the same invoice. If non-empty, forwarded copies of the sent message will have a URL button with a deep link to the bot (instead of a Pay button), with the value used as the start parameter

is_flexibleboolean<optional>

Optional. Pass True if the final price depends on the shipping method

max_tip_amountnumber<optional>

Optional. The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0

suggested_tip_amountsArray.<number><optional>

Optional. A JSON-serialized array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount.

provider_dataobject<optional>

Optional. JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider.

photo_urlstring<optional>

Optional. URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for.

photo_sizenumber<optional>

Optional. Photo size in bytes

photo_widthnumber<optional>

Optional. Photo width

photo_heightnumber<optional>

Optional. Photo height

need_nameboolean<optional>

Optional. Pass True if you require the user's full name to complete the order

need_phone_numberboolean<optional>

Optional. Pass True if you require the user's phone number to complete the order

need_emailboolean

Optional. Pass True if you require the user's email address to complete the order

need_shipping_addressboolean<optional>

Optional. Pass True if you require the user's shipping address to complete the order

send_phone_number_to_providerboolean<optional>

Optional. Pass True if the user's phone number should be sent to provider

send_email_to_providerboolean<optional>

Optional. Pass True if the user's email address should be sent to provider

disable_notificationboolean<optional>

Optional. Sends the message silently. Users will receive a notification with no sound.

protect_contentboolean<optional>

Optional. Protects the contents of the sent message from forwarding

reply_to_message_idnumber<optional>

Optional. If the message is a reply, ID of the original message

allow_sending_without_replyboolean<optional>

Optional. Pass True if the message should be sent even if the specified replied-to message is not found

reply_markupInlineKeyboardMarkup<optional>

Optional A JSON-serialized object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not empty, the first button must be a Pay button.

ExtraKickChatMember

Type:
  • object
Properties
NameTypeAttributesDescription
revoke_messagesboolean<optional>

Optional. Pass True to delete all messages from the chat for the user that is being removed. If False, the user will be able to see messages in the group that were sent before the user was removed. Always True for supergroups and channels.

ExtraLocation

Type:
  • object
Properties
NameTypeAttributesDescription
message_thread_idnumber<optional>

Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only

horizontal_accuracynumber<optional>

Optional The radius of uncertainty for the location, measured in meters; 0-1500

headingnumber<optional>

Optional Direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.

proximity_alert_radiusnumber<optional>

Optional The radius of uncertainty for the location, measured in meters; 0-1500

live_periodnumber<optional>

Optional. Period in seconds for which the location will be updated, see Live Locations, should be between 60 and 86400.

disable_notificationboolean<optional>

Optional. Sends the message silently. Users will receive a notification with no sound.

protect_contentboolean<optional>

Optional. Protects the contents of the sent message from forwarding

reply_to_message_idnumber<optional>

Optional. If the message is a reply, ID of the original message

allow_sending_without_replyboolean<optional>

Optional. Pass True if the message should be sent even if the specified replied-to message is not found

reply_markupInlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply<optional>

Optional. InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

ExtraMediaGroup

Type:
  • object
Properties
NameTypeAttributesDescription
message_thread_idnumber<optional>

Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only

disable_notificationboolean<optional>

Optional. Sends the message silently. Users will receive a notification with no sound.

protect_contentboolean<optional>

Optional. Protects the contents of the sent message from forwarding

reply_to_message_idnumber<optional>

Optional. If the message is a reply, ID of the original message

allow_sending_without_replyboolean<optional>

Optional. Pass True if the message should be sent even if the specified replied-to message is not found

ExtraPhoto

Type:
  • object
Properties
NameTypeAttributesDescription
message_thread_idnumber<optional>

Optional. Unique identifier of a message thread to which the message belongs; for supergroups only

captionstring<optional>

Optional. Photo caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing

parse_modeParseMode<optional>

Optional. Mode for parsing entities in the photo caption. See formatting options for more details.

caption_entitiesArray.<MessageEntity><optional>

Optional. A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of parse_mode

has_spoilerboolean<optional>

Optional. Pass True if the animation needs to be covered with a spoiler animation

disable_notificationboolean<optional>

Optional. Sends the message silently. Users will receive a notification with no sound.

protect_contentboolean<optional>

Optional. Protects the contents of the forwarded message from forwarding and saving

reply_to_message_idnumber<optional>

Optional. If the message is a reply, ID of the original message

allow_sending_without_replyboolean<optional>

Optional. Pass True, if the message should be sent even if the specified replied-to message is not found

reply_markupForceReply | ReplyKeyboardRemove | ReplyKeyboardMarkup | InlineKeyboardMarkup<optional>

Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

ExtraPinChatMessage

Type:
  • object
Properties
NameTypeAttributesDescription
disable_notificationboolean<optional>

Sends the message silently. Users will receive a notification with no sound.

ExtraPoll

Type:
  • object
Properties
NameTypeAttributesDescription
message_thread_idnumber<optional>

Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only

is_anonymousboolean<optional>

Optional. True, if the poll needs to be anonymous, defaults to True

allows_multiple_answersboolean<optional>

Optional. True, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to False

correct_option_idnumber<optional>

Optional. 0-based identifier of the correct answer option, required for polls in quiz mode

explanationstring<optional>

Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters with at most 2 line feeds after entities parsing

explanation_parse_modestring<optional>

Optional. Mode for parsing entities in the explanation. See formatting options for more details.

explanation_entitiesArray.<MessageEntity><optional>

Optional. A JSON-serialized list of special entities that appear in the poll explanation, which can be specified instead of parse_mode

open_periodnumber<optional>

Optional. Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with close_date.

close_datenumber<optional>

Optional. Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 600 seconds in the future. Can't be used together with open_period.

is_closedboolean<optional>

Optional. Pass True if the poll needs to be immediately closed. This can be useful for poll preview.

disable_notificationboolean<optional>

Optional. Sends the message silently. Users will receive a notification with no sound.

protect_contentboolean<optional>

Optional. Protects the contents of the sent message from forwarding

reply_to_message_idnumber<optional>

Optional. If the message is a reply, ID of the original message

allow_sending_without_replyboolean<optional>

Optional. Pass True if the message should be sent even if the specified replied-to message is not found

reply_markupInlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply<optional>

Optional. InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

ExtraPromoteChatMember

Type:
  • object
Properties
NameTypeAttributesDescription
is_anonymousboolean<optional>

Optional. True, if the poll needs to be anonymous, defaults to True

can_manage_chatboolean<optional>

Optional. True, if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege

can_post_messagesboolean<optional>

Optional. True, if the administrator can post in the channel; channels only

can_edit_messagesboolean<optional>

Optional. True, if the administrator can edit messages of other users and can pin messages; channels only

can_delete_messagesboolean<optional>

Optional. True, if the administrator can delete messages of other users

can_manage_video_chatsboolean<optional>

Optional. True, if the administrator can manage video chats

can_restrict_membersboolean<optional>

Optional. True, if the administrator can restrict, ban or unban chat members

can_promote_membersboolean<optional>

Optional. True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user)

can_invite_usersboolean<optional>

Optional. True, if the user is allowed to invite new users to the chat

can_change_infoboolean<optional>

Optional. True, if the user is allowed to change the chat title, photo and other settings

can_pin_messagesboolean<optional>

Optional. True, if the user is allowed to pin messages; groups and supergroups only

can_manage_topicsboolean<optional>

Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only

ExtraQuiz

Type:
  • object
Properties
NameTypeAttributesDescription
message_thread_idnumber<optional>

Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only

is_anonymousboolean<optional>

Optional. True, if the poll needs to be anonymous, defaults to True

allows_multiple_answersboolean<optional>

Optional. True, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to False

correct_option_idnumber<optional>

Optional. 0-based identifier of the correct answer option, required for polls in quiz mode

explanationstring<optional>

Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters with at most 2 line feeds after entities parsing

explanation_parse_modestring<optional>

Optional. Mode for parsing entities in the explanation. See formatting options for more details.

explanation_entitiesArray.<MessageEntity><optional>

Optional. A JSON-serialized list of special entities that appear in the poll explanation, which can be specified instead of parse_mode

open_periodnumber<optional>

Optional. Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with close_date.

close_datenumber<optional>

Optional. Point in time (Unix timestamp) when the poll will be automatically closed. Must be at least 5 and no more than 600 seconds in the future. Can't be used together with open_period.

is_closedboolean<optional>

Optional. Pass True if the poll needs to be immediately closed. This can be useful for poll preview.

disable_notificationboolean<optional>

Optional. Sends the message silently. Users will receive a notification with no sound.

protect_contentboolean<optional>

Optional. Protects the contents of the sent message from forwarding

reply_to_message_idnumber<optional>

Optional. If the message is a reply, ID of the original message

allow_sending_without_replyboolean<optional>

Optional. Pass True if the message should be sent even if the specified replied-to message is not found

reply_markupInlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply<optional>

Optional. InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

ExtraRestrictChatMember

Type:
  • object
Properties
NameTypeAttributesDescription
permissionsChatPermissions

A JSON-serialized object for new user permissions

use_independent_chat_permissionsboolean<optional>

Optional.Pass True if chat permissions are set independently. Otherwise, the can_send_other_messages and can_add_web_page_previews permissions will imply the can_send_messages, can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes, and can_send_voice_notes permissions; the can_send_polls permission will imply the can_send_messages permission.

until_datenumber<optional>

Optional. Date when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever

ExtraSendChatAction

Type:
  • object
Properties
NameTypeAttributesDescription
message_thread_idnumber<optional>

Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only

ExtraSendMessage

Type:
  • object
Properties
NameTypeAttributesDescription
message_thread_idnumber<optional>

Optional. Unique identifier of a message thread to which the message belongs; for supergroups only

parse_modeParseMode<optional>

Optional. Mode for parsing entities in the photo caption. See formatting options for more details.

entitiesArray.<MessageEntity><optional>

Optional. A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of parse_mode

disable_web_page_previewboolean<optional>

Optional. Disables link previews for links in this message

disable_notificationboolean<optional>

Optional. Sends the message silently. Users will receive a notification with no sound.

protect_contentboolean<optional>

Optional. Protects the contents of the forwarded message from forwarding and saving

reply_to_message_idnumber<optional>

Optional. If the message is a reply, ID of the original message

allow_sending_without_replyboolean<optional>

Optional. Pass True, if the message should be sent even if the specified replied-to message is not found

reply_markupForceReply | ReplyKeyboardRemove | ReplyKeyboardMarkup | InlineKeyboardMarkup<optional>

Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

ExtraSetChatPermissions

Type:
  • object
Properties
NameTypeAttributesDescription
use_independent_chat_permissionsboolean<optional>

Optional. Pass True if chat permissions are set independently. Otherwise, the can_send_other_messages and can_add_web_page_previews permissions will imply the can_send_messages, can_send_audios, can_send_documents, can_send_photos, can_send_videos, can_send_video_notes, and can_send_voice_notes permissions; the can_send_polls permission will imply the can_send_messages permission.

ExtraSetMyCommands

Type:
  • object
Properties
NameTypeAttributesDescription
language_codestring<optional>

Optional. A two-letter ISO 639-1 language code or an empty string

scopeBotCommandScope<optional>

Optional. A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault.

ExtraSetWebhook

Type:
  • object
Properties
NameTypeAttributesDefaultDescription
certificateInputFile<optional>

Optional. Upload your public key certificate so that the root certificate in use can be checked. See our self-signed guide for details.

ip_addressstring<optional>

Optional. The fixed IP address which will be used to send webhook requests instead of the IP address resolved through DNS

max_connectionsnumber<optional>
40

Optional. The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery, 1-100. Defaults to 40. Use lower values to limit the load on your bot's server, and higher values to increase your bot's throughput.

drop_pending_updatesboolean<optional>

Optional. Pass True to drop all pending updates

secret_tokenstring<optional>

Optional. A secret token to be sent in a header X-Telegram-Bot-Api-Secret-Token in every webhook request, 1-256 characters. Only characters A-Z, a-z, 0-9, _ and - are allowed. The header is useful to ensure that the request comes from a webhook set by you.

ExtraSticker

Type:
  • object
Properties
NameTypeAttributesDescription
message_thread_idnumber<optional>

Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only

stickerInputFile | FileId

Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a .WEBP file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files »

emojistring<optional>

Optional. Emoji associated with the sticker; only for just uploaded stickers

disable_notificationboolean<optional>

Optional. Sends the message silently. Users will receive a notification with no sound.

protect_contentboolean<optional>

Optional. Protects the contents of the sent message from forwarding

reply_to_message_idnumber<optional>

Optional. If the message is a reply, ID of the original message

allow_sending_without_replyboolean<optional>

Optional. Pass True if the message should be sent even if the specified replied-to message is not found

reply_markupInlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply<optional>

Optional. InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

ExtraStopMessageLiveLocation

Type:
  • object
Properties
NameTypeAttributesDescription
reply_markupInlineKeyboardMarkup<optional>

Optional A JSON-serialized object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not empty, the first button must be a Pay button.

ExtraStopPoll

Type:
  • object
Properties
NameTypeAttributesDescription
reply_markupInlineKeyboardMarkup<optional>

Optional A JSON-serialized object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not empty, the first button must be a Pay button.

ExtraUnPinChatMessage

Type:
  • object
Properties
NameTypeAttributesDescription
message_idnumber<optional>

Identifier of a message to unpin. If not specified, the most recent pinned message (by sending date) will be unpinned.

ExtraUnbanMember

Type:
  • object
Properties
NameTypeAttributesDescription
only_if_bannedboolean<optional>

Optional. Do nothing if the user is not banned

ExtraUploadStickerFile

Type:
  • object
Properties
NameTypeDescription
sticker_format'static' | 'animated' | 'video'

Format of the sticker, must be one of static, animated, video

ExtraVenue

Type:
  • object
Properties
NameTypeAttributesDescription
message_thread_idnumber<optional>

Optional. Unique identifier of a message thread to which the message belongs; for supergroups only

foursquare_idstring<optional>

Optional. Foursquare identifier of the venue

foursquare_typestring<optional>

Optional. Foursquare type of the venue, if known. (For example, arts_entertainment/default, arts_entertainment/aquarium or food/icecream.)

google_place_idstring<optional>

Optional. Google Places identifier of the venue

google_place_typestring<optional>

Optional. Google Places type of the venue. (See supported types.)

disable_notificationboolean<optional>

Optional. Sends the message silently. Users will receive a notification with no sound.

protect_contentboolean<optional>

Optional. Protects the contents of the forwarded message from forwarding and saving

reply_to_message_idnumber<optional>

Optional. If the message is a reply, ID of the original message

allow_sending_without_replyboolean<optional>

Optional. Pass True, if the message should be sent even if the specified replied-to message is not found

reply_markupForceReply | ReplyKeyboardRemove | ReplyKeyboardMarkup | InlineKeyboardMarkup<optional>

Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

ExtraVideo

Type:
  • object
Properties
NameTypeAttributesDescription
message_thread_idnumber<optional>

Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only

durationnumber<optional>

Optional. Duration of sent video in seconds

widthnumber<optional>

Optional. Video width

heightnumber<optional>

Optional. Video height

thumbnailInputFile | FileId<optional>

Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »

captionstring<optional>

Optional. Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing

parse_modeParseMode<optional>

Optional. Mode for parsing entities in the audio caption. See formatting options for more details.

caption_entitiesArray.<MessageEntity><optional>

Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode

has_spoilerboolean<optional>

Optional. Pass True if the video needs to be covered with a spoiler animation

supports_streamingboolean<optional>

Optional. Pass True if the uploaded video is suitable for streaming

disable_notificationboolean<optional>

Optional. Sends the message silently. Users will receive a notification with no sound.

protect_contentboolean<optional>

Optional. Protects the contents of the sent message from forwarding

reply_to_message_idnumber<optional>

Optional. If the message is a reply, ID of the original message

allow_sending_without_replyboolean<optional>

Optional. Pass True if the message should be sent even if the specified replied-to message is not found

reply_markupInlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply<optional>

Optional. InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

ExtraVideoNote

Type:
  • object
Properties
NameTypeAttributesDescription
message_thread_idnumber<optional>

Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only

durationnumber<optional>

Optional. Duration of sent video in seconds

lengthnumber<optional>

Optional. Video width and height, i.e. diameter of the video message

thumbnailInputFile | FileId<optional>

Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass "attach://<file_attach_name>" if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »

disable_notificationboolean<optional>

Optional. Sends the message silently. Users will receive a notification with no sound.

protect_contentboolean<optional>

Optional. Protects the contents of the sent message from forwarding

reply_to_message_idnumber<optional>

Optional. If the message is a reply, ID of the original message

allow_sending_without_replyboolean<optional>

Optional. Pass True if the message should be sent even if the specified replied-to message is not found

reply_markupInlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply<optional>

Optional. InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

ExtraVoice

Type:
  • object
Properties
NameTypeAttributesDescription
message_thread_idnumber<optional>

Optional. Unique identifier of a message thread to which the message belongs; for supergroups only

captionstring<optional>

Voice message caption, 0-1024 characters after entities parsing

parse_modeParseMode<optional>

Optional. Mode for parsing entities in the photo caption. See formatting options for more details.

caption_entitiesArray.<MessageEntity><optional>

A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of parse_mode

durationnumber<optional>

Optional. Duration of the voice message in seconds (See supported types.)

disable_notificationboolean<optional>

Optional. Sends the message silently. Users will receive a notification with no sound.

protect_contentboolean<optional>

Optional. Protects the contents of the forwarded message from forwarding and saving

reply_to_message_idnumber<optional>

Optional. If the message is a reply, ID of the original message

allow_sending_without_replyboolean<optional>

Optional. Pass True, if the message should be sent even if the specified replied-to message is not found

reply_markupForceReply | ReplyKeyboardRemove | ReplyKeyboardMarkup | InlineKeyboardMarkup<optional>

Optional. Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user.

File

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

The maximum file size to download is 20 MB

Type:
  • object
Properties
NameTypeAttributesDescription
file_idstring

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

file_unique_idstring

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

file_sizenumber<optional>

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.

file_pathstring<optional>

Optional. File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file.

FileId

Type:
  • string

FileToAttach

Type:
  • object
Properties
NameTypeAttributesDescription
urlstring<optional>

URL of file

filenamestring

Name of file

sourceStream | string | Buffer

Path to file / Stream / Buffer

ForceReply

Upon receiving a message with this object, Telegram clients will display a reply interface to the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be extremely useful if you want to create user-friendly step-by-step interfaces without having to sacrifice privacy mode .

Type:
  • object
Properties
NameTypeAttributesDescription
force_replyboolean

Shows reply interface to the user, as if they manually selected the bot's message and tapped 'Reply'

input_field_placeholderstring<optional>

Optional. The placeholder to be shown in the input field when the reply is active; 1-64 characters

selectiveboolean<optional>

Optional. Use this parameter if you want to force reply from specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.

ForumTopic

This object represents a forum topic.

Type:
  • object
Properties
NameTypeAttributesDescription
message_thread_idnumber

Unique identifier of the forum topic

namestring

Name of the topic

icon_colornumber

Color of the topic icon in RGB format

icon_custom_emoji_idstring<optional>

Optional. Unique identifier of the custom emoji shown as the topic icon

ForumTopicClosed

This object represents a service message about a forum topic closed in the chat. Currently holds no information.

Type:
  • *

ForumTopicCreated

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

Type:
  • object
Properties
NameTypeAttributesDescription
namestring

Name of the topic

icon_colornumber

Color of the topic icon in RGB format

icon_custom_emoji_idstring<optional>

Optional. Unique identifier of the custom emoji shown as the topic icon

ForumTopicEdited

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

Type:
  • object
Properties
NameTypeAttributesDescription
namestring<optional>

Optional. New name of the topic, if it was edited

icon_custom_emoji_idstring<optional>

Optional. New identifier of the custom emoji shown as the topic icon, if it was edited; an empty string if the icon was removed

ForumTopicReopened

This object represents a service message about a forum topic reopened in the chat. Currently holds no information.

Type:
  • *

Game

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

Type:
  • object
Properties
NameTypeAttributesDescription
titlestring

Title of the game

descriptionstring

Description of the game

photoArray.<PhotoSize>

Photo that will be displayed in the game message in chats.

textstring<optional>

Optional. Brief description of the game or high scores included in the game message. Can be automatically edited to include current high scores for the game when the bot calls setGameScore, or manually edited using editMessageText. 0-4096 characters.

text_entitiesArray.<MessageEntity><optional>

Optional. Special entities that appear in text, such as usernames, URLs, bot commands, etc.

animationAnimation<optional>

Optional. Animation that will be displayed in the game message in chats. Upload via BotFather

GameHighScore

This object represents one row of the high scores table for a game.

Type:
  • object
Properties
NameTypeDescription
positionnumber

Position in high score table for the game

userUser

User

scorenumber

Score

GeneralForumTopicHidden

This object represents a service message about General forum topic hidden in the chat. Currently holds no information.

Type:
  • *

GeneralForumTopicUnhidden

This object represents a service message about General forum topic unhidden in the chat. Currently holds no information.

Type:
  • *

InlineKeyboardButton

This object represents one button of an inline keyboard. You must use exactly one of the optional fields.

Type:
  • object
Properties
NameTypeAttributesDescription
textstring

Label text on the button

urlstring<optional>

Optional. HTTP or tg:// URL to be opened when the button is pressed. Links tg://user?id=<user_id> can be used to mention a user by their ID without using a username, if this is allowed by their privacy settings.

callback_datastring<optional>

Optional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes

web_appWebAppInfo<optional>

Optional. Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot.

login_urlLoginUrl<optional>

Optional. An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget.

switch_inline_querystring<optional>

Optional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot's username and the specified inline query in the input field. May be empty, in which case just the bot's username will be inserted.

switch_inline_query_current_chatstring<optional>

Optional. If set, pressing the button will insert the bot's username and the specified inline query in the current chat's input field. May be empty, in which case only the bot's username will be inserted.

This offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting something from multiple options.

callback_gameCallbackGame<optional>

Optional. Description of the game that will be launched when the user presses the button.

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

switch_inline_query_chosen_chatSwitchInlineQueryChosenChat<optional>

Optional. If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot's username and the specified inline query in the input field

payboolean<optional>

Optional. Specify True, to send a Pay button.

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

InlineKeyboardMarkup

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

Type:
  • object
Properties
NameTypeDescription
inline_keyboardArray.<Array.<InlineKeyboardButton>>

Array of button rows, each represented by an Array of InlineKeyboardButton objects

InlineKeyboardOptions

Type:
  • object
Properties
NameTypeAttributesDescription
columnsnumber<optional>

Count of keyboard columns, by default equals to buttons.length

wrapKeyboardWrap<optional>

Warp function

InlineQuery

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

Type:
  • object
Properties
NameTypeAttributesDescription
idstring

Unique identifier for this query

fromUser

Sender

querystring

Text of the query (up to 256 characters)

offsetstring

Offset of the results to be returned, can be controlled by the bot

chat_type'sender' | 'private' | 'group' | 'supergroup' | 'channel'<optional>

Optional. Type of the chat from which the inline query was sent. Can be either “sender” for a private chat with the inline query sender, “private”, “group”, “supergroup”, or “channel”. The chat type should be always known for requests sent from official clients and most third-party clients, unless the request was sent from a secret chat

locationLocation<optional>

Optional. Sender location, only for bots that request user location

InlineQueryResult

InlineQueryResultArticle

Represents a link to an article or web page.

Type:
  • object
Properties
NameTypeAttributesDescription
type'article'

Type of the result, must be article

idstring

Unique identifier for this result, 1-64 Bytes

titlestring

Title of the result

input_message_contentInputMessageContent

Content of the message to be sent

reply_markupInlineKeyboardMarkup<optional>

Optional. Inline keyboard attached to the message

urlstring<optional>

Optional. URL of the result

hide_urlboolean<optional>

Optional. Pass True if you don't want the URL to be shown in the message

descriptionstring<optional>

Optional. Short description of the result

thumbnail_urlstring<optional>

Optional. Url of the thumbnail for the result

thumbnail_widthnumber<optional>

Optional. Thumbnail width

thumbnail_heightnumber<optional>

Optional. Thumbnail height

InlineQueryResultAudio

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

Type:
  • object
Properties
NameTypeAttributesDescription
type'audio'

Type of the result, must be audio

idstring

Unique identifier for this result, 1-64 bytes

audio_urlstring

A valid URL for the audio file

titlestring

Title

captionstring<optional>

Optional. Caption, 0-1024 characters after entities parsing

parse_modeParseMode<optional>

Optional. Mode for parsing entities in the audio caption. See formatting options for more details.

caption_entitiesArray.<MessageEntity><optional>

Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode

performerstring<optional>

Optional. Performer

audio_durationnumber<optional>

Optional. Audio duration in seconds

reply_markupInlineKeyboardMarkup<optional>

Optional. Inline keyboard attached to the message

input_message_contentInputMessageContent<optional>

Optional. Content of the message to be sent instead of the audio

InlineQueryResultCachedAudio

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

Type:
  • object
Properties
NameTypeAttributesDescription
type'audio'

Type of the result, must be audio

idstring

Unique identifier for this result, 1-64 bytes

audio_file_idstring

A valid file identifier for the audio file

captionstring<optional>

Optional. Caption, 0-1024 characters after entities parsing

parse_modeParseMode<optional>

Optional. Mode for parsing entities in the audio caption. See formatting options for more details.

caption_entitiesArray.<MessageEntity><optional>

Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode

reply_markupInlineKeyboardMarkup<optional>

Optional. Inline keyboard attached to the message

input_message_contentInputMessageContent<optional>

Optional. Content of the message to be sent instead of the audio

InlineQueryResultCachedDocument

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

Type:
  • object
Properties
NameTypeAttributesDescription
type'document'

Type of the result, must be document

idstring

Unique identifier for this result, 1-64 bytes

titlestring

Title for the result

document_file_idstring

A valid file identifier for the file

descriptionstring<optional>

Optional. Short description of the result

captionstring<optional>

Optional. Caption of the document to be sent, 0-1024 characters after entities parsing

parse_modeParseMode<optional>

Optional. Mode for parsing entities in the document caption. See formatting options for more details.

caption_entitiesArray.<MessageEntity><optional>

Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode

reply_markupInlineKeyboardMarkup<optional>

Optional. Inline keyboard attached to the message

input_message_contentInputMessageContent<optional>

Optional. Content of the message to be sent instead of the file

InlineQueryResultCachedGif

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

Type:
  • object
Properties
NameTypeAttributesDescription
type'gif'

Type of the result, must be gif

idstring

Unique identifier for this result, 1-64 bytes

gif_file_idstring

A valid file identifier for the GIF file

titlestring<optional>

Optional. Title for the result

captionstring<optional>

Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing

parse_modeParseMode<optional>

Optional. Mode for parsing entities in the caption. See formatting options for more details.

caption_entitiesArray.<MessageEntity><optional>

Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode

reply_markupInlineKeyboardMarkup<optional>

Optional. Inline keyboard attached to the message

input_message_contentInputMessageContent<optional>

Optional. Content of the message to be sent instead of the GIF animation

InlineQueryResultCachedMpeg4Gif

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

Type:
  • object
Properties
NameTypeAttributesDescription
type'mpeg4_gif'

Type of the result, must be mpeg4_gif

idstring

Unique identifier for this result, 1-64 bytes

mpeg4_file_idstring

A valid file identifier for the MPEG4 file

titlestring<optional>

Optional. Title for the result

captionstring<optional>

Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing

parse_modeParseMode<optional>

Optional. Mode for parsing entities in the caption. See formatting options for more details.

caption_entitiesArray.<MessageEntity><optional>

Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode

reply_markupInlineKeyboardMarkup<optional>

Optional. Inline keyboard attached to the message

input_message_contentInputMessageContent<optional>

Optional. Content of the message to be sent instead of the video animation

InlineQueryResultCachedPhoto

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

Type:
  • object
Properties
NameTypeAttributesDescription
type'photo'

Type of the result, must be photo

idstring

Unique identifier for this result, 1-64 bytes

photo_file_idstring

A valid file identifier of the photo

titlestring<optional>

Optional. Title for the result

descriptionstring<optional>

Optional. Short description of the result

captionstring<optional>

Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing

parse_modeParseMode<optional>

Optional. Mode for parsing entities in the photo caption. See formatting options for more details.

caption_entitiesArray.<MessageEntity><optional>

Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode

reply_markupInlineKeyboardMarkup<optional>

Optional. Inline keyboard attached to the message

input_message_contentInputMessageContent<optional>

Optional. Content of the message to be sent instead of the photo

InlineQueryResultCachedSticker

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

Type:
  • object
Properties
NameTypeAttributesDescription
type'sticker'

Type of the result, must be sticker

idstring

Unique identifier for this result, 1-64 bytes

sticker_file_idstring

A valid file identifier of the sticker

reply_markupInlineKeyboardMarkup<optional>

Optional. Inline keyboard attached to the message

input_message_contentInputMessageContent<optional>

Optional. Content of the message to be sent instead of the sticker

InlineQueryResultCachedVideo

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

Type:
  • object
Properties
NameTypeAttributesDescription
type'video'

Type of the result, must be video

idstring

Unique identifier for this result, 1-64 bytes

video_file_idstring

A valid file identifier for the video file

titlestring

Title for the result

descriptionstring<optional>

Optional. Short description of the result

captionstring<optional>

Optional. Caption of the video to be sent, 0-1024 characters after entities parsing

parse_modeParseMode<optional>

Optional. Mode for parsing entities in the video caption. See formatting options for more details.

caption_entitiesArray.<MessageEntity><optional>

Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode

reply_markupInlineKeyboardMarkup<optional>

Optional. Inline keyboard attached to the message

input_message_contentInputMessageContent<optional>

Optional. Content of the message to be sent instead of the video

InlineQueryResultCachedVoice

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

Type:
  • object
Properties
NameTypeAttributesDescription
type'voice'

Type of the result, must be voice

idstring

Unique identifier for this result, 1-64 bytes

voice_file_idstring

A valid file identifier for the voice message

titlestring

Voice message title

captionstring<optional>

Optional. Caption, 0-1024 characters after entities parsing

parse_modeParseMode<optional>

Optional. Mode for parsing entities in the voice message caption. See formatting options for more details.

caption_entitiesArray.<MessageEntity><optional>

Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode

reply_markupInlineKeyboardMarkup<optional>

Optional. Inline keyboard attached to the message

input_message_contentInputMessageContent<optional>

Optional. Content of the message to be sent instead of the voice message

InlineQueryResultContact

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

Type:
  • object
Properties
NameTypeAttributesDescription
type'contact'

Type of the result, must be contact

idstring

Unique identifier for this result, 1-64 Bytes

phone_numberstring

Contact's phone number

first_namestring

Contact's first name

last_namestring<optional>

Optional. Contact's last name

vcardstring<optional>

Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes

reply_markupInlineKeyboardMarkup<optional>

Optional. Inline keyboard attached to the message

input_message_contentInputMessageContent<optional>

Optional. Content of the message to be sent instead of the contact

thumbnail_urlstring<optional>

Optional. Url of the thumbnail for the result

thumbnail_widthnumber<optional>

Optional. Thumbnail width

thumbnail_heightnumber<optional>

Optional. Thumbnail height

InlineQueryResultDocument

Represents a link to a file. By default, this file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the file. Currently, only .PDF and .ZIP files can be sent using this method.

Type:
  • object
Properties
NameTypeAttributesDescription
type'document'

Type of the result, must be document

idstring

Unique identifier for this result, 1-64 bytes

titlestring

Title for the result

captionstring<optional>

Optional. Caption of the document to be sent, 0-1024 characters after entities parsing

parse_modeParseMode<optional>

Optional. Mode for parsing entities in the document caption. See formatting options for more details.

caption_entitiesArray.<MessageEntity><optional>

Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode

document_urlstring

A valid URL for the file

mime_type'application/pdf' | 'application/zip'

MIME type of the content of the file, either “application/pdf” or “application/zip”

descriptionstring<optional>

Optional. Short description of the result

reply_markupInlineKeyboardMarkup<optional>

Optional. Inline keyboard attached to the message

input_message_contentInputMessageContent<optional>

Optional. Content of the message to be sent instead of the file

thumbnail_urlstring<optional>

Optional. URL of the thumbnail (JPEG only) for the file

thumbnail_widthnumber<optional>

Optional. Thumbnail width

thumbnail_heightnumber<optional>

Optional. Thumbnail height

InlineQueryResultGame

Represents a Game .

Type:
  • object
Properties
NameTypeAttributesDescription
type'game'

Type of the result, must be game

idstring

Unique identifier for this result, 1-64 bytes

game_short_namestring

Short name of the game

reply_markupInlineKeyboardMarkup<optional>

Optional. Inline keyboard attached to the message

InlineQueryResultGif

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

Type:
  • object
Properties
NameTypeAttributesDefaultDescription
type'gif'

Type of the result, must be gif

idstring

Unique identifier for this result, 1-64 bytes

gif_urlstring

A valid URL for the GIF file. File size must not exceed 1MB

gif_widthnumber<optional>

Optional. Width of the GIF

gif_heightnumber<optional>

Optional. Height of the GIF

gif_durationnumber<optional>

Optional. Duration of the GIF in seconds

thumbnail_urlstring

URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result

thumbnail_mime_type'image/jpeg' | 'image/gif' | 'video/mp4'<optional>
image/jpeg

Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg”

titlestring<optional>

Optional. Title for the result

captionstring<optional>

Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing

parse_modeParseMode<optional>

Optional. Mode for parsing entities in the caption. See formatting options for more details.

caption_entitiesArray.<MessageEntity><optional>

Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode

reply_markupInlineKeyboardMarkup<optional>

Optional. Inline keyboard attached to the message

input_message_contentInputMessageContent<optional>

Optional. Content of the message to be sent instead of the GIF animation

InlineQueryResultLocation

Represents a location on a map. By default, the location will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the location.

Type:
  • object
Properties
NameTypeAttributesDescription
type'location'

Type of the result, must be location

idstring

Unique identifier for this result, 1-64 Bytes

latitudenumber

Location latitude in degrees

longitudenumber

Location longitude in degrees

titlestring

Location title

horizontal_accuracynumber<optional>

Optional. The radius of uncertainty for the location, measured in meters; 0-1500

live_periodnumber<optional>

Optional. Period in seconds for which the location can be updated, should be between 60 and 86400.

headingnumber<optional>

Optional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.

proximity_alert_radiusnumber<optional>

Optional. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.

reply_markupInlineKeyboardMarkup<optional>

Optional. Inline keyboard attached to the message

input_message_contentInputMessageContent<optional>

Optional. Content of the message to be sent instead of the location

thumbnail_urlstring<optional>

Optional. Url of the thumbnail for the result

thumbnail_widthnumber<optional>

Optional. Thumbnail width

thumbnail_heightnumber<optional>

Optional. Thumbnail height

InlineQueryResultMpeg4Gif

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

Type:
  • object
Properties
NameTypeAttributesDefaultDescription
type'mpeg4_gif'

Type of the result, must be mpeg4_gif

idstring

Unique identifier for this result, 1-64 bytes

mpeg4_urlstring

A valid URL for the MPEG4 file. File size must not exceed 1MB

mpeg4_widthnumber<optional>

Optional. Video width

mpeg4_heightnumber<optional>

Optional. Video height

mpeg4_durationnumber<optional>

Optional. Video duration in seconds

thumbnail_urlstring

URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result

thumbnail_mime_type'image/jpeg' | 'image/gif' | 'video/mp4'<optional>
image/jpeg

Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg”

titlestring<optional>

Optional. Title for the result

captionstring<optional>

Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing

parse_modeParseMode<optional>

Optional. Mode for parsing entities in the caption. See formatting options for more details.

caption_entitiesArray.<MessageEntity><optional>

Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode

reply_markupInlineKeyboardMarkup<optional>

Optional. Inline keyboard attached to the message

input_message_contentInputMessageContent<optional>

Optional. Content of the message to be sent instead of the video animation

InlineQueryResultPhoto

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

Type:
  • object
Properties
NameTypeAttributesDescription
type'photo'

Type of the result, must be photo

idstring

Unique identifier for this result, 1-64 bytes

photo_urlstring

A valid URL of the photo. Photo must be in JPEG format. Photo size must not exceed 5MB

thumbnail_urlstring

URL of the thumbnail for the photo

photo_widthnumber<optional>

Optional. Width of the photo

photo_heightnumber<optional>

Optional. Height of the photo

titlestring<optional>

Optional. Title for the result

descriptionstring<optional>

Optional. Short description of the result

captionstring<optional>

Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing

parse_modeParseMode<optional>

Optional. Mode for parsing entities in the photo caption. See formatting options for more details.

caption_entitiesArray.<MessageEntity><optional>

Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode

reply_markupInlineKeyboardMarkup<optional>

Optional. Inline keyboard attached to the message

input_message_contentInputMessageContent<optional>

Optional. Content of the message to be sent instead of the photo

InlineQueryResultVenue

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

Type:
  • object
Properties
NameTypeAttributesDescription
type'venue'

Type of the result, must be venue

idstring

Unique identifier for this result, 1-64 Bytes

latitudenumber

Latitude of the venue location in degrees

longitudenumber

Longitude of the venue location in degrees

titlestring

Title of the venue

addressstring

Address of the venue

foursquare_idstring<optional>

Optional. Foursquare identifier of the venue if known

foursquare_typestring<optional>

Optional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)

google_place_idstring<optional>

Optional. Google Places identifier of the venue

google_place_typestring<optional>

Optional. Google Places type of the venue. (See supported types.)

reply_markupInlineKeyboardMarkup<optional>

Optional. Inline keyboard attached to the message

input_message_contentInputMessageContent<optional>

Optional. Content of the message to be sent instead of the venue

thumbnail_urlstring<optional>

Optional. Url of the thumbnail for the result

thumbnail_widthnumber<optional>

Optional. Thumbnail width

thumbnail_heightnumber<optional>

Optional. Thumbnail height

InlineQueryResultVideo

Represents a link to a page containing an embedded video player or a video file. By default, this video file will be sent by the user with an optional caption. Alternatively, you can use input_message_content to send a message with the specified content instead of the video.

If an InlineQueryResultVideo message contains an embedded video (e.g., YouTube), you must replace its content using input_message_content.

Type:
  • object
Properties
NameTypeAttributesDescription
type'video'

Type of the result, must be video

idstring

Unique identifier for this result, 1-64 bytes

video_urlstring

A valid URL for the embedded video player or video file

mime_type'text/html' | 'video/mp4'

MIME type of the content of the video URL, “text/html” or “video/mp4”

thumbnail_urlstring

URL of the thumbnail (JPEG only) for the video

titlestring

Title for the result

captionstring<optional>

Optional. Caption of the video to be sent, 0-1024 characters after entities parsing

parse_modeParseMode<optional>

Optional. Mode for parsing entities in the video caption. See formatting options for more details.

caption_entitiesArray.<MessageEntity><optional>

Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode

video_widthnumber<optional>

Optional. Video width

video_heightnumber<optional>

Optional. Video height

video_durationnumber<optional>

Optional. Video duration in seconds

descriptionstring<optional>

Optional. Short description of the result

reply_markupInlineKeyboardMarkup<optional>

Optional. Inline keyboard attached to the message

input_message_contentInputMessageContent<optional>

Optional. Content of the message to be sent instead of the video. This field is required if InlineQueryResultVideo is used to send an HTML-page as a result (e.g., a YouTube video).

InlineQueryResultVoice

Represents a link to a voice recording in an .OGG container encoded with OPUS. By default, this voice recording will be sent by the user. Alternatively, you can use input_message_content to send a message with the specified content instead of the the voice message.

Type:
  • object
Properties
NameTypeAttributesDescription
type'voice'

Type of the result, must be voice

idstring

Unique identifier for this result, 1-64 bytes

voice_urlstring

A valid URL for the voice recording

titlestring

Recording title

captionstring<optional>

Optional. Caption, 0-1024 characters after entities parsing

parse_modeParseMode<optional>

Optional. Mode for parsing entities in the voice message caption. See formatting options for more details.

caption_entitiesArray.<MessageEntity><optional>

Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode

voice_durationnumber<optional>

Optional. Recording duration in seconds

reply_markupInlineKeyboardMarkup<optional>

Optional. Inline keyboard attached to the message

input_message_contentInputMessageContent<optional>

Optional. Content of the message to be sent instead of the voice recording

InlineQueryResultsButton

This object represents a button to be shown above inline query results. You must use exactly one of the optional fields.

Type:
  • object
Properties
NameTypeAttributesDescription
textstring

Label text on the button

web_appWebAppInfo<optional>

Optional. Description of the Web App that will be launched when the user presses the button. The Web App will be able to switch back to the inline mode using the method switchInlineQuery inside the Web App.

start_parameterstring<optional>

Optional. Deep-linking parameter for the /start message sent to the bot when a user presses the button. 1-64 characters, only A-Z, a-z, 0-9, _ and - are allowed.

Example: An inline bot that sends YouTube videos can ask the user to connect the bot to their YouTube account to adapt search results accordingly. To do this, it displays a 'Connect your YouTube account' button above the results, or even before showing any. The user presses the button, switches to a private chat with the bot and, in doing so, passes a start parameter that instructs the bot to return an OAuth link. Once done, the bot can offer a switch_inline button so that the user can easily return to the chat where they wanted to use the bot's inline capabilities.

InputContactMessageContent

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

Type:
  • object
Properties
NameTypeAttributesDescription
phone_numberstring

Contact's phone number

first_namestring

Contact's first name

last_namestring<optional>

Optional. Contact's last name

vcardstring<optional>

Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes

InputFile

This object represents the contents of a file to be uploaded. Must be posted using multipart/form-data in the usual way that files are uploaded via the browser.

Type:
  • Buffer | ReadableStream | string

InputInvoiceMessageContent

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

Type:
  • object
Properties
NameTypeAttributesDescription
titlestring

Product name, 1-32 characters

descriptionstring

Product description, 1-255 characters

payloadstring

Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.

provider_tokenstring

Payment provider token, obtained via @BotFather

currencystring

Three-letter ISO 4217 currency code, see more on currencies

pricesArray.<LabeledPrice>

Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)

max_tip_amountnumber<optional>

Optional. The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0

suggested_tip_amountsArray.<number><optional>

Optional. A JSON-serialized array of suggested amounts of tip in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount.

provider_datastring<optional>

Optional. A JSON-serialized object for data about the invoice, which will be shared with the payment provider. A detailed description of the required fields should be provided by the payment provider.

photo_urlstring<optional>

Optional. URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service.

photo_sizenumber<optional>

Optional. Photo size in bytes

photo_widthnumber<optional>

Optional. Photo width

photo_heightnumber<optional>

Optional. Photo height

need_nameboolean<optional>

Optional. Pass True if you require the user's full name to complete the order

need_phone_numberboolean<optional>

Optional. Pass True if you require the user's phone number to complete the order

need_emailboolean<optional>

Optional. Pass True if you require the user's email address to complete the order

need_shipping_addressboolean<optional>

Optional. Pass True if you require the user's shipping address to complete the order

send_phone_number_to_providerboolean<optional>

Optional. Pass True if the user's phone number should be sent to provider

send_email_to_providerboolean<optional>

Optional. Pass True if the user's email address should be sent to provider

is_flexibleboolean<optional>

Optional. Pass True if the final price depends on the shipping method

InputLocationMessageContent

Represents the content of a location message to be sent as the result of an inline query.

Type:
  • object
Properties
NameTypeAttributesDescription
latitudenumber

Latitude of the location in degrees

longitudenumber

Longitude of the location in degrees

horizontal_accuracynumber<optional>

Optional. The radius of uncertainty for the location, measured in meters; 0-1500

live_periodnumber<optional>

Optional. Period in seconds for which the location can be updated, should be between 60 and 86400.

headingnumber<optional>

Optional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.

proximity_alert_radiusnumber<optional>

Optional. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.

InputMedia

This object represents the content of a media message to be sent. It should be one of

InputMediaAnimation

InputMediaDocument

InputMediaAudio

InputMediaPhoto

InputMediaVideo

InputMediaAnimation

Represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent.

Type:
  • object
Properties
NameTypeAttributesDescription
type'animation'

Type of the result, must be animation

mediastring

File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files »

thumbnailInputFile | FileId<optional>

Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »

captionstring<optional>

Optional. Caption of the animation to be sent, 0-1024 characters after entities parsing

parse_modeParseMode<optional>

Optional. Mode for parsing entities in the animation caption. See formatting options for more details.

caption_entitiesArray.<MessageEntity><optional>

Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode

widthnumber<optional>

Optional. Animation width

heightnumber<optional>

Optional. Animation height

durationnumber<optional>

Optional. Animation duration in seconds

has_spoilerboolean<optional>

Optional. Pass True if the animation needs to be covered with a spoiler animation

InputMediaAudio

Represents an audio file to be treated as music to be sent.

Type:
  • object
Properties
NameTypeAttributesDescription
type'audio'

Type of the result, must be audio

mediastring

File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files »

thumbnailInputFile | FileId<optional>

Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »

captionstring<optional>

Optional. Caption of the audio to be sent, 0-1024 characters after entities parsing

parse_modeParseMode<optional>

Optional. Mode for parsing entities in the audio caption. See formatting options for more details.

caption_entitiesArray.<MessageEntity><optional>

Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode

durationnumber<optional>

Optional. Duration of the audio in seconds

performerstring<optional>

Optional. Performer of the audio

titlestring<optional>

Optional. Title of the audio

InputMediaDocument

Represents a general file to be sent.

Type:
  • object
Properties
NameTypeAttributesDescription
type'document'

Type of the result, must be document

mediastring

File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files »

thumbnailInputFile | FileId<optional>

Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »

captionstring<optional>

Optional. Caption of the document to be sent, 0-1024 characters after entities parsing

parse_modeParseMode<optional>

Optional. Mode for parsing entities in the document caption. See formatting options for more details.

caption_entitiesArray.<MessageEntity><optional>

Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode

disable_content_type_detectionboolean<optional>

Optional. Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always True, if the document is sent as part of an album.

InputMediaPhoto

Represents a photo to be sent.

Type:
  • object
Properties
NameTypeAttributesDescription
type'photo'

Type of the result, must be photo

mediastring

File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files »

captionstring<optional>

Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing

parse_modeParseMode<optional>

Optional. Mode for parsing entities in the photo caption. See formatting options for more details.

caption_entitiesArray.<MessageEntity><optional>

Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode

has_spoilerboolean<optional>

Optional. Pass True if the photo needs to be covered with a spoiler animation

InputMediaVideo

Represents a video to be sent.

Type:
  • object
Properties
NameTypeAttributesDescription
type'video'

Type of the result, must be video

mediastring

File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. More information on Sending Files »

thumbnailInputFile | FileId<optional>

Optional. Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More information on Sending Files »

captionstring<optional>

Optional. Caption of the video to be sent, 0-1024 characters after entities parsing

parse_modeParseMode<optional>

Optional. Mode for parsing entities in the video caption. See formatting options for more details.

caption_entitiesArray.<MessageEntity><optional>

Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode

widthnumber<optional>

Optional. Video width

heightnumber<optional>

Optional. Video height

durationnumber<optional>

Optional. Video duration in seconds

supports_streamingboolean<optional>

Optional. Pass True if the uploaded video is suitable for streaming

has_spoilerboolean<optional>

Optional. Pass True if the video needs to be covered with a spoiler animation

InputMessageContent

This object represents the content of a message to be sent as a result of an inline query. Telegram clients currently support the following 5 types:

InputTextMessageContent

InputLocationMessageContent

InputVenueMessageContent

InputContactMessageContent

InputInvoiceMessageContent

InputSticker

This object describes a sticker to be added to a sticker set.

Type:
  • object
Properties
NameTypeAttributesDescription
stickerInputFile

The added sticker. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, upload a new one using multipart/form-data, or pass “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name. Animated and video stickers can't be uploaded via HTTP URL. More information on Sending Files »

emoji_listArray.<string>

List of 1-20 emoji associated with the sticker

mask_positionMaskPosition<optional>

Optional. Position where the mask should be placed on faces. For “mask” stickers only.

keywordsArray.<string><optional>

Optional. List of 0-20 search keywords for the sticker with total length of up to 64 characters. For “regular” and “custom_emoji” stickers only.

InputTextMessageContent

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

Type:
  • object
Properties
NameTypeAttributesDescription
message_textstring

Text of the message to be sent, 1-4096 characters

parse_modeParseMode<optional>

Optional. Mode for parsing entities in the message text. See formatting options for more details.

entitiesArray.<MessageEntity><optional>

Optional. List of special entities that appear in message text, which can be specified instead of parse_mode

disable_web_page_previewboolean<optional>

Optional. Disables link previews for links in the sent message

InputVenueMessageContent

Represents the content of a venue message to be sent as the result of an inline query.

Type:
  • object
Properties
NameTypeAttributesDescription
latitudenumber

Latitude of the venue in degrees

longitudenumber

Longitude of the venue in degrees

titlestring

Name of the venue

addressstring

Address of the venue

foursquare_idstring<optional>

Optional. Foursquare identifier of the venue, if known

foursquare_typestring<optional>

Optional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)

google_place_idstring<optional>

Optional. Google Places identifier of the venue

google_place_typestring<optional>

Optional. Google Places type of the venue. (See supported types.)

Invoice

This object contains basic information about an invoice.

Type:
  • object
Properties
NameTypeDescription
titlestring

Product name

descriptionstring

Product description

start_parameterstring

Unique bot deep-linking parameter that can be used to generate this invoice

currencystring

Three-letter ISO 4217 currency code

total_amountnumber

Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).

InvoiceLinkParams

Type:
  • object
Properties
NameTypeAttributesDescription
titlestring

Product name, 1-32 characters

descriptionstring

Product description, 1-255 characters

payloadstring

Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.

provider_tokenstring

Payment provider token, obtained via @BotFather

currencystring

Three-letter ISO 4217 currency code, see more on currencies

pricesArray.<LabeledPrice>

Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)

is_flexibleboolean<optional>

Optional. Pass True if the final price depends on the shipping method

max_tip_amountnumber<optional>

Optional. The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0

suggested_tip_amountsArray.<number><optional>

Optional. A JSON-serialized array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount.

provider_dataobject<optional>

Optional. JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider.

photo_urlstring<optional>

Optional. URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for.

photo_sizenumber<optional>

Optional. Photo size in bytes

photo_widthnumber<optional>

Optional. Photo width

photo_heightnumber<optional>

Optional. Photo height

need_nameboolean<optional>

Optional. Pass True if you require the user's full name to complete the order

need_phone_numberboolean<optional>

Optional. Pass True if you require the user's phone number to complete the order

need_emailboolean<optional>

Optional. Pass True if you require the user's email address to complete the order

need_shipping_addressboolean<optional>

Optional. Pass True if you require the user's shipping address to complete the order

send_phone_number_to_providerboolean<optional>

Optional. Pass True if the user's phone number should be sent to provider

send_email_to_providerboolean<optional>

Optional. Pass True if the user's email address should be sent to provider

InvoiceParams

Type:
  • object
Properties
NameTypeAttributesDescription
message_thread_idnumber<optional>

Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only

titlestring

Product name, 1-32 characters

descriptionstring

Product description, 1-255 characters

payloadstring

Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.

provider_tokenstring

Payment provider token, obtained via @BotFather

currencystring

Three-letter ISO 4217 currency code, see more on currencies

pricesArray.<LabeledPrice>

Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)

KeyboardButton

This object represents one button of the reply keyboard. For simple text buttons, String can be used instead of this object to specify the button text. The optional fields web_app, request_user, request_chat, request_contact, request_location, and request_poll are mutually exclusive.

Type:
  • object
Properties
NameTypeAttributesDescription
textstring

Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed

request_userKeyboardButtonRequestUser<optional>

Optional. If specified, pressing the button will open a list of suitable users. Tapping on any user will send their identifier to the bot in a “user_shared” service message. Available in private chats only.

request_chatKeyboardButtonRequestChat<optional>

Optional. If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a “chat_shared” service message. Available in private chats only.

request_contactboolean<optional>

Optional. If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only.

request_locationboolean<optional>

Optional. If True, the user's current location will be sent when the button is pressed. Available in private chats only.

request_pollKeyboardButtonPollType<optional>

Optional. If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. Available in private chats only.

web_appWebAppInfo<optional>

Optional. If specified, the described Web App will be launched when the button is pressed. The Web App will be able to send a “web_app_data” service message. Available in private chats only.

KeyboardButtonPollType

This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed.

Type:
  • object
Properties
NameTypeAttributesDescription
typestring<optional>

Optional. If quiz is passed, the user will be allowed to create only polls in the quiz mode. If regular is passed, only regular polls will be allowed. Otherwise, the user will be allowed to create a poll of any type.

KeyboardButtonRequestChat

This object defines the criteria used to request a suitable chat. The identifier of the selected chat will be shared with the bot when the corresponding button is pressed. More about requesting chats »

Type:
  • object
Properties
NameTypeAttributesDescription
request_idnumber

Signed 32-bit identifier of the request, which will be received back in the ChatShared object. Must be unique within the message

chat_is_channelboolean

Pass True to request a channel chat, pass False to request a group or a supergroup chat.

chat_is_forumboolean<optional>

Optional. Pass True to request a forum supergroup, pass False to request a non-forum chat. If not specified, no additional restrictions are applied.

chat_has_usernameboolean<optional>

Optional. Pass True to request a supergroup or a channel with a username, pass False to request a chat without a username. If not specified, no additional restrictions are applied.

chat_is_createdboolean<optional>

Optional. Pass True to request a chat owned by the user. Otherwise, no additional restrictions are applied.

user_administrator_rightsChatAdministratorRights<optional>

Optional. A JSON-serialized object listing the required administrator rights of the user in the chat. The rights must be a superset of bot_administrator_rights. If not specified, no additional restrictions are applied.

bot_administrator_rightsChatAdministratorRights<optional>

Optional. A JSON-serialized object listing the required administrator rights of the bot in the chat. The rights must be a subset of user_administrator_rights. If not specified, no additional restrictions are applied.

bot_is_memberboolean<optional>

Optional. Pass True to request a chat with the bot as a member. Otherwise, no additional restrictions are applied.

KeyboardButtonRequestUser

This object defines the criteria used to request a suitable user. The identifier of the selected user will be shared with the bot when the corresponding button is pressed. More about requesting users »

Type:
  • object
Properties
NameTypeAttributesDescription
request_idnumber

Signed 32-bit identifier of the request, which will be received back in the UserShared object. Must be unique within the message

user_is_botboolean<optional>

Optional. Pass True to request a bot, pass False to request a regular user. If not specified, no additional restrictions are applied.

user_is_premiumboolean<optional>

Optional. Pass True to request a premium user, pass False to request a non-premium user. If not specified, no additional restrictions are applied.

KeyboardOptions

Type:
  • object
Properties
NameTypeAttributesDefaultDescription
columnsnumber<optional>
1

Count of keyboard columns

wrapKeyboardWrap<optional>

Warp function

LabeledPrice

This object represents a portion of the price for goods or services.

Type:
  • object
Properties
NameTypeDescription
labelstring

Portion label

amountnumber

Price of the product in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).

Location

This object represents a point on the map.

Type:
  • object
Properties
NameTypeAttributesDescription
longitudenumber

Longitude as defined by sender

latitudenumber

Latitude as defined by sender

horizontal_accuracynumber<optional>

Optional. The radius of uncertainty for the location, measured in meters; 0-1500

live_periodnumber<optional>

Optional. Time relative to the message sending date, during which the location can be updated; in seconds. For active live locations only.

headingnumber<optional>

Optional. The direction in which user is moving, in degrees; 1-360. For active live locations only.

proximity_alert_radiusnumber<optional>

Optional. The maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only.

LoginButtonOptions

Type:
  • object
Properties
NameTypeAttributesDescription
forward_textstring<optional>

New text of the button in forwarded messages.

bot_usernamestring<optional>

Username of a bot, which will be used for user authorization.

request_write_accessboolean<optional>

Pass True to request the permission for your bot to send messages to the user.

LoginUrl

This object represents a parameter of the inline keyboard button used to automatically authorize a user. Serves as a great replacement for the Telegram Login Widget when the user is coming from Telegram. All the user needs to do is tap/click a button and confirm that they want to log in:

Telegram apps support these buttons as of version 5.7. Sample bot: @discussbot

Type:
  • object
Properties
NameTypeAttributesDescription
urlstring

An HTTPS URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in Receiving authorization data.

NOTE: You must always check the hash of the received data to verify the authentication and the integrity of the data as described in Checking authorization.

forward_textstring<optional>

Optional. New text of the button in forwarded messages.

bot_usernamestring<optional>

Optional. Username of a bot, which will be used for user authorization. See Setting up a bot for more details. If not specified, the current bot's username will be assumed. The url's domain must be the same as the domain linked with the bot. See Linking your domain to the bot for more details.

request_write_accessboolean<optional>

Optional. Pass True to request the permission for your bot to send messages to the user.

MaskPosition

This object describes the position on faces where a mask should be placed by default.

Type:
  • object
Properties
NameTypeDescription
point'forehead' | 'eyes' | 'mouth' | 'chin'

The part of the face relative to which the mask should be placed. One of “forehead”, “eyes”, “mouth”, or “chin”.

x_shiftnumber

Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place mask just to the left of the default mask position.

y_shiftnumber

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.

scalenumber

Mask scaling coefficient. For example, 2.0 means double size.

This object describes the bot's menu button in a private chat. It should be one of

MenuButtonCommands

MenuButtonWebApp

MenuButtonDefault

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

Type:
  • object
Properties
NameTypeDescription
type'commands'

Type of the button, must be commands

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

Type:
  • object
Properties
NameTypeDescription
type'default'

Type of the button, must be default

Represents a menu button, which launches a Web App .

Type:
  • object
Properties
NameTypeDescription
type'web_app'

Type of the button, must be web_app

textstring

Text on the button

web_appWebAppInfo

Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery.

Message

This object represents a message.

Type:
  • object
Properties
NameTypeAttributesDescription
message_idnumber

Unique message identifier inside this chat

message_thread_idnumber<optional>

Optional. Unique identifier of a message thread to which the message belongs; for supergroups only

fromUser<optional>

Optional. Sender of the message; empty for messages sent to channels. For backward compatibility, the field contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.

sender_chatChat<optional>

Optional. Sender of the message, sent on behalf of a chat. For example, the channel itself for channel posts, the supergroup itself for messages from anonymous group administrators, the linked channel for messages automatically forwarded to the discussion group. For backward compatibility, the field from contains a fake sender user in non-channel chats, if the message was sent on behalf of a chat.

datenumber

Date the message was sent in Unix time

chatChat

Conversation the message belongs to

forward_fromUser<optional>

Optional. For forwarded messages, sender of the original message

forward_from_chatChat<optional>

Optional. For messages forwarded from channels or from anonymous administrators, information about the original sender chat

forward_from_message_idnumber<optional>

Optional. For messages forwarded from channels, identifier of the original message in the channel

forward_signaturestring<optional>

Optional. For forwarded messages that were originally sent in channels or by an anonymous chat administrator, signature of the message sender if present

forward_sender_namestring<optional>

Optional. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages

forward_datenumber<optional>

Optional. For forwarded messages, date the original message was sent in Unix time

is_topic_messageboolean<optional>

Optional. True, if the message is sent to a forum topic

is_automatic_forwardboolean<optional>

Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group

reply_to_messageMessage<optional>

Optional. For replies, the original message. Note that the Message object in this field will not contain further reply_to_message fields even if it itself is a reply.

via_botUser<optional>

Optional. Bot through which the message was sent

edit_datenumber<optional>

Optional. Date the message was last edited in Unix time

has_protected_contentboolean<optional>

Optional. True, if the message can't be forwarded

media_group_idstring<optional>

Optional. The unique identifier of a media message group this message belongs to

author_signaturestring<optional>

Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator

textstring<optional>

Optional. For text messages, the actual UTF-8 text of the message

entitiesArray.<MessageEntity><optional>

Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text

animationAnimation<optional>

Optional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set

audioAudio<optional>

Optional. Message is an audio file, information about the file

documentDocument<optional>

Optional. Message is a general file, information about the file

photoArray.<PhotoSize><optional>

Optional. Message is a photo, available sizes of the photo

stickerSticker<optional>

Optional. Message is a sticker, information about the sticker

storyStory<optional>

Optional. Message is a forwarded story

videoVideo<optional>

Optional. Message is a video, information about the video

video_noteVideoNote<optional>

Optional. Message is a video note, information about the video message

voiceVoice<optional>

Optional. Message is a voice message, information about the file

captionstring<optional>

Optional. Caption for the animation, audio, document, photo, video or voice

caption_entitiesArray.<MessageEntity><optional>

Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption

has_media_spoilerboolean<optional>

Optional. True, if the message media is covered by a spoiler animation

contactContact<optional>

Optional. Message is a shared contact, information about the contact

diceDice<optional>

Optional. Message is a dice with random value

gameGame<optional>

Optional. Message is a game, information about the game. More about games »

pollPoll<optional>

Optional. Message is a native poll, information about the poll

venueVenue<optional>

Optional. Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set

locationLocation<optional>

Optional. Message is a shared location, information about the location

new_chat_membersArray.<User><optional>

Optional. New members that were added to the group or supergroup and information about them (the bot itself may be one of these members)

left_chat_memberUser<optional>

Optional. A member was removed from the group, information about them (this member may be the bot itself)

new_chat_titlestring<optional>

Optional. A chat title was changed to this value

new_chat_photoArray.<PhotoSize><optional>

Optional. A chat photo was change to this value

delete_chat_photoboolean<optional>

Optional. Service message: the chat photo was deleted

group_chat_createdboolean<optional>

Optional. Service message: the group has been created

supergroup_chat_createdboolean<optional>

Optional. Service message: the supergroup has been created. This field can't be received in a message coming through updates, because bot can't be a member of a supergroup when it is created. It can only be found in reply_to_message if someone replies to a very first message in a directly created supergroup.

channel_chat_createdboolean<optional>

Optional. Service message: the channel has been created. This field can't be received in a message coming through updates, because bot can't be a member of a channel when it is created. It can only be found in reply_to_message if someone replies to a very first message in a channel.

message_auto_delete_timer_changedMessageAutoDeleteTimerChanged<optional>

Optional. Service message: auto-delete timer settings changed in the chat

migrate_to_chat_idnumber<optional>

Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.

migrate_from_chat_idnumber<optional>

Optional. The supergroup has been migrated from a group with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.

pinned_messageMessage<optional>

Optional. Specified message was pinned. Note that the Message object in this field will not contain further reply_to_message fields even if it is itself a reply.

invoiceInvoice<optional>

Optional. Message is an invoice for a payment, information about the invoice. More about payments »

successful_paymentSuccessfulPayment<optional>

Optional. Message is a service message about a successful payment, information about the payment. More about payments »

user_sharedUserShared<optional>

Optional. Service message: a user was shared with the bot

chat_sharedChatShared<optional>

Optional. Service message: a chat was shared with the bot

connected_websitestring<optional>

Optional. The domain name of the website on which the user has logged in. More about Telegram Login »

passport_dataPassportData<optional>

Optional. Telegram Passport data

proximity_alert_triggeredProximityAlertTriggered<optional>

Optional. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location.

forum_topic_createdForumTopicCreated<optional>

Optional. Service message: forum topic created

forum_topic_closedForumTopicClosed<optional>

Optional. Service message: forum topic closed

forum_topic_reopenedForumTopicReopened<optional>

Optional. Service message: forum topic reopened

write_access_allowedWriteAccessAllowed<optional>

Optional. Service message: the user allowed the bot to write messages after adding it to the attachment or side menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess

general_forum_topic_unhiddenGeneralForumTopicUnhidden<optional>

Optional. Service message: the 'General' forum topic unhidden

general_forum_topic_hiddenGeneralForumTopicHidden<optional>

Optional. Service message: the 'General' forum topic hidden

forum_topic_editedForumTopicEdited<optional>

Optional. Service message: forum topic edited

video_chat_scheduledVideoChatScheduled<optional>

Optional. Service message: video chat scheduled

video_chat_startedVideoChatStarted<optional>

Optional. Service message: video chat started

video_chat_endedVideoChatEnded<optional>

Optional. Service message: video chat ended

video_chat_participants_invitedVideoChatParticipantsInvited<optional>

Optional. Service message: new participants invited to a video chat

web_app_dataWebAppData<optional>

Optional. Service message: data sent by a Web App

reply_markupInlineKeyboardMarkup<optional>

Optional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons.

MessageAutoDeleteTimerChanged

This object represents a service message about a change in auto-delete timer settings.

Type:
  • object
Properties
NameTypeDescription
message_auto_delete_timenumber

New auto-delete time for messages in the chat; in seconds

MessageEntity

This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.

Type:
  • object
Properties
NameTypeAttributesDescription
type'mention' | 'hashtag' | 'cashtag' | 'bot_command' | 'url' | 'email' | 'phone_number' | 'bold' | 'italic' | 'underline' | 'strikethrough' | 'spoiler' | 'code' | 'pre' | 'text_link' | 'text_mention' | 'custom_emoji'

Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” ([email protected]), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers)

offsetnumber

Offset in UTF-16 code units to the start of the entity

lengthnumber

Length of the entity in UTF-16 code units

urlstring<optional>

Optional. For “text_link” only, URL that will be opened after user taps on the text

userUser<optional>

Optional. For “text_mention” only, the mentioned user

languagestring<optional>

Optional. For “pre” only, the programming language of the entity text

custom_emoji_idstring<optional>

Optional. For “custom_emoji” only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker

MessageEntityType

Type:
  • 'mention' | 'hashtag' | 'cashtag' | 'bot_command' | 'url' | 'email' | 'phone_number' | 'bold' | 'italic' | 'underline' | 'strikethrough' | 'spoiler' | 'code' | 'pre' | 'text_link' | 'text_mention' | 'custom_emoji'

MessageId

This object represents a unique message identifier.

Type:
  • object
Properties
NameTypeDescription
message_idnumber

Unique message identifier

Middleware

Type:

MiddlewareFn()

OrderInfo

This object represents information about an order.

Type:
  • object
Properties
NameTypeAttributesDescription
namestring<optional>

Optional. User name

phone_numberstring<optional>

Optional. User's phone number

emailstring<optional>

Optional. User email

shipping_addressShippingAddress<optional>

Optional. User shipping address

ParseMode

Type:
  • 'Markdown' | 'MarkdownV2' | 'HTML'

PassportData

Describes Telegram Passport data shared with the bot by the user.

Type:
  • object
Properties
NameTypeDescription
dataArray.<EncryptedPassportElement>

Array with information about documents and other Telegram Passport elements that was shared with the bot

credentialsEncryptedCredentials

Encrypted credentials required to decrypt the data

PassportElementError

PassportElementErrorDataField

Represents an issue in one of the data fields that was provided by the user. The error is considered resolved when the field's value changes.

Type:
  • object
Properties
NameTypeDescription
source'data'

Error source, must be data

type'personal_details' | 'passport' | 'driver_license' | 'identity_card' | 'internal_passport' | 'address'

The section of the user's Telegram Passport which has the error, one of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”

field_namestring

Name of the data field which has the error

data_hashstring

Base64-encoded data hash

messagestring

Error message

PassportElementErrorFile

Represents an issue with a document scan. The error is considered resolved when the file with the document scan changes.

Type:
  • object
Properties
NameTypeDescription
source'file'

Error source, must be file

type'utility_bill' | 'bank_statement' | 'rental_agreement' | 'passport_registration' | 'temporary_registration'

The section of the user's Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”

file_hashstring

Base64-encoded file hash

messagestring

Error message

PassportElementErrorFiles

Represents an issue with a list of scans. The error is considered resolved when the list of files containing the scans changes.

Type:
  • object
Properties
NameTypeDescription
source'files'

Error source, must be files

type'utility_bill' | 'bank_statement' | 'rental_agreement' | 'passport_registration' | 'temporary_registration'

The section of the user's Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”

file_hashesArray.<string>

List of base64-encoded file hashes

messagestring

Error message

PassportElementErrorFrontSide

Represents an issue with the front side of a document. The error is considered resolved when the file with the front side of the document changes.

Type:
  • object
Properties
NameTypeDescription
source'front_side'

Error source, must be front_side

type'passport' | 'driver_license' | 'identity_card' | 'internal_passport'

The section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”

file_hashstring

Base64-encoded hash of the file with the front side of the document

messagestring

Error message

PassportElementErrorReverseSide

Represents an issue with the reverse side of a document. The error is considered resolved when the file with reverse side of the document changes.

Type:
  • object
Properties
NameTypeDescription
source'reverse_side'

Error source, must be reverse_side

type'driver_license' | 'identity_card'

The section of the user's Telegram Passport which has the issue, one of “driver_license”, “identity_card”

file_hashstring

Base64-encoded hash of the file with the reverse side of the document

messagestring

Error message

PassportElementErrorSelfie

Represents an issue with the selfie with a document. The error is considered resolved when the file with the selfie changes.

Type:
  • object
Properties
NameTypeDescription
source'selfie'

Error source, must be selfie

type'passport' | 'driver_license' | 'identity_card' | 'internal_passport'

The section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”

file_hashstring

Base64-encoded hash of the file with the selfie

messagestring

Error message

PassportElementErrorTranslationFile

Represents an issue with one of the files that constitute the translation of a document. The error is considered resolved when the file changes.

Type:
  • object
Properties
NameTypeDescription
source'translation_file'

Error source, must be translation_file

type'passport' | 'driver_license' | 'identity_card' | 'internal_passport' | 'utility_bill' | 'bank_statement' | 'rental_agreement' | 'passport_registration' | 'temporary_registration'

Type of element of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”

file_hashstring

Base64-encoded file hash

messagestring

Error message

PassportElementErrorTranslationFiles

Represents an issue with the translated version of a document. The error is considered resolved when a file with the document translation change.

Type:
  • object
Properties
NameTypeDescription
source'translation_files'

Error source, must be translation_files

type'passport' | 'driver_license' | 'identity_card' | 'internal_passport' | 'utility_bill' | 'bank_statement' | 'rental_agreement' | 'passport_registration' | 'temporary_registration'

Type of element of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”

file_hashesArray.<string>

List of base64-encoded file hashes

messagestring

Error message

PassportElementErrorUnspecified

Represents an issue in an unspecified place. The error is considered resolved when new data is added.

Type:
  • object
Properties
NameTypeDescription
source'unspecified'

Error source, must be unspecified

typestring

Type of element of the user's Telegram Passport which has the issue

element_hashstring

Base64-encoded element hash

messagestring

Error message

PassportFile

This object represents a file uploaded to Telegram Passport. Currently all Telegram Passport files are in JPEG format when decrypted and don't exceed 10MB.

Type:
  • object
Properties
NameTypeDescription
file_idstring

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

file_unique_idstring

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

file_sizenumber

File size in bytes

file_datenumber

Unix time when the file was uploaded

PhotoSize

This object represents one size of a photo or a file

/ sticker thumbnail.

Type:
  • object
Properties
NameTypeAttributesDescription
file_idstring

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

file_unique_idstring

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.

widthnumber

Photo width

heightnumber

Photo height

file_sizenumber<optional>

Optional. File size in bytes

Poll

This object contains information about a poll.

Type:
  • object
Properties
NameTypeAttributesDescription
idstring

Unique poll identifier

questionstring

Poll question, 1-300 characters

optionsArray.<PollOption>

List of poll options

total_voter_countnumber

Total number of users that voted in the poll

is_closedboolean

True, if the poll is closed

is_anonymousboolean

True, if the poll is anonymous

type'regular' | 'quiz'

Poll type, currently can be “regular” or “quiz”

allows_multiple_answersboolean

True, if the poll allows multiple answers

correct_option_idnumber<optional>

Optional. 0-based identifier of the correct answer option. Available only for polls in the quiz mode, which are closed, or was sent (not forwarded) by the bot or to the private chat with the bot.

explanationstring<optional>

Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters

explanation_entitiesArray.<MessageEntity><optional>

Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation

open_periodnumber<optional>

Optional. Amount of time in seconds the poll will be active after creation

close_datenumber<optional>

Optional. Point in time (Unix timestamp) when the poll will be automatically closed

PollAnswer

This object represents an answer of a user in a non-anonymous poll.

Type:
  • object
Properties
NameTypeAttributesDescription
poll_idstring

Unique poll identifier

voter_chatChat<optional>

Optional. The chat that changed the answer to the poll, if the voter is anonymous

userUser<optional>

Optional. The user that changed the answer to the poll, if the voter isn't anonymous

option_idsArray.<number>

0-based identifiers of chosen answer options. May be empty if the vote was retracted.

PollOption

This object contains information about one answer option in a poll.

Type:
  • object
Properties
NameTypeDescription
textstring

Option text, 1-100 characters

voter_countnumber

Number of users that voted for this option

PreCheckoutQuery

This object contains information about an incoming pre-checkout query.

Type:
  • object
Properties
NameTypeAttributesDescription
idstring

Unique query identifier

fromUser

User who sent the query

currencystring

Three-letter ISO 4217 currency code

total_amountnumber

Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).

invoice_payloadstring

Bot specified invoice payload

shipping_option_idstring<optional>

Optional. Identifier of the shipping option chosen by the user

order_infoOrderInfo<optional>

Optional. Order information provided by the user

PredicateFn(context) → {boolean|Promise.<boolean>}

Parameters:
NameTypeDescription
contextOpengramContext

Update context

Returns:
Type: 
boolean | Promise.<boolean>

ProximityAlertTriggered

This object represents the content of a service message, sent whenever a user in the chat triggers a proximity alert set by another user.

Type:
  • object
Properties
NameTypeDescription
travelerUser

User that triggered the alert

watcherUser

User that set the alert

distancenumber

The distance between the users

ReplyKeyboardMarkup

This object represents a custom keyboard with reply options (see Introduction to bots for details and examples).

Type:
  • object
Properties
NameTypeAttributesDescription
keyboardArray.<Array.<KeyboardButton>>

Array of button rows, each represented by an Array of KeyboardButton objects

resize_keyboardboolean<optional>

Optional. Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app's standard keyboard.

is_persistentboolean<optional>

Optional. Requests clients to always show the keyboard when the regular keyboard is hidden. Defaults to false, in which case the custom keyboard can be hidden and opened with a keyboard icon.

one_time_keyboardboolean<optional>

Optional. Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat - the user can press a special button in the input field to see the custom keyboard again. Defaults to false.

input_field_placeholderstring<optional>

Optional. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters

selectiveboolean<optional>

Optional. Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.

Example: A user requests to change the bot's language, bot replies to the request with a keyboard to select the new language. Other users in the group don't see the keyboard.

ReplyKeyboardRemove

Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see ReplyKeyboardMarkup) .

Type:
  • object
Properties
NameTypeAttributesDescription
remove_keyboardboolean

Requests clients to remove the custom keyboard (user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use one_time_keyboard in ReplyKeyboardMarkup)

selectiveboolean<optional>

Optional. Use this parameter if you want to remove the keyboard for specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot's message is a reply (has reply_to_message_id), sender of the original message.

Example: A user votes in a poll, bot returns confirmation message in reply to the vote and removes the keyboard for that user, while still showing the keyboard with poll options to users who haven't voted yet.

ResponseParameters

Describes why a request was unsuccessful.

Type:
  • object
Properties
NameTypeAttributesDescription
migrate_to_chat_idnumber<optional>

Optional. The group has been migrated to a supergroup with the specified identifier. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.

retry_afternumber<optional>

Optional. In case of exceeding flood control, the number of seconds left to wait before the request can be repeated

SentWebAppMessage

Describes an inline message sent by a Web App on behalf of a user.

Type:
  • object
Properties
NameTypeAttributesDescription
inline_message_idstring<optional>

Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message.

ShippingAddress

This object represents a shipping address.

Type:
  • object
Properties
NameTypeDescription
country_codestring

Two-letter ISO 3166-1 alpha-2 country code

statestring

State, if applicable

citystring

City

street_line1string

First line for the address

street_line2string

Second line for the address

post_codestring

Address post code

ShippingOption

This object represents one shipping option.

Type:
  • object
Properties
NameTypeDescription
idstring

Shipping option identifier

titlestring

Option title

pricesArray.<LabeledPrice>

List of price portions

ShippingQuery

This object contains information about an incoming shipping query.

Type:
  • object
Properties
NameTypeDescription
idstring

Unique query identifier

fromUser

User who sent the query

invoice_payloadstring

Bot specified invoice payload

shipping_addressShippingAddress

User specified shipping address

Sticker

This object represents a sticker.

Type:
  • object
Properties
NameTypeAttributesDescription
file_idstring

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

file_unique_idstring

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

type'regular' | 'mask' | 'custom_emoji'

Type of the sticker, currently one of “regular”, “mask”, “custom_emoji”. The type of the sticker is independent from its format, which is determined by the fields is_animated and is_video.

widthnumber

Sticker width

heightnumber

Sticker height

is_animatedboolean

True, if the sticker is animated

is_videoboolean

True, if the sticker is a video sticker

thumbnailPhotoSize<optional>

Optional. Sticker thumbnail in the .WEBP or .JPG format

emojistring<optional>

Optional. Emoji associated with the sticker

set_namestring<optional>

Optional. Name of the sticker set to which the sticker belongs

premium_animationFile<optional>

Optional. For premium regular stickers, premium animation for the sticker

mask_positionMaskPosition<optional>

Optional. For mask stickers, the position where the mask should be placed

custom_emoji_idstring<optional>

Optional. For custom emoji stickers, unique identifier of the custom emoji

file_sizenumber<optional>

Optional. File size in bytes

needs_repaintingtrue<optional>

Optional. 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

StickerSet

This object represents a sticker set.

Type:
  • object
Properties
NameTypeAttributesDescription
namestring

Sticker set name

titlestring

Sticker set title

sticker_type'regular' | 'mask' | 'custom_emoji'

Type of stickers in the set, currently one of “regular”, “mask”, “custom_emoji”

is_animatedboolean

True, if the sticker set contains animated stickers

is_videoboolean

True, if the sticker set contains video stickers

stickersArray.<Sticker>

List of all set stickers

thumbnailPhotoSize<optional>

Optional. Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format

Story

This object represents a message about a forwarded story in the chat. Currently holds no information.

Type:
  • *

SuccessfulPayment

This object contains basic information about a successful payment.

Type:
  • object
Properties
NameTypeAttributesDescription
currencystring

Three-letter ISO 4217 currency code

total_amountnumber

Total price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).

invoice_payloadstring

Bot specified invoice payload

shipping_option_idstring<optional>

Optional. Identifier of the shipping option chosen by the user

order_infoOrderInfo<optional>

Optional. Order information provided by the user

telegram_payment_charge_idstring

Telegram payment identifier

provider_payment_charge_idstring

Provider payment identifier

SwitchInlineQueryChosenChat

This object represents an inline button that switches the current user to inline mode in a chosen chat, with an optional default inline query.

Type:
  • object
Properties
NameTypeAttributesDescription
querystring<optional>

Optional. The default inline query to be inserted in the input field. If left empty, only the bot's username will be inserted

allow_user_chatsboolean<optional>

Optional. True, if private chats with users can be chosen

allow_bot_chatsboolean<optional>

Optional. True, if private chats with bots can be chosen

allow_group_chatsboolean<optional>

Optional. True, if group and supergroup chats can be chosen

allow_channel_chatsboolean<optional>

Optional. True, if channel chats can be chosen

TelegramOptions

Type:
  • object
Properties
NameTypeAttributesDefaultDescription
usernamestring<optional>

Bot username, used if you don't call bot.launch()

attachmentAgenthttp.Agent<optional>

HTTP Agent used for attachments

agenthttp.Agent<optional>

HTTP agent used for API calls. By default, it have this configuration: new https.Agent({ keepAlive: true, keepAliveMsecs: 10000 })

apiRootstring<optional>

API root URL

channelModeboolean<optional>
false

If true, channel posts can be matched as text update type

apiPrefixstring<optional>
bot

API prefix before bot token, by default bot, but if you use TDLight you maybe should change apiPrefix to user

testEnvboolean<optional>
false

Enable / disable test environment for WebApps, see more here

webhookReplyboolean<optional>
true

Enable / disable webhook reply

Trigger

Type:

TriggerPredicateFn(value, context) → {*}

Parameters:
NameTypeDescription
valuestring

Received value

contextOpengramContext

Update context

Returns:
Type: 
*

Update

This object represents an incoming update. At most one of the optional parameters can be present in any given update.

Type:
  • object
Properties
NameTypeAttributesDescription
update_idnumber

The update's unique identifier. Update identifiers start from a certain positive number and increase sequentially. This ID becomes especially handy if you're using webhooks, since it allows you to ignore repeated updates or to restore the correct update sequence, should they get out of order. If there are no new updates for at least a week, then identifier of the next update will be chosen randomly instead of sequentially.

messageMessage<optional>

Optional. New incoming message of any kind - text, photo, sticker, etc.

edited_messageMessage<optional>

Optional. New version of a message that is known to the bot and was edited

channel_postMessage<optional>

Optional. New incoming channel post of any kind - text, photo, sticker, etc.

edited_channel_postMessage<optional>

Optional. New version of a channel post that is known to the bot and was edited

inline_queryInlineQuery<optional>

Optional. New incoming inline query

chosen_inline_resultChosenInlineResult<optional>

Optional. The result of an inline query that was chosen by a user and sent to their chat partner. Please see our documentation on the feedback collecting for details on how to enable these updates for your bot.

callback_queryCallbackQuery<optional>

Optional. New incoming callback query

shipping_queryShippingQuery<optional>

Optional. New incoming shipping query. Only for invoices with flexible price

pre_checkout_queryPreCheckoutQuery<optional>

Optional. New incoming pre-checkout query. Contains full information about checkout

pollPoll<optional>

Optional. New poll state. Bots receive only updates about stopped polls and polls, which are sent by the bot

poll_answerPollAnswer<optional>

Optional. A user changed their answer in a non-anonymous poll. Bots receive new votes only in polls that were sent by the bot itself.

my_chat_memberChatMemberUpdated<optional>

Optional. The bot's chat member status was updated in a chat. For private chats, this update is received only when the bot is blocked or unblocked by the user.

chat_memberChatMemberUpdated<optional>

Optional. A chat member's status was updated in a chat. The bot must be an administrator in the chat and must explicitly specify “chat_member” in the list of allowed_updates to receive these updates.

chat_join_requestChatJoinRequest<optional>

Optional. A request to join the chat has been sent. The bot must have the can_invite_users administrator right in the chat to receive these updates.

UpdateSubtype

Type:
  • "voice" | "video_note" | "video" | "animation" | "venue" | "text" | "supergroup_chat_created" | "successful_payment" | "sticker" | "pinned_message" | "photo" | "new_chat_title" | "new_chat_photo" | "new_chat_members" | "migrate_to_chat_id" | "migrate_from_chat_id" | "location" | "left_chat_member" | "invoice" | "group_chat_created" | "game" | "dice" | "document" | "delete_chat_photo" | "contact" | "channel_chat_created" | "audio" | "connected_website" | "passport_data" | "poll" | "forward" | "message_auto_delete_timer_changed" | "video_chat_started" | "video_chat_ended" | "video_chat_participants_invited" | "video_chat_scheduled" | "web_app_data" | "forum_topic_created" | "forum_topic_closed" | "forum_topic_reopened" | "user_shared" | "chat_shared"

UpdateType

Type:
  • "callback_query" | "channel_post" | "chosen_inline_result" | "edited_channel_post" | "edited_message" | "inline_query" | "shipping_query" | "pre_checkout_query" | "message" | "poll" | "poll_answer" | "my_chat_member" | "chat_member" | "chat_join_request"

User

This object represents a Telegram user or bot.

Type:
  • object
Properties
NameTypeAttributesDescription
idnumber

Unique identifier for this user or bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier.

is_botboolean

True, if this user is a bot

first_namestring

User's or bot's first name

last_namestring<optional>

Optional. User's or bot's last name

usernamestring<optional>

Optional. User's or bot's username

language_codestring<optional>

Optional. IETF language tag of the user's language

is_premiumboolean<optional>

Optional. True, if this user is a Telegram Premium user

added_to_attachment_menuboolean<optional>

Optional. True, if this user added the bot to the attachment menu

can_join_groupsboolean<optional>

Optional. True, if the bot can be invited to groups. Returned only in getMe.

can_read_all_group_messagesboolean<optional>

Optional. True, if privacy mode is disabled for the bot. Returned only in getMe.

supports_inline_queriesboolean<optional>

Optional. True, if the bot supports inline queries. Returned only in getMe.

UserProfilePhotos

This object represent a user's profile pictures.

Type:
  • object
Properties
NameTypeDescription
total_countnumber

Total number of profile pictures the target user has

photosArray.<Array.<PhotoSize>>

Requested profile pictures (in up to 4 sizes each)

UserShared

This object contains information about the user whose identifier was shared with the bot using a KeyboardButtonRequestUser button.

Type:
  • object
Properties
NameTypeDescription
request_idnumber

Identifier of the request

user_idnumber

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

Venue

This object represents a venue.

Type:
  • object
Properties
NameTypeAttributesDescription
locationLocation

Venue location. Can't be a live location

titlestring

Name of the venue

addressstring

Address of the venue

foursquare_idstring<optional>

Optional. Foursquare identifier of the venue

foursquare_typestring<optional>

Optional. Foursquare type of the venue. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)

google_place_idstring<optional>

Optional. Google Places identifier of the venue

google_place_typestring<optional>

Optional. Google Places type of the venue. (See supported types.)

Video

This object represents a video file.

Type:
  • object
Properties
NameTypeAttributesDescription
file_idstring

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

file_unique_idstring

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.

widthnumber

Video width as defined by sender

heightnumber

Video height as defined by sender

durationnumber

Duration of the video in seconds as defined by sender

thumbnailPhotoSize<optional>

Optional. Video thumbnail

file_namestring<optional>

Optional. Original filename as defined by sender

mime_typestring<optional>

Optional. MIME type of the file as defined by sender

file_sizenumber<optional>

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.

VideoChatEnded

This object represents a service message about a video chat ended in the chat.

Type:
  • object
Properties
NameTypeDescription
durationnumber

Video chat duration in seconds

VideoChatParticipantsInvited

This object represents a service message about new members invited to a video chat.

Type:
  • object
Properties
NameTypeDescription
usersArray.<User>

New members that were invited to the video chat

VideoChatScheduled

This object represents a service message about a video chat scheduled in the chat.

Type:
  • object
Properties
NameTypeDescription
start_datenumber

Point in time (Unix timestamp) when the video chat is supposed to be started by a chat administrator

VideoChatStarted

This object represents a service message about a video chat started in the chat. Currently holds no information.

Type:
  • *

VideoNote

This object represents a video message

(available in Telegram apps as of v.4.0) .

Type:
  • object
Properties
NameTypeAttributesDescription
file_idstring

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

file_unique_idstring

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.

lengthnumber

Video width and height (diameter of the video message) as defined by sender

durationnumber

Duration of the video in seconds as defined by sender

thumbnailPhotoSize<optional>

Optional. Video thumbnail

file_sizenumber<optional>

Optional. File size in bytes

Voice

This object represents a voice note.

Type:
  • object
Properties
NameTypeAttributesDescription
file_idstring

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

file_unique_idstring

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.

durationnumber

Duration of the audio in seconds as defined by sender

mime_typestring<optional>

Optional. MIME type of the file as defined by sender

file_sizenumber<optional>

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.

WebAppData

Describes data sent from a Web App to the bot.

Type:
  • object
Properties
NameTypeDescription
datastring

The data. Be aware that a bad client can send arbitrary data in this field.

button_textstring

Text of the web_app keyboard button from which the Web App was opened. Be aware that a bad client can send arbitrary data in this field.

WebAppInfo

Describes a Web App .

Type:
  • object
Properties
NameTypeDescription
urlstring

An HTTPS URL of a Web App to be opened with additional data as specified in Initializing WebApps

WebhookInfo

Describes the current status of a webhook.

Type:
  • object
Properties
NameTypeAttributesDescription
urlstring

Webhook URL, may be empty if webhook is not set up

has_custom_certificateboolean

True, if a custom certificate was provided for webhook certificate checks

pending_update_countnumber

Number of updates awaiting delivery

ip_addressstring<optional>

Optional. Currently used webhook IP address

last_error_datenumber<optional>

Optional. Unix time for the most recent error that happened when trying to deliver an update via webhook

last_error_messagestring<optional>

Optional. Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook

last_synchronization_error_datenumber<optional>

Optional. Unix time of the most recent error that happened when trying to synchronize available updates with Telegram datacenters

max_connectionsnumber<optional>

Optional. The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery

allowed_updatesArray.<string><optional>

Optional. A list of update types the bot is subscribed to. Defaults to all update types except chat_member

WebhookResponse

Type:
  • object
Properties
NameTypeDescription
webhooktrue

Always true

details'https://core.telegram.org/bots/api#making-requests-when-getting-updates'

Link to telegram docs

WriteAccessAllowed

This object represents a service message about a user allowing a bot to write messages after adding it to the attachment menu, launching a Web App from a link, or accepting an explicit request from a Web App sent by the method requestWriteAccess

Type:
  • object
Properties
NameTypeAttributesDescription
from_requestboolean<optional>

Optional. True, if the access was granted after the user accepted an explicit request from a Web App sent by the method requestWriteAccess

web_app_namestring<optional>

Optional. Name of the Web App, if the access was granted when the Web App was launched from a link

from_attachment_menuboolean<optional>

Optional. True, if the access was granted when the bot was added to the attachment or side menu