The maximum amount of time in seconds that the result of the callback query may be cached client-side. Telegram apps will support caching starting in version 3.14. Defaults to 0.
If true, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to false.
Text of the notification. If not specified, nothing will be shown to the user, 0-200 characters
URL that will be opened by the user's client. If you have created a Game and accepted the conditions via @Botfather
, specify the URL that opens your game – note that this will only work if the query comes from a callback_game button.
Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter.
The maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300.
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
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.
Deep-linking parameter for the /start message sent to the bot when user presses the switch button. 1-64 characters, only A-Z, a-z, 0-9, _ and - are allowed.
Example: An inline bot that sends YouTube videos can ask the user to connect the bot to their YouTube account to adapt search results accordingly. To do this, it displays a ‘Connect your YouTube account’ button above the results, or even before showing any. The user presses the button, switches to a private chat with the bot and, in doing so, passes a start parameter that instructs the bot to return an oauth link. Once done, the bot can offer a switchInline button so that the user can easily return to the chat where they wanted to use the bot's inline capabilities.
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 switchPmParameter
Required if ok is False. Error message in human readable form that explains the reason for failure to proceed with the checkout (e.g. "Sorry, somebody just bought the last of our amazing black T-shirts while you were busy filling out your payment details. Please choose a different color or garment!"). Telegram will display this message to the user.
A placeholder, currently holds no information. Use BotFather to set up your game.
Describes actions that a non-administrator user is allowed to take in a chat.
Optional. True, if the user is allowed to add web page previews to their messages, implies can_send_media_messages
Optional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups
Optional. True, if the user is allowed to invite new users to the chat
Optional. True, if the user is allowed to pin messages. Ignored in public supergroups
Optional. True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages
Optional. True, if the user is allowed to send text messages, contacts, locations and venues
Optional. True, if the user is allowed to send animations, games, stickers and use inline bots, implies can_send_media_messages
Optional. True, if the user is allowed to send polls, implies can_send_messages
Pass True, if a set of mask stickers should be created
A JSON-serialized object for position where the mask should be placed on faces
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.
Shows reply interface to the user, as if they manually selected the bot‘s message and tapped ’Reply'
Optional. Use this parameter if you want to force reply from specific users only. Targets:
@mentioned
in the text of the Message object;Sends the message silently. Users will receive a notification with no sound.
List the types of updates you want your bot to receive. For example, specify [“message”, “edited_channel_post”, “callback_query”] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all updates regardless of type (default). If not specified, the previous setting will be used.
Please note that this parameter doesn't affect updates created before the call to the getUpdates, so unwanted updates may be received for a short period of time.
Limits the number of updates to be retrieved. Values between 1—100 are accepted. Defaults to 100.
Identifier of the first update to be returned. Must be greater by one than the highest among the identifiers of previously received updates. By default, updates starting with the earliest unconfirmed update are returned. An update is considered confirmed as soon as getUpdates is called with an offset higher than its updateId. The negative offset can be specified to retrieve updates starting from -offset update from the end of the updates queue. All previous updates will forgotten.
Timeout in seconds for long polling. Defaults to 0, i.e. usual short polling. Should be positive, short polling should be used for testing purposes only.
Limits the number of photos to be retrieved. Values between 1—100 are accepted. Defaults to 100.
Sequential number of the first photo to be returned. By default, all photos are returned.
This object represents one button of an inline keyboard. You must use exactly one of the optional fields.
Optional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes
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.
Optional. An HTTP URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget.
Optional. Specify True, to send a Pay button.
NOTE: This type of button must always be the first button in the first row.
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. Can be empty, in which case just the bot’s username will be inserted.
Note: This offers an easy way for users to start using your bot in inline mode when they are currently in a private chat with it. Especially useful when combined with switchPm… actions – in this case the user will be automatically returned to the chat they switched from, skipping the chat selection screen.
Optional. If set, pressing the button will insert the bot‘s username and the specified inline query in the current chat's input field. Can 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.
Label text on the button
Optional. HTTP or tg:// url to be opened when button is pressed
This object represents an inline keyboard that appears right next to the message it belongs to.
Array of button rows, each represented by an Array of InlineKeyboardButton objects
Optional. Caption of the photo to be sent, 0-1024 characters
File to send. Pass a fileId to send a file that exists on the Telegram servers (recommended) or pass an HTTP URL for Telegram to get a file from the Internet. Upload file is not supported yet.
Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
Type of the result, must be photo
Optional. Caption of the video to be sent, 0-1024 characters
Optional. Video duration
Optional. Video height
File to send. Pass a fileId to send a file that exists on the Telegram servers (recommended) or pass an HTTP URL for Telegram to get a file from the Internet. Upload file is not supported yet.
Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
Optional. Pass True, if the uploaded video is suitable for streaming
Thumb is not supported yet.
Type of the result, must be video
Optional. Video width
This object represents one button of the reply keyboard. For simple text buttons String can be used instead of this object to specify text of the button. Optional fields are mutually exclusive.
Optional. If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only
Optional. If True, the user's current location will be sent when the button is pressed. Available in private chats only
Text of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed
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
This object represents a point on the map.
Latitude as defined by sender
Longitude as defined by sender
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:
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.
Optional. New text of the button in forwarded messages.
Optional. Pass True to request the permission for your bot to send messages to the user.
An HTTP 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.
Pass True, if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels.
True, if the poll allows multiple answers
Optional. Point in time (Unix timestamp) when the poll will be automatically closed
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.
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
Optional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation
Unique poll identifier
True, if the poll is anonymous
True, if the poll is closed
Optional. Amount of time in seconds the poll will be active after creation
List of poll options
Poll question, 1-255 characters
Total number of users that voted in the poll
Poll type, currently can be “regular” or “quiz”
This object represents an answer of a user in a non-anonymous poll.
0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote.
Unique poll identifier
The user, who changed the answer to the poll
Pass True, if the administrator can change chat title, photo and other settings
Pass True, if the administrator can delete messages of other users
Pass True, if the administrator can edit messages of other users and can pin messages, channels only
Pass True, if the administrator can invite new users to the chat
Pass True, if the administrator can pin messages, supergroups only
Pass True, if the administrator can create channel posts, channels only
Pass True, if the administrator can add new administrators with a subset of his own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him)
Pass True, if the administrator can restrict, ban or unban chat members
This object represents a custom keyboard with reply options.
Array of button rows, each represented by an Array of KeyboardButton objects
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.
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.
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 replyToMessageId), 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.
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).
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 oneTimeKeyboard in ReplyKeyboardMarkup)
Optional. Use this parameter if you want to remove the keyboard for specific users only. Targets:
@mentioned
in the text of the Message objectExample: 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.
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
Animation caption (may also be used when resending animation by fileId), 0-1024 characters
Sends the message silently. Users will receive a notification with no sound.
Duration of sent animation in seconds
Animation height
Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
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.
If the message is a reply, ID of the original message
Thumb is not supported yet.
Animation width
Audio caption, 0-1024 characters
Sends the message silently. Users will receive a notification with no sound.
Duration of the audio in seconds
Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
Performer
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.
If the message is a reply, ID of the original message
Thumb is not supported yet.
Track name
Sends the message silently. Users will receive a notification with no sound.
Contact's last name
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.
If the message is a reply, ID of the original message
Additional data about the contact in the form of a vCard, 0-2048 bytes
Contact's first name
Contact's phone number
Document caption (may also be used when resending documents by fileId), 0-1024 characters
Sends the message silently. Users will receive a notification with no sound.
Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
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.
If the message is a reply, ID of the original message
Thumb is not supported yet.
Sends the message silently. Users will receive a notification with no sound.
A JSON-serialized object for an inline keyboard. If empty, one ‘Play game_title’ button will be shown. If not empty, the first button must launch the game.
If the message is a reply, ID of the original message
Sends the message silently. Users will receive a notification with no sound.
Pass True, if the final price depends on the shipping method
Pass True, if you require the user's email address to complete the order
Pass True, if you require the user's full name to complete the order
Pass True, if you require the user's phone number to complete the order
Pass True, if you require the user's shipping address to complete the order
Photo height
Photo size
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 width
JSON-encoded 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.
A JSON-serialized object for an inline keyboard. If empty, one 'Pay total price' button will be shown. If not empty, the first button must be a Pay button.
If the message is a reply, ID of the original message
Pass True, if user's email address should be sent to provider
Pass True, if user's phone number should be sent to provider
Sends the message silently. Users will receive a notification with no sound.
Period in seconds for which the location will be updated (see Live Locations, should be between 60 and 86400.
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.
If the message is a reply, ID of the original message
Sends the message silently. Users will receive a notification with no sound.
If the message is a reply, ID of the original message
Sends the message silently. Users will receive a notification with no sound.
Disables link previews for links in this message
Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message.
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.
If the message is a reply, ID of the original message
Photo caption (may also be used when resending photos by fileId), 0-1024 characters
Sends the message silently. Users will receive a notification with no sound.
Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
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.
If the message is a reply, ID of the original message
True, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to False
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.
0-based identifier of the correct answer option, required for polls in quiz mode
Sends the message silently. Users will receive a notification with no sound.
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
Mode for parsing entities in the explanation. See formatting options for more details.
True, if the poll needs to be anonymous, defaults to True
Pass True, if the poll needs to be immediately closed. This can be useful for poll preview.
Amount of time in seconds the poll will be active after creation, 5-600. Can't be used together with close_date.
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.
If the message is a reply, ID of the original message
Poll type, “quiz” or “regular”, defaults to “regular”
Sends the message silently. Users will receive a notification with no sound.
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.
If the message is a reply, ID of the original message
Sends the message silently. Users will receive a notification with no sound.
Foursquare identifier of the venue
Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
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.
If the message is a reply, ID of the original message
Sends the message silently. Users will receive a notification with no sound.
Duration of sent video in seconds
Video width and height, i.e. diameter of the video message
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.
If the message is a reply, ID of the original message
Thumb is not supported yet.
Video caption (may also be used when resending videos by fileId), 0-1024 characters
Sends the message silently. Users will receive a notification with no sound.
Duration of sent video in seconds
Video height
Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
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.
If the message is a reply, ID of the original message
Pass True, if the uploaded video is suitable for streaming
Thumb is not supported yet.
Video width
Voice message caption, 0-1024 characters
Sends the message silently. Users will receive a notification with no sound.
Duration of the voice message in seconds
Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.
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.
If the message is a reply, ID of the original message
List the types of updates you want your bot to receive. For example, specify [“message”, “edited_channel_post”, “callback_query”] to only receive updates of these types. See Update for a complete list of available update types. Specify an empty list to receive all updates regardless of type (default). If not specified, the previous setting will be used.
Please note that this parameter doesn't affect updates created before the call to the setWebhook, so unwanted updates may be received for a short period of time.
not supported yet.
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.
A JSON-serialized object for an inline keyboard.
This object represents a Telegram user or bot.
Optional. True, if the bot can be invited to groups. Returned only in getMe.
Optional. True, if privacy mode is disabled for the bot. Returned only in getMe.
User‘s or bot’s first name
Unique identifier for this user or bot
True, if this user is a bot
Optional. (IETF language tag)[https://en.wikipedia.org/wiki/IETF_language_tag] of the user's language
Optional. User‘s or bot’s last name
Optional. True, if the bot supports inline queries. Returned only in getMe.
Optional. User‘s or bot’s username
This object represents a venue.
Address of the venue
Optional. Foursquare identifier of the venue
Optional. Foursquare type of the venue. (For example, "arts_entertainment/default", "arts_entertainment/aquarium" or "food/icecream".)
Latitude of the venue
Longitude of the venue
Name of the venue
Contains information about the current status of a webhook.
Optional. A list of update types the bot is subscribed to. Defaults to all update types
True, if a custom certificate was provided for webhook certificate checks
Optional. Unix time for the most recent error that happened when trying to deliver an update via webhook
Optional. Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook
Optional. Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery
Number of updates awaiting delivery
Webhook URL, may be empty if webhook is not set up
Generated using TypeDoc
A JSON-serialized object for position where the mask should be placed on faces