Members
(constant) DEFAULT_OPTIONS :Object
- Object
- Source
(constant) WEBHOOK_REPLY_STUB :WebhookResponse
- Source
Methods
KeyboardWrap(btn, index, currentRow) → {boolean}
Keyboard Builder wrapping function used to divide the keyboard into columns.
Name | Type | Description |
---|---|---|
btn | string | Current button object |
index | number | Current button index |
currentRow | number | Current row |
- Source
- Type:
- boolean
Markup.keyboard(['one', 'two', 'three', 'four'], {
wrap: (btn, index, currentRow) => index % 2 !== 0
})
MarkupCallback(markup)
Markup factory function
Name | Type | Description |
---|---|---|
markup | Markup | Empty created Markup instance |
Extra.markdown().markup((markup) => markup.removeKeyboard())
(async) attachFormMedia(form, media, id, agentopt) → {Promise.<void>}
Used to attach media to form
Name | Type | Attributes | Description |
---|---|---|---|
form | MultipartStream | MultipartStream instance | |
media | string | | Value to attach | |
id | * | Form field name | |
agent | http. | <optional> | HTTP Agent |
- Source
- Type:
- Promise.<void>
(async) attachFormValue(form, id, value, agentopt) → {Promise.<void>}
Used to attach primitive values & media to form
Name | Type | Attributes | Description |
---|---|---|---|
form | MultipartStream | MultipartStream instance | |
id | * | Form field name | |
value | string | | Value to attach | |
agent | http. | <optional> | HTTP Agent |
- Source
- Type:
- Promise.<void>
isTelegramError(err) → {boolean}
Checks if the error is a TelegramError
Name | Type | Description |
---|---|---|
err | object | Error object |
- Source
- Type:
- boolean
Type Definitions
Action
- 'typing' |
'upload_photo' | 'record_video' | 'upload_video' | 'record_voice' | 'upload_voice' | 'upload_document' | 'choose_sticker' | 'find_location' | 'record_video_note' | 'upload_video_note'
- Source
Animation
This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).
- object
Name | Type | Attributes | Description |
---|---|---|---|
file_id | string | Identifier for this file, which can be used to download or reuse the file | |
file_unique_id | string | Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. | |
width | number | Video width as defined by sender | |
height | number | Video height as defined by sender | |
duration | number | Duration of the video in seconds as defined by sender | |
thumbnail | PhotoSize | <optional> | Optional. Animation thumbnail as defined by sender |
file_name | string | <optional> | Optional. Original animation filename as defined by sender |
mime_type | string | <optional> | Optional. MIME type of the file as defined by sender |
file_size | number | <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. |
- Source
AnswerToWebhookOptions
- object
Name | Type | Attributes | Description |
---|---|---|---|
attachmentAgent | http. | <optional> | HTTP Agent used for attachments |
- Source
Audio
This object represents an audio file to be treated as music by the Telegram clients.
- object
Name | Type | Attributes | Description |
---|---|---|---|
file_id | string | Identifier for this file, which can be used to download or reuse the file | |
file_unique_id | string | Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. | |
duration | number | Duration of the audio in seconds as defined by sender | |
performer | string | <optional> | Optional. Performer of the audio as defined by sender or by audio tags |
title | string | <optional> | Optional. Title of the audio as defined by sender or by audio tags |
file_name | string | <optional> | Optional. Original filename as defined by sender |
mime_type | string | <optional> | Optional. MIME type of the file as defined by sender |
file_size | number | <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. |
thumbnail | PhotoSize | <optional> | Optional. Thumbnail of the album cover to which the music file belongs |
- Source
BotCommand
This object represents a bot command.
- object
Name | Type | Description |
---|---|---|
command | string | Text of the command; 1-32 characters. Can contain only lowercase English letters, digits and underscores. |
description | string | Description of the command; 1-256 characters. |
- Source
BotCommandScope
This object represents the scope to which bot commands are applied. Currently, the following 7 scopes are supported:
BotCommandScopeAllPrivateChats
BotCommandScopeAllChatAdministrators
- Source
BotCommandScopeAllChatAdministrators
Represents the scope of bot commands, covering all group and supergroup chat administrators.
- object
Name | Type | Description |
---|---|---|
type | 'all_chat_administrators' | Scope type, must be all_chat_administrators |
- Source
BotCommandScopeAllGroupChats
Represents the scope of bot commands, covering all group and supergroup chats.
- object
Name | Type | Description |
---|---|---|
type | 'all_group_chats' | Scope type, must be all_group_chats |
- Source
BotCommandScopeAllPrivateChats
Represents the scope of bot commands, covering all private chats.
- object
Name | Type | Description |
---|---|---|
type | 'all_private_chats' | Scope type, must be all_private_chats |
- Source
BotCommandScopeChat
Represents the scope of bot commands, covering a specific chat.
- object
Name | Type | Description |
---|---|---|
type | 'chat' | Scope type, must be chat |
chat_id | number | | Unique identifier for the target chat or username of the target supergroup (in the format |
- Source
BotCommandScopeChatAdministrators
Represents the scope of bot commands, covering all administrators of a specific group or supergroup chat.
- object
Name | Type | Description |
---|---|---|
type | 'chat_administrators' | Scope type, must be chat_administrators |
chat_id | number | | Unique identifier for the target chat or username of the target supergroup (in the format |
- Source
BotCommandScopeChatMember
Represents the scope of bot commands, covering a specific member of a group or supergroup chat.
- object
Name | Type | Description |
---|---|---|
type | 'chat_member' | Scope type, must be chat_member |
chat_id | number | | Unique identifier for the target chat or username of the target supergroup (in the format |
user_id | number | Unique identifier of the target user |
- Source
BotCommandScopeDefault
Represents the default scope of bot commands. Default commands are used if no commands with a narrower scope are specified for the user.
- object
Name | Type | Description |
---|---|---|
type | 'default' | Scope type, must be default |
- Source
BotDescription
This object represents the bot's description.
- object
Name | Type | Description |
---|---|---|
description | string | The bot's description |
- Source
BotName
This object represents the bot's name.
- object
Name | Type | Description |
---|---|---|
name | string | The bot's name |
- Source
BotShortDescription
This object represents the bot's short description.
- object
Name | Type | Description |
---|---|---|
short_description | string | The bot's short description |
- Source
CallApiExtra
- object
Name | Type | Description |
---|---|---|
signal | AbortSignal | Optional |
- Source
CallbackGame
A placeholder, currently holds no information. Use BotFather to set up your game.
- *
- Source
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.
- object
Name | Type | Attributes | Description |
---|---|---|---|
id | string | Unique identifier for this query | |
from | User | Sender | |
message | Message | <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_id | string | <optional> | Optional. Identifier of the message sent via the bot in inline mode, that originated the query. |
chat_instance | string | Global identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games. | |
data | string | <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_name | string | <optional> | Optional. Short name of a Game to be returned, serves as the unique identifier for the game |
- Source
Chat
This object represents a chat.
- object
Name | Type | Attributes | Description |
---|---|---|---|
id | number | 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' | | Type of chat, can be either “private”, “group”, “supergroup” or “channel” | |
title | string | <optional> | Optional. Title, for supergroups, channels and group chats |
username | string | <optional> | Optional. Username, for private chats, supergroups and channels if available |
first_name | string | <optional> | Optional. First name of the other party in a private chat |
last_name | string | <optional> | Optional. Last name of the other party in a private chat |
is_forum | boolean | <optional> | Optional. True, if the supergroup chat is a forum (has topics enabled) |
photo | ChatPhoto | <optional> | Optional. Chat photo. Returned only in getChat. |
active_usernames | Array.<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_id | string | <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_date | number | <optional> | Optional. Expiration date of the emoji status of the other party in a private chat, if any. Returned only in getChat. |
bio | string | <optional> | Optional. Bio of the other party in a private chat. Returned only in getChat. |
has_private_forwards | boolean | <optional> | Optional. True, if privacy settings of the other party in the private chat allows to use |
has_restricted_voice_and_video_messages | boolean | <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_messages | boolean | <optional> | Optional. True, if users need to join the supergroup before they can send messages. Returned only in getChat. |
join_by_request | boolean | <optional> | Optional. True, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in getChat. |
description | string | <optional> | Optional. Description, for groups, supergroups and channel chats. Returned only in getChat. |
invite_link | string | <optional> | Optional. Primary invite link, for groups, supergroups and channel chats. Returned only in getChat. |
pinned_message | Message | <optional> | Optional. The most recent pinned message (by sending date). Returned only in getChat. |
permissions | ChatPermissions | <optional> | Optional. Default chat member permissions, for groups and supergroups. Returned only in getChat. |
slow_mode_delay | number | <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_time | number | <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_enabled | boolean | <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_members | boolean | <optional> | Optional. True, if non-administrators can only get the list of bots and administrators in the chat. Returned only in getChat. |
has_protected_content | boolean | <optional> | Optional. True, if messages from the chat can't be forwarded to other chats. Returned only in getChat. |
sticker_set_name | string | <optional> | Optional. For supergroups, name of group sticker set. Returned only in getChat. |
can_set_sticker_set | boolean | <optional> | Optional. True, if the bot can change the group sticker set. Returned only in getChat. |
linked_chat_id | number | <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. |
location | ChatLocation | <optional> | Optional. For supergroups, the location to which the supergroup is connected. Returned only in getChat. |
- Source
ChatAdministratorRights
Represents the rights of an administrator in a chat.
- object
Name | Type | Attributes | Description |
---|---|---|---|
is_anonymous | boolean | True, if the user's presence in the chat is hidden | |
can_manage_chat | boolean | 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_messages | boolean | True, if the administrator can delete messages of other users | |
can_manage_video_chats | boolean | True, if the administrator can manage video chats | |
can_restrict_members | boolean | True, if the administrator can restrict, ban or unban chat members, or access supergroup statistics | |
can_promote_members | boolean | True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user) | |
can_change_info | boolean | True, if the user is allowed to change the chat title, photo and other settings | |
can_invite_users | boolean | True, if the user is allowed to invite new users to the chat | |
can_post_messages | boolean | <optional> | Optional. True, if the administrator can post messages in the channel, or access channel statistics; channels only |
can_edit_messages | boolean | <optional> | Optional. True, if the administrator can edit messages of other users and can pin messages; channels only |
can_pin_messages | boolean | <optional> | Optional. True, if the user is allowed to pin messages; groups and supergroups only |
can_post_stories | boolean | <optional> | Optional. True, if the administrator can post stories in the channel; channels only |
can_edit_stories | boolean | <optional> | Optional. True, if the administrator can edit stories posted by other users; channels only |
can_delete_stories | boolean | <optional> | Optional. True, if the administrator can delete stories posted by other users; channels only |
can_manage_topics | boolean | <optional> | Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only |
- Source
ChatInviteLink
Represents an invite link for a chat.
- object
Name | Type | Attributes | Description |
---|---|---|---|
invite_link | string | The invite link. If the link was created by another chat administrator, then the second part of the link will be replaced with “…”. | |
creator | User | Creator of the link | |
creates_join_request | boolean | True, if users joining the chat via the link need to be approved by chat administrators | |
is_primary | boolean | True, if the link is primary | |
is_revoked | boolean | True, if the link is revoked | |
name | string | <optional> | Optional. Invite link name |
expire_date | number | <optional> | Optional. Point in time (Unix timestamp) when the link will expire or has been expired |
member_limit | number | <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_count | number | <optional> | Optional. Number of pending join requests created using this link |
- Source
ChatJoinRequest
Represents a join request sent to a chat.
- object
Name | Type | Attributes | Description |
---|---|---|---|
chat | Chat | Chat to which the request was sent | |
from | User | User that sent the join request | |
user_chat_id | number | Identifier of a private chat with the user who sent the join request. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. The bot can use this identifier for 5 minutes to send messages until the join request is processed, assuming no other administrator contacted the user. | |
date | number | Date the request was sent in Unix time | |
bio | string | <optional> | Optional. Bio of the user. |
invite_link | ChatInviteLink | <optional> | Optional. Chat invite link that was used by the user to send the join request |
- Source
ChatLocation
Represents a location to which a chat is connected.
- object
Name | Type | Description |
---|---|---|
location | Location | The location to which the supergroup is connected. Can't be a live location. |
address | string | Location address; 1-64 characters, as defined by the chat owner |
- Source
ChatMember
This object contains information about one member of a chat. Currently, the following 6 types of chat members are supported:
- Source
ChatMemberAdministrator
Represents a chat member that has some additional privileges.
- object
Name | Type | Attributes | Description |
---|---|---|---|
status | 'administrator' | The member's status in the chat, always “administrator” | |
user | User | Information about the user | |
can_be_edited | boolean | True, if the bot is allowed to edit administrator privileges of that user | |
is_anonymous | boolean | True, if the user's presence in the chat is hidden | |
can_manage_chat | boolean | 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_messages | boolean | True, if the administrator can delete messages of other users | |
can_manage_video_chats | boolean | True, if the administrator can manage video chats | |
can_restrict_members | boolean | True, if the administrator can restrict, ban or unban chat members, or access supergroup statistics | |
can_promote_members | boolean | True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that they have promoted, directly or indirectly (promoted by administrators that were appointed by the user) | |
can_change_info | boolean | True, if the user is allowed to change the chat title, photo and other settings | |
can_invite_users | boolean | True, if the user is allowed to invite new users to the chat | |
can_post_messages | boolean | <optional> | Optional. True, if the administrator can post messages in the channel, or access channel statistics; channels only |
can_edit_messages | boolean | <optional> | Optional. True, if the administrator can edit messages of other users and can pin messages; channels only |
can_pin_messages | boolean | <optional> | Optional. True, if the user is allowed to pin messages; groups and supergroups only |
can_post_stories | boolean | <optional> | Optional. True, if the administrator can post stories in the channel; channels only |
can_edit_stories | boolean | <optional> | Optional. True, if the administrator can edit stories posted by other users; channels only |
can_delete_stories | boolean | <optional> | Optional. True, if the administrator can delete stories posted by other users; channels only |
can_manage_topics | boolean | <optional> | Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only |
custom_title | string | <optional> | Optional. Custom title for this user |
- Source
ChatMemberBanned
Represents a chat member that was banned in the chat and can't return to the chat or view chat messages.
- object
Name | Type | Description |
---|---|---|
status | 'kicked' | The member's status in the chat, always “kicked” |
user | User | Information about the user |
until_date | number | Date when restrictions will be lifted for this user; Unix time. If 0, then the user is banned forever |
- Source
ChatMemberLeft
Represents a chat member that isn't currently a member of the chat, but may join it themselves.
- object
Name | Type | Description |
---|---|---|
status | 'left' | The member's status in the chat, always “left” |
user | User | Information about the user |
- Source
ChatMemberMember
Represents a chat member that has no additional privileges or restrictions.
- object
Name | Type | Description |
---|---|---|
status | 'member' | The member's status in the chat, always “member” |
user | User | Information about the user |
- Source
ChatMemberOwner
Represents a chat member that owns the chat and has all administrator privileges.
- object
Name | Type | Attributes | Description |
---|---|---|---|
status | 'creator' | The member's status in the chat, always “creator” | |
user | User | Information about the user | |
is_anonymous | boolean | True, if the user's presence in the chat is hidden | |
custom_title | string | <optional> | Optional. Custom title for this user |
- Source
ChatMemberRestricted
Represents a chat member that is under certain restrictions in the chat. Supergroups only.
- object
Name | Type | Description |
---|---|---|
status | 'restricted' | The member's status in the chat, always “restricted” |
user | User | Information about the user |
is_member | boolean | True, if the user is a member of the chat at the moment of the request |
can_send_messages | boolean | True, if the user is allowed to send text messages, contacts, invoices, locations and venues |
can_send_audios | boolean | True, if the user is allowed to send audios |
can_send_documents | boolean | True, if the user is allowed to send documents |
can_send_photos | boolean | True, if the user is allowed to send photos |
can_send_videos | boolean | True, if the user is allowed to send videos |
can_send_video_notes | boolean | True, if the user is allowed to send video notes |
can_send_voice_notes | boolean | True, if the user is allowed to send voice notes |
can_send_polls | boolean | True, if the user is allowed to send polls |
can_send_other_messages | boolean | True, if the user is allowed to send animations, games, stickers and use inline bots |
can_add_web_page_previews | boolean | True, if the user is allowed to add web page previews to their messages |
can_change_info | boolean | True, if the user is allowed to change the chat title, photo and other settings |
can_invite_users | boolean | True, if the user is allowed to invite new users to the chat |
can_pin_messages | boolean | True, if the user is allowed to pin messages |
can_manage_topics | boolean | True, if the user is allowed to create forum topics |
can_send_media_messages | boolean | True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes |
until_date | number | Date when restrictions will be lifted for this user; Unix time. If 0, then the user is restricted forever |
- Source
ChatMemberStatus
- 'creator' |
'administrator' | 'member' | 'restricted' | 'left' | 'kicked'
- Source
ChatMemberUpdated
This object represents changes in the status of a chat member.
- object
Name | Type | Attributes | Description |
---|---|---|---|
chat | Chat | Chat the user belongs to | |
from | User | Performer of the action, which resulted in the change | |
date | number | Date the change was done in Unix time | |
old_chat_member | ChatMember | Previous information about the chat member | |
new_chat_member | ChatMember | New information about the chat member | |
invite_link | ChatInviteLink | <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_link | boolean | <optional> | Optional. True, if the user joined the chat via a chat folder invite link |
- Source
ChatPermissions
Describes actions that a non-administrator user is allowed to take in a chat.
- object
Name | Type | Attributes | Description |
---|---|---|---|
can_send_messages | boolean | <optional> | Optional. True, if the user is allowed to send text messages, contacts, invoices, locations and venues |
can_send_media_messages | boolean | <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_audios | boolean | <optional> | Optional. True, if the user is allowed to send audios |
can_send_documents | boolean | <optional> | Optional. True, if the user is allowed to send documents |
can_send_photos | boolean | <optional> | Optional. True, if the user is allowed to send photos |
can_send_videos | boolean | <optional> | Optional. True, if the user is allowed to send videos |
can_send_video_notes | boolean | <optional> | Optional. True, if the user is allowed to send video notes |
can_send_voice_notes | boolean | <optional> | Optional. True, if the user is allowed to send voice notes |
can_send_polls | boolean | <optional> | Optional. True, if the user is allowed to send polls |
can_send_other_messages | boolean | <optional> | Optional. True, if the user is allowed to send animations, games, stickers and use inline bots |
can_add_web_page_previews | boolean | <optional> | Optional. True, if the user is allowed to add web page previews to their messages |
can_change_info | boolean | <optional> | Optional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups |
can_invite_users | boolean | <optional> | Optional. True, if the user is allowed to invite new users to the chat |
can_pin_messages | boolean | <optional> | Optional. True, if the user is allowed to pin messages. Ignored in public supergroups |
can_manage_topics | boolean | <optional> | Optional. True, if the user is allowed to create forum topics. If omitted defaults to the value of can_pin_messages |
- Source
ChatPhoto
This object represents a chat photo.
- object
Name | Type | Description |
---|---|---|
small_file_id | string | File identifier of small (160x160) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed. |
small_file_unique_id | string | Unique file identifier of small (160x160) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. |
big_file_id | string | File identifier of big (640x640) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed. |
big_file_unique_id | string | 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. |
- Source
ChatShared
This object contains information about the chat whose identifier was shared with the bot using a KeyboardButtonRequestChat button.
- object
Name | Type | Description |
---|---|---|
request_id | number | Identifier of the request |
chat_id | number | 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. |
- Source
ChatType
- 'private' |
'group' | 'supergroup' | 'channel'
- Source
ChosenInlineResult
Represents a result of an inline query that was chosen by the user and sent to their chat partner.
- object
Name | Type | Attributes | Description |
---|---|---|---|
result_id | string | The unique identifier for the result that was chosen | |
from | User | The user that chose the result | |
location | Location | <optional> | Optional. Sender location, only for bots that require user location |
inline_message_id | string | <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. |
query | string | The query that was used to obtain the result |
- Source
Contact
This object represents a phone contact.
- object
Name | Type | Attributes | Description |
---|---|---|---|
phone_number | string | Contact's phone number | |
first_name | string | Contact's first name | |
last_name | string | <optional> | Optional. Contact's last name |
user_id | number | <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. |
vcard | string | <optional> | Optional. Additional data about the contact in the form of a vCard |
- Source
ContextOptions
- object
Name | Type | Description |
---|---|---|
channelMode | boolean | Enable / Disable channel mode, you can find more information about this in Opengram constructor options type |
- Source
Dice
This object represents an animated emoji that displays a random value.
- object
Name | Type | Description |
---|---|---|
emoji | string | Emoji on which the dice throw animation is based |
value | number | Value of the dice, 1-6 for “🎲”, “🎯” and “🎳” base emoji, 1-5 for “🏀” and “⚽” base emoji, 1-64 for “🎰” base emoji |
- Source
Document
This object represents a general file (as opposed to photos , voice messages and audio files).
- object
Name | Type | Attributes | Description |
---|---|---|---|
file_id | string | Identifier for this file, which can be used to download or reuse the file | |
file_unique_id | string | Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. | |
thumbnail | PhotoSize | <optional> | Optional. Document thumbnail as defined by sender |
file_name | string | <optional> | Optional. Original filename as defined by sender |
mime_type | string | <optional> | Optional. MIME type of the file as defined by sender |
file_size | number | <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. |
- Source
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.
- object
Name | Type | Description |
---|---|---|
data | string | Base64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets required for EncryptedPassportElement decryption and authentication |
hash | string | Base64-encoded data hash for data authentication |
secret | string | Base64-encoded secret, encrypted with the bot's public RSA key, required for data decryption |
- Source
EncryptedPassportElement
Describes documents or other Telegram Passport elements shared with the bot by the user.
- object
Name | Type | Attributes | Description |
---|---|---|---|
type | 'personal_details' | | 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”. | |
data | string | <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_number | string | <optional> | Optional. User's verified phone number, available only for “phone_number” type |
email | string | <optional> | Optional. User's verified email address, available only for “email” type |
files | Array.<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_side | PassportFile | <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_side | PassportFile | <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. |
selfie | PassportFile | <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. |
translation | Array.<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. |
hash | string | Base64-encoded element hash for using in PassportElementErrorUnspecified |
- Source
EntityPredicate
- EntityPredicateFn |
MessageEntityType | Array.<(EntityPredicateFn|MessageEntityType)>
- Source
EntityPredicateFn(entityObject, entityText, context) → {boolean}
Name | Type | Description |
---|---|---|
entityObject | MessageEntity | Entity object |
entityText | string | Entity text |
context | OpengramContext | Update context |
- Source
- Type:
- boolean
ExtraAddStickerToSet
- object
Name | Type | Description |
---|---|---|
sticker | InputSticker | 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. |
- Source
ExtraAnimation
- object
Name | Type | Attributes | Description |
---|---|---|---|
message_thread_id | number | <optional> | Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only |
duration | number | <optional> | Optional. Duration of sent animation in seconds |
width | number | <optional> | Optional. Animation width |
height | number | <optional> | Optional. Animation height |
thumbnail | InputFile | | <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 » |
caption | string | <optional> | Optional. Animation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing |
parse_mode | ParseMode | <optional> | Optional. Mode for parsing entities in the animation caption. See formatting options for more details. |
caption_entities | Array.<MessageEntity> | <optional> | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode |
has_spoiler | boolean | <optional> | Optional. Pass |
disable_notification | boolean | <optional> | Optional. Sends the message silently. Users will receive a notification with no sound. |
protect_content | boolean | <optional> | Optional. Protects the contents of the sent message from forwarding |
reply_to_message_id | number | <optional> | Optional. If the message is a reply, ID of the original message |
allow_sending_without_reply | boolean | <optional> | Optional. Pass True if the message should be sent even if the specified replied-to message is not found |
reply_markup | InlineKeyboardMarkup | | <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. |
- Source
ExtraAnswerCbQuery
- object
Name | Type | Attributes | Description |
---|---|---|---|
url | string | <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 |
cache_time | number | <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 |
- Source
ExtraAnswerInlineQuery
- object
Name | Type | Attributes | Description |
---|---|---|---|
cache_time | number | <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_personal | boolean | <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_offset | string | <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_text | string | <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_parameter | string | <optional> | Optional. Deep-linking parameter for the |
- Source
ExtraAudio
- object
Name | Type | Attributes | Description |
---|---|---|---|
message_thread_id | number | <optional> | Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only |
performer | string | <optional> | Performer |
title | string | <optional> | Track name |
duration | number | <optional> | Optional. Duration of sent audio in seconds |
thumbnail | InputFile | | <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 » |
caption | string | <optional> | Optional. Audio caption, 0-1024 characters after entities parsing |
parse_mode | ParseMode | <optional> | Optional. Mode for parsing entities in the audio caption. See formatting options for more details. |
caption_entities | Array.<MessageEntity> | <optional> | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode |
has_spoiler | boolean | <optional> | Optional. Pass |
disable_notification | boolean | <optional> | Optional. Sends the message silently. Users will receive a notification with no sound. |
protect_content | boolean | <optional> | Optional. Protects the contents of the sent message from forwarding |
reply_to_message_id | number | <optional> | Optional. If the message is a reply, ID of the original message |
allow_sending_without_reply | boolean | <optional> | Optional. Pass True if the message should be sent even if the specified replied-to message is not found |
reply_markup | InlineKeyboardMarkup | | <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. |
- Source
ExtraBanChatMember
- object
Name | Type | Attributes | Description |
---|---|---|---|
until_date | number | <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_messages | boolean | <optional> | Optional. Pass |
- Source
ExtraContact
- object
Name | Type | Attributes | Description |
---|---|---|---|
message_thread_id | number | <optional> | Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only |
last_name | string | <optional> | Optional. Contact's last name |
vcard | string | <optional> | Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes |
disable_notification | boolean | <optional> | Optional. Sends the message silently. Users will receive a notification with no sound. |
protect_content | boolean | <optional> | Optional. Protects the contents of the sent message from forwarding |
reply_to_message_id | number | <optional> | Optional. If the message is a reply, ID of the original message |
allow_sending_without_reply | boolean | <optional> | Optional. Pass True if the message should be sent even if the specified replied-to message is not found |
reply_markup | InlineKeyboardMarkup | | <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. |
- Source
ExtraCopyMessage
- object
Name | Type | Attributes | Description |
---|---|---|---|
message_thread_id | number | <optional> | Optional. Unique identifier of a message thread to which the message belongs; for supergroups only |
caption | string | <optional> | Optional. New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept |
parse_mode | ParseMode | <optional> | Optional. Mode for parsing entities in the new caption. See formatting options for more details. |
caption_entities | Array.<MessageEntity> | <optional> | A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of parse_mode |
disable_notification | boolean | <optional> | Sends the message silently. Users will receive a notification with no sound. |
protect_content | boolean | <optional> | Optional. Protects the contents of the forwarded message from forwarding and saving |
reply_to_message_id | number | <optional> | Optional. If the message is a reply, ID of the original message |
allow_sending_without_reply | boolean | <optional> | Optional. Pass |
reply_markup | ForceReply | | <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. |
- Source
ExtraCreateChatInviteLink
- object
Name | Type | Attributes | Description |
---|---|---|---|
name | string | <optional> | Optional. Invite link name; 0-32 characters |
expire_date | number | <optional> | Optional. Point in time (Unix timestamp) when the link will expire | |
member_limit | number | <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_request | boolean | <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 | |
- Source
ExtraCreateForumTopic
- object
Name | Type | Attributes | Description |
---|---|---|---|
icon_color | number | <optional> | Optional. Color of the topic icon in RGB format. Currently, must be one of |
icon_custom_emoji_id | string | <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 |
- Source
ExtraCreateNewStickerSet
- object
Name | Type | Attributes | Description |
---|---|---|---|
stickers | Array.<InputSticker> | A JSON-serialized list of 1-50 initial stickers to be added to the sticker set | |
sticker_format | 'static' | | Format of stickers in the set, must be one of | |
sticker_type | 'regular' | | <optional> | Optional. Type of stickers in the set, pass |
needs_repainting | boolean | <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 |
- Source
ExtraDeleteMyCommands
- object
Name | Type | Attributes | Description |
---|---|---|---|
language_code | string | <optional> | Optional. A two-letter ISO 639-1 language code or an empty string |
- Source
ExtraDeleteWebhook
- object
Name | Type | Attributes | Description |
---|---|---|---|
drop_pending_updates | boolean | <optional> | Pass True to drop all pending updates |
- Source
ExtraDice
- object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
message_thread_id | number | <optional> | Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only | |
emoji | string | <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_notification | boolean | <optional> | Optional. Sends the message silently. Users will receive a notification with no sound. | |
protect_content | boolean | <optional> | Optional. Protects the contents of the sent message from forwarding | |
reply_to_message_id | number | <optional> | Optional. If the message is a reply, ID of the original message | |
allow_sending_without_reply | boolean | <optional> | Optional. Pass True if the message should be sent even if the specified replied-to message is not found | |
reply_markup | InlineKeyboardMarkup | | <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. |
- Source
ExtraDocument
- object
Name | Type | Attributes | Description |
---|---|---|---|
message_thread_id | number | <optional> | Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only |
thumbnail | InputFile | | <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 » |
caption | string | <optional> | Optional. Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing |
parse_mode | ParseMode | <optional> | Optional. Mode for parsing entities in the document caption. See formatting options for more details. |
caption_entities | Array.<MessageEntity> | <optional> | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode |
disable_content_type_detection | boolean | <optional> | Optional. Disables automatic server-side content type detection for files uploaded using multipart/form-data |
disable_notification | boolean | <optional> | Optional. Sends the message silently. Users will receive a notification with no sound. |
protect_content | boolean | <optional> | Optional. Protects the contents of the sent message from forwarding |
reply_to_message_id | number | <optional> | Optional. If the message is a reply, ID of the original message |
allow_sending_without_reply | boolean | <optional> | Optional. Pass True if the message should be sent even if the specified replied-to message is not found |
reply_markup | InlineKeyboardMarkup | | <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. |
- Source
ExtraEditChatInviteLink
- object
Name | Type | Attributes | Description |
---|---|---|---|
name | string | <optional> | Optional Invite link name 0-32 characters |
expire_date | number | <optional> | number Optional. Point in time (Unix timestamp) when the link will expire |
member_limit | number | <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_request | boolean | <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 |
- Source
ExtraEditForumTopic
- object
Name | Type | Attributes | Description |
---|---|---|---|
name | string | <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_id | string | <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 |
- Source
ExtraEditMessageCaption
- object
Name | Type | Attributes | Description |
---|---|---|---|
parse_mode | ParseMode | <optional> | Optional. Mode for parsing entities in the message caption. See formatting options for more details. |
caption_entities | Array.<MessageEntity> | <optional> | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode |
reply_markup | InlineKeyboardMarkup | <optional> | Optional A JSON-serialized object for an inline keyboard. If empty, one 'Pay |
- Source
ExtraEditMessageLiveLocation
- object
Name | Type | Attributes | Description |
---|---|---|---|
horizontal_accuracy | number | <optional> | Optional The radius of uncertainty for the location, measured in meters; 0-1500 |
heading | number | <optional> | Optional Direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. |
proximity_alert_radius | number | <optional> | OptionalThe maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified. |
reply_markup | InlineKeyboardMarkup | <optional> | Optional A JSON-serialized object for a new inline keyboard. |
- Source
ExtraEditMessageMedia
- object
Name | Type | Attributes | Description |
---|---|---|---|
caption | string | <optional> | Optional. Caption of the media to be sent, 0-1024 characters after entities parsing |
parse_mode | ParseMode | <optional> | Optional. Mode for parsing entities in the media caption. See formatting options for more details. |
caption_entities | Array.<MessageEntity> | <optional> | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode |
has_spoiler | boolean | <optional> | Optional. Pass |
reply_markup | InlineKeyboardMarkup | <optional> | InlineKeyboardMarkup A JSON-serialized object for a new inline keyboard. |
- Source
ExtraEditMessageReplyMarkup
- object
Name | Type | Attributes | Description |
---|---|---|---|
reply_markup | InlineKeyboardMarkup | <optional> | Optional A JSON-serialized object for an inline keyboard. If empty, one 'Pay |
- Source
ExtraEditMessageText
- object
Name | Type | Attributes | Description |
---|---|---|---|
disable_web_page_preview | boolean | <optional> | Optional. Disables link previews for links in the sent message |
parse_mode | ParseMode | <optional> | Optional. Mode for parsing entities in the text. See formatting options for more details. |
entities | Array.<MessageEntity> | <optional> | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode |
reply_markup | InlineKeyboardMarkup | <optional> | Optional A JSON-serialized object for an inline keyboard. If empty, one 'Pay |
- Source
ExtraForwardMessage
- object
Name | Type | Attributes | Description |
---|---|---|---|
message_thread_id | number | <optional> | Optional. Unique identifier of a message thread to which the message belongs; for supergroups only |
protect_content | boolean | <optional> | Optional. Protects the contents of the forwarded message from forwarding and saving |
disable_notification | boolean | <optional> | Optional. Sends the message silently. Users will receive a notification with no sound. |
- Source
ExtraGame
- object
Name | Type | Attributes | Description |
---|---|---|---|
message_thread_id | number | <optional> | Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only |
disable_notification | boolean | <optional> | Optional. Sends the message silently. Users will receive a notification with no sound. |
protect_content | boolean | <optional> | Optional. Protects the contents of the sent message from forwarding |
reply_to_message_id | number | <optional> | Optional. If the message is a reply, ID of the original message |
allow_sending_without_reply | boolean | <optional> | Optional. Pass True if the message should be sent even if the specified replied-to message is not found |
reply_markup | InlineKeyboardMarkup | <optional> | InlineKeyboardMarkup A JSON-serialized object for a new inline keyboard. |
- Source
ExtraGetMyCommands
- object
Name | Type | Attributes | Description |
---|---|---|---|
language_code | string | <optional> | Optional. A two-letter ISO 639-1 language code or an empty string |
- Source
ExtraInvoice
- object
Name | Type | Attributes | Description |
---|---|---|---|
message_thread_id | number | <optional> | Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only |
start_parameter | string | <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_flexible | boolean | <optional> | Optional. Pass True if the final price depends on the shipping method |
max_tip_amount | number | <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 |
suggested_tip_amounts | Array.<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_data | object | <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_url | string | <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_size | number | <optional> | Optional. Photo size in bytes |
photo_width | number | <optional> | Optional. Photo width |
photo_height | number | <optional> | Optional. Photo height |
need_name | boolean | <optional> | Optional. Pass True if you require the user's full name to complete the order |
need_phone_number | boolean | <optional> | Optional. Pass True if you require the user's phone number to complete the order |
need_email | boolean | Optional. Pass True if you require the user's email address to complete the order | |
need_shipping_address | boolean | <optional> | Optional. Pass True if you require the user's shipping address to complete the order |
send_phone_number_to_provider | boolean | <optional> | Optional. Pass True if the user's phone number should be sent to provider |
send_email_to_provider | boolean | <optional> | Optional. Pass True if the user's email address should be sent to provider |
disable_notification | boolean | <optional> | Optional. Sends the message silently. Users will receive a notification with no sound. |
protect_content | boolean | <optional> | Optional. Protects the contents of the sent message from forwarding |
reply_to_message_id | number | <optional> | Optional. If the message is a reply, ID of the original message |
allow_sending_without_reply | boolean | <optional> | Optional. Pass True if the message should be sent even if the specified replied-to message is not found |
reply_markup | InlineKeyboardMarkup | <optional> | Optional A JSON-serialized object for an inline keyboard. If empty, one 'Pay |
- Source
ExtraKickChatMember
- object
Name | Type | Attributes | Description |
---|---|---|---|
revoke_messages | boolean | <optional> | Optional. Pass |
- Source
ExtraLocation
- object
Name | Type | Attributes | Description |
---|---|---|---|
message_thread_id | number | <optional> | Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only |
horizontal_accuracy | number | <optional> | Optional The radius of uncertainty for the location, measured in meters; 0-1500 |
heading | number | <optional> | Optional Direction in which the user is moving, in degrees. Must be between 1 and 360 if specified. |
proximity_alert_radius | number | <optional> | Optional The radius of uncertainty for the location, measured in meters; 0-1500 |
live_period | number | <optional> | Optional. Period in seconds for which the location will be updated, see Live Locations, should be between |
disable_notification | boolean | <optional> | Optional. Sends the message silently. Users will receive a notification with no sound. |
protect_content | boolean | <optional> | Optional. Protects the contents of the sent message from forwarding |
reply_to_message_id | number | <optional> | Optional. If the message is a reply, ID of the original message |
allow_sending_without_reply | boolean | <optional> | Optional. Pass True if the message should be sent even if the specified replied-to message is not found |
reply_markup | InlineKeyboardMarkup | | <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. |
- Source
ExtraMediaGroup
- object
Name | Type | Attributes | Description |
---|---|---|---|
message_thread_id | number | <optional> | Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only |
disable_notification | boolean | <optional> | Optional. Sends the message silently. Users will receive a notification with no sound. |
protect_content | boolean | <optional> | Optional. Protects the contents of the sent message from forwarding |
reply_to_message_id | number | <optional> | Optional. If the message is a reply, ID of the original message |
allow_sending_without_reply | boolean | <optional> | Optional. Pass True if the message should be sent even if the specified replied-to message is not found |
- Source
ExtraPhoto
- object
Name | Type | Attributes | Description |
---|---|---|---|
message_thread_id | number | <optional> | Optional. Unique identifier of a message thread to which the message belongs; for supergroups only |
caption | string | <optional> | Optional. Photo caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing |
parse_mode | ParseMode | <optional> | Optional. Mode for parsing entities in the photo caption. See formatting options for more details. |
caption_entities | Array.<MessageEntity> | <optional> | Optional. A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of |
has_spoiler | boolean | <optional> | Optional. Pass |
disable_notification | boolean | <optional> | Optional. Sends the message silently. Users will receive a notification with no sound. |
protect_content | boolean | <optional> | Optional. Protects the contents of the forwarded message from forwarding and saving |
reply_to_message_id | number | <optional> | Optional. If the message is a reply, ID of the original message |
allow_sending_without_reply | boolean | <optional> | Optional. Pass |
reply_markup | ForceReply | | <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. |
- Source
ExtraPinChatMessage
- object
Name | Type | Attributes | Description |
---|---|---|---|
disable_notification | boolean | <optional> | Sends the message silently. Users will receive a notification with no sound. |
- Source
ExtraPoll
- object
Name | Type | Attributes | Description |
---|---|---|---|
message_thread_id | number | <optional> | Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only |
is_anonymous | boolean | <optional> | Optional. True, if the poll needs to be anonymous, defaults to True |
allows_multiple_answers | boolean | <optional> | Optional. True, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to False |
correct_option_id | number | <optional> | Optional. 0-based identifier of the correct answer option, required for polls in quiz mode |
explanation | string | <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_mode | string | <optional> | Optional. Mode for parsing entities in the explanation. See formatting options for more details. |
explanation_entities | Array.<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_period | number | <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_date | number | <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_closed | boolean | <optional> | Optional. Pass True if the poll needs to be immediately closed. This can be useful for poll preview. |
disable_notification | boolean | <optional> | Optional. Sends the message silently. Users will receive a notification with no sound. |
protect_content | boolean | <optional> | Optional. Protects the contents of the sent message from forwarding |
reply_to_message_id | number | <optional> | Optional. If the message is a reply, ID of the original message |
allow_sending_without_reply | boolean | <optional> | Optional. Pass True if the message should be sent even if the specified replied-to message is not found |
reply_markup | InlineKeyboardMarkup | | <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. |
- Source
ExtraPromoteChatMember
- object
Name | Type | Attributes | Description |
---|---|---|---|
is_anonymous | boolean | <optional> | Optional. True, if the poll needs to be anonymous, defaults to True |
can_manage_chat | boolean | <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_messages | boolean | <optional> | Optional. True, if the administrator can post in the channel; channels only |
can_edit_messages | boolean | <optional> | Optional. True, if the administrator can edit messages of other users and can pin messages; channels only |
can_delete_messages | boolean | <optional> | Optional. True, if the administrator can delete messages of other users |
can_manage_video_chats | boolean | <optional> | Optional. True, if the administrator can manage video chats |
can_restrict_members | boolean | <optional> | Optional. True, if the administrator can restrict, ban or unban chat members |
can_promote_members | boolean | <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_users | boolean | <optional> | Optional. True, if the user is allowed to invite new users to the chat |
can_change_info | boolean | <optional> | Optional. True, if the user is allowed to change the chat title, photo and other settings |
can_pin_messages | boolean | <optional> | Optional. True, if the user is allowed to pin messages; groups and supergroups only |
can_manage_topics | boolean | <optional> | Optional. True, if the user is allowed to create, rename, close, and reopen forum topics; supergroups only |
- Source
ExtraQuiz
- object
Name | Type | Attributes | Description |
---|---|---|---|
message_thread_id | number | <optional> | Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only |
is_anonymous | boolean | <optional> | Optional. True, if the poll needs to be anonymous, defaults to True |
allows_multiple_answers | boolean | <optional> | Optional. True, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to False |
correct_option_id | number | <optional> | Optional. 0-based identifier of the correct answer option, required for polls in quiz mode |
explanation | string | <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_mode | string | <optional> | Optional. Mode for parsing entities in the explanation. See formatting options for more details. |
explanation_entities | Array.<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_period | number | <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_date | number | <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_closed | boolean | <optional> | Optional. Pass True if the poll needs to be immediately closed. This can be useful for poll preview. |
disable_notification | boolean | <optional> | Optional. Sends the message silently. Users will receive a notification with no sound. |
protect_content | boolean | <optional> | Optional. Protects the contents of the sent message from forwarding |
reply_to_message_id | number | <optional> | Optional. If the message is a reply, ID of the original message |
allow_sending_without_reply | boolean | <optional> | Optional. Pass True if the message should be sent even if the specified replied-to message is not found |
reply_markup | InlineKeyboardMarkup | | <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. |
- Source
ExtraRestrictChatMember
- object
Name | Type | Attributes | Description |
---|---|---|---|
permissions | ChatPermissions | A JSON-serialized object for new user permissions | |
use_independent_chat_permissions | boolean | <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_date | number | <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 |
- Source
ExtraSendChatAction
- object
Name | Type | Attributes | Description |
---|---|---|---|
message_thread_id | number | <optional> | Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only |
- Source
ExtraSendMessage
- object
Name | Type | Attributes | Description |
---|---|---|---|
message_thread_id | number | <optional> | Optional. Unique identifier of a message thread to which the message belongs; for supergroups only |
parse_mode | ParseMode | <optional> | Optional. Mode for parsing entities in the photo caption. See formatting options for more details. |
entities | Array.<MessageEntity> | <optional> | Optional. A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of |
disable_web_page_preview | boolean | <optional> | Optional. Disables link previews for links in this message |
disable_notification | boolean | <optional> | Optional. Sends the message silently. Users will receive a notification with no sound. |
protect_content | boolean | <optional> | Optional. Protects the contents of the forwarded message from forwarding and saving |
reply_to_message_id | number | <optional> | Optional. If the message is a reply, ID of the original message |
allow_sending_without_reply | boolean | <optional> | Optional. Pass |
reply_markup | ForceReply | | <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. |
- Source
ExtraSetChatPermissions
- object
Name | Type | Attributes | Description |
---|---|---|---|
use_independent_chat_permissions | boolean | <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. |
- Source
ExtraSetMyCommands
- object
Name | Type | Attributes | Description |
---|---|---|---|
language_code | string | <optional> | Optional. A two-letter ISO 639-1 language code or an empty string |
scope | BotCommandScope | <optional> | Optional. A JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault. |
- Source
ExtraSetWebhook
- object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
certificate | InputFile | <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_address | string | <optional> | Optional. The fixed IP address which will be used to send webhook requests instead of the IP address resolved through DNS | |
max_connections | number | <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_updates | boolean | <optional> | Optional. Pass | |
secret_token | string | <optional> | Optional. A secret token to be sent in a header |
- Source
ExtraSticker
- object
Name | Type | Attributes | Description |
---|---|---|---|
message_thread_id | number | <optional> | Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only |
sticker | InputFile | | 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 » | |
emoji | string | <optional> | Optional. Emoji associated with the sticker; only for just uploaded stickers |
disable_notification | boolean | <optional> | Optional. Sends the message silently. Users will receive a notification with no sound. |
protect_content | boolean | <optional> | Optional. Protects the contents of the sent message from forwarding |
reply_to_message_id | number | <optional> | Optional. If the message is a reply, ID of the original message |
allow_sending_without_reply | boolean | <optional> | Optional. Pass True if the message should be sent even if the specified replied-to message is not found |
reply_markup | InlineKeyboardMarkup | | <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. |
- Source
ExtraStopMessageLiveLocation
- object
Name | Type | Attributes | Description |
---|---|---|---|
reply_markup | InlineKeyboardMarkup | <optional> | Optional A JSON-serialized object for an inline keyboard. If empty, one 'Pay |
- Source
ExtraStopPoll
- object
Name | Type | Attributes | Description |
---|---|---|---|
reply_markup | InlineKeyboardMarkup | <optional> | Optional A JSON-serialized object for an inline keyboard. If empty, one 'Pay |
- Source
ExtraUnPinChatMessage
- object
Name | Type | Attributes | Description |
---|---|---|---|
message_id | number | <optional> | Identifier of a message to unpin. If not specified, the most recent pinned message (by sending date) will be unpinned. |
- Source
ExtraUnbanMember
- object
Name | Type | Attributes | Description |
---|---|---|---|
only_if_banned | boolean | <optional> | Optional. Do nothing if the user is not banned |
- Source
ExtraUploadStickerFile
- object
Name | Type | Description |
---|---|---|
sticker_format | 'static' | | Format of the sticker, must be one of |
- Source
ExtraVenue
- object
Name | Type | Attributes | Description |
---|---|---|---|
message_thread_id | number | <optional> | Optional. Unique identifier of a message thread to which the message belongs; for supergroups only |
foursquare_id | string | <optional> | Optional. Foursquare identifier of the venue |
foursquare_type | string | <optional> | Optional. Foursquare type of the venue, if known. (For example, |
google_place_id | string | <optional> | Optional. Google Places identifier of the venue |
google_place_type | string | <optional> | Optional. Google Places type of the venue. (See supported types.) |
disable_notification | boolean | <optional> | Optional. Sends the message silently. Users will receive a notification with no sound. |
protect_content | boolean | <optional> | Optional. Protects the contents of the forwarded message from forwarding and saving |
reply_to_message_id | number | <optional> | Optional. If the message is a reply, ID of the original message |
allow_sending_without_reply | boolean | <optional> | Optional. Pass |
reply_markup | ForceReply | | <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. |
- Source
ExtraVideo
- object
Name | Type | Attributes | Description |
---|---|---|---|
message_thread_id | number | <optional> | Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only |
duration | number | <optional> | Optional. Duration of sent video in seconds |
width | number | <optional> | Optional. Video width |
height | number | <optional> | Optional. Video height |
thumbnail | InputFile | | <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 » |
caption | string | <optional> | Optional. Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing |
parse_mode | ParseMode | <optional> | Optional. Mode for parsing entities in the audio caption. See formatting options for more details. |
caption_entities | Array.<MessageEntity> | <optional> | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode |
has_spoiler | boolean | <optional> | Optional. Pass |
supports_streaming | boolean | <optional> | Optional. Pass True if the uploaded video is suitable for streaming |
disable_notification | boolean | <optional> | Optional. Sends the message silently. Users will receive a notification with no sound. |
protect_content | boolean | <optional> | Optional. Protects the contents of the sent message from forwarding |
reply_to_message_id | number | <optional> | Optional. If the message is a reply, ID of the original message |
allow_sending_without_reply | boolean | <optional> | Optional. Pass True if the message should be sent even if the specified replied-to message is not found |
reply_markup | InlineKeyboardMarkup | | <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. |
- Source
ExtraVideoNote
- object
Name | Type | Attributes | Description |
---|---|---|---|
message_thread_id | number | <optional> | Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only |
duration | number | <optional> | Optional. Duration of sent video in seconds |
length | number | <optional> | Optional. Video width and height, i.e. diameter of the video message |
thumbnail | InputFile | | <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_notification | boolean | <optional> | Optional. Sends the message silently. Users will receive a notification with no sound. |
protect_content | boolean | <optional> | Optional. Protects the contents of the sent message from forwarding |
reply_to_message_id | number | <optional> | Optional. If the message is a reply, ID of the original message |
allow_sending_without_reply | boolean | <optional> | Optional. Pass True if the message should be sent even if the specified replied-to message is not found |
reply_markup | InlineKeyboardMarkup | | <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. |
- Source
ExtraVoice
- object
Name | Type | Attributes | Description |
---|---|---|---|
message_thread_id | number | <optional> | Optional. Unique identifier of a message thread to which the message belongs; for supergroups only |
caption | string | <optional> | Voice message caption, 0-1024 characters after entities parsing |
parse_mode | ParseMode | <optional> | Optional. Mode for parsing entities in the photo caption. See formatting options for more details. |
caption_entities | Array.<MessageEntity> | <optional> | A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of |
duration | number | <optional> | Optional. Duration of the voice message in seconds (See supported types.) |
disable_notification | boolean | <optional> | Optional. Sends the message silently. Users will receive a notification with no sound. |
protect_content | boolean | <optional> | Optional. Protects the contents of the forwarded message from forwarding and saving |
reply_to_message_id | number | <optional> | Optional. If the message is a reply, ID of the original message |
allow_sending_without_reply | boolean | <optional> | Optional. Pass |
reply_markup | ForceReply | | <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. |
- Source
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
- object
Name | Type | Attributes | Description |
---|---|---|---|
file_id | string | Identifier for this file, which can be used to download or reuse the file | |
file_unique_id | string | Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. | |
file_size | number | <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_path | string | <optional> | Optional. File path. Use |
- Source
FileId
- string
- Source
FileToAttach
- object
Name | Type | Attributes | Description |
---|---|---|---|
url | string | <optional> | URL of file |
filename | string | Name of file | |
source | Stream | | Path to file / Stream / Buffer |
- Source
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 .
- object
Name | Type | Attributes | Description |
---|---|---|---|
force_reply | boolean | Shows reply interface to the user, as if they manually selected the bot's message and tapped 'Reply' | |
input_field_placeholder | string | <optional> | Optional. The placeholder to be shown in the input field when the reply is active; 1-64 characters |
selective | boolean | <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. |
- Source
ForumTopic
This object represents a forum topic.
- object
Name | Type | Attributes | Description |
---|---|---|---|
message_thread_id | number | Unique identifier of the forum topic | |
name | string | Name of the topic | |
icon_color | number | Color of the topic icon in RGB format | |
icon_custom_emoji_id | string | <optional> | Optional. Unique identifier of the custom emoji shown as the topic icon |
- Source
ForumTopicClosed
This object represents a service message about a forum topic closed in the chat. Currently holds no information.
- *
- Source
ForumTopicCreated
This object represents a service message about a new forum topic created in the chat.
- object
Name | Type | Attributes | Description |
---|---|---|---|
name | string | Name of the topic | |
icon_color | number | Color of the topic icon in RGB format | |
icon_custom_emoji_id | string | <optional> | Optional. Unique identifier of the custom emoji shown as the topic icon |
- Source
ForumTopicEdited
This object represents a service message about an edited forum topic.
- object
Name | Type | Attributes | Description |
---|---|---|---|
name | string | <optional> | Optional. New name of the topic, if it was edited |
icon_custom_emoji_id | string | <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 |
- Source
ForumTopicReopened
This object represents a service message about a forum topic reopened in the chat. Currently holds no information.
- *
- Source
Game
This object represents a game. Use BotFather to create and edit games, their short names will act as unique identifiers.
- object
Name | Type | Attributes | Description |
---|---|---|---|
title | string | Title of the game | |
description | string | Description of the game | |
photo | Array.<PhotoSize> | Photo that will be displayed in the game message in chats. | |
text | string | <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_entities | Array.<MessageEntity> | <optional> | Optional. Special entities that appear in text, such as usernames, URLs, bot commands, etc. |
animation | Animation | <optional> | Optional. Animation that will be displayed in the game message in chats. Upload via BotFather |
- Source
GameHighScore
This object represents one row of the high scores table for a game.
- object
Name | Type | Description |
---|---|---|
position | number | Position in high score table for the game |
user | User | User |
score | number | Score |
- Source
GeneralForumTopicHidden
This object represents a service message about General forum topic hidden in the chat. Currently holds no information.
- *
- Source
GeneralForumTopicUnhidden
This object represents a service message about General forum topic unhidden in the chat. Currently holds no information.
- *
- Source
InlineKeyboardButton
This object represents one button of an inline keyboard. You must use exactly one of the optional fields.
- object
Name | Type | Attributes | Description |
---|---|---|---|
text | string | Label text on the button | |
url | string | <optional> | Optional. HTTP or tg:// URL to be opened when the button is pressed. Links |
callback_data | string | <optional> | Optional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes |
web_app | WebAppInfo | <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_url | LoginUrl | <optional> | Optional. An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget. |
switch_inline_query | string | <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_chat | string | <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_game | CallbackGame | <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_chat | SwitchInlineQueryChosenChat | <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 |
pay | boolean | <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. |
- Source
InlineKeyboardMarkup
This object represents an inline keyboard that appears right next to the message it belongs to.
- object
Name | Type | Description |
---|---|---|
inline_keyboard | Array.<Array.<InlineKeyboardButton>> | Array of button rows, each represented by an Array of InlineKeyboardButton objects |
- Source
InlineKeyboardOptions
- object
Name | Type | Attributes | Description |
---|---|---|---|
columns | number | <optional> | Count of keyboard columns, by default equals to |
wrap | KeyboardWrap | <optional> | Warp function |
- Source
InlineQuery
This object represents an incoming inline query. When the user sends an empty query, your bot could return some default or trending results.
- object
Name | Type | Attributes | Description |
---|---|---|---|
id | string | Unique identifier for this query | |
from | User | Sender | |
query | string | Text of the query (up to 256 characters) | |
offset | string | Offset of the results to be returned, can be controlled by the bot | |
chat_type | 'sender' | | <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 |
location | Location | <optional> | Optional. Sender location, only for bots that request user location |
- Source
InlineQueryResult
This object represents one result of an inline query. Telegram clients currently support results of the following 20 types:
InlineQueryResultCachedDocument
InlineQueryResultCachedMpeg4Gif
- InlineQueryResultCachedAudio |
InlineQueryResultCachedDocument | InlineQueryResultCachedGif | InlineQueryResultCachedMpeg4Gif | InlineQueryResultCachedPhoto | InlineQueryResultCachedSticker | InlineQueryResultCachedVideo | InlineQueryResultCachedVoice | InlineQueryResultArticle | InlineQueryResultAudio | InlineQueryResultContact | InlineQueryResultGame | InlineQueryResultDocument | InlineQueryResultGif | InlineQueryResultLocation | InlineQueryResultMpeg4Gif | InlineQueryResultPhoto | InlineQueryResultVenue | InlineQueryResultVideo | InlineQueryResultVoice
- Source
InlineQueryResultArticle
Represents a link to an article or web page.
- object
Name | Type | Attributes | Description |
---|---|---|---|
type | 'article' | Type of the result, must be article | |
id | string | Unique identifier for this result, 1-64 Bytes | |
title | string | Title of the result | |
input_message_content | InputMessageContent | Content of the message to be sent | |
reply_markup | InlineKeyboardMarkup | <optional> | Optional. Inline keyboard attached to the message |
url | string | <optional> | Optional. URL of the result |
hide_url | boolean | <optional> | Optional. Pass True if you don't want the URL to be shown in the message |
description | string | <optional> | Optional. Short description of the result |
thumbnail_url | string | <optional> | Optional. Url of the thumbnail for the result |
thumbnail_width | number | <optional> | Optional. Thumbnail width |
thumbnail_height | number | <optional> | Optional. Thumbnail height |
- Source
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.
- object
Name | Type | Attributes | Description |
---|---|---|---|
type | 'audio' | Type of the result, must be audio | |
id | string | Unique identifier for this result, 1-64 bytes | |
audio_url | string | A valid URL for the audio file | |
title | string | Title | |
caption | string | <optional> | Optional. Caption, 0-1024 characters after entities parsing |
parse_mode | ParseMode | <optional> | Optional. Mode for parsing entities in the audio caption. See formatting options for more details. |
caption_entities | Array.<MessageEntity> | <optional> | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode |
performer | string | <optional> | Optional. Performer |
audio_duration | number | <optional> | Optional. Audio duration in seconds |
reply_markup | InlineKeyboardMarkup | <optional> | Optional. Inline keyboard attached to the message |
input_message_content | InputMessageContent | <optional> | Optional. Content of the message to be sent instead of the audio |
- Source
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.
- object
Name | Type | Attributes | Description |
---|---|---|---|
type | 'audio' | Type of the result, must be audio | |
id | string | Unique identifier for this result, 1-64 bytes | |
audio_file_id | string | A valid file identifier for the audio file | |
caption | string | <optional> | Optional. Caption, 0-1024 characters after entities parsing |
parse_mode | ParseMode | <optional> | Optional. Mode for parsing entities in the audio caption. See formatting options for more details. |
caption_entities | Array.<MessageEntity> | <optional> | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode |
reply_markup | InlineKeyboardMarkup | <optional> | Optional. Inline keyboard attached to the message |
input_message_content | InputMessageContent | <optional> | Optional. Content of the message to be sent instead of the audio |
- Source
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.
- object
Name | Type | Attributes | Description |
---|---|---|---|
type | 'document' | Type of the result, must be document | |
id | string | Unique identifier for this result, 1-64 bytes | |
title | string | Title for the result | |
document_file_id | string | A valid file identifier for the file | |
description | string | <optional> | Optional. Short description of the result |
caption | string | <optional> | Optional. Caption of the document to be sent, 0-1024 characters after entities parsing |
parse_mode | ParseMode | <optional> | Optional. Mode for parsing entities in the document caption. See formatting options for more details. |
caption_entities | Array.<MessageEntity> | <optional> | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode |
reply_markup | InlineKeyboardMarkup | <optional> | Optional. Inline keyboard attached to the message |
input_message_content | InputMessageContent | <optional> | Optional. Content of the message to be sent instead of the file |
- Source
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.
- object
Name | Type | Attributes | Description |
---|---|---|---|
type | 'gif' | Type of the result, must be gif | |
id | string | Unique identifier for this result, 1-64 bytes | |
gif_file_id | string | A valid file identifier for the GIF file | |
title | string | <optional> | Optional. Title for the result |
caption | string | <optional> | Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing |
parse_mode | ParseMode | <optional> | Optional. Mode for parsing entities in the caption. See formatting options for more details. |
caption_entities | Array.<MessageEntity> | <optional> | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode |
reply_markup | InlineKeyboardMarkup | <optional> | Optional. Inline keyboard attached to the message |
input_message_content | InputMessageContent | <optional> | Optional. Content of the message to be sent instead of the GIF animation |
- Source
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.
- object
Name | Type | Attributes | Description |
---|---|---|---|
type | 'mpeg4_gif' | Type of the result, must be mpeg4_gif | |
id | string | Unique identifier for this result, 1-64 bytes | |
mpeg4_file_id | string | A valid file identifier for the MPEG4 file | |
title | string | <optional> | Optional. Title for the result |
caption | string | <optional> | Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing |
parse_mode | ParseMode | <optional> | Optional. Mode for parsing entities in the caption. See formatting options for more details. |
caption_entities | Array.<MessageEntity> | <optional> | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode |
reply_markup | InlineKeyboardMarkup | <optional> | Optional. Inline keyboard attached to the message |
input_message_content | InputMessageContent | <optional> | Optional. Content of the message to be sent instead of the video animation |
- Source
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.
- object
Name | Type | Attributes | Description |
---|---|---|---|
type | 'photo' | Type of the result, must be photo | |
id | string | Unique identifier for this result, 1-64 bytes | |
photo_file_id | string | A valid file identifier of the photo | |
title | string | <optional> | Optional. Title for the result |
description | string | <optional> | Optional. Short description of the result |
caption | string | <optional> | Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing |
parse_mode | ParseMode | <optional> | Optional. Mode for parsing entities in the photo caption. See formatting options for more details. |
caption_entities | Array.<MessageEntity> | <optional> | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode |
reply_markup | InlineKeyboardMarkup | <optional> | Optional. Inline keyboard attached to the message |
input_message_content | InputMessageContent | <optional> | Optional. Content of the message to be sent instead of the photo |
- Source
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.
- object
Name | Type | Attributes | Description |
---|---|---|---|
type | 'sticker' | Type of the result, must be sticker | |
id | string | Unique identifier for this result, 1-64 bytes | |
sticker_file_id | string | A valid file identifier of the sticker | |
reply_markup | InlineKeyboardMarkup | <optional> | Optional. Inline keyboard attached to the message |
input_message_content | InputMessageContent | <optional> | Optional. Content of the message to be sent instead of the sticker |
- Source
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.
- object
Name | Type | Attributes | Description |
---|---|---|---|
type | 'video' | Type of the result, must be video | |
id | string | Unique identifier for this result, 1-64 bytes | |
video_file_id | string | A valid file identifier for the video file | |
title | string | Title for the result | |
description | string | <optional> | Optional. Short description of the result |
caption | string | <optional> | Optional. Caption of the video to be sent, 0-1024 characters after entities parsing |
parse_mode | ParseMode | <optional> | Optional. Mode for parsing entities in the video caption. See formatting options for more details. |
caption_entities | Array.<MessageEntity> | <optional> | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode |
reply_markup | InlineKeyboardMarkup | <optional> | Optional. Inline keyboard attached to the message |
input_message_content | InputMessageContent | <optional> | Optional. Content of the message to be sent instead of the video |
- Source
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.
- object
Name | Type | Attributes | Description |
---|---|---|---|
type | 'voice' | Type of the result, must be voice | |
id | string | Unique identifier for this result, 1-64 bytes | |
voice_file_id | string | A valid file identifier for the voice message | |
title | string | Voice message title | |
caption | string | <optional> | Optional. Caption, 0-1024 characters after entities parsing |
parse_mode | ParseMode | <optional> | Optional. Mode for parsing entities in the voice message caption. See formatting options for more details. |
caption_entities | Array.<MessageEntity> | <optional> | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode |
reply_markup | InlineKeyboardMarkup | <optional> | Optional. Inline keyboard attached to the message |
input_message_content | InputMessageContent | <optional> | Optional. Content of the message to be sent instead of the voice message |
- Source
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.
- object
Name | Type | Attributes | Description |
---|---|---|---|
type | 'contact' | Type of the result, must be contact | |
id | string | Unique identifier for this result, 1-64 Bytes | |
phone_number | string | Contact's phone number | |
first_name | string | Contact's first name | |
last_name | string | <optional> | Optional. Contact's last name |
vcard | string | <optional> | Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes |
reply_markup | InlineKeyboardMarkup | <optional> | Optional. Inline keyboard attached to the message |
input_message_content | InputMessageContent | <optional> | Optional. Content of the message to be sent instead of the contact |
thumbnail_url | string | <optional> | Optional. Url of the thumbnail for the result |
thumbnail_width | number | <optional> | Optional. Thumbnail width |
thumbnail_height | number | <optional> | Optional. Thumbnail height |
- Source
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.
- object
Name | Type | Attributes | Description |
---|---|---|---|
type | 'document' | Type of the result, must be document | |
id | string | Unique identifier for this result, 1-64 bytes | |
title | string | Title for the result | |
caption | string | <optional> | Optional. Caption of the document to be sent, 0-1024 characters after entities parsing |
parse_mode | ParseMode | <optional> | Optional. Mode for parsing entities in the document caption. See formatting options for more details. |
caption_entities | Array.<MessageEntity> | <optional> | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode |
document_url | string | A valid URL for the file | |
mime_type | 'application/pdf' | | MIME type of the content of the file, either “application/pdf” or “application/zip” | |
description | string | <optional> | Optional. Short description of the result |
reply_markup | InlineKeyboardMarkup | <optional> | Optional. Inline keyboard attached to the message |
input_message_content | InputMessageContent | <optional> | Optional. Content of the message to be sent instead of the file |
thumbnail_url | string | <optional> | Optional. URL of the thumbnail (JPEG only) for the file |
thumbnail_width | number | <optional> | Optional. Thumbnail width |
thumbnail_height | number | <optional> | Optional. Thumbnail height |
- Source
InlineQueryResultGame
Represents a Game .
- object
Name | Type | Attributes | Description |
---|---|---|---|
type | 'game' | Type of the result, must be game | |
id | string | Unique identifier for this result, 1-64 bytes | |
game_short_name | string | Short name of the game | |
reply_markup | InlineKeyboardMarkup | <optional> | Optional. Inline keyboard attached to the message |
- Source
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.
- object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
type | 'gif' | Type of the result, must be gif | ||
id | string | Unique identifier for this result, 1-64 bytes | ||
gif_url | string | A valid URL for the GIF file. File size must not exceed 1MB | ||
gif_width | number | <optional> | Optional. Width of the GIF | |
gif_height | number | <optional> | Optional. Height of the GIF | |
gif_duration | number | <optional> | Optional. Duration of the GIF in seconds | |
thumbnail_url | string | URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result | ||
thumbnail_mime_type | 'image/jpeg' | | <optional> | image/jpeg | Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg” |
title | string | <optional> | Optional. Title for the result | |
caption | string | <optional> | Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing | |
parse_mode | ParseMode | <optional> | Optional. Mode for parsing entities in the caption. See formatting options for more details. | |
caption_entities | Array.<MessageEntity> | <optional> | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode | |
reply_markup | InlineKeyboardMarkup | <optional> | Optional. Inline keyboard attached to the message | |
input_message_content | InputMessageContent | <optional> | Optional. Content of the message to be sent instead of the GIF animation |
- Source
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.
- object
Name | Type | Attributes | Description |
---|---|---|---|
type | 'location' | Type of the result, must be location | |
id | string | Unique identifier for this result, 1-64 Bytes | |
latitude | number | Location latitude in degrees | |
longitude | number | Location longitude in degrees | |
title | string | Location title | |
horizontal_accuracy | number | <optional> | Optional. The radius of uncertainty for the location, measured in meters; 0-1500 |
live_period | number | <optional> | Optional. Period in seconds for which the location can be updated, should be between 60 and 86400. |
heading | number | <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_radius | number | <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_markup | InlineKeyboardMarkup | <optional> | Optional. Inline keyboard attached to the message |
input_message_content | InputMessageContent | <optional> | Optional. Content of the message to be sent instead of the location |
thumbnail_url | string | <optional> | Optional. Url of the thumbnail for the result |
thumbnail_width | number | <optional> | Optional. Thumbnail width |
thumbnail_height | number | <optional> | Optional. Thumbnail height |
- Source
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.
- object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
type | 'mpeg4_gif' | Type of the result, must be mpeg4_gif | ||
id | string | Unique identifier for this result, 1-64 bytes | ||
mpeg4_url | string | A valid URL for the MPEG4 file. File size must not exceed 1MB | ||
mpeg4_width | number | <optional> | Optional. Video width | |
mpeg4_height | number | <optional> | Optional. Video height | |
mpeg4_duration | number | <optional> | Optional. Video duration in seconds | |
thumbnail_url | string | URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result | ||
thumbnail_mime_type | 'image/jpeg' | | <optional> | image/jpeg | Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg” |
title | string | <optional> | Optional. Title for the result | |
caption | string | <optional> | Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing | |
parse_mode | ParseMode | <optional> | Optional. Mode for parsing entities in the caption. See formatting options for more details. | |
caption_entities | Array.<MessageEntity> | <optional> | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode | |
reply_markup | InlineKeyboardMarkup | <optional> | Optional. Inline keyboard attached to the message | |
input_message_content | InputMessageContent | <optional> | Optional. Content of the message to be sent instead of the video animation |
- Source
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.
- object
Name | Type | Attributes | Description |
---|---|---|---|
type | 'photo' | Type of the result, must be photo | |
id | string | Unique identifier for this result, 1-64 bytes | |
photo_url | string | A valid URL of the photo. Photo must be in JPEG format. Photo size must not exceed 5MB | |
thumbnail_url | string | URL of the thumbnail for the photo | |
photo_width | number | <optional> | Optional. Width of the photo |
photo_height | number | <optional> | Optional. Height of the photo |
title | string | <optional> | Optional. Title for the result |
description | string | <optional> | Optional. Short description of the result |
caption | string | <optional> | Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing |
parse_mode | ParseMode | <optional> | Optional. Mode for parsing entities in the photo caption. See formatting options for more details. |
caption_entities | Array.<MessageEntity> | <optional> | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode |
reply_markup | InlineKeyboardMarkup | <optional> | Optional. Inline keyboard attached to the message |
input_message_content | InputMessageContent | <optional> | Optional. Content of the message to be sent instead of the photo |
- Source
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.
- object
Name | Type | Attributes | Description |
---|---|---|---|
type | 'venue' | Type of the result, must be venue | |
id | string | Unique identifier for this result, 1-64 Bytes | |
latitude | number | Latitude of the venue location in degrees | |
longitude | number | Longitude of the venue location in degrees | |
title | string | Title of the venue | |
address | string | Address of the venue | |
foursquare_id | string | <optional> | Optional. Foursquare identifier of the venue if known |
foursquare_type | string | <optional> | Optional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) |
google_place_id | string | <optional> | Optional. Google Places identifier of the venue |
google_place_type | string | <optional> | Optional. Google Places type of the venue. (See supported types.) |
reply_markup | InlineKeyboardMarkup | <optional> | Optional. Inline keyboard attached to the message |
input_message_content | InputMessageContent | <optional> | Optional. Content of the message to be sent instead of the venue |
thumbnail_url | string | <optional> | Optional. Url of the thumbnail for the result |
thumbnail_width | number | <optional> | Optional. Thumbnail width |
thumbnail_height | number | <optional> | Optional. Thumbnail height |
- Source
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.
- object
Name | Type | Attributes | Description |
---|---|---|---|
type | 'video' | Type of the result, must be video | |
id | string | Unique identifier for this result, 1-64 bytes | |
video_url | string | A valid URL for the embedded video player or video file | |
mime_type | 'text/html' | | MIME type of the content of the video URL, “text/html” or “video/mp4” | |
thumbnail_url | string | URL of the thumbnail (JPEG only) for the video | |
title | string | Title for the result | |
caption | string | <optional> | Optional. Caption of the video to be sent, 0-1024 characters after entities parsing |
parse_mode | ParseMode | <optional> | Optional. Mode for parsing entities in the video caption. See formatting options for more details. |
caption_entities | Array.<MessageEntity> | <optional> | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode |
video_width | number | <optional> | Optional. Video width |
video_height | number | <optional> | Optional. Video height |
video_duration | number | <optional> | Optional. Video duration in seconds |
description | string | <optional> | Optional. Short description of the result |
reply_markup | InlineKeyboardMarkup | <optional> | Optional. Inline keyboard attached to the message |
input_message_content | InputMessageContent | <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). |
- Source
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.
- object
Name | Type | Attributes | Description |
---|---|---|---|
type | 'voice' | Type of the result, must be voice | |
id | string | Unique identifier for this result, 1-64 bytes | |
voice_url | string | A valid URL for the voice recording | |
title | string | Recording title | |
caption | string | <optional> | Optional. Caption, 0-1024 characters after entities parsing |
parse_mode | ParseMode | <optional> | Optional. Mode for parsing entities in the voice message caption. See formatting options for more details. |
caption_entities | Array.<MessageEntity> | <optional> | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode |
voice_duration | number | <optional> | Optional. Recording duration in seconds |
reply_markup | InlineKeyboardMarkup | <optional> | Optional. Inline keyboard attached to the message |
input_message_content | InputMessageContent | <optional> | Optional. Content of the message to be sent instead of the voice recording |
- Source
InlineQueryResultsButton
This object represents a button to be shown above inline query results. You must use exactly one of the optional fields.
- object
Name | Type | Attributes | Description |
---|---|---|---|
text | string | Label text on the button | |
web_app | WebAppInfo | <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_parameter | string | <optional> | Optional. Deep-linking parameter for the /start message sent to the bot when a user presses the button. 1-64 characters, only 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. |
- Source
InputContactMessageContent
Represents the content of a contact message to be sent as the result of an inline query.
- object
Name | Type | Attributes | Description |
---|---|---|---|
phone_number | string | Contact's phone number | |
first_name | string | Contact's first name | |
last_name | string | <optional> | Optional. Contact's last name |
vcard | string | <optional> | Optional. Additional data about the contact in the form of a vCard, 0-2048 bytes |
- Source
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.
- Buffer |
ReadableStream | string
- Source
InputInvoiceMessageContent
Represents the content of an invoice message to be sent as the result of an inline query.
- object
Name | Type | Attributes | Description |
---|---|---|---|
title | string | Product name, 1-32 characters | |
description | string | Product description, 1-255 characters | |
payload | string | Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. | |
provider_token | string | Payment provider token, obtained via @BotFather | |
currency | string | Three-letter ISO 4217 currency code, see more on currencies | |
prices | Array.<LabeledPrice> | Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) | |
max_tip_amount | number | <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 |
suggested_tip_amounts | Array.<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_data | string | <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_url | string | <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_size | number | <optional> | Optional. Photo size in bytes |
photo_width | number | <optional> | Optional. Photo width |
photo_height | number | <optional> | Optional. Photo height |
need_name | boolean | <optional> | Optional. Pass True if you require the user's full name to complete the order |
need_phone_number | boolean | <optional> | Optional. Pass True if you require the user's phone number to complete the order |
need_email | boolean | <optional> | Optional. Pass True if you require the user's email address to complete the order |
need_shipping_address | boolean | <optional> | Optional. Pass True if you require the user's shipping address to complete the order |
send_phone_number_to_provider | boolean | <optional> | Optional. Pass True if the user's phone number should be sent to provider |
send_email_to_provider | boolean | <optional> | Optional. Pass True if the user's email address should be sent to provider |
is_flexible | boolean | <optional> | Optional. Pass True if the final price depends on the shipping method |
- Source
InputLocationMessageContent
Represents the content of a location message to be sent as the result of an inline query.
- object
Name | Type | Attributes | Description |
---|---|---|---|
latitude | number | Latitude of the location in degrees | |
longitude | number | Longitude of the location in degrees | |
horizontal_accuracy | number | <optional> | Optional. The radius of uncertainty for the location, measured in meters; 0-1500 |
live_period | number | <optional> | Optional. Period in seconds for which the location can be updated, should be between 60 and 86400. |
heading | number | <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_radius | number | <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. |
- Source
InputMedia
This object represents the content of a media message to be sent. It should be one of
- Source
InputMediaAnimation
Represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent.
- object
Name | Type | Attributes | Description |
---|---|---|---|
type | 'animation' | Type of the result, must be animation | |
media | string | 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 » | |
thumbnail | InputFile | | <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 » |
caption | string | <optional> | Optional. Caption of the animation to be sent, 0-1024 characters after entities parsing |
parse_mode | ParseMode | <optional> | Optional. Mode for parsing entities in the animation caption. See formatting options for more details. |
caption_entities | Array.<MessageEntity> | <optional> | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode |
width | number | <optional> | Optional. Animation width |
height | number | <optional> | Optional. Animation height |
duration | number | <optional> | Optional. Animation duration in seconds |
has_spoiler | boolean | <optional> | Optional. Pass |
- Source
InputMediaAudio
Represents an audio file to be treated as music to be sent.
- object
Name | Type | Attributes | Description |
---|---|---|---|
type | 'audio' | Type of the result, must be audio | |
media | string | 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 » | |
thumbnail | InputFile | | <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 » |
caption | string | <optional> | Optional. Caption of the audio to be sent, 0-1024 characters after entities parsing |
parse_mode | ParseMode | <optional> | Optional. Mode for parsing entities in the audio caption. See formatting options for more details. |
caption_entities | Array.<MessageEntity> | <optional> | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode |
duration | number | <optional> | Optional. Duration of the audio in seconds |
performer | string | <optional> | Optional. Performer of the audio |
title | string | <optional> | Optional. Title of the audio |
- Source
InputMediaDocument
Represents a general file to be sent.
- object
Name | Type | Attributes | Description |
---|---|---|---|
type | 'document' | Type of the result, must be document | |
media | string | 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 » | |
thumbnail | InputFile | | <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 » |
caption | string | <optional> | Optional. Caption of the document to be sent, 0-1024 characters after entities parsing |
parse_mode | ParseMode | <optional> | Optional. Mode for parsing entities in the document caption. See formatting options for more details. |
caption_entities | Array.<MessageEntity> | <optional> | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode |
disable_content_type_detection | boolean | <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. |
- Source
InputMediaPhoto
Represents a photo to be sent.
- object
Name | Type | Attributes | Description |
---|---|---|---|
type | 'photo' | Type of the result, must be photo | |
media | string | 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 » | |
caption | string | <optional> | Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing |
parse_mode | ParseMode | <optional> | Optional. Mode for parsing entities in the photo caption. See formatting options for more details. |
caption_entities | Array.<MessageEntity> | <optional> | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode |
has_spoiler | boolean | <optional> | Optional. Pass |
- Source
InputMediaVideo
Represents a video to be sent.
- object
Name | Type | Attributes | Description |
---|---|---|---|
type | 'video' | Type of the result, must be video | |
media | string | 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 » | |
thumbnail | InputFile | | <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 » |
caption | string | <optional> | Optional. Caption of the video to be sent, 0-1024 characters after entities parsing |
parse_mode | ParseMode | <optional> | Optional. Mode for parsing entities in the video caption. See formatting options for more details. |
caption_entities | Array.<MessageEntity> | <optional> | Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode |
width | number | <optional> | Optional. Video width |
height | number | <optional> | Optional. Video height |
duration | number | <optional> | Optional. Video duration in seconds |
supports_streaming | boolean | <optional> | Optional. Pass True if the uploaded video is suitable for streaming |
has_spoiler | boolean | <optional> | Optional. Pass |
- Source
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:
- Source
InputSticker
This object describes a sticker to be added to a sticker set.
- object
Name | Type | Attributes | Description |
---|---|---|---|
sticker | InputFile | 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_list | Array.<string> | List of 1-20 emoji associated with the sticker | |
mask_position | MaskPosition | <optional> | Optional. Position where the mask should be placed on faces. For “mask” stickers only. |
keywords | Array.<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. |
- Source
InputTextMessageContent
Represents the content of a text message to be sent as the result of an inline query.
- object
Name | Type | Attributes | Description |
---|---|---|---|
message_text | string | Text of the message to be sent, 1-4096 characters | |
parse_mode | ParseMode | <optional> | Optional. Mode for parsing entities in the message text. See formatting options for more details. |
entities | Array.<MessageEntity> | <optional> | Optional. List of special entities that appear in message text, which can be specified instead of parse_mode |
disable_web_page_preview | boolean | <optional> | Optional. Disables link previews for links in the sent message |
- Source
InputVenueMessageContent
Represents the content of a venue message to be sent as the result of an inline query.
- object
Name | Type | Attributes | Description |
---|---|---|---|
latitude | number | Latitude of the venue in degrees | |
longitude | number | Longitude of the venue in degrees | |
title | string | Name of the venue | |
address | string | Address of the venue | |
foursquare_id | string | <optional> | Optional. Foursquare identifier of the venue, if known |
foursquare_type | string | <optional> | Optional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) |
google_place_id | string | <optional> | Optional. Google Places identifier of the venue |
google_place_type | string | <optional> | Optional. Google Places type of the venue. (See supported types.) |
- Source
Invoice
This object contains basic information about an invoice.
- object
Name | Type | Description |
---|---|---|
title | string | Product name |
description | string | Product description |
start_parameter | string | Unique bot deep-linking parameter that can be used to generate this invoice |
currency | string | Three-letter ISO 4217 currency code |
total_amount | number | Total price in the smallest units of the currency (integer, not float/double). For example, for a price of |
- Source
InvoiceLinkParams
- object
Name | Type | Attributes | Description |
---|---|---|---|
title | string | Product name, 1-32 characters | |
description | string | Product description, 1-255 characters | |
payload | string | Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. | |
provider_token | string | Payment provider token, obtained via @BotFather | |
currency | string | Three-letter ISO 4217 currency code, see more on currencies | |
prices | Array.<LabeledPrice> | Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) | |
is_flexible | boolean | <optional> | Optional. Pass True if the final price depends on the shipping method |
max_tip_amount | number | <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 |
suggested_tip_amounts | Array.<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_data | object | <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_url | string | <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_size | number | <optional> | Optional. Photo size in bytes |
photo_width | number | <optional> | Optional. Photo width |
photo_height | number | <optional> | Optional. Photo height |
need_name | boolean | <optional> | Optional. Pass True if you require the user's full name to complete the order |
need_phone_number | boolean | <optional> | Optional. Pass True if you require the user's phone number to complete the order |
need_email | boolean | <optional> | Optional. Pass True if you require the user's email address to complete the order |
need_shipping_address | boolean | <optional> | Optional. Pass True if you require the user's shipping address to complete the order |
send_phone_number_to_provider | boolean | <optional> | Optional. Pass True if the user's phone number should be sent to provider |
send_email_to_provider | boolean | <optional> | Optional. Pass True if the user's email address should be sent to provider |
- Source
InvoiceParams
- object
Name | Type | Attributes | Description |
---|---|---|---|
message_thread_id | number | <optional> | Optional. Unique identifier for the target message thread (topic) of the forum; for forum supergroups only |
title | string | Product name, 1-32 characters | |
description | string | Product description, 1-255 characters | |
payload | string | Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes. | |
provider_token | string | Payment provider token, obtained via @BotFather | |
currency | string | Three-letter ISO 4217 currency code, see more on currencies | |
prices | Array.<LabeledPrice> | Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.) |
- Source
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.
- object
Name | Type | Attributes | Description |
---|---|---|---|
text | string | 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_user | KeyboardButtonRequestUser | <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_chat | KeyboardButtonRequestChat | <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_contact | boolean | <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_location | boolean | <optional> | Optional. If True, the user's current location will be sent when the button is pressed. Available in private chats only. |
request_poll | KeyboardButtonPollType | <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_app | WebAppInfo | <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. |
- Source
KeyboardButtonPollType
This object represents type of a poll, which is allowed to be created and sent when the corresponding button is pressed.
- object
Name | Type | Attributes | Description |
---|---|---|---|
type | string | <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. |
- Source
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 »
- object
Name | Type | Attributes | Description |
---|---|---|---|
request_id | number | Signed 32-bit identifier of the request, which will be received back in the ChatShared object. Must be unique within the message | |
chat_is_channel | boolean | Pass True to request a channel chat, pass False to request a group or a supergroup chat. | |
chat_is_forum | boolean | <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_username | boolean | <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_created | boolean | <optional> | Optional. Pass True to request a chat owned by the user. Otherwise, no additional restrictions are applied. |
user_administrator_rights | ChatAdministratorRights | <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_rights | ChatAdministratorRights | <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_member | boolean | <optional> | Optional. Pass True to request a chat with the bot as a member. Otherwise, no additional restrictions are applied. |
- Source
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 »
- object
Name | Type | Attributes | Description |
---|---|---|---|
request_id | number | Signed 32-bit identifier of the request, which will be received back in the UserShared object. Must be unique within the message | |
user_is_bot | boolean | <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_premium | boolean | <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. |
- Source
KeyboardOptions
- object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
columns | number | <optional> | 1 | Count of keyboard columns |
wrap | KeyboardWrap | <optional> | Warp function |
- Source
LabeledPrice
This object represents a portion of the price for goods or services.
- object
Name | Type | Description |
---|---|---|
label | string | Portion label |
amount | number | Price of the product in the smallest units of the currency (integer, not float/double). For example, for a price of |
- Source
Location
This object represents a point on the map.
- object
Name | Type | Attributes | Description |
---|---|---|---|
longitude | number | Longitude as defined by sender | |
latitude | number | Latitude as defined by sender | |
horizontal_accuracy | number | <optional> | Optional. The radius of uncertainty for the location, measured in meters; 0-1500 |
live_period | number | <optional> | Optional. Time relative to the message sending date, during which the location can be updated; in seconds. For active live locations only. |
heading | number | <optional> | Optional. The direction in which user is moving, in degrees; 1-360. For active live locations only. |
proximity_alert_radius | number | <optional> | Optional. The maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only. |
- Source
LoginButtonOptions
- object
Name | Type | Attributes | Description |
---|---|---|---|
forward_text | string | <optional> | New text of the button in forwarded messages. |
bot_username | string | <optional> | Username of a bot, which will be used for user authorization. |
request_write_access | boolean | <optional> | Pass True to request the permission for your bot to send messages to the user. |
- Source
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
- object
Name | Type | Attributes | Description |
---|---|---|---|
url | string | An HTTPS URL to be opened with user authorization data added to the query string when the button is pressed. If the user refuses to provide authorization data, the original URL without information about the user will be opened. The data added is the same as described in Receiving authorization data. NOTE: You must always check the hash of the received data to verify the authentication and the integrity of the data as described in Checking authorization. | |
forward_text | string | <optional> | Optional. New text of the button in forwarded messages. |
bot_username | string | <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_access | boolean | <optional> | Optional. Pass True to request the permission for your bot to send messages to the user. |
- Source
MaskPosition
This object describes the position on faces where a mask should be placed by default.
- object
Name | Type | Description |
---|---|---|
point | 'forehead' | | The part of the face relative to which the mask should be placed. One of “forehead”, “eyes”, “mouth”, or “chin”. |
x_shift | number | Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place mask just to the left of the default mask position. |
y_shift | number | Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. For example, 1.0 will place the mask just below the default mask position. |
scale | number | Mask scaling coefficient. For example, 2.0 means double size. |
- Source
MenuButton
This object describes the bot's menu button in a private chat. It should be one of
- Source
MenuButtonCommands
Represents a menu button, which opens the bot's list of commands.
- object
Name | Type | Description |
---|---|---|
type | 'commands' | Type of the button, must be commands |
- Source
MenuButtonDefault
Describes that no specific value for the menu button was set.
- object
Name | Type | Description |
---|---|---|
type | 'default' | Type of the button, must be default |
- Source
MenuButtonWebApp
Represents a menu button, which launches a Web App .
- object
Name | Type | Description |
---|---|---|
type | 'web_app' | Type of the button, must be web_app |
text | string | Text on the button |
web_app | WebAppInfo | 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. |
- Source
Message
This object represents a message.
- object
Name | Type | Attributes | Description |
---|---|---|---|
message_id | number | Unique message identifier inside this chat | |
message_thread_id | number | <optional> | Optional. Unique identifier of a message thread to which the message belongs; for supergroups only |
from | User | <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_chat | Chat | <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. |
date | number | Date the message was sent in Unix time | |
chat | Chat | Conversation the message belongs to | |
forward_from | User | <optional> | Optional. For forwarded messages, sender of the original message |
forward_from_chat | Chat | <optional> | Optional. For messages forwarded from channels or from anonymous administrators, information about the original sender chat |
forward_from_message_id | number | <optional> | Optional. For messages forwarded from channels, identifier of the original message in the channel |
forward_signature | string | <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_name | string | <optional> | Optional. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages |
forward_date | number | <optional> | Optional. For forwarded messages, date the original message was sent in Unix time |
is_topic_message | boolean | <optional> | Optional. True, if the message is sent to a forum topic |
is_automatic_forward | boolean | <optional> | Optional. True, if the message is a channel post that was automatically forwarded to the connected discussion group |
reply_to_message | Message | <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_bot | User | <optional> | Optional. Bot through which the message was sent |
edit_date | number | <optional> | Optional. Date the message was last edited in Unix time |
has_protected_content | boolean | <optional> | Optional. True, if the message can't be forwarded |
media_group_id | string | <optional> | Optional. The unique identifier of a media message group this message belongs to |
author_signature | string | <optional> | Optional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator |
text | string | <optional> | Optional. For text messages, the actual UTF-8 text of the message |
entities | Array.<MessageEntity> | <optional> | Optional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text |
animation | Animation | <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 |
audio | Audio | <optional> | Optional. Message is an audio file, information about the file |
document | Document | <optional> | Optional. Message is a general file, information about the file |
photo | Array.<PhotoSize> | <optional> | Optional. Message is a photo, available sizes of the photo |
sticker | Sticker | <optional> | Optional. Message is a sticker, information about the sticker |
story | Story | <optional> | Optional. Message is a forwarded story |
video | Video | <optional> | Optional. Message is a video, information about the video |
video_note | VideoNote | <optional> | Optional. Message is a video note, information about the video message |
voice | Voice | <optional> | Optional. Message is a voice message, information about the file |
caption | string | <optional> | Optional. Caption for the animation, audio, document, photo, video or voice |
caption_entities | Array.<MessageEntity> | <optional> | Optional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption |
has_media_spoiler | boolean | <optional> | Optional. |
contact | Contact | <optional> | Optional. Message is a shared contact, information about the contact |
dice | Dice | <optional> | Optional. Message is a dice with random value |
game | Game | <optional> | Optional. Message is a game, information about the game. More about games » |
poll | Poll | <optional> | Optional. Message is a native poll, information about the poll |
venue | Venue | <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 |
location | Location | <optional> | Optional. Message is a shared location, information about the location |
new_chat_members | Array.<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_member | User | <optional> | Optional. A member was removed from the group, information about them (this member may be the bot itself) |
new_chat_title | string | <optional> | Optional. A chat title was changed to this value |
new_chat_photo | Array.<PhotoSize> | <optional> | Optional. A chat photo was change to this value |
delete_chat_photo | boolean | <optional> | Optional. Service message: the chat photo was deleted |
group_chat_created | boolean | <optional> | Optional. Service message: the group has been created |
supergroup_chat_created | boolean | <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_created | boolean | <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_changed | MessageAutoDeleteTimerChanged | <optional> | Optional. Service message: auto-delete timer settings changed in the chat |
migrate_to_chat_id | number | <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_id | number | <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_message | Message | <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. |
invoice | Invoice | <optional> | Optional. Message is an invoice for a payment, information about the invoice. More about payments » |
successful_payment | SuccessfulPayment | <optional> | Optional. Message is a service message about a successful payment, information about the payment. More about payments » |
user_shared | UserShared | <optional> | Optional. Service message: a user was shared with the bot |
chat_shared | ChatShared | <optional> | Optional. Service message: a chat was shared with the bot |
connected_website | string | <optional> | Optional. The domain name of the website on which the user has logged in. More about Telegram Login » |
passport_data | PassportData | <optional> | Optional. Telegram Passport data |
proximity_alert_triggered | ProximityAlertTriggered | <optional> | Optional. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location. |
forum_topic_created | ForumTopicCreated | <optional> | Optional. Service message: forum topic created |
forum_topic_closed | ForumTopicClosed | <optional> | Optional. Service message: forum topic closed |
forum_topic_reopened | ForumTopicReopened | <optional> | Optional. Service message: forum topic reopened |
write_access_allowed | WriteAccessAllowed | <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_unhidden | GeneralForumTopicUnhidden | <optional> | Optional. Service message: the 'General' forum topic unhidden |
general_forum_topic_hidden | GeneralForumTopicHidden | <optional> | Optional. Service message: the 'General' forum topic hidden |
forum_topic_edited | ForumTopicEdited | <optional> | Optional. Service message: forum topic edited |
video_chat_scheduled | VideoChatScheduled | <optional> | Optional. Service message: video chat scheduled |
video_chat_started | VideoChatStarted | <optional> | Optional. Service message: video chat started |
video_chat_ended | VideoChatEnded | <optional> | Optional. Service message: video chat ended |
video_chat_participants_invited | VideoChatParticipantsInvited | <optional> | Optional. Service message: new participants invited to a video chat |
web_app_data | WebAppData | <optional> | Optional. Service message: data sent by a Web App |
reply_markup | InlineKeyboardMarkup | <optional> | Optional. Inline keyboard attached to the message. |
- Source
MessageAutoDeleteTimerChanged
This object represents a service message about a change in auto-delete timer settings.
- object
Name | Type | Description |
---|---|---|
message_auto_delete_time | number | New auto-delete time for messages in the chat; in seconds |
- Source
MessageEntity
This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
- object
Name | Type | Attributes | Description |
---|---|---|---|
type | 'mention' | | Type of the entity. Currently, can be “mention” ( | |
offset | number | Offset in UTF-16 code units to the start of the entity | |
length | number | Length of the entity in UTF-16 code units | |
url | string | <optional> | Optional. For “text_link” only, URL that will be opened after user taps on the text |
user | User | <optional> | Optional. For “text_mention” only, the mentioned user |
language | string | <optional> | Optional. For “pre” only, the programming language of the entity text |
custom_emoji_id | string | <optional> | Optional. For “custom_emoji” only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker |
- Source
MessageEntityType
- 'mention' |
'hashtag' | 'cashtag' | 'bot_command' | 'url' | 'email' | 'phone_number' | 'bold' | 'italic' | 'underline' | 'strikethrough' | 'spoiler' | 'code' | 'pre' | 'text_link' | 'text_mention' | 'custom_emoji'
- Source
MessageId
This object represents a unique message identifier.
- object
Name | Type | Description |
---|---|---|
message_id | number | Unique message identifier |
- Source
Middleware
- MiddlewareFn |
object
- Source
MiddlewareFn()
- Source
OrderInfo
This object represents information about an order.
- object
Name | Type | Attributes | Description |
---|---|---|---|
name | string | <optional> | Optional. User name |
phone_number | string | <optional> | Optional. User's phone number |
email | string | <optional> | Optional. User email |
shipping_address | ShippingAddress | <optional> | Optional. User shipping address |
- Source
ParseMode
- 'Markdown' |
'MarkdownV2' | 'HTML'
- Source
PassportData
Describes Telegram Passport data shared with the bot by the user.
- object
Name | Type | Description |
---|---|---|
data | Array.<EncryptedPassportElement> | Array with information about documents and other Telegram Passport elements that was shared with the bot |
credentials | EncryptedCredentials | Encrypted credentials required to decrypt the data |
- Source
PassportElementError
This object represents an error in the Telegram Passport element which was submitted that should be resolved by the user. It should be one of:
PassportElementErrorReverseSide
PassportElementErrorTranslationFile
- Source
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.
- object
Name | Type | Description |
---|---|---|
source | 'data' | Error source, must be data |
type | 'personal_details' | | 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_name | string | Name of the data field which has the error |
data_hash | string | Base64-encoded data hash |
message | string | Error message |
- Source
PassportElementErrorFile
Represents an issue with a document scan. The error is considered resolved when the file with the document scan changes.
- object
Name | Type | Description |
---|---|---|
source | 'file' | Error source, must be file |
type | 'utility_bill' | | 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_hash | string | Base64-encoded file hash |
message | string | Error message |
- Source
PassportElementErrorFiles
Represents an issue with a list of scans. The error is considered resolved when the list of files containing the scans changes.
- object
Name | Type | Description |
---|---|---|
source | 'files' | Error source, must be files |
type | 'utility_bill' | | 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_hashes | Array.<string> | List of base64-encoded file hashes |
message | string | Error message |
- Source
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.
- object
Name | Type | Description |
---|---|---|
source | 'front_side' | Error source, must be front_side |
type | 'passport' | | The section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport” |
file_hash | string | Base64-encoded hash of the file with the front side of the document |
message | string | Error message |
- Source
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.
- object
Name | Type | Description |
---|---|---|
source | 'reverse_side' | Error source, must be reverse_side |
type | 'driver_license' | | The section of the user's Telegram Passport which has the issue, one of “driver_license”, “identity_card” |
file_hash | string | Base64-encoded hash of the file with the reverse side of the document |
message | string | Error message |
- Source
PassportElementErrorSelfie
Represents an issue with the selfie with a document. The error is considered resolved when the file with the selfie changes.
- object
Name | Type | Description |
---|---|---|
source | 'selfie' | Error source, must be selfie |
type | 'passport' | | The section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport” |
file_hash | string | Base64-encoded hash of the file with the selfie |
message | string | Error message |
- Source
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.
- object
Name | Type | Description |
---|---|---|
source | 'translation_file' | Error source, must be translation_file |
type | 'passport' | | 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_hash | string | Base64-encoded file hash |
message | string | Error message |
- Source
PassportElementErrorTranslationFiles
Represents an issue with the translated version of a document. The error is considered resolved when a file with the document translation change.
- object
Name | Type | Description |
---|---|---|
source | 'translation_files' | Error source, must be translation_files |
type | 'passport' | | 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_hashes | Array.<string> | List of base64-encoded file hashes |
message | string | Error message |
- Source
PassportElementErrorUnspecified
Represents an issue in an unspecified place. The error is considered resolved when new data is added.
- object
Name | Type | Description |
---|---|---|
source | 'unspecified' | Error source, must be unspecified |
type | string | Type of element of the user's Telegram Passport which has the issue |
element_hash | string | Base64-encoded element hash |
message | string | Error message |
- Source
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.
- object
Name | Type | Description |
---|---|---|
file_id | string | Identifier for this file, which can be used to download or reuse the file |
file_unique_id | string | Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. |
file_size | number | File size in bytes |
file_date | number | Unix time when the file was uploaded |
- Source
PhotoSize
- object
Name | Type | Attributes | Description |
---|---|---|---|
file_id | string | Identifier for this file, which can be used to download or reuse the file | |
file_unique_id | string | Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. | |
width | number | Photo width | |
height | number | Photo height | |
file_size | number | <optional> | Optional. File size in bytes |
- Source
Poll
This object contains information about a poll.
- object
Name | Type | Attributes | Description |
---|---|---|---|
id | string | Unique poll identifier | |
question | string | Poll question, 1-300 characters | |
options | Array.<PollOption> | List of poll options | |
total_voter_count | number | Total number of users that voted in the poll | |
is_closed | boolean | True, if the poll is closed | |
is_anonymous | boolean | True, if the poll is anonymous | |
type | 'regular' | | Poll type, currently can be “regular” or “quiz” | |
allows_multiple_answers | boolean | True, if the poll allows multiple answers | |
correct_option_id | number | <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. |
explanation | string | <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_entities | Array.<MessageEntity> | <optional> | Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation |
open_period | number | <optional> | Optional. Amount of time in seconds the poll will be active after creation |
close_date | number | <optional> | Optional. Point in time (Unix timestamp) when the poll will be automatically closed |
- Source
PollAnswer
This object represents an answer of a user in a non-anonymous poll.
- object
Name | Type | Attributes | Description |
---|---|---|---|
poll_id | string | Unique poll identifier | |
voter_chat | Chat | <optional> | Optional. The chat that changed the answer to the poll, if the voter is anonymous |
user | User | <optional> | Optional. The user that changed the answer to the poll, if the voter isn't anonymous |
option_ids | Array.<number> | 0-based identifiers of chosen answer options. May be empty if the vote was retracted. |
- Source
PollOption
This object contains information about one answer option in a poll.
- object
Name | Type | Description |
---|---|---|
text | string | Option text, 1-100 characters |
voter_count | number | Number of users that voted for this option |
- Source
PreCheckoutQuery
This object contains information about an incoming pre-checkout query.
- object
Name | Type | Attributes | Description |
---|---|---|---|
id | string | Unique query identifier | |
from | User | User who sent the query | |
currency | string | Three-letter ISO 4217 currency code | |
total_amount | number | Total price in the smallest units of the currency (integer, not float/double). For example, for a price of | |
invoice_payload | string | Bot specified invoice payload | |
shipping_option_id | string | <optional> | Optional. Identifier of the shipping option chosen by the user |
order_info | OrderInfo | <optional> | Optional. Order information provided by the user |
- Source
PredicateFn(context) → {boolean|Promise.<boolean>}
Name | Type | Description |
---|---|---|
context | OpengramContext | Update context |
- Source
- 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.
- object
Name | Type | Description |
---|---|---|
traveler | User | User that triggered the alert |
watcher | User | User that set the alert |
distance | number | The distance between the users |
- Source
ReplyKeyboardMarkup
This object represents a custom keyboard with reply options (see Introduction to bots for details and examples).
- object
Name | Type | Attributes | Description |
---|---|---|---|
keyboard | Array.<Array.<KeyboardButton>> | Array of button rows, each represented by an Array of KeyboardButton objects | |
resize_keyboard | boolean | <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_persistent | boolean | <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_keyboard | boolean | <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_placeholder | string | <optional> | Optional. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters |
selective | boolean | <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. |
- Source
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) .
- object
Name | Type | Attributes | Description |
---|---|---|---|
remove_keyboard | boolean | Requests clients to remove the custom keyboard (user will not be able to summon this keyboard; if you want to hide the keyboard from sight but keep it accessible, use one_time_keyboard in ReplyKeyboardMarkup) | |
selective | boolean | <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. |
- Source
ResponseParameters
Describes why a request was unsuccessful.
- object
Name | Type | Attributes | Description |
---|---|---|---|
migrate_to_chat_id | number | <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_after | number | <optional> | Optional. In case of exceeding flood control, the number of seconds left to wait before the request can be repeated |
- Source
SentWebAppMessage
Describes an inline message sent by a Web App on behalf of a user.
- object
Name | Type | Attributes | Description |
---|---|---|---|
inline_message_id | string | <optional> | Optional. Identifier of the sent inline message. Available only if there is an inline keyboard attached to the message. |
- Source
ShippingAddress
This object represents a shipping address.
- object
Name | Type | Description |
---|---|---|
country_code | string | Two-letter ISO 3166-1 alpha-2 country code |
state | string | State, if applicable |
city | string | City |
street_line1 | string | First line for the address |
street_line2 | string | Second line for the address |
post_code | string | Address post code |
- Source
ShippingOption
This object represents one shipping option.
- object
Name | Type | Description |
---|---|---|
id | string | Shipping option identifier |
title | string | Option title |
prices | Array.<LabeledPrice> | List of price portions |
- Source
ShippingQuery
This object contains information about an incoming shipping query.
- object
Name | Type | Description |
---|---|---|
id | string | Unique query identifier |
from | User | User who sent the query |
invoice_payload | string | Bot specified invoice payload |
shipping_address | ShippingAddress | User specified shipping address |
- Source
Sticker
This object represents a sticker.
- object
Name | Type | Attributes | Description |
---|---|---|---|
file_id | string | Identifier for this file, which can be used to download or reuse the file | |
file_unique_id | string | 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' | | Type of the sticker, currently one of “regular”, “mask”, “custom_emoji”. The type of the sticker is independent from its format, which is determined by the fields is_animated and is_video. | |
width | number | Sticker width | |
height | number | Sticker height | |
is_animated | boolean | True, if the sticker is animated | |
is_video | boolean | True, if the sticker is a video sticker | |
thumbnail | PhotoSize | <optional> | Optional. Sticker thumbnail in the .WEBP or .JPG format |
emoji | string | <optional> | Optional. Emoji associated with the sticker |
set_name | string | <optional> | Optional. Name of the sticker set to which the sticker belongs |
premium_animation | File | <optional> | Optional. For premium regular stickers, premium animation for the sticker |
mask_position | MaskPosition | <optional> | Optional. For mask stickers, the position where the mask should be placed |
custom_emoji_id | string | <optional> | Optional. For custom emoji stickers, unique identifier of the custom emoji |
file_size | number | <optional> | Optional. File size in bytes |
needs_repainting | true | <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 |
- Source
StickerSet
This object represents a sticker set.
- object
Name | Type | Attributes | Description |
---|---|---|---|
name | string | Sticker set name | |
title | string | Sticker set title | |
sticker_type | 'regular' | | Type of stickers in the set, currently one of “regular”, “mask”, “custom_emoji” | |
is_animated | boolean | True, if the sticker set contains animated stickers | |
is_video | boolean | True, if the sticker set contains video stickers | |
stickers | Array.<Sticker> | List of all set stickers | |
thumbnail | PhotoSize | <optional> | Optional. Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format |
- Source
Story
This object represents a message about a forwarded story in the chat. Currently holds no information.
- *
- Source
SuccessfulPayment
This object contains basic information about a successful payment.
- object
Name | Type | Attributes | Description |
---|---|---|---|
currency | string | Three-letter ISO 4217 currency code | |
total_amount | number | Total price in the smallest units of the currency (integer, not float/double). For example, for a price of | |
invoice_payload | string | Bot specified invoice payload | |
shipping_option_id | string | <optional> | Optional. Identifier of the shipping option chosen by the user |
order_info | OrderInfo | <optional> | Optional. Order information provided by the user |
telegram_payment_charge_id | string | Telegram payment identifier | |
provider_payment_charge_id | string | Provider payment identifier |
- Source
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.
- object
Name | Type | Attributes | Description |
---|---|---|---|
query | string | <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_chats | boolean | <optional> | Optional. True, if private chats with users can be chosen |
allow_bot_chats | boolean | <optional> | Optional. True, if private chats with bots can be chosen |
allow_group_chats | boolean | <optional> | Optional. True, if group and supergroup chats can be chosen |
allow_channel_chats | boolean | <optional> | Optional. True, if channel chats can be chosen |
- Source
TelegramOptions
- object
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
username | string | <optional> | Bot username, used if you don't call | |
attachmentAgent | http. | <optional> | HTTP Agent used for attachments | |
agent | http. | <optional> | HTTP agent used for API calls. By default, it have this configuration: | |
apiRoot | string | <optional> | API root URL | |
channelMode | boolean | <optional> | false | If |
apiPrefix | string | <optional> | bot | API prefix before bot token, by default |
testEnv | boolean | <optional> | false | Enable / disable test environment for WebApps, see more here |
webhookReply | boolean | <optional> | true | Enable / disable webhook reply |
- Source
Trigger
- RegExp |
string | TriggerPredicateFn
- Source
TriggerPredicateFn(value, context) → {*}
Name | Type | Description |
---|---|---|
value | string | Received value |
context | OpengramContext | Update context |
- Source
- Type:
- *
Update
This object represents an incoming update. At most one of the optional parameters can be present in any given update.
- object
Name | Type | Attributes | Description |
---|---|---|---|
update_id | number | 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. | |
message | Message | <optional> | Optional. New incoming message of any kind - text, photo, sticker, etc. |
edited_message | Message | <optional> | Optional. New version of a message that is known to the bot and was edited |
channel_post | Message | <optional> | Optional. New incoming channel post of any kind - text, photo, sticker, etc. |
edited_channel_post | Message | <optional> | Optional. New version of a channel post that is known to the bot and was edited |
inline_query | InlineQuery | <optional> | Optional. New incoming inline query |
chosen_inline_result | ChosenInlineResult | <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_query | CallbackQuery | <optional> | Optional. New incoming callback query |
shipping_query | ShippingQuery | <optional> | Optional. New incoming shipping query. Only for invoices with flexible price |
pre_checkout_query | PreCheckoutQuery | <optional> | Optional. New incoming pre-checkout query. Contains full information about checkout |
poll | Poll | <optional> | Optional. New poll state. Bots receive only updates about stopped polls and polls, which are sent by the bot |
poll_answer | PollAnswer | <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_member | ChatMemberUpdated | <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_member | ChatMemberUpdated | <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_request | ChatJoinRequest | <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. |
- Source
UpdateSubtype
- "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"
- Source
UpdateType
- "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"
- Source
User
This object represents a Telegram user or bot.
- object
Name | Type | Attributes | Description |
---|---|---|---|
id | number | Unique identifier for this user or bot. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this identifier. | |
is_bot | boolean | True, if this user is a bot | |
first_name | string | User's or bot's first name | |
last_name | string | <optional> | Optional. User's or bot's last name |
username | string | <optional> | Optional. User's or bot's username |
language_code | string | <optional> | Optional. IETF language tag of the user's language |
is_premium | boolean | <optional> | Optional. True, if this user is a Telegram Premium user |
added_to_attachment_menu | boolean | <optional> | Optional. True, if this user added the bot to the attachment menu |
can_join_groups | boolean | <optional> | Optional. True, if the bot can be invited to groups. Returned only in getMe. |
can_read_all_group_messages | boolean | <optional> | Optional. True, if privacy mode is disabled for the bot. Returned only in getMe. |
supports_inline_queries | boolean | <optional> | Optional. True, if the bot supports inline queries. Returned only in getMe. |
- Source
UserProfilePhotos
This object represent a user's profile pictures.
- object
Name | Type | Description |
---|---|---|
total_count | number | Total number of profile pictures the target user has |
photos | Array.<Array.<PhotoSize>> | Requested profile pictures (in up to 4 sizes each) |
- Source
UserShared
This object contains information about the user whose identifier was shared with the bot using a KeyboardButtonRequestUser button.
- object
Name | Type | Description |
---|---|---|
request_id | number | Identifier of the request |
user_id | number | 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. |
- Source
Venue
This object represents a venue.
- object
Name | Type | Attributes | Description |
---|---|---|---|
location | Location | Venue location. Can't be a live location | |
title | string | Name of the venue | |
address | string | Address of the venue | |
foursquare_id | string | <optional> | Optional. Foursquare identifier of the venue |
foursquare_type | string | <optional> | Optional. Foursquare type of the venue. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.) |
google_place_id | string | <optional> | Optional. Google Places identifier of the venue |
google_place_type | string | <optional> | Optional. Google Places type of the venue. (See supported types.) |
- Source
Video
This object represents a video file.
- object
Name | Type | Attributes | Description |
---|---|---|---|
file_id | string | Identifier for this file, which can be used to download or reuse the file | |
file_unique_id | string | Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. | |
width | number | Video width as defined by sender | |
height | number | Video height as defined by sender | |
duration | number | Duration of the video in seconds as defined by sender | |
thumbnail | PhotoSize | <optional> | Optional. Video thumbnail |
file_name | string | <optional> | Optional. Original filename as defined by sender |
mime_type | string | <optional> | Optional. MIME type of the file as defined by sender |
file_size | number | <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. |
- Source
VideoChatEnded
This object represents a service message about a video chat ended in the chat.
- object
Name | Type | Description |
---|---|---|
duration | number | Video chat duration in seconds |
- Source
VideoChatParticipantsInvited
This object represents a service message about new members invited to a video chat.
- object
Name | Type | Description |
---|---|---|
users | Array.<User> | New members that were invited to the video chat |
- Source
VideoChatScheduled
This object represents a service message about a video chat scheduled in the chat.
- object
Name | Type | Description |
---|---|---|
start_date | number | Point in time (Unix timestamp) when the video chat is supposed to be started by a chat administrator |
- Source
VideoChatStarted
This object represents a service message about a video chat started in the chat. Currently holds no information.
- *
- Source
VideoNote
This object represents a video message
(available in Telegram apps as of v.4.0) .
- object
Name | Type | Attributes | Description |
---|---|---|---|
file_id | string | Identifier for this file, which can be used to download or reuse the file | |
file_unique_id | string | Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. | |
length | number | Video width and height (diameter of the video message) as defined by sender | |
duration | number | Duration of the video in seconds as defined by sender | |
thumbnail | PhotoSize | <optional> | Optional. Video thumbnail |
file_size | number | <optional> | Optional. File size in bytes |
- Source
Voice
This object represents a voice note.
- object
Name | Type | Attributes | Description |
---|---|---|---|
file_id | string | Identifier for this file, which can be used to download or reuse the file | |
file_unique_id | string | Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. | |
duration | number | Duration of the audio in seconds as defined by sender | |
mime_type | string | <optional> | Optional. MIME type of the file as defined by sender |
file_size | number | <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. |
- Source
WebAppData
Describes data sent from a Web App to the bot.
- object
Name | Type | Description |
---|---|---|
data | string | The data. Be aware that a bad client can send arbitrary data in this field. |
button_text | string | 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. |
- Source
WebAppInfo
Describes a Web App .
- object
Name | Type | Description |
---|---|---|
url | string | An HTTPS URL of a Web App to be opened with additional data as specified in Initializing WebApps |
- Source
WebhookInfo
Describes the current status of a webhook.
- object
Name | Type | Attributes | Description |
---|---|---|---|
url | string | Webhook URL, may be empty if webhook is not set up | |
has_custom_certificate | boolean | True, if a custom certificate was provided for webhook certificate checks | |
pending_update_count | number | Number of updates awaiting delivery | |
ip_address | string | <optional> | Optional. Currently used webhook IP address |
last_error_date | number | <optional> | Optional. Unix time for the most recent error that happened when trying to deliver an update via webhook |
last_error_message | string | <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_date | number | <optional> | Optional. Unix time of the most recent error that happened when trying to synchronize available updates with Telegram datacenters |
max_connections | number | <optional> | Optional. The maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery |
allowed_updates | Array.<string> | <optional> | Optional. A list of update types the bot is subscribed to. Defaults to all update types except chat_member |
- Source
WebhookResponse
- object
Name | Type | Description |
---|---|---|
webhook | true | Always |
details | 'https://core. | Link to telegram docs |
- Source
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
- object
Name | Type | Attributes | Description |
---|---|---|---|
from_request | boolean | <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_name | string | <optional> | Optional. Name of the Web App, if the access was granted when the Web App was launched from a link |
from_attachment_menu | boolean | <optional> | Optional. True, if the access was granted when the bot was added to the attachment or side menu |
- Source