From de08a75a2b4698caf5d8af6533f4bf00443d7476 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Sat, 13 Nov 2021 10:21:26 +0000 Subject: [PATCH] Update content of files --- data/core.telegram.org/bots/2-0-intro.html | 230 - .../core.telegram.org/bots/api-changelog.html | 641 -- data/core.telegram.org/bots/api.html | 9293 ----------------- .../constructor/inputStickerSetID.html | 152 - .../constructor/messages.dhConfig | 162 - .../constructor/recentMeUrlChatInvite.html | 152 - .../constructor/topPeerCategoryChannels.html | 132 - .../constructor/updateStickerSetsOrder.html | 157 - .../method/payments.clearSavedInfo | 160 - data/core.telegram.org/mtproto/auth_key.html | 262 - .../constructor/pageBlockChannel.html | 147 - data/telegram.org/blog/android-wear-2-0.html | 224 - data/telegram.org/blog/autoplay.html | 245 - data/telegram.org/blog/bots-2-0.html | 260 - .../telegram-me-change-number-and-pfs.html | 228 - data/telegram.org/blog/voice-2-secret-3.html | 245 - 16 files changed, 12690 deletions(-) delete mode 100644 data/core.telegram.org/bots/2-0-intro.html delete mode 100644 data/core.telegram.org/bots/api-changelog.html delete mode 100644 data/core.telegram.org/bots/api.html delete mode 100644 data/core.telegram.org/constructor/inputStickerSetID.html delete mode 100644 data/core.telegram.org/constructor/messages.dhConfig delete mode 100644 data/core.telegram.org/constructor/recentMeUrlChatInvite.html delete mode 100644 data/core.telegram.org/constructor/topPeerCategoryChannels.html delete mode 100644 data/core.telegram.org/constructor/updateStickerSetsOrder.html delete mode 100644 data/core.telegram.org/method/payments.clearSavedInfo delete mode 100644 data/core.telegram.org/mtproto/auth_key.html delete mode 100644 data/corefork.telegram.org/constructor/pageBlockChannel.html delete mode 100644 data/telegram.org/blog/android-wear-2-0.html delete mode 100644 data/telegram.org/blog/autoplay.html delete mode 100644 data/telegram.org/blog/bots-2-0.html delete mode 100644 data/telegram.org/blog/telegram-me-change-number-and-pfs.html delete mode 100644 data/telegram.org/blog/voice-2-secret-3.html diff --git a/data/core.telegram.org/bots/2-0-intro.html b/data/core.telegram.org/bots/2-0-intro.html deleted file mode 100644 index 76a98e5867..0000000000 --- a/data/core.telegram.org/bots/2-0-intro.html +++ /dev/null @@ -1,230 +0,0 @@ - - - - - Introducing Bot API 2.0 - - - - - - - - - - - - - -
- -
-
-
-
-

Introducing Bot API 2.0

- -
- -
-

Howdy! This text assumes that you‘re familiar with Telegram’s bot platform.
If this is not the case, kindly check out our Introduction to Bots.

-
-

Today we‘re introducing the biggest change to Telegram’s Bot Platform since June 2015. These new tools will help you create fluid and intuitive interfaces for your bots. And bots are becoming a lot more capable. They can now send any type of content supported on Telegram, provide location-based services and integrate with other services deeply based on users' phone numbers.

-

If you'd like a more concise changelog, you can find one in the Bot API Manual.

-

New Inline Keyboards

-

To begin with, we're adding a new type of keyboard that is integrated directly into the message it belongs to. Inline keyboards are available for messages sent both in chat mode and inline mode.

-
- - - -

- - - -
- -

Unlike with custom reply keyboards, pressing buttons on inline keyboards doesn't result in messages sent to the chat. Instead, inline keyboards support buttons that work behind the scenes: callback buttons, URL buttons and switch to inline buttons.

-
-

Manual: Inline keyboards »

-
-

Callback buttons

-

When a user presses a callback button, no messages are sent to the chat. Instead, your bot simply receives the relevant query. Upon receiving the query, your bot can display some result in a notification at the top of the chat screen or in an alert.

-
-

-
- -

Sample bot
@music – This sample music bot uses inline callback buttons to flip pages and reload random results.

-

Read on to updating messages to find out how callback buttons can get even cooler.

-

URL buttons

-

Buttons of this type have a small arrow icon to help the user understand that tapping on a URL button will open an external link. Naturally, we'll show them a confirmation alert before opening the link in the browser.

-
-
-
- -

Switch to Inline buttons

-

Pressing a switch to inline button prompts the user to select a chat, opens it and inserts the bot's username into the input field. You can also pass a query that will be inserted along with the username – this way your users will immediately get some inline results they can share.

-
-

-
- -

Sample bot
@sticker – This sticker search bot offers a ‘switch to inline’ button to teach users how to use it in inline mode.

-

Updating Messages

-

Since inline keyboards don‘t send additional messages to the chat, it made sense to give bots a way of manipulating their existing messages, so that they don’t have to send a new message each time they need to update something. This helps reduce clutter and build more fluid interfaces.

-
-
- -
-
- -

Sample bot
@music – Watch how the music bot updates its messages with search results when you press the navigation buttons.

-
-

Manual: Updating messages »

-
-

Locations and Numbers

-

Some bots need extra data from the user to work properly. For example, knowing the user‘s location helps provide more relevant geo-specific results. The user’s phone number can be very useful for integrations with other services, like banks, etc.

-

We've added an easy way for bots to ask the user for their location and phone number using special buttons. Note that both phone number and location request buttons will only work in private chats.

-
-

-
- -

When these buttons are pressed, Telegram clients will display a confirmation alert that tells the user what's about to happen.

-
-

Manual: Number and location buttons »

-
-

Inline bots can also request location data from their users. Use the /setinlinegeo command with @BotFather to enable this. Your bot will ask the user for permission to access their location whenever they send an inline request.

-

Sample bot
@foursquare – This bot will ask for permission to access the user's location, then provide geo-targeted results.

-

Inline Bots 2.0

-

Speaking of inline bots, they are also getting a major upgrade today.

-

New types of content

-

Inline bots now support all types of content available in Telegram (19 in all), they are now capable of sending stickers, videos, music, locations, documents and more.

-
-

-
- -

Sample bots
@sticker – This sticker bot will accept one or more emoji and search for relevant stickers.
@music – The music bot allows users to send mp3 tracks from a database of public domain classical music.

-
-

Manual: Types of inline content »

-
-

Switching between inline mode and private chat

-

Some inline bots can benefit from an initial setup process, like connecting them to an account on an external service (e.g., YouTube). We've added an easy way of switching between the private chat with a bot and whatever chat the user wants to share inline results in.

-
-

-
- -

You can now display a special ‘Switch to PM’ button above the inline results (or instead of them). This button will open a private chat with the bot and pass a parameter of your choosing, so that you can prompt the user for the relevant setup actions. Once done, you can use an inline keyboard with a switch_inline_query button to send the user back to the original chat.

-

Sample bots
@youtube – Shows a ‘Sign in to YouTube’ button, then suggests personalized results.

-
-

Manual: Switch to PM

-
-

Better inline UI

-

Since sending content via inline bots works differently from sending ordinary messages, we‘ve changed the interface a little. There’s hardly a more effective way of explaining that there‘s no need to hit ’Send':

-
-

-
- -

Tapping on the cross icon once will clear the query, tapping twice will give the ‘Send’ button back to the user.

-

Group Admins

-

As a dessert, we‘re beginning to roll out tools that will allow you to create bot solutions for group admins. As the first step, we’ve added methods to remove members from groups and supergroups.

-
-

Manual: Group management »

-
-

And that's about it for now. Stay tuned for more updates and subscribe to our official @Botnews channel on Telegram.

-
-

Read the full changelog for this update »

-
-
- -
- -
-
- -
- - - - - - - - diff --git a/data/core.telegram.org/bots/api-changelog.html b/data/core.telegram.org/bots/api-changelog.html deleted file mode 100644 index f7743e51fb..0000000000 --- a/data/core.telegram.org/bots/api-changelog.html +++ /dev/null @@ -1,641 +0,0 @@ - - - - - Bot API changelog - - - - - - - - - - - - - -
- -
-
-
-
-

Bot API changelog

- -
- -
-

The Bot API is an HTTP-based interface created for developers keen on building bots for Telegram.
To learn how to create and set up a bot, please consult our Introduction to Bots »

-
-

You will find all changes to our Bot API on this page.

-

Recent changes

-
-

Subscribe to @BotNews to be the first to know about the latest updates and join the discussion in @BotTalk

-
-

November 5, 2021

-

Bot API 5.4

- -
-
-

⚠️ WARNING! ⚠️
User identifiers will become bigger than 2^31 - 1 before the end of this year and it will be no longer possible to store them in a signed 32-bit integer type. User identifiers will have up to 52 significant bits, so a 64-bit integer or double-precision float type would still be safe for storing them. Please make sure that your code can correctly handle such user identifiers.

-
-
-

June 25, 2021

-

Bot API 5.3

-

Personalized Commands

-
    -
  • Bots can now show lists of commands tailored to specific situations - including localized commands for users with different languages, as well as different commands based on chat type or for specific chats, and special lists of commands for chat admins.
  • -
  • Added the class BotCommandScope, describing the scope to which bot commands apply.
  • -
  • Added the parameters scope and language_code to the method setMyCommands to allow bots specify different commands for different chats and users.
  • -
  • Added the parameters scope and language_code to the method getMyCommands.
  • -
  • Added the method deleteMyCommands to allow deletion of the bot's commands for the given scope and user language.
  • -
  • Improved visibility of bot commands in Telegram apps with the new 'Menu' button in chats with bots, read more on the blog.
  • -
-

Custom Placeholders

- -

And More

-
    -
  • Improved documentation of the class ChatMember by splitting it into 6 subclasses.
  • -
  • Renamed the method kickChatMember to banChatMember. The old method name can still be used.
  • -
  • Renamed the method getChatMembersCount to getChatMemberCount. The old method name can still be used.
  • -
  • Values of the field file_unique_id in objects of the type PhotoSize and of the fields small_file_unique_id and big_file_unique_id in objects of the type ChatPhoto were changed.
  • -
-
-
-

⚠️ WARNING! ⚠️
After one of the upcoming Bot API updates, user identifiers will become bigger than 2^31 - 1 and it will be no longer possible to store them in a signed 32-bit integer type. User identifiers will have up to 52 significant bits, so a 64-bit integer or double-precision float type would still be safe for storing them. Please make sure that your code can correctly handle such user identifiers.

-
-
-

April 26, 2021

-

Bot API 5.2

-
    -
  • Support for Payments 2.0, see this manual for more details about the Bot Payments API.
  • -
  • Added the type InputInvoiceMessageContent to support sending invoices as inline query results.
  • -
  • Allowed sending invoices to group, supergroup and channel chats.
  • -
  • Added the fields max_tip_amount and suggested_tip_amounts to the method sendInvoice to allow adding optional tips to the payment.
  • -
  • The parameter start_parameter of the method sendInvoice became optional. If the parameter isn't specified, the invoice can be paid directly from forwarded messages.
  • -
  • Added the field chat_type to the class InlineQuery, containing the type of the chat, from which the inline request was sent.
  • -
  • Added the type VoiceChatScheduled and the field voice_chat_scheduled to the class Message.
  • -
  • Fixed an error in sendChatAction documentation to correctly mention “record_voice” and “upload_voice” instead of “record_audio” and “upload_audio” for related to voice note actions. Old action names will still work for backward compatibility.
  • -
-
-
-

⚠️ WARNING! ⚠️
After the next Bot API update (Bot API 5.3) there will be a one-time change of the value of the field file_unique_id in objects of the type PhotoSize and of the fields small_file_unique_id and big_file_unique_id in objects of the type ChatPhoto.

-
-
-
-

⚠️ WARNING! ⚠️
Service messages about non-bot users joining the chat will be soon removed from large groups. We recommend using the “chat_member” update as a replacement.

-
-
-
-

⚠️ WARNING! ⚠️
After one of the upcoming Bot API updates, user identifiers will become bigger than 2^31 - 1 and it will be no longer possible to store them in a signed 32-bit integer type. User identifiers will have up to 52 significant bits, so a 64-bit integer or double-precision float type would still be safe for storing them. Please make sure that your code can correctly handle such user identifiers.

-
-
-

March 9, 2021

-

Bot API 5.1

-

Added two new update types

-
    -
  • Added updates about member status changes in chats, represented by the class ChatMemberUpdated and the fields my_chat_member and chat_member in the Update class. The bot must be an administrator in the chat to receive chat_member updates about other chat members. By default, only my_chat_member updates about the bot itself are received.
  • -
-

Improved Invite Links

-
    -
  • Added the class ChatInviteLink, representing an invite link to a chat.
  • -
  • Added the method createChatInviteLink, which can be used to create new invite links in addition to the primary invite link.
  • -
  • Added the method editChatInviteLink, which can be used to edit non-primary invite links created by the bot.
  • -
  • Added the method revokeChatInviteLink, which can be used to revoke invite links created by the bot.
  • -
-

Voice Chat Info

- -

And More

-
    -
  • Added the type MessageAutoDeleteTimerChanged and the field message_auto_delete_timer_changed to the class Message.
  • -
  • Added the parameter revoke_messages to the method kickChatMember, allowing to delete all messages from a group for the user who is being removed.
  • -
  • Added the new administrator privilege can_manage_chat to the class ChatMember and parameter can_manage_chat to the method promoteChatMember. This administrator right is implied by any other administrator privilege.
  • -
  • Supported the new bowling animation for the random dice. Choose between different animations (dice, darts, basketball, football, bowling, slot machine) by specifying the emoji parameter in the method sendDice.
  • -
-
-
-

⚠️ WARNING! ⚠️
After one of the upcoming Bot API updates, some user identifiers will become bigger than 2^31 - 1 and it will be no longer possible to store them in a signed 32-bit integer type. User identifiers will have up to 52 significant bits, so a 64-bit integer or double-precision float type would still be safe for storing them. Please make sure that your code can correctly handle such user identifiers.

-
-
-

November 4, 2020

-

Introducing Bot API 5.0

-

Run Your Own Bot API Server

-
    -
  • Bot API source code is now available at telegram-bot-api. You can now run your own Bot API server locally, boosting your bots' performance.
  • -
  • Added the method logOut, which can be used to log out from the cloud Bot API server before launching your bot locally. You must log out the bot before running it locally, otherwise there is no guarantee that the bot will receive all updates.
  • -
  • Added the method close, which can be used to close the bot instance before moving it from one local server to another.
  • -
-

Transfer Bot Ownership

-
    -
  • You can now use @BotFather to transfer your existing bots to another Telegram account.
  • -
-

Webhooks

-
    -
  • Added the parameter ip_address to the method setWebhook, allowing to bypass DNS resolving and use the specified fixed IP address to send webhook requests.
  • -
  • Added the field ip_address to the class WebhookInfo, containing the current IP address used for webhook connections creation.
  • -
  • Added the ability to drop all pending updates when changing webhook URL using the parameter drop_pending_updates in the methods setWebhook and deleteWebhook.
  • -
-

Working with Groups

-
    -
  • The getChat request now returns the user's bio for private chats if available.
  • -
  • The getChat request now returns the identifier of the linked chat for supergroups and channels, i.e. the discussion group identifier for a channel and vice versa.
  • -
  • The getChat request now returns the location to which the supergroup is connected (see Local Groups). Added the class ChatLocation to represent the location.
  • -
  • Added the parameter only_if_banned to the method unbanChatMember to allow safe unban.
  • -
-

Working with Files

-
    -
  • Added the field file_name to the classes Audio and Video, containing the name of the original file.
  • -
  • Added the ability to disable server-side file content type detection using the parameter disable_content_type_detection in the method sendDocument and the class inputMediaDocument.
  • -
-

Multiple Pinned Messages

-
    -
  • Added the ability to pin messages in private chats.
  • -
  • Added the parameter message_id to the method unpinChatMessage to allow unpinning of the specific pinned message.
  • -
  • Added the method unpinAllChatMessages, which can be used to unpin all pinned messages in a chat.
  • -
-

File Albums

-
    -
  • Added support for sending and receiving audio and document albums in the method sendMediaGroup.
  • -
-

Live Locations

- -

Anonymous Admins

-
    -
  • Added the field sender_chat to the class Message, containing the sender of a message which is a chat (group or channel). For backward compatibility in non-channel chats, the field from in such messages will contain the user 777000 for messages automatically forwarded to the discussion group and the user 1087968824 (@GroupAnonymousBot) for messages from anonymous group administrators.
  • -
  • Added the field is_anonymous to the class chatMember, which can be used to distinguish anonymous chat administrators.
  • -
  • Added the parameter is_anonymous to the method promoteChatMember, which allows to promote anonymous chat administrators. The bot itself should have the is_anonymous right to do this. Despite the fact that bots can have the is_anonymous right, they will never appear as anonymous in the chat. Bots can use the right only for passing to other administrators.
  • -
  • Added the custom title of an anonymous message sender to the class Message as author_signature.
  • -
-

And More

- -

And Last but not Least

-
    -
  • Supported the new football and slot machine animations for the random dice. Choose between different animations (dice, darts, basketball, football, slot machine) by specifying the emoji parameter in the method sendDice.
  • -
-

June 4, 2020

-

Bot API 4.9

-
    -
  • Added the new field via_bot to the Message object. You can now know which bot was used to send a message.
  • -
  • Supported video thumbnails for inline GIF and MPEG4 animations.
  • -
  • Supported the new basketball animation for the random dice. Choose between different animations (dice, darts, basketball) by specifying the emoji parameter in the method sendDice.
  • -
-

April 24, 2020

-

Bot API 4.8

-
    -
  • Supported explanations for Quizzes 2.0. Add explanations by specifying the parameters explanation and explanation_parse_mode in the method sendPoll.
  • -
  • Added the fields explanation and explanation_entities to the Poll object.
  • -
  • Supported timed polls that automatically close at a certain date and time. Set up by specifying the parameter open_period or close_date in the method sendPoll.
  • -
  • Added the fields open_period and close_date to the Poll object.
  • -
  • Supported the new darts animation for the dice mini-game. Choose between the default dice animation and darts animation by specifying the parameter emoji in the method sendDice.
  • -
  • Added the field emoji to the Dice object.
  • -
-

March 30, 2020

-

Bot API 4.7

-
    -
  • Added the method sendDice for sending a dice message, which will have a random value from 1 to 6. (Yes, we're aware of the “proper” singular of die. But it's awkward, and we decided to help it change. One dice at a time!)
  • -
  • Added the field dice to the Message object.
  • -
  • Added the method getMyCommands for getting the current list of the bot's commands.
  • -
  • Added the method setMyCommands for changing the list of the bot's commands through the Bot API instead of @BotFather.
  • -
  • Added the ability to create animated sticker sets by specifying the parameter tgs_sticker instead of png_sticker in the method createNewStickerSet.
  • -
  • Added the ability to add animated stickers to sets created by the bot by specifying the parameter tgs_sticker instead of png_sticker in the method addStickerToSet.
  • -
  • Added the field thumb to the StickerSet object.
  • -
  • Added the ability to change thumbnails of sticker sets created by the bot using the method setStickerSetThumb.
  • -
-

January 23, 2020

-

Bot API 4.6

-
    -
  • Supported Polls 2.0.
  • -
  • Added the ability to send non-anonymous, multiple answer, and quiz-style polls: added the parameters is_anonymous, type, allows_multiple_answers, correct_option_id, is_closed options to the method sendPoll.
  • -
  • Added the object KeyboardButtonPollType and the field request_poll to the object KeyboardButton.
  • -
  • Added updates about changes of user answers in non-anonymous polls, represented by the object PollAnswer and the field poll_answer in the Update object.
  • -
  • Added the fields total_voter_count, is_anonymous, type, allows_multiple_answers, correct_option_id to the Poll object.
  • -
  • Bots can now send polls to private chats.
  • -
  • Added more information about the bot in response to the getMe request: added the fields can_join_groups, can_read_all_group_messages and supports_inline_queries to the User object.
  • -
  • Added the optional field language to the MessageEntity object.
  • -
-

December 31, 2019

-

Bot API 4.5

-
    -
  • Added support for two new MessageEntity types, underline and strikethrough.
  • -
  • Added support for nested MessageEntity objects. Entities can now contain other entities. If two entities have common characters then one of them is fully contained inside the other.
  • -
  • Added support for nested entities and the new tags <u>/<ins> (for underlined text) and <s>/<strike>/<del> (for strikethrough text) in parse mode HTML.
  • -
  • Added a new parse mode, MarkdownV2, which supports nested entities and two new entities __ (for underlined text) and ~ (for strikethrough text). Parse mode Markdown remains unchanged for backward compatibility.
  • -
  • Added the field file_unique_id to the objects Animation, Audio, Document, PassportFile, PhotoSize, Sticker, Video, VideoNote, Voice, File and the fields small_file_unique_id and big_file_unique_id to the object ChatPhoto. The new fields contain a unique file identifier, which is supposed to be the same over time and for different bots, but can't be used to download or reuse the file.
  • -
  • Added the field custom_title to the ChatMember object.
  • -
  • Added the new method setChatAdministratorCustomTitle to manage the custom titles of administrators promoted by the bot.
  • -
  • Added the field slow_mode_delay to the Chat object.
  • -
-

July 29, 2019

-

Bot API 4.4

-
    -
  • Added support for animated stickers. New field is_animated in Sticker and StickerSet objects, animated stickers can now be used in sendSticker and InlineQueryResultCachedSticker.
  • -
  • Added support for default permissions in groups. New object ChatPermissions, containing actions which a member can take in a chat. New field permissions in the Chat object; new method setChatPermissions.
  • -
  • The field all_members_are_administrators has been removed from the documentation for the Chat object. The field is still returned in the object for backward compatibility, but new bots should use the permissions field instead.
  • -
  • Added support for more permissions for group and supergroup members: added the new field can_send_polls to ChatMember object, added can_change_info, can_invite_users, can_pin_messages in ChatMember object for restricted users (previously available only for administrators).
  • -
  • The method restrictChatMember now takes the new user permissions in a single argument of the type ChatPermissions. The old way of passing parameters will keep working for a while for backward compatibility.
  • -
  • Added description support for basic groups (previously available in supergroups and channel chats). You can pass a group's chat_id to setChatDescription and receive the group's description in the Chat object in the response to getChat method.
  • -
  • Added invite_link support for basic groups (previously available in supergroups and channel chats). You can pass a group's chat_id to exportChatInviteLink and receive the group's invite link in the Chat object in the response to getChat method.
  • -
  • File identifiers from the ChatPhoto object are now invalidated and can no longer be used whenever the photo is changed.
  • -
  • All webhook requests from the Bot API are now coming from the subnets 149.154.160.0/20 and 91.108.4.0/22. Most users won't need to do anything to continue receiving webhooks. If you control inbound access with a firewall, you may need to update your configuration. You can always find the list of actual IP addresses of servers used to send webhooks there: https://core.telegram.org/bots/webhooks.
  • -
  • As of the next Bot API update (version 4.5), nested MessageEntity objects will be allowed in message texts and captions. Please make sure that your code can correctly handle such entities.
  • -
-

May 31, 2019

-

Bot API 4.3

-
    -
  • Added support for Seamless Telegram Login on external websites.
  • -
  • Added the new object LoginUrl and the new field login_url to the InlineKeyboardButton object which allows to automatically authorize users before they go to a URL specified by the bot. Users will be asked to confirm authorization in their Telegram app (needs version 5.7 or higher) when they press the button:
  • -
-
- TITLE -
- -

Also in this update:

-
    -
  • Added the field reply_markup to the Message object, containing the inline keyboard attached to the message.
  • -
  • If a message with an inline keyboard is forwarded, the forwarded message will now have an inline keyboard if the keyboard contained only url and login_url buttons or if the message was sent via a bot and the keyboard contained only url, login_url, switch_inline_query or switch_inline_query_current_chat buttons. In the latter case, switch_inline_query_current_chat buttons are replaced with switch_inline_query buttons.
  • -
  • Bots now receive the edited_message Update even if only Message.reply_markup has changed.
  • -
  • Bots that have the can_edit_messages right in a channel can now use the method editMessageReplyMarkup for messages written by other administrators forever without the 48 hours limit.
  • -
  • Don't forget that starting in July 2019, webhook requests from Bot API will be coming from the subnets 149.154.160.0/20 and 91.108.4.0/22. Most users won't need to do anything to continue receiving webhooks. If you control inbound access with a firewall, you may need to update your configuration. You can always find the list of actual IP addresses of servers used to send webhooks there: https://core.telegram.org/bots/webhooks.
  • -
-

April 14, 2019

-

Bot API 4.2

-
    -
  • Added support for native polls: added the object Poll, the methods sendPoll and stopPoll and the field poll in the Message and Update objects.
  • -
  • The method deleteMessage can now be used to delete messages sent by a user to the bot in private chats within 48 hours.
  • -
  • Added support for pinned messages in basic groups in addition to supergroups and channel chats: you can pass group's chat_id to pinChatMessage and unpinChatMessage, and receive the pinned group message in Chat object.
  • -
  • Added the field is_member to the ChatMember object, which can be used to find whether a restricted user is a member of the chat.
  • -
  • Added the field forward_sender_name to the Message object, containing name of the sender who has opted to hide their account.
  • -
  • Starting in July 2019, webhook requests from Bot API will be coming from the subnets 149.154.160.0/20 and 91.108.4.0/22. Most users won't need to do anything to continue receiving webhooks. If you control inbound access with a firewall, you may need to update your configuration. You can always find the list of actual IP addresses of servers used to send webhooks there: https://core.telegram.org/bots/webhooks.
  • -
  • Document thumbnails now should be inscribed in a 320x320 square instead of 90x90.
  • -
-

August 27, 2018

-

Bot API 4.1

- -

July 26, 2018

-

Bot API 4.0.

-
    -
  • Added support for Telegram Passport. See the official announcement on the blog and the manual for details.
  • -
  • Added support for editing the media content of messages: added the method editMessageMedia and new types InputMediaAnimation, InputMediaAudio, and InputMediaDocument.
  • -
  • Added the field thumb to the Audio object to contain the thumbnail of the album cover to which the music file belongs.
  • -
  • Added support for attaching custom thumbnails to uploaded files. For animations, audios, videos and video notes, which are less than 10 MB in size, thumbnails are generated automatically.
  • -
  • tg:// URLs now can be used in inline keyboard url buttons and text_link message entities.
  • -
  • Added the method sendAnimation, which can be used instead of sendDocument to send animations, specifying their duration, width and height.
  • -
  • Added the field animation to the Message object. For backward compatibility, when this field is set, the document field will be also set.
  • -
  • Added two new MessageEntity types: cashtag and phone_number.
  • -
  • Added support for Foursquare venues: added the new field foursquare_type to the objects Venue, InlineQueryResultVenue and InputVenueMessageContent, and the parameter foursquare_type to the sendVenue method.
  • -
  • You can now create inline mentions of users, who have pressed your bot's callback buttons.
  • -
  • You can now use the Retry-After response header to configure the delay after which the Bot API will retry the request after an unsuccessful response from a webhook.
  • -
  • If a webhook returns the HTTP error 410 Gone for all requests for more than 23 hours successively, it can be automatically removed.
  • -
  • Added vCard support when sharing contacts: added the field vcard to the objects Contact, InlineQueryResultContact, InputContactMessageContent and the method sendContact.
  • -
-

February 13, 2018

-

Bot API 3.6.

-
    -
  • Supported text formatting in media captions. Specify the desired parse_mode (Markdown or HTML) when you provide a caption.
  • -
  • In supergroups, if the bot receives a message that is a reply, it will also receive the message to which that message is replying – even if the original message is inaccessible due to the bot's privacy settings. (In other words, replying to any message in a supergroup with a message that mentions the bot or features a command for it acts as forwarding the original message to the bot).
  • -
  • Added the new field connected_website to Message. The bot will receive a message with this field in a private chat when a user logs in on the bot's connected website using the Login Widget and allows sending messages from your bot.
  • -
  • Added the new parameter supports_streaming to the sendVideo method and a field with the same name to the InputMediaVideo object.
  • -
-

November 17, 2017

-

Bot API 3.5.

- -

October 11, 2017

-

Bot API 3.4.

- -

August 23, 2017

-

Bot API 3.3.

-
    -
  • Bots can now mention users via inline mentions, without using usernames.
  • -
  • getChat now also returns pinned messages in supergroups, if present. Added the new field pinned_message to the Chat object.
  • -
  • Added the new fields author_signature and forward_signature to the Message object.
  • -
  • Added the new field is_bot to the User object.
  • -
-

July 21, 2017

-

Bot API 3.2. Teach your bot to handle stickers and sticker sets.

- -

June 30, 2017

-

Bot API 3.1. Build your own robotic police force for supergoups with these new methods for admin bots:

- -

May 18, 2017

-

Introducing Bot API 3.0.

-

NEW Payment Platform

-

See Introduction to Bot Payments for a brief overview. If you're not a developer, you may like this user-friendly blog post better.

- -

NEW Video Messages

-
    -
  • As of Telegram v.4.0, users can send short rounded video messages, using an interface similar to that of voice notes.
  • -
  • Added the sendVideoNote method, the new field video_note to Message, the fields record_video_note or upload_video_note to sendChatAction.
  • -
-

NEW Multilingual Bots

-
    -
  • The User object now may have a language_code field that contains the IETF language tag of the user's language.
  • -
  • Thanks to this, your bot can now offer localized responses to users that speak different languages.
  • -
-

More power to admin bots

-
    -
  • unbanChatMemeber now also works in channels!
  • -
  • New method deleteMessage that allows the bot to delete its own messages, as well as messages posted by other in groups and channels where the bot is an administrator.
  • -
-

Minor Changes

-
    -
  • Replaced the field new_chat_member in Message with new_chat_members (the old field will still be available for a while for compatibility purposes).
  • -
  • Inline keyboards with switch_inline_query and switch_inline_query_current_chat can no longer be sent to channels because they are useless there.
  • -
  • New fields gif_duration in InlineQueryResultGif and mpeg4_duration in InlineQueryResultMpeg4Gif.
  • -
-

December 4, 2016

-

Introducing Bot API 2.3.1, a nifty little update that will give you more control over how your bot gets its updates.

-
    -
  • Use the new field max_connections in setWebhook to optimize your bot's server load
  • -
  • Use allowed_updates in setWebhook and getUpdates to selectively subscribe to updates of a certain type. Among other things, this allows you to stop getting updates about new posts in channels where your bot is an admin.
  • -
  • deleteWebhook moved out of setWebhook to get a whole separate method for itself.
  • -
-

November 21, 2016

-

Bot API 2.3

-
    -
  • Modified bot privacy mode for the sake of consistency.
  • -
  • Your bot can now get updates about posts in channels. Added new fields channel_post and edited_channel_post to Update.

    -
  • -
  • You can now update high scores to a lower value by using the new force parameter in setGameScore. Handy for punishing cheaters or fixing errors in your game's High Score table.

    -
  • -
  • Starting today, messages with high scores will be updated with new high scores by default. Use disable_edit_message in setGameScore if you don't want this.
  • -
  • The edit_message parameter from setGameScore is no longer in use. For backward compatibility, it will be taken into account for a while, unless disable_edit_message is passed explicitly.
  • -
  • Added the new field forward_from_message_id to Message.
  • -
  • Added the new parameter cache_time to answerCallbackQuery. Will eventually work in Telegram apps — somewhere after version 3.14, maybe 3.15.
  • -
  • Renamed hide_keyboard to remove_keyboard in ReplyKeyboardRemove for clarity. hide_keyboard will still work for a while for backward compatibility.
  • -
-

October 3, 2016

-

Bot API 2.2. Introducing a new Gaming Platform! See this introduction for a brief overview.
If you're not a developer, you may like this user-friendly blog post better.

- -

Other changes

- -
    -
  • New field all_members_are_administrators in the Chat object.
  • -
  • Certain server responses may now contain the new parameters field with expanded info on errors that occurred while processing your requests.
  • -
-

May 25, 2016

- -

May 22, 2016

- -

May 12, 2016

- -

May 6, 2016

-
    -
  • Added the field emoji to the Sticker object. Your bot can now know the emoji a sticker corresponds to.
  • -
  • Added the field forward_from_chat to the Message object for messages forwarded from channels.
  • -
-

April 9, 2016

-

Introducing Bot API 2.0. Check out this page for a review of this major update.

- -

Inline bots

-
    -
  • Added support for all content types available on Telegram. 19 types of InlineQueryResult objects are now supported.
  • -
  • Inline bots can now substitute all kinds of content with text. Added 4 types of InputMessageContent objects.
  • -
  • Your inline bot can also ask users for permission to use their location. Added the new Botfather command /setinlinegeo, added field location to the InlineQuery object, added fields location and inline_message_id to the ChosenInlineResult object.
  • -
  • Added an easy way to switch between inline mode and a private chat with the bot – useful for settings, establishing external connections and teaching users how to use your bot in inline mode. Added parameters switch_pm_text and switch_pm_parameter to the method answerInlineQuery.
  • -
-

Miscellaneous

- -

February 20, 2016

-
    -
  • Added the disable_notification parameter to all methods that send messages or any kind.
  • -
  • Removed backward compatibility from the method sendAudio. Voice messages now must be sent using the method sendVoice. There is no more need to specify a non-empty title or performer while sending the audio by file_id.
  • -
-

January 20, 2016

-
    -
  • By the way, you can use both HTML-style and markdown-style formatting in your bot's messages to send bold, italic or fixed-width text and inline links. All official Telegram clients support this. See Formatting options for details.
  • -
-

January 14, 2016

-
    -
  • You can now collect feedback on which results provided by your inline bot get chosen by the users. Added the setinlinefeedback command for Botfather, new type ChosenInlineResult, new field chosen_inline_result to the Update object.
  • -
-

January 4, 2016

- -

November, 2015

-
    -
  • Added support for supergroups. The Type field in the Chat object can now contain 'supergroup'.
  • -
  • New optional fields added to the Message object: supergroup_chat_created, migrate_to_chat_id, migrate_from_chat_id and channel_chat_created.
  • -
-

October 8, 2015

-
    -
  • Added initial channel support for bots (no Telegram clients support this at the moment, please wait for updates):
  • -
  • The Chat field in the Message is now of the new type Chat.
  • -
  • You can now pass a channel username (in the format @channelusername) in the place of chat_id in all methods (and instead of from_chat_id in forwardMessage). For this to work, the bot must be an administrator in the channel (and that's exactly what Telegram clients don't support yet — adding bots as administrators coming soon).
  • -
-

September 18, 2015

-
    -
  • Bots can now download files and media sent by users.
  • -
  • Added getFile and File.
  • -
-

September 7, 2015

-
    -
  • You can now pass parameters using application/json (please note that this doesn't work for file uploads: use multipart/form-data to upload files).
  • -
  • Added very basic markdown support. New field parse_mode added to sendMessage. For the moment messages with markdown will be displayed correctly only in Telegram for Android. Other official apps will catch up soon.
  • -
-

August 29, 2015

-
    -
  • Added support for self-signed certificates: upload your certificate using the certificate parameter in the setWebhook method.
  • -
  • You can now make new requests when responding to webhook updates.
  • -
-

August 15, 2015

-
    -
  • Added new type Voice and new method sendVoice for sending voice messages.
  • -
  • Earlier Audio and sendAudio should now be used for sending music files. Telegram clients will show such files in the in-app music player. If you were using sendAudio for your bot to send voice messages, please use sendVoice instead.
  • -
  • Added optional fields performer, title to the Audio object and sendAudio method.
  • -
  • Added optional field voice to the Message object.
  • -
-

July 2015

-
    -
  • The thumb field is now optional for Video, Sticker and Document objects
  • -
  • The API now supports both video and photo captions. The caption field has been removed from the Video object and added to the Message object instead.
  • -
  • caption and duration optional fields have been added to the sendVideo method.
  • -
  • Fixed typo: user_id in the Contact object is now correctly labeled as Integer, not String
  • -
-

June 24, 2015

-

The bot platform was officially launched.

-
-

Back to the Bot API Manual »

-
-
- -
- -
-
- -
- - - - - - - - diff --git a/data/core.telegram.org/bots/api.html b/data/core.telegram.org/bots/api.html deleted file mode 100644 index 571b978de8..0000000000 --- a/data/core.telegram.org/bots/api.html +++ /dev/null @@ -1,9293 +0,0 @@ - - - - - Telegram Bot API - - - - - - - - - - - - - -
- -
-
-
- -

Telegram Bot API

- -
- -
-

The Bot API is an HTTP-based interface created for developers keen on building bots for Telegram.
To learn how to create and set up a bot, please consult our Introduction to Bots and Bot FAQ.

-
-

Recent changes

-
-

Subscribe to @BotNews to be the first to know about the latest updates and join the discussion in @BotTalk

-
-

November 5, 2021

-

Bot API 5.4

- -
-
-

⚠️ WARNING! ⚠️
User identifiers will become bigger than 2^31 - 1 before the end of this year and it will be no longer possible to store them in a signed 32-bit integer type. User identifiers will have up to 52 significant bits, so a 64-bit integer or double-precision float type would still be safe for storing them. Please make sure that your code can correctly handle such user identifiers.

-
-
-

June 25, 2021

-

Bot API 5.3

-

Personalized Commands

-
    -
  • Bots can now show lists of commands tailored to specific situations - including localized commands for users with different languages, as well as different commands based on chat type or for specific chats, and special lists of commands for chat administrators.
  • -
  • Added the class BotCommandScope, describing the scope to which bot commands apply.
  • -
  • Added the parameters scope and language_code to the method setMyCommands to allow bots specify different commands for different chats and users.
  • -
  • Added the parameters scope and language_code to the method getMyCommands.
  • -
  • Added the method deleteMyCommands to allow deletion of the bot's commands for the given scope and user language.
  • -
  • Improved visibility of bot commands in Telegram apps with the new 'Menu' button in chats with bots, read more on the blog.
  • -
-

Custom Placeholders

- -

And More

-
    -
  • Improved documentation of the class ChatMember by splitting it into 6 subclasses.
  • -
  • Renamed the method kickChatMember to banChatMember. The old method name can still be used.
  • -
  • Renamed the method getChatMembersCount to getChatMemberCount. The old method name can still be used.
  • -
  • Values of the field file_unique_id in objects of the type PhotoSize and of the fields small_file_unique_id and big_file_unique_id in objects of the type ChatPhoto were changed.
  • -
-
-
-

⚠️ WARNING! ⚠️
After one of the upcoming Bot API updates, user identifiers will become bigger than 2^31 - 1 and it will be no longer possible to store them in a signed 32-bit integer type. User identifiers will have up to 52 significant bits, so a 64-bit integer or double-precision float type would still be safe for storing them. Please make sure that your code can correctly handle such user identifiers.

-
-
-

April 26, 2021

-

Bot API 5.2

-
    -
  • Support for Payments 2.0, see this manual for more details about the Bot Payments API.
  • -
  • Added the type InputInvoiceMessageContent to support sending invoices as inline query results.
  • -
  • Allowed sending invoices to group, supergroup and channel chats.
  • -
  • Added the fields max_tip_amount and suggested_tip_amounts to the method sendInvoice to allow adding optional tips to the payment.
  • -
  • The parameter start_parameter of the method sendInvoice became optional. If the parameter isn't specified, the invoice can be paid directly from forwarded messages.
  • -
  • Added the field chat_type to the class InlineQuery, containing the type of the chat, from which the inline request was sent.
  • -
  • Added the type VoiceChatScheduled and the field voice_chat_scheduled to the class Message.
  • -
  • Fixed an error in sendChatAction documentation to correctly mention “record_voice” and “upload_voice” instead of “record_audio” and “upload_audio” for related to voice note actions. Old action names will still work for backward compatibility.
  • -
-

See earlier changes »

-

Authorizing your bot

-

Each bot is given a unique authentication token when it is created. The token looks something like 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11, but we'll use simply <token> in this document instead. You can learn about obtaining tokens and generating new ones in this document.

-

Making requests

-

All queries to the Telegram Bot API must be served over HTTPS and need to be presented in this form: https://api.telegram.org/bot<token>/METHOD_NAME. Like this for example:

-
https://api.telegram.org/bot123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11/getMe
-

We support GET and POST HTTP methods. We support four ways of passing parameters in Bot API requests:

-
    -
  • URL query string
  • -
  • application/x-www-form-urlencoded
  • -
  • application/json (except for uploading files)
  • -
  • multipart/form-data (use to upload files)
  • -
-

The response contains a JSON object, which always has a Boolean field 'ok' and may have an optional String field 'description' with a human-readable description of the result. If 'ok' equals True, the request was successful and the result of the query can be found in the 'result' field. In case of an unsuccessful request, 'ok' equals false and the error is explained in the 'description'. An Integer 'error_code' field is also returned, but its contents are subject to change in the future. Some errors may also have an optional field 'parameters' of the type ResponseParameters, which can help to automatically handle the error.

-
    -
  • All methods in the Bot API are case-insensitive.
  • -
  • All queries must be made using UTF-8.
  • -
-

Making requests when getting updates

-

If you're using webhooks, you can perform a request to the Bot API while sending an answer to the webhook. Use either application/json or application/x-www-form-urlencoded or multipart/form-data response content type for passing parameters. Specify the method to be invoked in the method parameter of the request. It's not possible to know that such a request was successful or get its result.

-
-

Please see our FAQ for examples.

-
-

Using a Local Bot API Server

-

The Bot API server source code is available at telegram-bot-api. You can run it locally and send the requests to your own server instead of https://api.telegram.org. If you switch to a local Bot API server, your bot will be able to:

-
    -
  • Download files without a size limit.
  • -
  • Upload files up to 2000 MB.
  • -
  • Upload files using their local path and the file URI scheme.
  • -
  • Use an HTTP URL for the webhook.
  • -
  • Use any local IP address for the webhook.
  • -
  • Use any port for the webhook.
  • -
  • Set max_webhook_connections up to 100000.
  • -
  • Receive the absolute local path as a value of the file_path field without the need to download the file after a getFile request.
  • -
-

Do I need a Local Bot API Server

-

The majority of bots will be OK with the default configuration, running on our servers. But if you feel that you need one of these features, you're welcome to switch to your own at any time.

-

Getting updates

-

There are two mutually exclusive ways of receiving updates for your bot — the getUpdates method on one hand and Webhooks on the other. Incoming updates are stored on the server until the bot receives them either way, but they will not be kept longer than 24 hours.

-

Regardless of which option you choose, you will receive JSON-serialized Update objects as a result.

-

Update

-

This object represents an incoming update.
At most one of the optional parameters can be present in any given update.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
update_idIntegerThe 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.
messageMessageOptional. New incoming message of any kind — text, photo, sticker, etc.
edited_messageMessageOptional. New version of a message that is known to the bot and was edited
channel_postMessageOptional. New incoming channel post of any kind — text, photo, sticker, etc.
edited_channel_postMessageOptional. New version of a channel post that is known to the bot and was edited
inline_queryInlineQueryOptional. New incoming inline query
chosen_inline_resultChosenInlineResultOptional. 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_queryCallbackQueryOptional. New incoming callback query
shipping_queryShippingQueryOptional. New incoming shipping query. Only for invoices with flexible price
pre_checkout_queryPreCheckoutQueryOptional. New incoming pre-checkout query. Contains full information about checkout
pollPollOptional. New poll state. Bots receive only updates about stopped polls and polls, which are sent by the bot
poll_answerPollAnswerOptional. 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_memberChatMemberUpdatedOptional. 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_memberChatMemberUpdatedOptional. 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_requestChatJoinRequestOptional. 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.
-

getUpdates

-

Use this method to receive incoming updates using long polling (wiki). An Array of Update objects is returned.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
offsetIntegerOptionalIdentifier 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 update_id. 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.
limitIntegerOptionalLimits the number of updates to be retrieved. Values between 1-100 are accepted. Defaults to 100.
timeoutIntegerOptionalTimeout 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.
allowed_updatesArray of StringOptionalA JSON-serialized list of the update types 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 update types except chat_member (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.
-
-

Notes
1. This method will not work if an outgoing webhook is set up.
2. In order to avoid getting duplicate updates, recalculate offset after each server response.

-
-

setWebhook

-

Use this method to specify a url and receive incoming updates via an outgoing webhook. Whenever there is an update for the bot, we will send an HTTPS POST request to the specified url, containing a JSON-serialized Update. In case of an unsuccessful request, we will give up after a reasonable amount of attempts. Returns True on success.

-

If you'd like to make sure that the Webhook request comes from Telegram, we recommend using a secret path in the URL, e.g. https://www.example.com/<token>. Since nobody else knows your bot's token, you can be pretty sure it's us.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
urlStringYesHTTPS url to send updates to. Use an empty string to remove webhook integration
certificateInputFileOptionalUpload your public key certificate so that the root certificate in use can be checked. See our self-signed guide for details.
ip_addressStringOptionalThe fixed IP address which will be used to send webhook requests instead of the IP address resolved through DNS
max_connectionsIntegerOptionalMaximum 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.
allowed_updatesArray of StringOptionalA JSON-serialized list of the update types 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 update types except chat_member (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.
drop_pending_updatesBooleanOptionalPass True to drop all pending updates
-
-

Notes
1. You will not be able to receive updates using getUpdates for as long as an outgoing webhook is set up.
2. To use a self-signed certificate, you need to upload your public key certificate using certificate parameter. Please upload as InputFile, sending a String will not work.
3. Ports currently supported for Webhooks: 443, 80, 88, 8443.

-

NEW! If you're having any trouble setting up webhooks, please check out this amazing guide to Webhooks.

-
-

deleteWebhook

-

Use this method to remove webhook integration if you decide to switch back to getUpdates. Returns True on success.

- - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
drop_pending_updatesBooleanOptionalPass True to drop all pending updates
-

getWebhookInfo

-

Use this method to get current webhook status. Requires no parameters. On success, returns a WebhookInfo object. If the bot is using getUpdates, will return an object with the url field empty.

-

WebhookInfo

-

Contains information about the current status of a webhook.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
urlStringWebhook URL, may be empty if webhook is not set up
has_custom_certificateBooleanTrue, if a custom certificate was provided for webhook certificate checks
pending_update_countIntegerNumber of updates awaiting delivery
ip_addressStringOptional. Currently used webhook IP address
last_error_dateIntegerOptional. Unix time for the most recent error that happened when trying to deliver an update via webhook
last_error_messageStringOptional. Error message in human-readable format for the most recent error that happened when trying to deliver an update via webhook
max_connectionsIntegerOptional. Maximum allowed number of simultaneous HTTPS connections to the webhook for update delivery
allowed_updatesArray of StringOptional. A list of update types the bot is subscribed to. Defaults to all update types except chat_member
-

Available types

-

All types used in the Bot API responses are represented as JSON-objects.

-

It is safe to use 32-bit signed integers for storing all Integer fields unless otherwise noted.

-
-

Optional fields may be not returned when irrelevant.

-
-

User

-

This object represents a Telegram user or bot.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
idIntegerUnique 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_botBooleanTrue, if this user is a bot
first_nameStringUser's or bot's first name
last_nameStringOptional. User's or bot's last name
usernameStringOptional. User's or bot's username
language_codeStringOptional. IETF language tag of the user's language
can_join_groupsBooleanOptional. True, if the bot can be invited to groups. Returned only in getMe.
can_read_all_group_messagesBooleanOptional. True, if privacy mode is disabled for the bot. Returned only in getMe.
supports_inline_queriesBooleanOptional. True, if the bot supports inline queries. Returned only in getMe.
-

Chat

-

This object represents a chat.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
idIntegerUnique 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.
typeStringType of chat, can be either “private”, “group”, “supergroup” or “channel”
titleStringOptional. Title, for supergroups, channels and group chats
usernameStringOptional. Username, for private chats, supergroups and channels if available
first_nameStringOptional. First name of the other party in a private chat
last_nameStringOptional. Last name of the other party in a private chat
photoChatPhotoOptional. Chat photo. Returned only in getChat.
bioStringOptional. Bio of the other party in a private chat. Returned only in getChat.
descriptionStringOptional. Description, for groups, supergroups and channel chats. Returned only in getChat.
invite_linkStringOptional. Primary invite link, for groups, supergroups and channel chats. Returned only in getChat.
pinned_messageMessageOptional. The most recent pinned message (by sending date). Returned only in getChat.
permissionsChatPermissionsOptional. Default chat member permissions, for groups and supergroups. Returned only in getChat.
slow_mode_delayIntegerOptional. For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user; in seconds. Returned only in getChat.
message_auto_delete_timeIntegerOptional. The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in getChat.
sticker_set_nameStringOptional. For supergroups, name of group sticker set. Returned only in getChat.
can_set_sticker_setBooleanOptional. True, if the bot can change the group sticker set. Returned only in getChat.
linked_chat_idIntegerOptional. 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.
locationChatLocationOptional. For supergroups, the location to which the supergroup is connected. Returned only in getChat.
-

Message

-

This object represents a message.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
message_idIntegerUnique message identifier inside this chat
fromUserOptional. Sender, empty for messages sent to channels
sender_chatChatOptional. Sender of the message, sent on behalf of a chat. The channel itself for channel messages. The supergroup itself for messages from anonymous group administrators. The linked channel for messages automatically forwarded to the discussion group
dateIntegerDate the message was sent in Unix time
chatChatConversation the message belongs to
forward_fromUserOptional. For forwarded messages, sender of the original message
forward_from_chatChatOptional. For messages forwarded from channels or from anonymous administrators, information about the original sender chat
forward_from_message_idIntegerOptional. For messages forwarded from channels, identifier of the original message in the channel
forward_signatureStringOptional. For messages forwarded from channels, signature of the post author if present
forward_sender_nameStringOptional. Sender's name for messages forwarded from users who disallow adding a link to their account in forwarded messages
forward_dateIntegerOptional. For forwarded messages, date the original message was sent in Unix time
reply_to_messageMessageOptional. 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_botUserOptional. Bot through which the message was sent
edit_dateIntegerOptional. Date the message was last edited in Unix time
media_group_idStringOptional. The unique identifier of a media message group this message belongs to
author_signatureStringOptional. Signature of the post author for messages in channels, or the custom title of an anonymous group administrator
textStringOptional. For text messages, the actual UTF-8 text of the message, 0-4096 characters
entitiesArray of MessageEntityOptional. For text messages, special entities like usernames, URLs, bot commands, etc. that appear in the text
animationAnimationOptional. Message is an animation, information about the animation. For backward compatibility, when this field is set, the document field will also be set
audioAudioOptional. Message is an audio file, information about the file
documentDocumentOptional. Message is a general file, information about the file
photoArray of PhotoSizeOptional. Message is a photo, available sizes of the photo
stickerStickerOptional. Message is a sticker, information about the sticker
videoVideoOptional. Message is a video, information about the video
video_noteVideoNoteOptional. Message is a video note, information about the video message
voiceVoiceOptional. Message is a voice message, information about the file
captionStringOptional. Caption for the animation, audio, document, photo, video or voice, 0-1024 characters
caption_entitiesArray of MessageEntityOptional. For messages with a caption, special entities like usernames, URLs, bot commands, etc. that appear in the caption
contactContactOptional. Message is a shared contact, information about the contact
diceDiceOptional. Message is a dice with random value
gameGameOptional. Message is a game, information about the game. More about games »
pollPollOptional. Message is a native poll, information about the poll
venueVenueOptional. Message is a venue, information about the venue. For backward compatibility, when this field is set, the location field will also be set
locationLocationOptional. Message is a shared location, information about the location
new_chat_membersArray of UserOptional. 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_memberUserOptional. A member was removed from the group, information about them (this member may be the bot itself)
new_chat_titleStringOptional. A chat title was changed to this value
new_chat_photoArray of PhotoSizeOptional. A chat photo was change to this value
delete_chat_photoTrueOptional. Service message: the chat photo was deleted
group_chat_createdTrueOptional. Service message: the group has been created
supergroup_chat_createdTrueOptional. 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_createdTrueOptional. 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_changedMessageAutoDeleteTimerChangedOptional. Service message: auto-delete timer settings changed in the chat
migrate_to_chat_idIntegerOptional. 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_idIntegerOptional. 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_messageMessageOptional. 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.
invoiceInvoiceOptional. Message is an invoice for a payment, information about the invoice. More about payments »
successful_paymentSuccessfulPaymentOptional. Message is a service message about a successful payment, information about the payment. More about payments »
connected_websiteStringOptional. The domain name of the website on which the user has logged in. More about Telegram Login »
passport_dataPassportDataOptional. Telegram Passport data
proximity_alert_triggeredProximityAlertTriggeredOptional. Service message. A user in the chat triggered another user's proximity alert while sharing Live Location.
voice_chat_scheduledVoiceChatScheduledOptional. Service message: voice chat scheduled
voice_chat_startedVoiceChatStartedOptional. Service message: voice chat started
voice_chat_endedVoiceChatEndedOptional. Service message: voice chat ended
voice_chat_participants_invitedVoiceChatParticipantsInvitedOptional. Service message: new participants invited to a voice chat
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message. login_url buttons are represented as ordinary url buttons.
-

MessageId

-

This object represents a unique message identifier.

- - - - - - - - - - - - - - - -
FieldTypeDescription
message_idIntegerUnique message identifier
-

MessageEntity

-

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
typeStringType of the entity. Can be “mention” (@username), “hashtag” (#hashtag), “cashtag” ($USD), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames)
offsetIntegerOffset in UTF-16 code units to the start of the entity
lengthIntegerLength of the entity in UTF-16 code units
urlStringOptional. For “text_link” only, url that will be opened after user taps on the text
userUserOptional. For “text_mention” only, the mentioned user
languageStringOptional. For “pre” only, the programming language of the entity text
-

PhotoSize

-

This object represents one size of a photo or a file / sticker thumbnail.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
file_idStringIdentifier for this file, which can be used to download or reuse the file
file_unique_idStringUnique 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.
widthIntegerPhoto width
heightIntegerPhoto height
file_sizeIntegerOptional. File size in bytes
-

Animation

-

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
file_idStringIdentifier for this file, which can be used to download or reuse the file
file_unique_idStringUnique 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.
widthIntegerVideo width as defined by sender
heightIntegerVideo height as defined by sender
durationIntegerDuration of the video in seconds as defined by sender
thumbPhotoSizeOptional. Animation thumbnail as defined by sender
file_nameStringOptional. Original animation filename as defined by sender
mime_typeStringOptional. MIME type of the file as defined by sender
file_sizeIntegerOptional. File size in bytes
-

Audio

-

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
file_idStringIdentifier for this file, which can be used to download or reuse the file
file_unique_idStringUnique 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.
durationIntegerDuration of the audio in seconds as defined by sender
performerStringOptional. Performer of the audio as defined by sender or by audio tags
titleStringOptional. Title of the audio as defined by sender or by audio tags
file_nameStringOptional. Original filename as defined by sender
mime_typeStringOptional. MIME type of the file as defined by sender
file_sizeIntegerOptional. File size in bytes
thumbPhotoSizeOptional. Thumbnail of the album cover to which the music file belongs
-

Document

-

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
file_idStringIdentifier for this file, which can be used to download or reuse the file
file_unique_idStringUnique 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.
thumbPhotoSizeOptional. Document thumbnail as defined by sender
file_nameStringOptional. Original filename as defined by sender
mime_typeStringOptional. MIME type of the file as defined by sender
file_sizeIntegerOptional. File size in bytes
-

Video

-

This object represents a video file.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
file_idStringIdentifier for this file, which can be used to download or reuse the file
file_unique_idStringUnique 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.
widthIntegerVideo width as defined by sender
heightIntegerVideo height as defined by sender
durationIntegerDuration of the video in seconds as defined by sender
thumbPhotoSizeOptional. Video thumbnail
file_nameStringOptional. Original filename as defined by sender
mime_typeStringOptional. Mime type of a file as defined by sender
file_sizeIntegerOptional. File size in bytes
-

VideoNote

-

This object represents a video message (available in Telegram apps as of v.4.0).

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
file_idStringIdentifier for this file, which can be used to download or reuse the file
file_unique_idStringUnique 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.
lengthIntegerVideo width and height (diameter of the video message) as defined by sender
durationIntegerDuration of the video in seconds as defined by sender
thumbPhotoSizeOptional. Video thumbnail
file_sizeIntegerOptional. File size in bytes
-

Voice

-

This object represents a voice note.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
file_idStringIdentifier for this file, which can be used to download or reuse the file
file_unique_idStringUnique 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.
durationIntegerDuration of the audio in seconds as defined by sender
mime_typeStringOptional. MIME type of the file as defined by sender
file_sizeIntegerOptional. File size in bytes
-

Contact

-

This object represents a phone contact.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
phone_numberStringContact's phone number
first_nameStringContact's first name
last_nameStringOptional. Contact's last name
user_idIntegerOptional. 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.
vcardStringOptional. Additional data about the contact in the form of a vCard
-

Dice

-

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

- - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
emojiStringEmoji on which the dice throw animation is based
valueIntegerValue of the dice, 1-6 for “🎲”, “🎯” and “🎳” base emoji, 1-5 for “🏀” and “⚽” base emoji, 1-64 for “🎰” base emoji
-

PollOption

-

This object contains information about one answer option in a poll.

- - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
textStringOption text, 1-100 characters
voter_countIntegerNumber of users that voted for this option
-

PollAnswer

-

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

- - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
poll_idStringUnique poll identifier
userUserThe user, who changed the answer to the poll
option_idsArray of Integer0-based identifiers of answer options, chosen by the user. May be empty if the user retracted their vote.
-

Poll

-

This object contains information about a poll.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
idStringUnique poll identifier
questionStringPoll question, 1-300 characters
optionsArray of PollOptionList of poll options
total_voter_countIntegerTotal number of users that voted in the poll
is_closedBooleanTrue, if the poll is closed
is_anonymousBooleanTrue, if the poll is anonymous
typeStringPoll type, currently can be “regular” or “quiz”
allows_multiple_answersBooleanTrue, if the poll allows multiple answers
correct_option_idIntegerOptional. 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.
explanationStringOptional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon in a quiz-style poll, 0-200 characters
explanation_entitiesArray of MessageEntityOptional. Special entities like usernames, URLs, bot commands, etc. that appear in the explanation
open_periodIntegerOptional. Amount of time in seconds the poll will be active after creation
close_dateIntegerOptional. Point in time (Unix timestamp) when the poll will be automatically closed
-

Location

-

This object represents a point on the map.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
longitudeFloatLongitude as defined by sender
latitudeFloatLatitude as defined by sender
horizontal_accuracyFloat numberOptional. The radius of uncertainty for the location, measured in meters; 0-1500
live_periodIntegerOptional. Time relative to the message sending date, during which the location can be updated; in seconds. For active live locations only.
headingIntegerOptional. The direction in which user is moving, in degrees; 1-360. For active live locations only.
proximity_alert_radiusIntegerOptional. Maximum distance for proximity alerts about approaching another chat member, in meters. For sent live locations only.
-

Venue

-

This object represents a venue.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
locationLocationVenue location. Can't be a live location
titleStringName of the venue
addressStringAddress of the venue
foursquare_idStringOptional. Foursquare identifier of the venue
foursquare_typeStringOptional. Foursquare type of the venue. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
google_place_idStringOptional. Google Places identifier of the venue
google_place_typeStringOptional. Google Places type of the venue. (See supported types.)
-

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.

- - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
travelerUserUser that triggered the alert
watcherUserUser that set the alert
distanceIntegerThe distance between the users
-

MessageAutoDeleteTimerChanged

-

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

- - - - - - - - - - - - - - - -
FieldTypeDescription
message_auto_delete_timeIntegerNew auto-delete time for messages in the chat; in seconds
-

VoiceChatScheduled

-

This object represents a service message about a voice chat scheduled in the chat.

- - - - - - - - - - - - - - - -
FieldTypeDescription
start_dateIntegerPoint in time (Unix timestamp) when the voice chat is supposed to be started by a chat administrator
-

VoiceChatStarted

-

This object represents a service message about a voice chat started in the chat. Currently holds no information.

-

VoiceChatEnded

-

This object represents a service message about a voice chat ended in the chat.

- - - - - - - - - - - - - - - -
FieldTypeDescription
durationIntegerVoice chat duration in seconds
-

VoiceChatParticipantsInvited

-

This object represents a service message about new members invited to a voice chat.

- - - - - - - - - - - - - - - -
FieldTypeDescription
usersArray of UserOptional. New members that were invited to the voice chat
-

UserProfilePhotos

-

This object represent a user's profile pictures.

- - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
total_countIntegerTotal number of profile pictures the target user has
photosArray of Array of PhotoSizeRequested profile pictures (in up to 4 sizes each)
-

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.

-
-

Maximum file size to download is 20 MB

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
file_idStringIdentifier for this file, which can be used to download or reuse the file
file_unique_idStringUnique 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_sizeIntegerOptional. File size in bytes, if known
file_pathStringOptional. File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file.
-

ReplyKeyboardMarkup

-

This object represents a custom keyboard with reply options (see Introduction to bots for details and examples).

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
keyboardArray of Array of KeyboardButtonArray of button rows, each represented by an Array of KeyboardButton objects
resize_keyboardBooleanOptional. 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.
one_time_keyboardBooleanOptional. 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_placeholderStringOptional. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters
selectiveBooleanOptional. 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.
-

KeyboardButton

-

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 request_contact, request_location, and request_poll are mutually exclusive.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
textStringText of the button. If none of the optional fields are used, it will be sent as a message when the button is pressed
request_contactBooleanOptional. If True, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only
request_locationBooleanOptional. If True, the user's current location will be sent when the button is pressed. Available in private chats only
request_pollKeyboardButtonPollTypeOptional. 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
-

Note: request_contact and request_location options will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message.
Note: request_poll option will only work in Telegram versions released after 23 January, 2020. Older clients will display unsupported message.

-

KeyboardButtonPollType

-

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

- - - - - - - - - - - - - - - -
FieldTypeDescription
typeStringOptional. 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.
-

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).

- - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
remove_keyboardTrueRequests 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)
selectiveBooleanOptional. 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.
-

InlineKeyboardMarkup

-

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

- - - - - - - - - - - - - - - -
FieldTypeDescription
inline_keyboardArray of Array of InlineKeyboardButtonArray of button rows, each represented by an Array of InlineKeyboardButton objects
-

Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message.

-

InlineKeyboardButton

-

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
textStringLabel text on the button
urlStringOptional. HTTP or tg:// url to be opened when button is pressed
login_urlLoginUrlOptional. An HTTP URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget.
callback_dataStringOptional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes
switch_inline_queryStringOptional. 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 switch_pm… actions – in this case the user will be automatically returned to the chat they switched from, skipping the chat selection screen.
switch_inline_query_current_chatStringOptional. 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.
callback_gameCallbackGameOptional. 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.
payBooleanOptional. Specify True, to send a Pay button.

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

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:

-
- TITLE -
- -

Telegram apps support these buttons as of version 5.7.

-
-

Sample bot: @discussbot

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
urlStringAn 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.
forward_textStringOptional. New text of the button in forwarded messages.
bot_usernameStringOptional. 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_accessBooleanOptional. Pass True to request the permission for your bot to send messages to the user.
-

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.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
idStringUnique identifier for this query
fromUserSender
messageMessageOptional. 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_idStringOptional. Identifier of the message sent via the bot in inline mode, that originated the query.
chat_instanceStringGlobal identifier, uniquely corresponding to the chat to which the message with the callback button was sent. Useful for high scores in games.
dataStringOptional. Data associated with the callback button. Be aware that a bad client can send arbitrary data in this field.
game_short_nameStringOptional. Short name of a Game to be returned, serves as the unique identifier for the game
-
-

NOTE: After the user presses a callback button, Telegram clients will display a progress bar until you call answerCallbackQuery. It is, therefore, necessary to react by calling answerCallbackQuery even if no notification to the user is needed (e.g., without specifying any of the optional parameters).

-
-

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.

- - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
force_replyTrueShows reply interface to the user, as if they manually selected the bot's message and tapped 'Reply'
input_field_placeholderStringOptional. The placeholder to be shown in the input field when the reply is active; 1-64 characters
selectiveBooleanOptional. 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.
-
-

Example: A poll bot for groups runs in privacy mode (only receives commands, replies to its messages and mentions). There could be two ways to create a new poll:

-
    -
  • Explain the user how to send a command with parameters (e.g. /newpoll question answer1 answer2). May be appealing for hardcore users but lacks modern day polish.
  • -
  • Guide the user through a step-by-step process. 'Please send me your question', 'Cool, now let's add the first answer option', 'Great. Keep adding answer options, then send /done when you're ready'.
  • -
-

The last option is definitely more attractive. And if you use ForceReply in your bot's questions, it will receive the user's answers even if it only receives replies, commands and mentions — without any extra work for the user.

-
-

ChatPhoto

-

This object represents a chat photo.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
small_file_idStringFile 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_idStringUnique 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_idStringFile 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_idStringUnique 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.
-

ChatInviteLink

-

Represents an invite link for a chat.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
invite_linkStringThe invite link. If the link was created by another chat administrator, then the second part of the link will be replaced with “…”.
creatorUserCreator of the link
creates_join_requestBooleanTrue, if users joining the chat via the link need to be approved by chat administrators
is_primaryBooleanTrue, if the link is primary
is_revokedBooleanTrue, if the link is revoked
nameStringOptional. Invite link name
expire_dateIntegerOptional. Point in time (Unix timestamp) when the link will expire or has been expired
member_limitIntegerOptional. 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_countIntegerOptional. Number of pending join requests created using this link
-

ChatMember

-

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

- -

ChatMemberOwner

-

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
statusStringThe member's status in the chat, always “creator”
userUserInformation about the user
is_anonymousBooleanTrue, if the user's presence in the chat is hidden
custom_titleStringOptional. Custom title for this user
-

ChatMemberAdministrator

-

Represents a chat member that has some additional privileges.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
statusStringThe member's status in the chat, always “administrator”
userUserInformation about the user
can_be_editedBooleanTrue, if the bot is allowed to edit administrator privileges of that user
is_anonymousBooleanTrue, if the user's presence in the chat is hidden
can_manage_chatBooleanTrue, 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_delete_messagesBooleanTrue, if the administrator can delete messages of other users
can_manage_voice_chatsBooleanTrue, if the administrator can manage voice chats
can_restrict_membersBooleanTrue, if the administrator can restrict, ban or unban chat members
can_promote_membersBooleanTrue, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by the user)
can_change_infoBooleanTrue, if the user is allowed to change the chat title, photo and other settings
can_invite_usersBooleanTrue, if the user is allowed to invite new users to the chat
can_post_messagesBooleanOptional. True, if the administrator can post in the channel; channels only
can_edit_messagesBooleanOptional. True, if the administrator can edit messages of other users and can pin messages; channels only
can_pin_messagesBooleanOptional. True, if the user is allowed to pin messages; groups and supergroups only
custom_titleStringOptional. Custom title for this user
-

ChatMemberMember

-

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

- - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
statusStringThe member's status in the chat, always “member”
userUserInformation about the user
-

ChatMemberRestricted

-

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
statusStringThe member's status in the chat, always “restricted”
userUserInformation about the user
is_memberBooleanTrue, if the user is a member of the chat at the moment of the request
can_change_infoBooleanTrue, if the user is allowed to change the chat title, photo and other settings
can_invite_usersBooleanTrue, if the user is allowed to invite new users to the chat
can_pin_messagesBooleanTrue, if the user is allowed to pin messages
can_send_messagesBooleanTrue, if the user is allowed to send text messages, contacts, locations and venues
can_send_media_messagesBooleanTrue, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes
can_send_pollsBooleanTrue, if the user is allowed to send polls
can_send_other_messagesBooleanTrue, if the user is allowed to send animations, games, stickers and use inline bots
can_add_web_page_previewsBooleanTrue, if the user is allowed to add web page previews to their messages
until_dateIntegerDate when restrictions will be lifted for this user; unix time. If 0, then the user is restricted forever
-

ChatMemberLeft

-

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

- - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
statusStringThe member's status in the chat, always “left”
userUserInformation about the user
-

ChatMemberBanned

-

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

- - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
statusStringThe member's status in the chat, always “kicked”
userUserInformation about the user
until_dateIntegerDate when restrictions will be lifted for this user; unix time. If 0, then the user is banned forever
-

ChatMemberUpdated

-

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
chatChatChat the user belongs to
fromUserPerformer of the action, which resulted in the change
dateIntegerDate the change was done in Unix time
old_chat_memberChatMemberPrevious information about the chat member
new_chat_memberChatMemberNew information about the chat member
invite_linkChatInviteLinkOptional. Chat invite link, which was used by the user to join the chat; for joining by invite link events only.
-

ChatJoinRequest

-

Represents a join request sent to a chat.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
chatChatChat to which the request was sent
fromUserUser that sent the join request
dateIntegerDate the request was sent in Unix time
bioStringOptional. Bio of the user.
invite_linkChatInviteLinkOptional. Chat invite link that was used by the user to send the join request
-

ChatPermissions

-

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
can_send_messagesBooleanOptional. True, if the user is allowed to send text messages, contacts, locations and venues
can_send_media_messagesBooleanOptional. True, if the user is allowed to send audios, documents, photos, videos, video notes and voice notes, implies can_send_messages
can_send_pollsBooleanOptional. True, if the user is allowed to send polls, implies can_send_messages
can_send_other_messagesBooleanOptional. True, if the user is allowed to send animations, games, stickers and use inline bots, implies can_send_media_messages
can_add_web_page_previewsBooleanOptional. True, if the user is allowed to add web page previews to their messages, implies can_send_media_messages
can_change_infoBooleanOptional. True, if the user is allowed to change the chat title, photo and other settings. Ignored in public supergroups
can_invite_usersBooleanOptional. True, if the user is allowed to invite new users to the chat
can_pin_messagesBooleanOptional. True, if the user is allowed to pin messages. Ignored in public supergroups
-

ChatLocation

-

Represents a location to which a chat is connected.

- - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
locationLocationThe location to which the supergroup is connected. Can't be a live location.
addressStringLocation address; 1-64 characters, as defined by the chat owner
-

BotCommand

-

This object represents a bot command.

- - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
commandStringText of the command, 1-32 characters. Can contain only lowercase English letters, digits and underscores.
descriptionStringDescription of the command, 3-256 characters.
-

BotCommandScope

-

This object represents the scope to which bot commands are applied. Currently, the following 7 scopes are supported:

- -

Determining list of commands

-

The following algorithm is used to determine the list of commands for a particular user viewing the bot menu. The first list of commands which is set is returned:

-

Commands in the chat with the bot

-
    -
  • botCommandScopeChat + language_code
  • -
  • botCommandScopeChat
  • -
  • botCommandScopeAllPrivateChats + language_code
  • -
  • botCommandScopeAllPrivateChats
  • -
  • botCommandScopeDefault + language_code
  • -
  • botCommandScopeDefault
  • -
-

Commands in group and supergroup chats

-
    -
  • botCommandScopeChatMember + language_code
  • -
  • botCommandScopeChatMember
  • -
  • botCommandScopeChatAdministrators + language_code (administrators only)
  • -
  • botCommandScopeChatAdministrators (administrators only)
  • -
  • botCommandScopeChat + language_code
  • -
  • botCommandScopeChat
  • -
  • botCommandScopeAllChatAdministrators + language_code (administrators only)
  • -
  • botCommandScopeAllChatAdministrators (administrators only)
  • -
  • botCommandScopeAllGroupChats + language_code
  • -
  • botCommandScopeAllGroupChats
  • -
  • botCommandScopeDefault + language_code
  • -
  • botCommandScopeDefault
  • -
-

BotCommandScopeDefault

-

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

- - - - - - - - - - - - - - - -
FieldTypeDescription
typeStringScope type, must be default
-

BotCommandScopeAllPrivateChats

-

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

- - - - - - - - - - - - - - - -
FieldTypeDescription
typeStringScope type, must be all_private_chats
-

BotCommandScopeAllGroupChats

-

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

- - - - - - - - - - - - - - - -
FieldTypeDescription
typeStringScope type, must be all_group_chats
-

BotCommandScopeAllChatAdministrators

-

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

- - - - - - - - - - - - - - - -
FieldTypeDescription
typeStringScope type, must be all_chat_administrators
-

BotCommandScopeChat

-

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

- - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
typeStringScope type, must be chat
chat_idInteger or StringUnique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
-

BotCommandScopeChatAdministrators

-

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

- - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
typeStringScope type, must be chat_administrators
chat_idInteger or StringUnique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
-

BotCommandScopeChatMember

-

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

- - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
typeStringScope type, must be chat_member
chat_idInteger or StringUnique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
user_idIntegerUnique identifier of the target user
-

ResponseParameters

-

Contains information about why a request was unsuccessful.

- - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
migrate_to_chat_idIntegerOptional. 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_afterIntegerOptional. In case of exceeding flood control, the number of seconds left to wait before the request can be repeated
-

InputMedia

-

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

- -

InputMediaPhoto

-

Represents a photo to be sent.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
typeStringType of the result, must be photo
mediaStringFile 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 info on Sending Files »
captionStringOptional. Caption of the photo to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the photo caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
-

InputMediaVideo

-

Represents a video to be sent.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
typeStringType of the result, must be video
mediaStringFile 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 info on Sending Files »
thumbInputFile or StringOptional. 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 info on Sending Files »
captionStringOptional. Caption of the video to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the video caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
widthIntegerOptional. Video width
heightIntegerOptional. Video height
durationIntegerOptional. Video duration in seconds
supports_streamingBooleanOptional. Pass True, if the uploaded video is suitable for streaming
-

InputMediaAnimation

-

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
typeStringType of the result, must be animation
mediaStringFile 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 info on Sending Files »
thumbInputFile or StringOptional. 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 info on Sending Files »
captionStringOptional. Caption of the animation to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the animation caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
widthIntegerOptional. Animation width
heightIntegerOptional. Animation height
durationIntegerOptional. Animation duration in seconds
-

InputMediaAudio

-

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
typeStringType of the result, must be audio
mediaStringFile 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 info on Sending Files »
thumbInputFile or StringOptional. 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 info on Sending Files »
captionStringOptional. Caption of the audio to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the audio caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
durationIntegerOptional. Duration of the audio in seconds
performerStringOptional. Performer of the audio
titleStringOptional. Title of the audio
-

InputMediaDocument

-

Represents a general file to be sent.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
typeStringType of the result, must be document
mediaStringFile 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 info on Sending Files »
thumbInputFile or StringOptional. 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 info on Sending Files »
captionStringOptional. Caption of the document to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the document caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
disable_content_type_detectionBooleanOptional. 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.
-

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.

-

Sending files

-

There are three ways to send files (photos, stickers, audio, media, etc.):

-
    -
  1. If the file is already stored somewhere on the Telegram servers, you don't need to reupload it: each file object has a file_id field, simply pass this file_id as a parameter instead of uploading. There are no limits for files sent this way.
  2. -
  3. Provide Telegram with an HTTP URL for the file to be sent. Telegram will download and send the file. 5 MB max size for photos and 20 MB max for other types of content.
  4. -
  5. Post the file using multipart/form-data in the usual way that files are uploaded via the browser. 10 MB max size for photos, 50 MB for other files.
  6. -
-

Sending by file_id

-
    -
  • It is not possible to change the file type when resending by file_id. I.e. a video can't be sent as a photo, a photo can't be sent as a document, etc.
  • -
  • It is not possible to resend thumbnails.
  • -
  • Resending a photo by file_id will send all of its sizes.
  • -
  • file_id is unique for each individual bot and can't be transferred from one bot to another.
  • -
  • file_id uniquely identifies a file, but a file can have different valid file_ids even for the same bot.
  • -
-

Sending by URL

-
    -
  • When sending by URL the target file must have the correct MIME type (e.g., audio/mpeg for sendAudio, etc.).
  • -
  • In sendDocument, sending by URL will currently only work for GIF, PDF and ZIP files.
  • -
  • To use sendVoice, the file must have the type audio/ogg and be no more than 1MB in size. 1-20MB voice notes will be sent as files.
  • -
  • Other configurations may work but we can't guarantee that they will.
  • -
-

Inline mode objects

-

Objects and methods used in the inline mode are described in the Inline mode section.

-

Available methods

-
-

All methods in the Bot API are case-insensitive. We support GET and POST HTTP methods. Use either URL query string or application/json or application/x-www-form-urlencoded or multipart/form-data for passing parameters in Bot API requests.
On successful call, a JSON-object containing the result will be returned.

-
-

getMe

-

A simple method for testing your bot's authentication token. Requires no parameters. Returns basic information about the bot in form of a User object.

-

logOut

-

Use this method to log out from the cloud Bot API server before launching the bot locally. You must log out the bot before running it locally, otherwise there is no guarantee that the bot will receive updates. After a successful call, you can immediately log in on a local server, but will not be able to log in back to the cloud Bot API server for 10 minutes. Returns True on success. Requires no parameters.

-

close

-

Use this method to close the bot instance before moving it from one local server to another. You need to delete the webhook before calling this method to ensure that the bot isn't launched again after server restart. The method will return error 429 in the first 10 minutes after the bot is launched. Returns True on success. Requires no parameters.

-

sendMessage

-

Use this method to send text messages. On success, the sent Message is returned.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
textStringYesText of the message to be sent, 1-4096 characters after entities parsing
parse_modeStringOptionalMode for parsing entities in the message text. See formatting options for more details.
entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode
disable_web_page_previewBooleanOptionalDisables link previews for links in this message
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional 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.
-

Formatting options

-

The Bot API supports basic formatting for messages. You can use bold, italic, underlined and strikethrough text, as well as inline links and pre-formatted code in your bots' messages. Telegram clients will render them accordingly. You can use either markdown-style or HTML-style formatting.

-

Note that Telegram clients will display an alert to the user before opening an inline link ('Open this link?' together with the full URL).

-

Message entities can be nested, providing following restrictions are met:
- If two entities has common characters then one of them is fully contained inside another.
- bold, italic, underline and strikethrough entities can contain and to be contained in any other entities, except pre and code.
- All other entities can't contain each other.

-

Links tg://user?id=<user_id> can be used to mention a user by their ID without using a username. Please note:

-
    -
  • These links will work only if they are used inside an inline link. For example, they will not work, when used in an inline keyboard button or in a message text.
  • -
  • These mentions are only guaranteed to work if the user has contacted the bot in the past, has sent a callback query to the bot via inline button or is a member in the group where he was mentioned.
  • -
-
MarkdownV2 style
-

To use this mode, pass MarkdownV2 in the parse_mode field. Use the following syntax in your message:

-
*bold \*text*
-_italic \*text_
-__underline__
-~strikethrough~
-*bold _italic bold ~italic bold strikethrough~ __underline italic bold___ bold*
-[inline URL](http://www.example.com/)
-[inline mention of a user](tg://user?id=123456789)
-`inline fixed-width code`
-```
-pre-formatted fixed-width code block
-```
-```python
-pre-formatted fixed-width code block written in the Python programming language
-```
-

Please note:

-
    -
  • Any character with code between 1 and 126 inclusively can be escaped anywhere with a preceding '\' character, in which case it is treated as an ordinary character and not a part of the markup. This implies that '\' character usually must be escaped with a preceding '\' character.
  • -
  • Inside pre and code entities, all '`' and '\' characters must be escaped with a preceding '\' character.
  • -
  • Inside (...) part of inline link definition, all ')' and '\' must be escaped with a preceding '\' character.
  • -
  • In all other places characters '_', '*', '[', ']', '(', ')', '~', '`', '>', '#', '+', '-', '=', '|', '{', '}', '.', '!' must be escaped with the preceding character '\'.
  • -
  • In case of ambiguity between italic and underline entities __ is always greadily treated from left to right as beginning or end of underline entity, so instead of ___italic underline___ use ___italic underline_\r__, where \r is a character with code 13, which will be ignored.
  • -
-
HTML style
-

To use this mode, pass HTML in the parse_mode field. The following tags are currently supported:

-
<b>bold</b>, <strong>bold</strong>
-<i>italic</i>, <em>italic</em>
-<u>underline</u>, <ins>underline</ins>
-<s>strikethrough</s>, <strike>strikethrough</strike>, <del>strikethrough</del>
-<b>bold <i>italic bold <s>italic bold strikethrough</s> <u>underline italic bold</u></i> bold</b>
-<a href="http://www.example.com/">inline URL</a>
-<a href="tg://user?id=123456789">inline mention of a user</a>
-<code>inline fixed-width code</code>
-<pre>pre-formatted fixed-width code block</pre>
-<pre><code class="language-python">pre-formatted fixed-width code block written in the Python programming language</code></pre>
-

Please note:

-
    -
  • Only the tags mentioned above are currently supported.
  • -
  • All <, > and & symbols that are not a part of a tag or an HTML entity must be replaced with the corresponding HTML entities (< with &lt;, > with &gt; and & with &amp;).
  • -
  • All numerical HTML entities are supported.
  • -
  • The API currently supports only the following named HTML entities: &lt;, &gt;, &amp; and &quot;.
  • -
  • Use nested pre and code tags, to define programming language for pre entity.
  • -
  • Programming language can't be specified for standalone code tags.
  • -
-
Markdown style
-

This is a legacy mode, retained for backward compatibility. To use this mode, pass Markdown in the parse_mode field. Use the following syntax in your message:

-
*bold text*
-_italic text_
-[inline URL](http://www.example.com/)
-[inline mention of a user](tg://user?id=123456789)
-`inline fixed-width code`
-```
-pre-formatted fixed-width code block
-```
-```python
-pre-formatted fixed-width code block written in the Python programming language
-```
-

Please note:

-
    -
  • Entities must not be nested, use parse mode MarkdownV2 instead.
  • -
  • There is no way to specify underline and strikethrough entities, use parse mode MarkdownV2 instead.
  • -
  • To escape characters '_', '*', '`', '[' outside of an entity, prepend the characters '\' before them.
  • -
  • Escaping inside entities is not allowed, so entity must be closed first and reopened again: use _snake_\__case_ for italic snake_case and *2*\**2=4* for bold 2*2=4.
  • -
-

forwardMessage

-

Use this method to forward messages of any kind. Service messages can't be forwarded. On success, the sent Message is returned.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
from_chat_idInteger or StringYesUnique identifier for the chat where the original message was sent (or channel username in the format @channelusername)
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
message_idIntegerYesMessage identifier in the chat specified in from_chat_id
-

copyMessage

-

Use this method to copy messages of any kind. Service messages and invoice messages can't be copied. The method is analogous to the method forwardMessage, but the copied message doesn't have a link to the original message. Returns the MessageId of the sent message on success.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
from_chat_idInteger or StringYesUnique identifier for the chat where the original message was sent (or channel username in the format @channelusername)
message_idIntegerYesMessage identifier in the chat specified in from_chat_id
captionStringOptionalNew caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept
parse_modeStringOptionalMode for parsing entities in the new caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the new caption, which can be specified instead of parse_mode
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional 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.
-

sendPhoto

-

Use this method to send photos. On success, the sent Message is returned.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
photoInputFile or StringYesPhoto to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20. More info on Sending Files »
captionStringOptionalPhoto caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing
parse_modeStringOptionalMode for parsing entities in the photo caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional 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.
-

sendAudio

-

Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio must be in the .MP3 or .M4A format. On success, the sent Message is returned. Bots can currently send audio files of up to 50 MB in size, this limit may be changed in the future.

-

For sending voice messages, use the sendVoice method instead.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
audioInputFile or StringYesAudio file to send. Pass a file_id as String to send an audio file that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an audio file from the Internet, or upload a new one using multipart/form-data. More info on Sending Files »
captionStringOptionalAudio caption, 0-1024 characters after entities parsing
parse_modeStringOptionalMode for parsing entities in the audio caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
durationIntegerOptionalDuration of the audio in seconds
performerStringOptionalPerformer
titleStringOptionalTrack name
thumbInputFile or StringOptionalThumbnail 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 info on Sending Files »
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional 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.
-

sendDocument

-

Use this method to send general files. On success, the sent Message is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
documentInputFile or StringYesFile 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 file from the Internet, or upload a new one using multipart/form-data. More info on Sending Files »
thumbInputFile or StringOptionalThumbnail 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 info on Sending Files »
captionStringOptionalDocument caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing
parse_modeStringOptionalMode for parsing entities in the document caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
disable_content_type_detectionBooleanOptionalDisables automatic server-side content type detection for files uploaded using multipart/form-data
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional 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.
-

sendVideo

-

Use this method to send video files, Telegram clients support mp4 videos (other formats may be sent as Document). On success, the sent Message is returned. Bots can currently send video files of up to 50 MB in size, this limit may be changed in the future.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
videoInputFile or StringYesVideo to send. Pass a file_id as String to send a video that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a video from the Internet, or upload a new video using multipart/form-data. More info on Sending Files »
durationIntegerOptionalDuration of sent video in seconds
widthIntegerOptionalVideo width
heightIntegerOptionalVideo height
thumbInputFile or StringOptionalThumbnail 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 info on Sending Files »
captionStringOptionalVideo caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing
parse_modeStringOptionalMode for parsing entities in the video caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
supports_streamingBooleanOptionalPass True, if the uploaded video is suitable for streaming
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional 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.
-

sendAnimation

-

Use this method to send animation files (GIF or H.264/MPEG-4 AVC video without sound). On success, the sent Message is returned. Bots can currently send animation files of up to 50 MB in size, this limit may be changed in the future.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
animationInputFile or StringYesAnimation to send. Pass a file_id as String to send an animation that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get an animation from the Internet, or upload a new animation using multipart/form-data. More info on Sending Files »
durationIntegerOptionalDuration of sent animation in seconds
widthIntegerOptionalAnimation width
heightIntegerOptionalAnimation height
thumbInputFile or StringOptionalThumbnail 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 info on Sending Files »
captionStringOptionalAnimation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing
parse_modeStringOptionalMode for parsing entities in the animation caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional 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.
-

sendVoice

-

Use this method to send audio files, if you want Telegram clients to display the file as a playable voice message. For this to work, your audio must be in an .OGG file encoded with OPUS (other formats may be sent as Audio or Document). On success, the sent Message is returned. Bots can currently send voice messages of up to 50 MB in size, this limit may be changed in the future.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
voiceInputFile or StringYesAudio file 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 file from the Internet, or upload a new one using multipart/form-data. More info on Sending Files »
captionStringOptionalVoice message caption, 0-1024 characters after entities parsing
parse_modeStringOptionalMode for parsing entities in the voice message caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
durationIntegerOptionalDuration of the voice message in seconds
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional 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.
-

sendVideoNote

-

As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long. Use this method to send video messages. On success, the sent Message is returned.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
video_noteInputFile or StringYesVideo note to send. Pass a file_id as String to send a video note that exists on the Telegram servers (recommended) or upload a new video using multipart/form-data. More info on Sending Files ». Sending video notes by a URL is currently unsupported
durationIntegerOptionalDuration of sent video in seconds
lengthIntegerOptionalVideo width and height, i.e. diameter of the video message
thumbInputFile or StringOptionalThumbnail 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 info on Sending Files »
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional 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.
-

sendMediaGroup

-

Use this method to send a group of photos, videos, documents or audios as an album. Documents and audio files can be only grouped in an album with messages of the same type. On success, an array of Messages that were sent is returned.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
mediaArray of InputMediaAudio, InputMediaDocument, InputMediaPhoto and InputMediaVideoYesA JSON-serialized array describing messages to be sent, must include 2-10 items
disable_notificationBooleanOptionalSends messages silently. Users will receive a notification with no sound.
reply_to_message_idIntegerOptionalIf the messages are a reply, ID of the original message
allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
-

sendLocation

-

Use this method to send point on the map. On success, the sent Message is returned.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
latitudeFloat numberYesLatitude of the location
longitudeFloat numberYesLongitude of the location
horizontal_accuracyFloat numberOptionalThe radius of uncertainty for the location, measured in meters; 0-1500
live_periodIntegerOptionalPeriod in seconds for which the location will be updated (see Live Locations, should be between 60 and 86400.
headingIntegerOptionalFor live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
proximity_alert_radiusIntegerOptionalFor live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional 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.
-

editMessageLiveLocation

-

Use this method to edit live location messages. A location can be edited until its live_period expires or editing is explicitly disabled by a call to stopMessageLiveLocation. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringOptionalRequired if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
message_idIntegerOptionalRequired if inline_message_id is not specified. Identifier of the message to edit
inline_message_idStringOptionalRequired if chat_id and message_id are not specified. Identifier of the inline message
latitudeFloat numberYesLatitude of new location
longitudeFloat numberYesLongitude of new location
horizontal_accuracyFloat numberOptionalThe radius of uncertainty for the location, measured in meters; 0-1500
headingIntegerOptionalDirection in which the user is moving, in degrees. Must be between 1 and 360 if specified.
proximity_alert_radiusIntegerOptionalMaximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for a new inline keyboard.
-

stopMessageLiveLocation

-

Use this method to stop updating a live location message before live_period expires. On success, if the message is not an inline message, the edited Message is returned, otherwise True is returned.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringOptionalRequired if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
message_idIntegerOptionalRequired if inline_message_id is not specified. Identifier of the message with live location to stop
inline_message_idStringOptionalRequired if chat_id and message_id are not specified. Identifier of the inline message
reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for a new inline keyboard.
-

sendVenue

-

Use this method to send information about a venue. On success, the sent Message is returned.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
latitudeFloat numberYesLatitude of the venue
longitudeFloat numberYesLongitude of the venue
titleStringYesName of the venue
addressStringYesAddress of the venue
foursquare_idStringOptionalFoursquare identifier of the venue
foursquare_typeStringOptionalFoursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
google_place_idStringOptionalGoogle Places identifier of the venue
google_place_typeStringOptionalGoogle Places type of the venue. (See supported types.)
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional 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.
-

sendContact

-

Use this method to send phone contacts. On success, the sent Message is returned.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
phone_numberStringYesContact's phone number
first_nameStringYesContact's first name
last_nameStringOptionalContact's last name
vcardStringOptionalAdditional data about the contact in the form of a vCard, 0-2048 bytes
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove keyboard or to force a reply from the user.
-

sendPoll

-

Use this method to send a native poll. On success, the sent Message is returned.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
questionStringYesPoll question, 1-300 characters
optionsArray of StringYesA JSON-serialized list of answer options, 2-10 strings 1-100 characters each
is_anonymousBooleanOptionalTrue, if the poll needs to be anonymous, defaults to True
typeStringOptionalPoll type, “quiz” or “regular”, defaults to “regular”
allows_multiple_answersBooleanOptionalTrue, if the poll allows multiple answers, ignored for polls in quiz mode, defaults to False
correct_option_idIntegerOptional0-based identifier of the correct answer option, required for polls in quiz mode
explanationStringOptionalText 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_modeStringOptionalMode for parsing entities in the explanation. See formatting options for more details.
explanation_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the poll explanation, which can be specified instead of parse_mode
open_periodIntegerOptionalAmount of time in seconds the poll will be active after creation, 5-600. Can't be used together with close_date.
close_dateIntegerOptionalPoint 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_closedBooleanOptionalPass True, if the poll needs to be immediately closed. This can be useful for poll preview.
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional 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.
-

sendDice

-

Use this method to send an animated emoji that will display a random value. On success, the sent Message is returned.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
emojiStringOptionalEmoji 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_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional 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.
-

sendChatAction

-

Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns True on success.

-
-

Example: The ImageBot needs some time to process a request and upload the image. Instead of sending a text message along the lines of “Retrieving image, please wait…”, the bot may use sendChatAction with action = upload_photo. The user will see a “sending photo” status for the bot.

-
-

We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive.

- - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
actionStringYesType of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_voice or upload_voice for voice notes, upload_document for general files, choose_sticker for stickers, find_location for location data, record_video_note or upload_video_note for video notes.
-

getUserProfilePhotos

-

Use this method to get a list of profile pictures for a user. Returns a UserProfilePhotos object.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
user_idIntegerYesUnique identifier of the target user
offsetIntegerOptionalSequential number of the first photo to be returned. By default, all photos are returned.
limitIntegerOptionalLimits the number of photos to be retrieved. Values between 1-100 are accepted. Defaults to 100.
-

getFile

-

Use this method to get basic info about a file and prepare it for downloading. For the moment, bots can download files of up to 20MB in size. On success, a File object is returned. The file can then be downloaded via the link https://api.telegram.org/file/bot<token>/<file_path>, where <file_path> is taken from the response. 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 again.

- - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
file_idStringYesFile identifier to get info about
-

Note: This function may not preserve the original file name and MIME type. You should save the file's MIME type and name (if available) when the File object is received.

-

banChatMember

-

Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target group or username of the target supergroup or channel (in the format @channelusername)
user_idIntegerYesUnique identifier of the target user
until_dateIntegerOptionalDate 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_messagesBooleanOptionalPass True to delete all messages from the chat for the user that is being removed. If False, the user will be able to see messages in the group that were sent before the user was removed. Always True for supergroups and channels.
-

unbanChatMember

-

Use this method to unban a previously banned user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. By default, this method guarantees that after the call the user is not a member of the chat, but will be able to join it. So if the user is a member of the chat they will also be removed from the chat. If you don't want this, use the parameter only_if_banned. Returns True on success.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target group or username of the target supergroup or channel (in the format @username)
user_idIntegerYesUnique identifier of the target user
only_if_bannedBooleanOptionalDo nothing if the user is not banned
-

restrictChatMember

-

Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate administrator rights. Pass True for all permissions to lift restrictions from a user. Returns True on success.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
user_idIntegerYesUnique identifier of the target user
permissionsChatPermissionsYesA JSON-serialized object for new user permissions
until_dateIntegerOptionalDate 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
-

promoteChatMember

-

Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Pass False for all boolean parameters to demote a user. Returns True on success.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
user_idIntegerYesUnique identifier of the target user
is_anonymousBooleanOptionalPass True, if the administrator's presence in the chat is hidden
can_manage_chatBooleanOptionalPass 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_messagesBooleanOptionalPass True, if the administrator can create channel posts, channels only
can_edit_messagesBooleanOptionalPass True, if the administrator can edit messages of other users and can pin messages, channels only
can_delete_messagesBooleanOptionalPass True, if the administrator can delete messages of other users
can_manage_voice_chatsBooleanOptionalPass True, if the administrator can manage voice chats
can_restrict_membersBooleanOptionalPass True, if the administrator can restrict, ban or unban chat members
can_promote_membersBooleanOptionalPass True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him)
can_change_infoBooleanOptionalPass True, if the administrator can change chat title, photo and other settings
can_invite_usersBooleanOptionalPass True, if the administrator can invite new users to the chat
can_pin_messagesBooleanOptionalPass True, if the administrator can pin messages, supergroups only
-

setChatAdministratorCustomTitle

-

Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True on success.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
user_idIntegerYesUnique identifier of the target user
custom_titleStringYesNew custom title for the administrator; 0-16 characters, emoji are not allowed
-

setChatPermissions

-

Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members administrator rights. Returns True on success.

- - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
permissionsChatPermissionsYesA JSON-serialized object for new default chat permissions
-

exportChatInviteLink

-

Use this method to generate a new primary invite link for a chat; any previously generated primary link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the new invite link as String on success.

- - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
-
-

Note: Each administrator in a chat generates their own invite links. Bots can't use invite links generated by other administrators. If you want your bot to work with invite links, it will need to generate its own link using exportChatInviteLink or by calling the getChat method. If your bot needs to generate a new primary invite link replacing its previous one, use exportChatInviteLink again.

-
-

createChatInviteLink

-

Use this method to create an additional invite link for a chat. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. The link can be revoked using the method revokeChatInviteLink. Returns the new invite link as ChatInviteLink object.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
nameStringOptionalInvite link name; 0-32 characters
expire_dateIntegerOptionalPoint in time (Unix timestamp) when the link will expire
member_limitIntegerOptionalMaximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999
creates_join_requestBooleanOptionalTrue, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified
-

editChatInviteLink

-

Use this method to edit a non-primary invite link created by the bot. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the edited invite link as a ChatInviteLink object.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
invite_linkStringYesThe invite link to edit
nameStringOptionalInvite link name; 0-32 characters
expire_dateIntegerOptionalPoint in time (Unix timestamp) when the link will expire
member_limitIntegerOptionalMaximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999
creates_join_requestBooleanOptionalTrue, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can't be specified
-

revokeChatInviteLink

-

Use this method to revoke an invite link created by the bot. If the primary link is revoked, a new link is automatically generated. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the revoked invite link as ChatInviteLink object.

- - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier of the target chat or username of the target channel (in the format @channelusername)
invite_linkStringYesThe invite link to revoke
-

approveChatJoinRequest

-

Use this method to approve a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns True on success.

- - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
user_idIntegerYesUnique identifier of the target user
-

declineChatJoinRequest

-

Use this method to decline a chat join request. The bot must be an administrator in the chat for this to work and must have the can_invite_users administrator right. Returns True on success.

- - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
user_idIntegerYesUnique identifier of the target user
-

setChatPhoto

-

Use this method to set a new profile photo for the chat. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.

- - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
photoInputFileYesNew chat photo, uploaded using multipart/form-data
-

deleteChatPhoto

-

Use this method to delete a chat photo. Photos can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.

- - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
-

setChatTitle

-

Use this method to change the title of a chat. Titles can't be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.

- - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
titleStringYesNew chat title, 1-255 characters
-

setChatDescription

-

Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.

- - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
descriptionStringOptionalNew chat description, 0-255 characters
-

pinChatMessage

-

Use this method to add a message to the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
message_idIntegerYesIdentifier of a message to pin
disable_notificationBooleanOptionalPass 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 and private chats.
-

unpinChatMessage

-

Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.

- - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
message_idIntegerOptionalIdentifier of a message to unpin. If not specified, the most recent pinned message (by sending date) will be unpinned.
-

unpinAllChatMessages

-

Use this method to clear the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the 'can_pin_messages' administrator right in a supergroup or 'can_edit_messages' administrator right in a channel. Returns True on success.

- - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
-

leaveChat

-

Use this method for your bot to leave a group, supergroup or channel. Returns True on success.

- - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
-

getChat

-

Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.). Returns a Chat object on success.

- - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
-

getChatAdministrators

-

Use this method to get a list of administrators in a chat. On success, returns an Array of ChatMember objects that contains information about all chat administrators except other bots. If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned.

- - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
-

getChatMemberCount

-

Use this method to get the number of members in a chat. Returns Int on success.

- - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
-

getChatMember

-

Use this method to get information about a member of a chat. Returns a ChatMember object on success.

- - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername)
user_idIntegerYesUnique identifier of the target user
-

setChatStickerSet

-

Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success.

- - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
sticker_set_nameStringYesName of the sticker set to be set as the group sticker set
-

deleteChatStickerSet

-

Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set optionally returned in getChat requests to check if the bot can use this method. Returns True on success.

- - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)
-

answerCallbackQuery

-

Use this method to send answers to callback queries sent from inline keyboards. The answer will be displayed to the user as a notification at the top of the chat screen or as an alert. On success, True is returned.

-
-

Alternatively, the user can be redirected to the specified Game URL. For this option to work, you must first create a game for your bot via @Botfather and accept the terms. Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter.

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
callback_query_idStringYesUnique identifier for the query to be answered
textStringOptionalText of the notification. If not specified, nothing will be shown to the user, 0-200 characters
show_alertBooleanOptionalIf True, an alert will be shown by the client instead of a notification at the top of the chat screen. Defaults to false.
urlStringOptionalURL that will be opened by the user's client. If you have created a Game and accepted the conditions via @Botfather, specify the URL that opens your game — note that this will only work if the query comes from a callback_game button.

Otherwise, you may use links like t.me/your_bot?start=XXXX that open your bot with a parameter.
cache_timeIntegerOptionalThe 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.
-

setMyCommands

-

Use this method to change the list of the bot's commands. See https://core.telegram.org/bots#commands for more details about bot commands. Returns True on success.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
commandsArray of BotCommandYesA JSON-serialized list of bot commands to be set as the list of the bot's commands. At most 100 commands can be specified.
scopeBotCommandScopeOptionalA JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault.
language_codeStringOptionalA two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands
-

deleteMyCommands

-

Use this method to delete the list of the bot's commands for the given scope and user language. After deletion, higher level commands will be shown to affected users. Returns True on success.

- - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
scopeBotCommandScopeOptionalA JSON-serialized object, describing scope of users for which the commands are relevant. Defaults to BotCommandScopeDefault.
language_codeStringOptionalA two-letter ISO 639-1 language code. If empty, commands will be applied to all users from the given scope, for whose language there are no dedicated commands
-

getMyCommands

-

Use this method to get the current list of the bot's commands for the given scope and user language. Returns Array of BotCommand on success. If commands aren't set, an empty list is returned.

- - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
scopeBotCommandScopeOptionalA JSON-serialized object, describing scope of users. Defaults to BotCommandScopeDefault.
language_codeStringOptionalA two-letter ISO 639-1 language code or an empty string
-

Inline mode methods

-

Methods and objects used in the inline mode are described in the Inline mode section.

-

Updating messages

-

The following methods allow you to change an existing message in the message history instead of sending a new one with a result of an action. This is most useful for messages with inline keyboards using callback queries, but can also help reduce clutter in conversations with regular chat bots.

-

Please note, that it is currently only possible to edit messages without reply_markup or with inline keyboards.

-

editMessageText

-

Use this method to edit text and game messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringOptionalRequired if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
message_idIntegerOptionalRequired if inline_message_id is not specified. Identifier of the message to edit
inline_message_idStringOptionalRequired if chat_id and message_id are not specified. Identifier of the inline message
textStringYesNew text of the message, 1-4096 characters after entities parsing
parse_modeStringOptionalMode for parsing entities in the message text. See formatting options for more details.
entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode
disable_web_page_previewBooleanOptionalDisables link previews for links in this message
reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for an inline keyboard.
-

editMessageCaption

-

Use this method to edit captions of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringOptionalRequired if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
message_idIntegerOptionalRequired if inline_message_id is not specified. Identifier of the message to edit
inline_message_idStringOptionalRequired if chat_id and message_id are not specified. Identifier of the inline message
captionStringOptionalNew caption of the message, 0-1024 characters after entities parsing
parse_modeStringOptionalMode for parsing entities in the message caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptionalA JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for an inline keyboard.
-

editMessageMedia

-

Use this method to edit animation, audio, document, photo, or video messages. If a message is part of a message album, then it can be edited only to an audio for audio albums, only to a document for document albums and to a photo or a video otherwise. When an inline message is edited, a new file can't be uploaded; use a previously uploaded file via its file_id or specify a URL. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringOptionalRequired if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
message_idIntegerOptionalRequired if inline_message_id is not specified. Identifier of the message to edit
inline_message_idStringOptionalRequired if chat_id and message_id are not specified. Identifier of the inline message
mediaInputMediaYesA JSON-serialized object for a new media content of the message
reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for a new inline keyboard.
-

editMessageReplyMarkup

-

Use this method to edit only the reply markup of messages. On success, if the edited message is not an inline message, the edited Message is returned, otherwise True is returned.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringOptionalRequired if inline_message_id is not specified. Unique identifier for the target chat or username of the target channel (in the format @channelusername)
message_idIntegerOptionalRequired if inline_message_id is not specified. Identifier of the message to edit
inline_message_idStringOptionalRequired if chat_id and message_id are not specified. Identifier of the inline message
reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for an inline keyboard.
-

stopPoll

-

Use this method to stop a poll which was sent by the bot. On success, the stopped Poll is returned.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
message_idIntegerYesIdentifier of the original message with the poll
reply_markupInlineKeyboardMarkupOptionalA JSON-serialized object for a new message inline keyboard.
-

deleteMessage

-

Use this method to delete a message, including service messages, with the following limitations:
- A message can only be deleted if it was sent less than 48 hours ago.
- A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.
- Bots can delete outgoing messages in private chats, groups, and supergroups.
- Bots can delete incoming messages in private chats.
- Bots granted can_post_messages permissions can delete outgoing messages in channels.
- If the bot is an administrator of a group, it can delete any message there.
- If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there.
Returns True on success.

- - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
message_idIntegerYesIdentifier of the message to delete
-

Stickers

-

The following methods and objects allow your bot to handle stickers and sticker sets.

-

Sticker

-

This object represents a sticker.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
file_idStringIdentifier for this file, which can be used to download or reuse the file
file_unique_idStringUnique 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.
widthIntegerSticker width
heightIntegerSticker height
is_animatedBooleanTrue, if the sticker is animated
thumbPhotoSizeOptional. Sticker thumbnail in the .WEBP or .JPG format
emojiStringOptional. Emoji associated with the sticker
set_nameStringOptional. Name of the sticker set to which the sticker belongs
mask_positionMaskPositionOptional. For mask stickers, the position where the mask should be placed
file_sizeIntegerOptional. File size in bytes
-

StickerSet

-

This object represents a sticker set.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
nameStringSticker set name
titleStringSticker set title
is_animatedBooleanTrue, if the sticker set contains animated stickers
contains_masksBooleanTrue, if the sticker set contains masks
stickersArray of StickerList of all set stickers
thumbPhotoSizeOptional. Sticker set thumbnail in the .WEBP or .TGS format
-

MaskPosition

-

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
pointStringThe part of the face relative to which the mask should be placed. One of “forehead”, “eyes”, “mouth”, or “chin”.
x_shiftFloat numberShift 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_shiftFloat numberShift 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.
scaleFloat numberMask scaling coefficient. For example, 2.0 means double size.
-

sendSticker

-

Use this method to send static .WEBP or animated .TGS stickers. On success, the sent Message is returned.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
stickerInputFile or StringYesSticker 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 info on Sending Files »
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
reply_markupInlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReplyOptionalAdditional 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.
-

getStickerSet

-

Use this method to get a sticker set. On success, a StickerSet object is returned.

- - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
nameStringYesName of the sticker set
-

uploadStickerFile

-

Use this method to upload a .PNG file with a sticker for later use in createNewStickerSet and addStickerToSet methods (can be used multiple times). Returns the uploaded File on success.

- - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
user_idIntegerYesUser identifier of sticker file owner
png_stickerInputFileYesPNG image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. More info on Sending Files »
-

createNewStickerSet

-

Use this method to create a new sticker set owned by a user. The bot will be able to edit the sticker set thus created. You must use exactly one of the fields png_sticker or tgs_sticker. Returns True on success.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
user_idIntegerYesUser identifier of created sticker set owner
nameStringYesShort name of sticker set, to be used in t.me/addstickers/ URLs (e.g., animals). Can contain only english letters, digits and underscores. Must begin with a letter, can't contain consecutive underscores and must end in “_by_<bot username>”. <bot_username> is case insensitive. 1-64 characters.
titleStringYesSticker set title, 1-64 characters
png_stickerInputFile or StringOptionalPNG image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. 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, or upload a new one using multipart/form-data. More info on Sending Files »
tgs_stickerInputFileOptionalTGS animation with the sticker, uploaded using multipart/form-data. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements
emojisStringYesOne or more emoji corresponding to the sticker
contains_masksBooleanOptionalPass True, if a set of mask stickers should be created
mask_positionMaskPositionOptionalA JSON-serialized object for position where the mask should be placed on faces
-

addStickerToSet

-

Use this method to add a new sticker to a set created by the bot. You must use exactly one of the fields png_sticker or tgs_sticker. Animated stickers can be added to animated sticker sets and only to them. Animated sticker sets can have up to 50 stickers. Static sticker sets can have up to 120 stickers. Returns True on success.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
user_idIntegerYesUser identifier of sticker set owner
nameStringYesSticker set name
png_stickerInputFile or StringOptionalPNG image with the sticker, must be up to 512 kilobytes in size, dimensions must not exceed 512px, and either width or height must be exactly 512px. 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, or upload a new one using multipart/form-data. More info on Sending Files »
tgs_stickerInputFileOptionalTGS animation with the sticker, uploaded using multipart/form-data. See https://core.telegram.org/animated_stickers#technical-requirements for technical requirements
emojisStringYesOne or more emoji corresponding to the sticker
mask_positionMaskPositionOptionalA JSON-serialized object for position where the mask should be placed on faces
-

setStickerPositionInSet

-

Use this method to move a sticker in a set created by the bot to a specific position. Returns True on success.

- - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
stickerStringYesFile identifier of the sticker
positionIntegerYesNew sticker position in the set, zero-based
-

deleteStickerFromSet

-

Use this method to delete a sticker from a set created by the bot. Returns True on success.

- - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
stickerStringYesFile identifier of the sticker
-

setStickerSetThumb

-

Use this method to set the thumbnail of a sticker set. Animated thumbnails can be set for animated sticker sets only. Returns True on success.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
nameStringYesSticker set name
user_idIntegerYesUser identifier of the sticker set owner
thumbInputFile or StringOptionalA PNG image with the thumbnail, must be up to 128 kilobytes in size and have width and height exactly 100px, or a TGS animation with the thumbnail up to 32 kilobytes in size; see https://core.telegram.org/animated_stickers#technical-requirements for animated sticker technical requirements. 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, or upload a new one using multipart/form-data. More info on Sending Files ». Animated sticker set thumbnail can't be uploaded via HTTP URL.
-

Inline mode

-

The following methods and objects allow your bot to work in inline mode.
Please see our Introduction to Inline bots for more details.

-

To enable this option, send the /setinline command to @BotFather and provide the placeholder text that the user will see in the input field after typing your bot's name.

-

InlineQuery

-

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
idStringUnique identifier for this query
fromUserSender
queryStringText of the query (up to 256 characters)
offsetStringOffset of the results to be returned, can be controlled by the bot
chat_typeStringOptional. 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
locationLocationOptional. Sender location, only for bots that request user location
-

answerInlineQuery

-

Use this method to send answers to an inline query. On success, True is returned.
No more than 50 results per query are allowed.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
inline_query_idStringYesUnique identifier for the answered query
resultsArray of InlineQueryResultYesA JSON-serialized array of results for the inline query
cache_timeIntegerOptionalThe maximum amount of time in seconds that the result of the inline query may be cached on the server. Defaults to 300.
is_personalBooleanOptionalPass 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_offsetStringOptionalPass 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_textStringOptionalIf 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_parameterStringOptionalDeep-linking parameter for the /start message sent to the bot when user presses the switch button. 1-64 characters, only A-Z, a-z, 0-9, _ and - are allowed.

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

InlineQueryResult

-

This object represents one result of an inline query. Telegram clients currently support results of the following 20 types:

- -

Note: All URLs passed in inline query results will be available to end users and therefore must be assumed to be public.

-

InlineQueryResultArticle

-

Represents a link to an article or web page.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
typeStringType of the result, must be article
idStringUnique identifier for this result, 1-64 Bytes
titleStringTitle of the result
input_message_contentInputMessageContentContent of the message to be sent
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
urlStringOptional. URL of the result
hide_urlBooleanOptional. Pass True, if you don't want the URL to be shown in the message
descriptionStringOptional. Short description of the result
thumb_urlStringOptional. Url of the thumbnail for the result
thumb_widthIntegerOptional. Thumbnail width
thumb_heightIntegerOptional. Thumbnail height
-

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.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
typeStringType of the result, must be photo
idStringUnique identifier for this result, 1-64 bytes
photo_urlStringA valid URL of the photo. Photo must be in JPEG format. Photo size must not exceed 5MB
thumb_urlStringURL of the thumbnail for the photo
photo_widthIntegerOptional. Width of the photo
photo_heightIntegerOptional. Height of the photo
titleStringOptional. Title for the result
descriptionStringOptional. Short description of the result
captionStringOptional. Caption of the photo to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the photo caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the photo
-

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.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
typeStringType of the result, must be gif
idStringUnique identifier for this result, 1-64 bytes
gif_urlStringA valid URL for the GIF file. File size must not exceed 1MB
gif_widthIntegerOptional. Width of the GIF
gif_heightIntegerOptional. Height of the GIF
gif_durationIntegerOptional. Duration of the GIF in seconds
thumb_urlStringURL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result
thumb_mime_typeStringOptional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg”
titleStringOptional. Title for the result
captionStringOptional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the GIF animation
-

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.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
typeStringType of the result, must be mpeg4_gif
idStringUnique identifier for this result, 1-64 bytes
mpeg4_urlStringA valid URL for the MP4 file. File size must not exceed 1MB
mpeg4_widthIntegerOptional. Video width
mpeg4_heightIntegerOptional. Video height
mpeg4_durationIntegerOptional. Video duration in seconds
thumb_urlStringURL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result
thumb_mime_typeStringOptional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg”
titleStringOptional. Title for the result
captionStringOptional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the video animation
-

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.

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
typeStringType of the result, must be video
idStringUnique identifier for this result, 1-64 bytes
video_urlStringA valid URL for the embedded video player or video file
mime_typeStringMime type of the content of video url, “text/html” or “video/mp4”
thumb_urlStringURL of the thumbnail (JPEG only) for the video
titleStringTitle for the result
captionStringOptional. Caption of the video to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the video caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
video_widthIntegerOptional. Video width
video_heightIntegerOptional. Video height
video_durationIntegerOptional. Video duration in seconds
descriptionStringOptional. Short description of the result
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. 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).
-

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.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
typeStringType of the result, must be audio
idStringUnique identifier for this result, 1-64 bytes
audio_urlStringA valid URL for the audio file
titleStringTitle
captionStringOptional. Caption, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the audio caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
performerStringOptional. Performer
audio_durationIntegerOptional. Audio duration in seconds
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the audio
-

Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.

-

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.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
typeStringType of the result, must be voice
idStringUnique identifier for this result, 1-64 bytes
voice_urlStringA valid URL for the voice recording
titleStringRecording title
captionStringOptional. Caption, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the voice message caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
voice_durationIntegerOptional. Recording duration in seconds
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the voice recording
-

Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.

-

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.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
typeStringType of the result, must be document
idStringUnique identifier for this result, 1-64 bytes
titleStringTitle for the result
captionStringOptional. Caption of the document to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the document caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
document_urlStringA valid URL for the file
mime_typeStringMime type of the content of the file, either “application/pdf” or “application/zip”
descriptionStringOptional. Short description of the result
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the file
thumb_urlStringOptional. URL of the thumbnail (JPEG only) for the file
thumb_widthIntegerOptional. Thumbnail width
thumb_heightIntegerOptional. Thumbnail height
-

Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.

-

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.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
typeStringType of the result, must be location
idStringUnique identifier for this result, 1-64 Bytes
latitudeFloat numberLocation latitude in degrees
longitudeFloat numberLocation longitude in degrees
titleStringLocation title
horizontal_accuracyFloat numberOptional. The radius of uncertainty for the location, measured in meters; 0-1500
live_periodIntegerOptional. Period in seconds for which the location can be updated, should be between 60 and 86400.
headingIntegerOptional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
proximity_alert_radiusIntegerOptional. 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_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the location
thumb_urlStringOptional. Url of the thumbnail for the result
thumb_widthIntegerOptional. Thumbnail width
thumb_heightIntegerOptional. Thumbnail height
-

Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.

-

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.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
typeStringType of the result, must be venue
idStringUnique identifier for this result, 1-64 Bytes
latitudeFloatLatitude of the venue location in degrees
longitudeFloatLongitude of the venue location in degrees
titleStringTitle of the venue
addressStringAddress of the venue
foursquare_idStringOptional. Foursquare identifier of the venue if known
foursquare_typeStringOptional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
google_place_idStringOptional. Google Places identifier of the venue
google_place_typeStringOptional. Google Places type of the venue. (See supported types.)
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the venue
thumb_urlStringOptional. Url of the thumbnail for the result
thumb_widthIntegerOptional. Thumbnail width
thumb_heightIntegerOptional. Thumbnail height
-

Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.

-

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.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
typeStringType of the result, must be contact
idStringUnique identifier for this result, 1-64 Bytes
phone_numberStringContact's phone number
first_nameStringContact's first name
last_nameStringOptional. Contact's last name
vcardStringOptional. Additional data about the contact in the form of a vCard, 0-2048 bytes
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the contact
thumb_urlStringOptional. Url of the thumbnail for the result
thumb_widthIntegerOptional. Thumbnail width
thumb_heightIntegerOptional. Thumbnail height
-

Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.

-

InlineQueryResultGame

-

Represents a Game.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
typeStringType of the result, must be game
idStringUnique identifier for this result, 1-64 bytes
game_short_nameStringShort name of the game
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
-

Note: This will only work in Telegram versions released after October 1, 2016. Older clients will not display any inline results if a game result is among them.

-

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.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
typeStringType of the result, must be photo
idStringUnique identifier for this result, 1-64 bytes
photo_file_idStringA valid file identifier of the photo
titleStringOptional. Title for the result
descriptionStringOptional. Short description of the result
captionStringOptional. Caption of the photo to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the photo caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the photo
-

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.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
typeStringType of the result, must be gif
idStringUnique identifier for this result, 1-64 bytes
gif_file_idStringA valid file identifier for the GIF file
titleStringOptional. Title for the result
captionStringOptional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the GIF animation
-

InlineQueryResultCachedMpeg4Gif

-

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
typeStringType of the result, must be mpeg4_gif
idStringUnique identifier for this result, 1-64 bytes
mpeg4_file_idStringA valid file identifier for the MP4 file
titleStringOptional. Title for the result
captionStringOptional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the video animation
-

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.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
typeStringType of the result, must be sticker
idStringUnique identifier for this result, 1-64 bytes
sticker_file_idStringA valid file identifier of the sticker
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the sticker
-

Note: This will only work in Telegram versions released after 9 April, 2016 for static stickers and after 06 July, 2019 for animated stickers. Older clients will ignore them.

-

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.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
typeStringType of the result, must be document
idStringUnique identifier for this result, 1-64 bytes
titleStringTitle for the result
document_file_idStringA valid file identifier for the file
descriptionStringOptional. Short description of the result
captionStringOptional. Caption of the document to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the document caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the file
-

Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.

-

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.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
typeStringType of the result, must be video
idStringUnique identifier for this result, 1-64 bytes
video_file_idStringA valid file identifier for the video file
titleStringTitle for the result
descriptionStringOptional. Short description of the result
captionStringOptional. Caption of the video to be sent, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the video caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the video
-

InlineQueryResultCachedVoice

-

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
typeStringType of the result, must be voice
idStringUnique identifier for this result, 1-64 bytes
voice_file_idStringA valid file identifier for the voice message
titleStringVoice message title
captionStringOptional. Caption, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the voice message caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the voice message
-

Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.

-

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.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
typeStringType of the result, must be audio
idStringUnique identifier for this result, 1-64 bytes
audio_file_idStringA valid file identifier for the audio file
captionStringOptional. Caption, 0-1024 characters after entities parsing
parse_modeStringOptional. Mode for parsing entities in the audio caption. See formatting options for more details.
caption_entitiesArray of MessageEntityOptional. List of special entities that appear in the caption, which can be specified instead of parse_mode
reply_markupInlineKeyboardMarkupOptional. Inline keyboard attached to the message
input_message_contentInputMessageContentOptional. Content of the message to be sent instead of the audio
-

Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.

-

InputMessageContent

-

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

- -

InputTextMessageContent

-

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
message_textStringText of the message to be sent, 1-4096 characters
parse_modeStringOptional. Mode for parsing entities in the message text. See formatting options for more details.
entitiesArray of MessageEntityOptional. List of special entities that appear in message text, which can be specified instead of parse_mode
disable_web_page_previewBooleanOptional. Disables link previews for links in the sent message
-

InputLocationMessageContent

-

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
latitudeFloatLatitude of the location in degrees
longitudeFloatLongitude of the location in degrees
horizontal_accuracyFloat numberOptional. The radius of uncertainty for the location, measured in meters; 0-1500
live_periodIntegerOptional. Period in seconds for which the location can be updated, should be between 60 and 86400.
headingIntegerOptional. For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360 if specified.
proximity_alert_radiusIntegerOptional. For live locations, a maximum distance for proximity alerts about approaching another chat member, in meters. Must be between 1 and 100000 if specified.
-

InputVenueMessageContent

-

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
latitudeFloatLatitude of the venue in degrees
longitudeFloatLongitude of the venue in degrees
titleStringName of the venue
addressStringAddress of the venue
foursquare_idStringOptional. Foursquare identifier of the venue, if known
foursquare_typeStringOptional. Foursquare type of the venue, if known. (For example, “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
google_place_idStringOptional. Google Places identifier of the venue
google_place_typeStringOptional. Google Places type of the venue. (See supported types.)
-

InputContactMessageContent

-

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
phone_numberStringContact's phone number
first_nameStringContact's first name
last_nameStringOptional. Contact's last name
vcardStringOptional. Additional data about the contact in the form of a vCard, 0-2048 bytes
-

InputInvoiceMessageContent

-

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
titleStringProduct name, 1-32 characters
descriptionStringProduct description, 1-255 characters
payloadStringBot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.
provider_tokenStringPayment provider token, obtained via Botfather
currencyStringThree-letter ISO 4217 currency code, see more on currencies
pricesArray of LabeledPricePrice breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)
max_tip_amountIntegerOptional. The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0
suggested_tip_amountsArray of IntegerOptional. 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_dataStringOptional. 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_urlStringOptional. 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_sizeIntegerOptional. Photo size
photo_widthIntegerOptional. Photo width
photo_heightIntegerOptional. Photo height
need_nameBooleanOptional. Pass True, if you require the user's full name to complete the order
need_phone_numberBooleanOptional. Pass True, if you require the user's phone number to complete the order
need_emailBooleanOptional. Pass True, if you require the user's email address to complete the order
need_shipping_addressBooleanOptional. Pass True, if you require the user's shipping address to complete the order
send_phone_number_to_providerBooleanOptional. Pass True, if user's phone number should be sent to provider
send_email_to_providerBooleanOptional. Pass True, if user's email address should be sent to provider
is_flexibleBooleanOptional. Pass True, if the final price depends on the shipping method
-

ChosenInlineResult

-

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
result_idStringThe unique identifier for the result that was chosen
fromUserThe user that chose the result
locationLocationOptional. Sender location, only for bots that require user location
inline_message_idStringOptional. 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.
queryStringThe query that was used to obtain the result
-

Note: It is necessary to enable inline feedback via @Botfather in order to receive these objects in updates.

-

Payments

-

Your bot can accept payments from Telegram users. Please see the introduction to payments for more details on the process and how to set up payments for your bot. Please note that users will need Telegram v.4.0 or higher to use payments (released on May 18, 2017).

-

sendInvoice

-

Use this method to send invoices. On success, the sent Message is returned.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idInteger or StringYesUnique identifier for the target chat or username of the target channel (in the format @channelusername)
titleStringYesProduct name, 1-32 characters
descriptionStringYesProduct description, 1-255 characters
payloadStringYesBot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.
provider_tokenStringYesPayments provider token, obtained via Botfather
currencyStringYesThree-letter ISO 4217 currency code, see more on currencies
pricesArray of LabeledPriceYesPrice breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.)
max_tip_amountIntegerOptionalThe maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0
suggested_tip_amountsArray of IntegerOptionalA 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.
start_parameterStringOptionalUnique 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
provider_dataStringOptionalA 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_urlStringOptionalURL 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_sizeIntegerOptionalPhoto size
photo_widthIntegerOptionalPhoto width
photo_heightIntegerOptionalPhoto height
need_nameBooleanOptionalPass True, if you require the user's full name to complete the order
need_phone_numberBooleanOptionalPass True, if you require the user's phone number to complete the order
need_emailBooleanOptionalPass True, if you require the user's email address to complete the order
need_shipping_addressBooleanOptionalPass True, if you require the user's shipping address to complete the order
send_phone_number_to_providerBooleanOptionalPass True, if user's phone number should be sent to provider
send_email_to_providerBooleanOptionalPass True, if user's email address should be sent to provider
is_flexibleBooleanOptionalPass True, if the final price depends on the shipping method
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
reply_markupInlineKeyboardMarkupOptionalA 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.
-

answerShippingQuery

-

If you sent an invoice requesting a shipping address and the parameter is_flexible was specified, the Bot API will send an Update with a shipping_query field to the bot. Use this method to reply to shipping queries. On success, True is returned.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
shipping_query_idStringYesUnique identifier for the query to be answered
okBooleanYesSpecify True if delivery to the specified address is possible and False if there are any problems (for example, if delivery to the specified address is not possible)
shipping_optionsArray of ShippingOptionOptionalRequired if ok is True. A JSON-serialized array of available shipping options.
error_messageStringOptionalRequired if ok is False. Error message in human readable form that explains why it is impossible to complete the order (e.g. "Sorry, delivery to your desired address is unavailable'). Telegram will display this message to the user.
-

answerPreCheckoutQuery

-

Once the user has confirmed their payment and shipping details, the Bot API sends the final confirmation in the form of an Update with the field pre_checkout_query. Use this method to respond to such pre-checkout queries. On success, True is returned. Note: The Bot API must receive an answer within 10 seconds after the pre-checkout query was sent.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
pre_checkout_query_idStringYesUnique identifier for the query to be answered
okBooleanYesSpecify True if everything is alright (goods are available, etc.) and the bot is ready to proceed with the order. Use False if there are any problems.
error_messageStringOptionalRequired 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.
-

LabeledPrice

-

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

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

Invoice

-

This object contains basic information about an invoice.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
titleStringProduct name
descriptionStringProduct description
start_parameterStringUnique bot deep-linking parameter that can be used to generate this invoice
currencyStringThree-letter ISO 4217 currency code
total_amountIntegerTotal price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
-

ShippingAddress

-

This object represents a shipping address.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
country_codeStringISO 3166-1 alpha-2 country code
stateStringState, if applicable
cityStringCity
street_line1StringFirst line for the address
street_line2StringSecond line for the address
post_codeStringAddress post code
-

OrderInfo

-

This object represents information about an order.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
nameStringOptional. User name
phone_numberStringOptional. User's phone number
emailStringOptional. User email
shipping_addressShippingAddressOptional. User shipping address
-

ShippingOption

-

This object represents one shipping option.

- - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
idStringShipping option identifier
titleStringOption title
pricesArray of LabeledPriceList of price portions
-

SuccessfulPayment

-

This object contains basic information about a successful payment.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
currencyStringThree-letter ISO 4217 currency code
total_amountIntegerTotal price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
invoice_payloadStringBot specified invoice payload
shipping_option_idStringOptional. Identifier of the shipping option chosen by the user
order_infoOrderInfoOptional. Order info provided by the user
telegram_payment_charge_idStringTelegram payment identifier
provider_payment_charge_idStringProvider payment identifier
-

ShippingQuery

-

This object contains information about an incoming shipping query.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
idStringUnique query identifier
fromUserUser who sent the query
invoice_payloadStringBot specified invoice payload
shipping_addressShippingAddressUser specified shipping address
-

PreCheckoutQuery

-

This object contains information about an incoming pre-checkout query.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
idStringUnique query identifier
fromUserUser who sent the query
currencyStringThree-letter ISO 4217 currency code
total_amountIntegerTotal price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45 pass amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies).
invoice_payloadStringBot specified invoice payload
shipping_option_idStringOptional. Identifier of the shipping option chosen by the user
order_infoOrderInfoOptional. Order info provided by the user
-

Telegram Passport

-

Telegram Passport is a unified authorization method for services that require personal identification. Users can upload their documents once, then instantly share their data with services that require real-world ID (finance, ICOs, etc.). Please see the manual for details.

-

PassportData

-

Contains information about Telegram Passport data shared with the bot by the user.

- - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
dataArray of EncryptedPassportElementArray with information about documents and other Telegram Passport elements that was shared with the bot
credentialsEncryptedCredentialsEncrypted credentials required to decrypt the data
-

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.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
file_idStringIdentifier for this file, which can be used to download or reuse the file
file_unique_idStringUnique 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_sizeIntegerFile size in bytes
file_dateIntegerUnix time when the file was uploaded
-

EncryptedPassportElement

-

Contains information about documents or other Telegram Passport elements shared with the bot by the user.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
typeStringElement 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”.
dataStringOptional. 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_numberStringOptional. User's verified phone number, available only for “phone_number” type
emailStringOptional. User's verified email address, available only for “email” type
filesArray of PassportFileOptional. 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_sidePassportFileOptional. 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_sidePassportFileOptional. 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.
selfiePassportFileOptional. Encrypted file with the selfie of the user holding a document, provided by the user; available for “passport”, “driver_license”, “identity_card” and “internal_passport”. The file can be decrypted and verified using the accompanying EncryptedCredentials.
translationArray of PassportFileOptional. 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.
hashStringBase64-encoded element hash for using in PassportElementErrorUnspecified
-

EncryptedCredentials

-

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

- - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
dataStringBase64-encoded encrypted JSON-serialized data with unique user's payload, data hashes and secrets required for EncryptedPassportElement decryption and authentication
hashStringBase64-encoded data hash for data authentication
secretStringBase64-encoded secret, encrypted with the bot's public RSA key, required for data decryption
-

setPassportDataErrors

-

Informs a user that some of the Telegram Passport elements they provided contains errors. The user will not be able to re-submit their Passport to you until the errors are fixed (the contents of the field for which you returned the error must change). Returns True on success.

-

Use this if the data submitted by the user doesn't satisfy the standards your service requires for any reason. For example, if a birthday date seems invalid, a submitted document is blurry, a scan shows evidence of tampering, etc. Supply some details in the error message to make sure the user knows how to correct the issues.

- - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
user_idIntegerYesUser identifier
errorsArray of PassportElementErrorYesA JSON-serialized array describing the errors
-

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:

- -

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.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
sourceStringError source, must be data
typeStringThe section of the user's Telegram Passport which has the error, one of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”
field_nameStringName of the data field which has the error
data_hashStringBase64-encoded data hash
messageStringError message
-

PassportElementErrorFrontSide

-

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
sourceStringError source, must be front_side
typeStringThe section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”
file_hashStringBase64-encoded hash of the file with the front side of the document
messageStringError message
-

PassportElementErrorReverseSide

-

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
sourceStringError source, must be reverse_side
typeStringThe section of the user's Telegram Passport which has the issue, one of “driver_license”, “identity_card”
file_hashStringBase64-encoded hash of the file with the reverse side of the document
messageStringError message
-

PassportElementErrorSelfie

-

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
sourceStringError source, must be selfie
typeStringThe section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”
file_hashStringBase64-encoded hash of the file with the selfie
messageStringError message
-

PassportElementErrorFile

-

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
sourceStringError source, must be file
typeStringThe section of the user's Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”
file_hashStringBase64-encoded file hash
messageStringError message
-

PassportElementErrorFiles

-

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
sourceStringError source, must be files
typeStringThe section of the user's Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”
file_hashesArray of StringList of base64-encoded file hashes
messageStringError message
-

PassportElementErrorTranslationFile

-

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
sourceStringError source, must be translation_file
typeStringType 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_hashStringBase64-encoded file hash
messageStringError message
-

PassportElementErrorTranslationFiles

-

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
sourceStringError source, must be translation_files
typeStringType of element of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”
file_hashesArray of StringList of base64-encoded file hashes
messageStringError message
-

PassportElementErrorUnspecified

-

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
sourceStringError source, must be unspecified
typeStringType of element of the user's Telegram Passport which has the issue
element_hashStringBase64-encoded element hash
messageStringError message
-

Games

-

Your bot can offer users HTML5 games to play solo or to compete against each other in groups and one-on-one chats. Create games via @BotFather using the /newgame command. Please note that this kind of power requires responsibility: you will need to accept the terms for each game that your bots will be offering.

-
    -
  • Games are a new type of content on Telegram, represented by the Game and InlineQueryResultGame objects.
  • -
  • Once you've created a game via BotFather, you can send games to chats as regular messages using the sendGame method, or use inline mode with InlineQueryResultGame.
  • -
  • If you send the game message without any buttons, it will automatically have a 'Play GameName' button. When this button is pressed, your bot gets a CallbackQuery with the game_short_name of the requested game. You provide the correct URL for this particular user and the app opens the game in the in-app browser.
  • -
  • You can manually add multiple buttons to your game message. Please note that the first button in the first row must always launch the game, using the field callback_game in InlineKeyboardButton. You can add extra buttons according to taste: e.g., for a description of the rules, or to open the game's official community.
  • -
  • To make your game more attractive, you can upload a GIF animation that demostrates the game to the users via BotFather (see Lumberjack for example).
  • -
  • A game message will also display high scores for the current chat. Use setGameScore to post high scores to the chat with the game, add the edit_message parameter to automatically update the message with the current scoreboard.
  • -
  • Use getGameHighScores to get data for in-game high score tables.
  • -
  • You can also add an extra sharing button for users to share their best score to different chats.
  • -
  • For examples of what can be done using this new stuff, check the @gamebot and @gamee bots.
  • -
-

sendGame

-

Use this method to send a game. On success, the sent Message is returned.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
chat_idIntegerYesUnique identifier for the target chat
game_short_nameStringYesShort name of the game, serves as the unique identifier for the game. Set up your games via Botfather.
disable_notificationBooleanOptionalSends the message silently. Users will receive a notification with no sound.
reply_to_message_idIntegerOptionalIf the message is a reply, ID of the original message
allow_sending_without_replyBooleanOptionalPass True, if the message should be sent even if the specified replied-to message is not found
reply_markupInlineKeyboardMarkupOptionalA 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.
-

Game

-

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

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
titleStringTitle of the game
descriptionStringDescription of the game
photoArray of PhotoSizePhoto that will be displayed in the game message in chats.
textStringOptional. Brief description of the game or high scores included in the game message. Can be automatically edited to include current high scores for the game when the bot calls setGameScore, or manually edited using editMessageText. 0-4096 characters.
text_entitiesArray of MessageEntityOptional. Special entities that appear in text, such as usernames, URLs, bot commands, etc.
animationAnimationOptional. Animation that will be displayed in the game message in chats. Upload via BotFather
-

CallbackGame

-

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

-

setGameScore

-

Use this method to set the score of the specified user in a game message. On success, if the message is not an inline message, the Message is returned, otherwise True is returned. Returns an error, if the new score is not greater than the user's current score in the chat and force is False.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
user_idIntegerYesUser identifier
scoreIntegerYesNew score, must be non-negative
forceBooleanOptionalPass True, if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters
disable_edit_messageBooleanOptionalPass True, if the game message should not be automatically edited to include the current scoreboard
chat_idIntegerOptionalRequired if inline_message_id is not specified. Unique identifier for the target chat
message_idIntegerOptionalRequired if inline_message_id is not specified. Identifier of the sent message
inline_message_idStringOptionalRequired if chat_id and message_id are not specified. Identifier of the inline message
-

getGameHighScores

-

Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. On success, returns an Array of GameHighScore objects.

-
-

This method will currently return scores for the target user, plus two of their closest neighbors on each side. Will also return the top three users if the user and his neighbors are not among them. Please note that this behavior is subject to change.

-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ParameterTypeRequiredDescription
user_idIntegerYesTarget user id
chat_idIntegerOptionalRequired if inline_message_id is not specified. Unique identifier for the target chat
message_idIntegerOptionalRequired if inline_message_id is not specified. Identifier of the sent message
inline_message_idStringOptionalRequired if chat_id and message_id are not specified. Identifier of the inline message
-

GameHighScore

-

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

- - - - - - - - - - - - - - - - - - - - - - - - - -
FieldTypeDescription
positionIntegerPosition in high score table for the game
userUserUser
scoreIntegerScore
-
-

And that's about all we've got for now.
If you've got any questions, please check out our Bot FAQ »

-
- -
- -
-
- -
- - - - - - - - diff --git a/data/core.telegram.org/constructor/inputStickerSetID.html b/data/core.telegram.org/constructor/inputStickerSetID.html deleted file mode 100644 index 0c60dc80b9..0000000000 --- a/data/core.telegram.org/constructor/inputStickerSetID.html +++ /dev/null @@ -1,152 +0,0 @@ - - - - - inputStickerSetID - - - - - - - - - - - - - -
- -
-
-
- -

inputStickerSetID

- -

Stickerset by ID

-

- -
-
inputStickerSetID#9de7a269 id:long access_hash:long = InputStickerSet;

-

Parameters

- - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
idlongID
access_hashlongAccess hash
-

Type

-

InputStickerSet

- -
- -
-
- -
- - - - - - diff --git a/data/core.telegram.org/constructor/messages.dhConfig b/data/core.telegram.org/constructor/messages.dhConfig deleted file mode 100644 index 4a41053c42..0000000000 --- a/data/core.telegram.org/constructor/messages.dhConfig +++ /dev/null @@ -1,162 +0,0 @@ - - - - - messages.dhConfig - - - - - - - - - - - - - -
- -
-
-
- -

messages.dhConfig

- -

New set of configuring parameters.

-

- -
-
messages.dhConfig#2c221edd g:int p:bytes version:int random:bytes = messages.DhConfig;

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
gintNew value prime, see Wikipedia
pbytesNew value primitive root, see Wikipedia
versionintVestion of set of parameters
randombytesRandom sequence of bytes of assigned length
-

Type

-

messages.DhConfig

- -
- -
-
- -
- - - - - - diff --git a/data/core.telegram.org/constructor/recentMeUrlChatInvite.html b/data/core.telegram.org/constructor/recentMeUrlChatInvite.html deleted file mode 100644 index 060dc60df6..0000000000 --- a/data/core.telegram.org/constructor/recentMeUrlChatInvite.html +++ /dev/null @@ -1,152 +0,0 @@ - - - - - recentMeUrlChatInvite - - - - - - - - - - - - - -
- -
-
-
- -

recentMeUrlChatInvite

- -

Recent t.me invite link to a chat

-

- -
-
recentMeUrlChatInvite#eb49081d url:string chat_invite:ChatInvite = RecentMeUrl;

-

Parameters

- - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
urlstringt.me URL
chat_inviteChatInviteChat invitation
-

Type

-

RecentMeUrl

- -
- -
-
- -
- - - - - - diff --git a/data/core.telegram.org/constructor/topPeerCategoryChannels.html b/data/core.telegram.org/constructor/topPeerCategoryChannels.html deleted file mode 100644 index b11cfbe95c..0000000000 --- a/data/core.telegram.org/constructor/topPeerCategoryChannels.html +++ /dev/null @@ -1,132 +0,0 @@ - - - - - topPeerCategoryChannels - - - - - - - - - - - - - -
- -
-
-
- -

topPeerCategoryChannels

- -

Most frequently visited channels

-

- -
-
topPeerCategoryChannels#161d9628 = TopPeerCategory;

-

Parameters

-

This constructor does not require any parameters.

-

Type

-

TopPeerCategory

- -
- -
-
- -
- - - - - - diff --git a/data/core.telegram.org/constructor/updateStickerSetsOrder.html b/data/core.telegram.org/constructor/updateStickerSetsOrder.html deleted file mode 100644 index 0879d1674e..0000000000 --- a/data/core.telegram.org/constructor/updateStickerSetsOrder.html +++ /dev/null @@ -1,157 +0,0 @@ - - - - - updateStickerSetsOrder - - - - - - - - - - - - - -
- -
-
-
- -

updateStickerSetsOrder

- -

The order of stickersets was changed

-

- -
-
updateStickerSetsOrder#bb2d201 flags:# masks:flags.0?true order:Vector<long> = Update;

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
flags#Flags, see TL conditional fields
masksflags.0?trueWhether the updated stickers are mask stickers
orderVector<long>New sticker order by sticker ID
-

Type

-

Update

- -
- -
-
- -
- - - - - - diff --git a/data/core.telegram.org/method/payments.clearSavedInfo b/data/core.telegram.org/method/payments.clearSavedInfo deleted file mode 100644 index ddaac72abf..0000000000 --- a/data/core.telegram.org/method/payments.clearSavedInfo +++ /dev/null @@ -1,160 +0,0 @@ - - - - - payments.clearSavedInfo - - - - - - - - - - - - - -
- -
-
-
- -

payments.clearSavedInfo

- -

Clear saved payment information

-

- -
-
boolFalse#bc799737 = Bool;
-boolTrue#997275b5 = Bool;
----functions---
-payments.clearSavedInfo#d83d70c1 flags:# credentials:flags.0?true info:flags.1?true = Bool;

-

Parameters

- - - - - - - - - - - - - - - - - - - - - - - - - -
NameTypeDescription
flags#Flags, see TL conditional fields
credentialsflags.0?trueRemove saved payment credentials
infoflags.1?trueClear the last order settings saved by the user
-

Result

-

Bool

- -
- -
-
- -
- - - - - - diff --git a/data/core.telegram.org/mtproto/auth_key.html b/data/core.telegram.org/mtproto/auth_key.html deleted file mode 100644 index 8d23086d86..0000000000 --- a/data/core.telegram.org/mtproto/auth_key.html +++ /dev/null @@ -1,262 +0,0 @@ - - - - - Creating an Authorization Key - - - - - - - - - - - - - -
- -
-
-
- -

Creating an Authorization Key

- -

The query format is described using Binary Data Serialization and the TL Language. All large numbers are transmitted as strings containing the required sequence of bytes in big endian order. Hash functions, such as SHA1, return strings (of 20 bytes) which can also be interpreted as big endian numbers. Small numbers (int, long, int128, int256) are normally little endian; however, if they are part of SHA1, the bytes are not rearranged. This way, if long x is the 64 lower-order bits of SHA1 of string s, then the final 8 bytes of 20-byte string SHA1(s) are taken and interpreted as a 64-bit integer.

-

Prior to sending off unencrypted messages (required in this instance to generate an authorization key), the client must undergo (p,q) authorization as follows.

-

DH exchange initiation

-
    -
  1. -

    Client sends query to server

    -

    req_pq_multi#be7e8ef1 nonce:int128 = ResPQ;

    -
  2. -
-

The value of nonce is selected randomly by the client (random number) and identifies the client within this communication. Following this step, it is known to all.

-
    -
  1. -

    Server sends response of the form

    -

    resPQ#05162463 nonce:int128 server_nonce:int128 pq:string server_public_key_fingerprints:Vector long = ResPQ;

    -
  2. -
-

Here, string pq is a representation of a natural number (in binary big endian format). This number is the product of two different odd prime numbers. Normally, pq is less than or equal to 2^63-1. The value of server_nonce is selected randomly by the server; following this step, it is known to all.

-

server_public_key_fingerprints is a list of public RSA key fingerprints (64 lower-order bits of SHA1 (server_public_key); the public key is represented as a bare type rsa_public_key n:string e:string = RSAPublicKey, where, as usual, n and е are numbers in big endian format serialized as strings of bytes, following which SHA1 is computed) received by the server.

-

All subsequent messages contain the pair (nonce, server_nonce) both in the plain-text, and the encrypted portions which makes it possible to identify a “temporary session” — one run of the key generation protocol described on this page that uses the same (nonce, server_nonce) pair. An intruder could not create a parallel session with the server with the same parameters and reuse parts of server- or client-encrypted messages for its own purposes in such a parallel session, because a different server_nonce would be selected by the server for any new “temporary session”.

-

Proof of work

-
    -
  1. Client decomposes pq into prime factors such that p < q.
  2. -
-

This starts a round of Diffie-Hellman key exchanges.

-

Presenting proof of work; Server authentication

-
    -
  1. -

    Client sends query to server

    -

    req_DH_params#d712e4be nonce:int128 server_nonce:int128 p:string q:string public_key_fingerprint:long encrypted_data:string = Server_DH_Params

    -
  2. -
-

Here, encrypted_data is obtained as follows:

-
    -
  • -

    new_nonce := another (good) random number generated by the client; after this query, it is known to both client and server;

    -
  • -
  • -

    data := a serialization of

    -
    p_q_inner_data_dc#a9f55f95 pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 dc:int = P_Q_inner_data;
    -

    or of

    -
    p_q_inner_data_temp_dc#56fddf88 pq:string p:string q:string nonce:int128 server_nonce:int128 new_nonce:int256 dc:int expires_in:int = P_Q_inner_data;
    -
  • -
  • -

    encrypted_data := RSA_PAD (data, server_public_key), where RSA_PAD is a version of RSA with a variant of OAEP+ padding explained below in 4.1).

    -
  • -
-

Someone might intercept the query and replace it with their own, independently decomposing pq into factors instead of the client. The only field that it makes sense to modify is new_nonce which would be the one an intruder would have to re-generate (because an intruder cannot decrypt the encrypted data sent by the client). Since all subsequent messages are encrypted using new_nonce or contain new_nonce_hash, they will not be processed by the client (an intruder would not be able to make it look as though they had been generated by the server because they would not contain new_nonce). Therefore, this intercept will only result in the intruder’s completing the authorization key generation protocol in place of the client and creating a new key (that has nothing to do with the client); however, the same effect could be achieved simply by creating a new key in one's own name.

-

An alternative form of inner data (p_q_inner_data_temp_dc) is used to create temporary keys, that are only stored in the server RAM and are discarded after at most expires_in seconds. The server is free to discard its copy earlier. In all other respects the temporary key generation protocol is the same. After a temporary key is created, the client usually binds it to its principal authorisation key by means of the auth.bindTempAuthKey method, and uses it for all client-server communication until it expires; then a new temporary key is generated. Thus Perfect Forward Secrecy (PFS) in client-server communication is achieved. Read more about PFS »

-

4.1) RSA_PAD(data, server_public_key) mentioned above is implemented as follows:

-
    -
  • data_with_padding := data + random_padding_bytes; -- where random_padding_bytes are chosen so that the resulting length of data_with_padding is precisely 192 bytes, and data is the TL-serialized data to be encrypted as before. One has to check that data is not longer than 144 bytes.
  • -
  • data_pad_reversed := BYTE_REVERSE(data_with_padding); -- is obtained from data_with_padding by reversing the byte order.
  • -
  • a random 32-byte temp_key is generated.
  • -
  • data_with_hash := data_pad_reversed + SHA256(temp_key + data_with_padding); -- after this assignment, data_with_hash is exactly 224 bytes long.
  • -
  • aes_encrypted := AES256_IGE(data_with_hash, temp_key, 0); -- AES256-IGE encryption with zero IV.
  • -
  • temp_key_xor := temp_key XOR SHA256(aes_encrypted); -- adjusted key, 32 bytes
  • -
  • key_aes_encrypted := temp_key_xor + aes_encrypted; -- exactly 256 bytes (2048 bits) long
  • -
  • The value of key_aes_encrypted is compared with the RSA-modulus of server_pubkey as a big-endian 2048-bit (256-byte) unsigned integer. If key_aes_encrypted turns out to be greater than or equal to the RSA modulus, the previous steps starting from the generation of new random temp_key are repeated. Otherwise the final step is performed:
  • -
  • encrypted_data := RSA(key_aes_encrypted, server_pubkey); -- 256-byte big-endian integer is elevated to the requisite power from the RSA public key modulo the RSA modulus, and the result is stored as a big-endian integer consisting of exactly 256 bytes (with leading zero bytes if required).
  • -
-
    -
  1. -

    Server responds with:

    -

    server_DH_params_ok#d0e8075c nonce:int128 server_nonce:int128 encrypted_answer:string = Server_DH_Params;

    -
  2. -
-
-

If the query is incorrect, the server returns a -404 error and the handshake must be restarted (any subsequent request also returns -404, even if it is correct).

-
-

Here, encrypted_answer is obtained as follows:

-
    -
  • -

    new_nonce_hash := 128 lower-order bits of SHA1 (new_nonce);

    -
  • -
  • -

    answer := serialization

    -
      server_DH_inner_data#b5890dba nonce:int128 server_nonce:int128 g:int dh_prime:string g_a:string server_time:int = Server_DH_inner_data;
    -
  • -
  • -

    answer_with_hash := SHA1(answer) + answer + (0-15 random bytes); such that the length be divisible by 16;

    -
  • -
  • -

    tmp_aes_key := SHA1(new_nonce + server_nonce) + substr (SHA1(server_nonce + new_nonce), 0, 12);

    -
  • -
  • -

    tmp_aes_iv := substr (SHA1(server_nonce + new_nonce), 12, 8) + SHA1(new_nonce + new_nonce) + substr (new_nonce, 0, 4);

    -
  • -
  • -

    encrypted_answer := AES256_ige_encrypt (answer_with_hash, tmp_aes_key, tmp_aes_iv); here, tmp_aes_key is a 256-bit key, and tmp_aes_iv is a 256-bit initialization vector. The same as in all the other instances that use AES encryption, the encrypted data is padded with random bytes to a length divisible by 16 immediately prior to encryption.

    -
  • -
-

Following this step, new_nonce is still known to client and server only. The client is certain that it is the server that responded and that the response was generated specifically in response to client query req_DH_params, since the response data are encrypted using new_nonce.

-

Client is expected to check whether p = dh_prime is a safe 2048-bit prime (meaning that both p and (p-1)/2 are prime, and that 2^2047 < p < 2^2048), and that g generates a cyclic subgroup of prime order (p-1)/2, i.e. is a quadratic residue mod p. Since g is always equal to 2, 3, 4, 5, 6 or 7, this is easily done using quadratic reciprocity law, yielding a simple condition on p mod 4g -- namely, p mod 8 = 7 for g = 2; p mod 3 = 2 for g = 3; no extra condition for g = 4; p mod 5 = 1 or 4 for g = 5; p mod 24 = 19 or 23 for g = 6; and p mod 7 = 3, 5 or 6 for g = 7. After g and p have been checked by the client, it makes sense to cache the result, so as not to repeat lengthy computations in future.

-

If the verification takes too long time (which is the case for older mobile devices), one might initially run only 15 Miller--Rabin iterations for verifying primeness of p and (p - 1)/2 with error probability not exceeding one billionth, and do more iterations later in the background.

-

Another optimization is to embed into the client application code a small table with some known "good" couples (g,p) (or just known safe primes p, since the condition on g is easily verified during execution), checked during code generation phase, so as to avoid doing such verification during runtime altogether. Server changes these values rarely, thus one usually has to put the current value of server's dh_prime into such a table. For example, current value of dh_prime equals (in big-endian byte order)

-
C7 1C AE B9 C6 B1 C9 04 8E 6C 52 2F 70 F1 3F 73 98 0D 40 23 8E 3E 21 C1 49 34 D0 37 56 3D 93 0F 48 19 8A 0A A7 C1 40 58 22 94 93 D2 25 30 F4 DB FA 33 6F 6E 0A C9 25 13 95 43 AE D4 4C CE 7C 37 20 FD 51 F6 94 58 70 5A C6 8C D4 FE 6B 6B 13 AB DC 97 46 51 29 69 32 84 54 F1 8F AF 8C 59 5F 64 24 77 FE 96 BB 2A 94 1D 5B CD 1D 4A C8 CC 49 88 07 08 FA 9B 37 8E 3C 4F 3A 90 60 BE E6 7C F9 A4 A4 A6 95 81 10 51 90 7E 16 27 53 B5 6B 0F 6B 41 0D BA 74 D8 A8 4B 2A 14 B3 14 4E 0E F1 28 47 54 FD 17 ED 95 0D 59 65 B4 B9 DD 46 58 2D B1 17 8D 16 9C 6B C4 65 B0 D6 FF 9C A3 92 8F EF 5B 9A E4 E4 18 FC 15 E8 3E BE A0 F8 7F A9 FF 5E ED 70 05 0D ED 28 49 F4 7B F9 59 D9 56 85 0C E9 29 85 1F 0D 81 15 F6 35 B1 05 EE 2E 4E 15 D0 4B 24 54 BF 6F 4F AD F0 34 B1 04 03 11 9C D8 E3 B9 2F CC 5B
-
    -
  1. -

    Client computes random 2048-bit number b (using a sufficient amount of entropy) and sends the server a message

    -

    set_client_DH_params#f5045f1f nonce:int128 server_nonce:int128 encrypted_data:string = Set_client_DH_params_answer;

    -
  2. -
-

Here, encrypted_data is obtained thus:

-
    -
  • -

    g_b := pow(g, b) mod dh_prime;

    -
  • -
  • -

    data := serialization

    -
      client_DH_inner_data#6643b654 nonce:int128 server_nonce:int128 retry_id:long g_b:string = Client_DH_Inner_Data
    -
  • -
  • -

    data_with_hash := SHA1(data) + data + (0-15 random bytes); such that length be divisible by 16;

    -
  • -
  • -

    encrypted_data := AES256_ige_encrypt (data_with_hash, tmp_aes_key, tmp_aes_iv);

    -
  • -
-

The retry_id field is equal to zero at the time of the first attempt; otherwise, it is equal to auth_key_aux_hash from the previous failed attempt (see Item 9).

-
    -
  1. -

    Thereafter, auth_key equals pow(g, {ab}) mod dh_prime; on the server, it is computed as pow(g_b, a) mod dh_prime, and on the client as (g_a)^b mod dh_prime.

    -
  2. -
  3. -

    auth_key_hash is computed := 64 lower-order bits of SHA1 (auth_key). The server checks whether there already is another key with the same auth_key_hash and responds in one of the following ways.

    -
  4. -
-

DH key exchange complete

-
    -
  1. -

    Server responds in one of three ways:

    -

    dh_gen_ok#3bcbf734 nonce:int128 server_nonce:int128 new_nonce_hash1:int128 = Set_client_DH_params_answer; -dh_gen_retry#46dc1fb9 nonce:int128 server_nonce:int128 new_nonce_hash2:int128 = Set_client_DH_params_answer; -dh_gen_fail#a69dae02 nonce:int128 server_nonce:int128 new_nonce_hash3:int128 = Set_client_DH_params_answer;

    -
  2. -
-
    -
  • new_nonce_hash1, new_nonce_hash2, and new_nonce_hash3 are obtained as the 128 lower-order bits of SHA1 of the byte string derived from the new_nonce string by adding a single byte with the value of 1, 2, or 3, and followed by another 8 bytes with auth_key_aux_hash. Different values are required to prevent an intruder from changing server response dh_gen_ok into dh_gen_retry.
  • -
  • auth_key_aux_hash is the 64 higher-order bits of SHA1(auth_key). It must not be confused with auth_key_hash.
  • -
-

In the other case, the client goes to Item 6) generating a new b. -In the first case, the client and the server have negotiated auth_key, following which they forget all other temporary data, and the client creates another encrypted session using auth_key. At the same time, server_salt is initially set to substr(new_nonce, 0, 8) XOR substr(server_nonce, 0, 8). If required, the client stores the difference between server_time received in 5) and its local time, to be able always to have a good approximation of server time which is required to generate correct message identifiers.

-

IMPORTANT: Apart from the conditions on the Diffie-Hellman prime dh_prime and generator g, both sides are to check that g, g_a and g_b are greater than 1 and less than dh_prime - 1. We recommend checking that g_a and g_b are between 2^{2048-64} and dh_prime - 2^{2048-64} as well.

-

Error Handling (Lost Queries and Responses)

-

If the client fails to receive any response to its query from the server within a certain time interval, it may simply re-send the query. If the server has already sent a response to this query (exactly the same request and not just similar: all the parameters during the repeat request must take on the same values) but it did not get to the client, the server will simply re-send the same response. The server remembers the response for up to 10 minutes after having received the query in 1). If the server has already forgotten the response or the requisite temporary data, the client will have to start from the beginning.

-

The server may consider that if the client has already sent in the next query using the data from the previous server response to the specific client, the response is known to have been received by the client and may be forgotten by the server.

-

Usage Example

-

An example of a complete list of queries required to generate an authorization key is shown on a separate page.

- -
- -
-
- -
- - - - - - diff --git a/data/corefork.telegram.org/constructor/pageBlockChannel.html b/data/corefork.telegram.org/constructor/pageBlockChannel.html deleted file mode 100644 index e10e1d2f07..0000000000 --- a/data/corefork.telegram.org/constructor/pageBlockChannel.html +++ /dev/null @@ -1,147 +0,0 @@ - - - - - pageBlockChannel - - - - - - - - - - - - - -
- -
-
-
- -

pageBlockChannel

- -

Reference to a telegram channel

-

- -
-
pageBlockChannel#ef1751b5 channel:Chat = PageBlock;

-

Parameters

- - - - - - - - - - - - - - - -
NameTypeDescription
channelChatThe channel/supergroup/chat
-

Type

-

PageBlock

- -
- -
-
- -
- - - - - - diff --git a/data/telegram.org/blog/android-wear-2-0.html b/data/telegram.org/blog/android-wear-2-0.html deleted file mode 100644 index 1d883c149d..0000000000 --- a/data/telegram.org/blog/android-wear-2-0.html +++ /dev/null @@ -1,224 +0,0 @@ - - - - - Telegram for Android Wear 2.0 - - - - - - - - - - - - - - - - - - - -
-
- -
-
-
- -
-
-

Telegram for Android Wear 2.0

- -
- -
- -
- -
- -

Google has just unveiled Android Wear 2.0, the latest in smartwatch platforms. It supports standalone apps, so today we're releasing Telegram for Android Wear 2.0. It‘s everything you’d want from a perfect watch app — compact, beautiful, and super-fast.

-
- -
- -

Using this tiny yet powerful app, you can browse your chats and quickly reply to messages with voice, text, emoji, or stickers. You can also view your contacts and even create groups right from your watch.

-
-
- -
-
- -

The smartwatch app also supports several themes in different colors. By the way, theme support is coming to our main Android app soon, so stay tuned.

-

Telegram for Android Wear 2.0 is available for download on Google Play. If you have Android Wear 2.0 installed on your watch, just search for Telegram in the store.

-

- -

February 9, 2017
The Telegram Team

-
- -
- - -
- - -
-
-
- - - - - - - diff --git a/data/telegram.org/blog/autoplay.html b/data/telegram.org/blog/autoplay.html deleted file mode 100644 index aa10c97871..0000000000 --- a/data/telegram.org/blog/autoplay.html +++ /dev/null @@ -1,245 +0,0 @@ - - - - - Autoplaying Videos, Automatic Downloads and Multiple Accounts - - - - - - - - - - - - - - - - - - - -
-
- -
-
-
- -
-
-

Autoplaying Videos, Automatic Downloads and Multiple Accounts

- -
- -
- -
- Autoplaying Videos and New Automatic Download Settings -
- -

Today's update will make Telegram chats livelier with Autoplaying Videos. Smaller videos will start playing without sound when they reach your screen. To unmute them, simply press the volume buttons on your device.

-
- -
- -

If you like to be in control of your data usage, try the new auto-download settings. It‘s easy to see your current settings at a glance and we’ve added a new quick way to switch between Low, Medium and High presets for Mobile, Roaming and Wi-Fi.

-

You can also manually set up automatic downloads by chat type, media type and file size. The app will remember your choices as the Custom preset in case you need to temporarily switch to Low and back — or the other way around.

-

To Each According to Their Needs

-

Default settings for data usage have become more generous but depend on the affordability of mobile data in your country. We know that in some places it's easier to buy an aircraft carrier than download an extra 20MB (looking at you, Ethiopia). Telegram will try to download less data for users in such countries.

-

On the other hand, if you're likely to have a monster data allowance, Telegram will try to save you from tapping the “download” arrow too often.

-

These new default limits for automatic downloads are not set in stone. Starting today, we can change them remotely, based on your feedback and the cost of data in each country.

-

To Log Out or Not to Log Out?

-

New users often bring their logout habits from other apps and don't realize that this is rarely necessary on Telegram. To help them find their way around the app, the logout menu now shows several alternative options to logging out:

-
- Logout Alternatives -

Logout Alternatives

-
- - -

Multiple Account Support

-

Some of us have several phone numbers and multiple Telegram accounts: one for work, another strictly personal and a third one provided by benevolent aliens along with instructions to never use it except in a planetary emergency.

-

You can add all these accounts to your app and easily switch between up to 3 phone numbers without logging out.

-
- Add account -

Add Account in Settings > Edit

-
- -

If you've added several accounts, you will receive push notifications for all of them. Notifications will include information on which account they were sent to. You can also tap and hold on an account in Settings for a sneak peek of its chats list:

-
- -
- -

The multiple accounts feature was born in Telegram for Android and is now also available on iOS. We hope your alter-egos will be pleased.

-

- -

February 26, 2019,
The Telegram Team

-
- -
- - -
- - -
-
-
- - - - - - - diff --git a/data/telegram.org/blog/bots-2-0.html b/data/telegram.org/blog/bots-2-0.html deleted file mode 100644 index 8a3bf00f87..0000000000 --- a/data/telegram.org/blog/bots-2-0.html +++ /dev/null @@ -1,260 +0,0 @@ - - - - - Bot Platform 2.0 - - - - - - - - - - - - - - - - - - - -
-
- -
-
-
- -
-
-

Bot Platform 2.0

- -
- -
- -

At Telegram, we made it our mission to redefine the boundaries of what you can do with your messaging app. Last year we launched the Bot Platform that has unleashed the creativity of thousands of developers.

-

Today we are giving bot developers a whole new dimension with Bots 2.0: inline keyboards, callback and URL buttons, location permissions and on-the-fly message editing. The new bots can also generate any type of content for you to share with friends, including documents, MP3s, videos, stickers, animations and contacts.

-

To give you a taste of the new possibilities, we built some sample bots last weekend – @music, @youtube, @foursquare and @sticker (make sure your Telegram app was updated today before you try them).

-

New Keyboards, New Actions

-

Here's how @music works – it uses an inline keyboard that allows you to interact with it without sending any messages. And it updates its own messages on the fly as you flip through the pages of search results:

-
-
- -
-
- -

New Types of Content

-

The @music bot also works in inline mode, which means it can help you send MP3s to any of your chats, right from the input field:

-
-
- -
-
- -

Inline bots can now send all types of attachments that are available on Telegram. We suspect you're going to like the @sticker inline bot – it can find you relevant stickers based on emoji.

-

New Mechanics

-

Like the @music bot, @youtube also works in two modes. It uses the new clever chat switching mechanic to connect your Telegram account with YouTube:

-
-
- -
-
- -

Once a Youtube account is connected, you can access additional settings via the new menu option above the results.

-

New Permissions

-

Now, @foursquare is an inline bot that utilizes our new location features and helps you send addresses of places and venues nearby. Note how it asks for permission to use your location when you try to send something for the first time:

-
-
- -
-
- - -

New Horizons

-

These sample bots are but the beginning. Our Bot API 2.0 allows developers to create fluid and easy-to-use interfaces for powerful bots. And we will be seeing a lot of new ones in the coming months, after all, 2016 is the year of bots.

-

If you are a developer, take a look at our Introduction to Bots 2.0 and read the full changelog. Also, feel free to subscribe to our official @BotNews channel to stay up to date on platform news.

-

If you are a user, hang on – soon you will have plenty of cool bots to play with. Meanwhile, enjoy the sample bots!

-

- - -
-

Oh. And we almost forgot we've got more new stuff today!
Read on about Sharing and Previews »

-
-

- -

April 12, 2016
The Telegram Team

-
- -
- - -
- - -
-
-
- - - - - - - diff --git a/data/telegram.org/blog/telegram-me-change-number-and-pfs.html b/data/telegram.org/blog/telegram-me-change-number-and-pfs.html deleted file mode 100644 index a8955ba287..0000000000 --- a/data/telegram.org/blog/telegram-me-change-number-and-pfs.html +++ /dev/null @@ -1,228 +0,0 @@ - - - - - Telegram.me, Changing Numbers and PFS - - - - - - - - - - - - - - - - - - - -
-
- -
-
-
- -
-
-

Telegram.me, Changing Numbers and PFS

- -
- -
- -
-

Our iOS and Android apps got updated with three new features today.

-
-

Opening a telegram.me/YourUsernameHere link on your phone will now automatically fire up your Telegram app and open a chat with that user. You can share username links with friends, write them on business cards or put them up on your website.

-
- -
- -
Here's what people will see if they don't have Telegram yet
- -

Changing Your Phone Number

-

It is easy to switch to Telegram and retain your social graph, since it is based on phone numbers. But what if you need to change the phone number itself? As of today, you can change your number in Telegram — and keep everything, including all your contacts, messages and media from the Telegram cloud, as well as all your secret chats.

-
- - - -
-
- -

Your mutual contacts (people in your contacts, who also have your number) will get your new number added to your contact in their address book unless you have blocked them in Telegram. This makes changing numbers even easier.

-

Perfect Forward Secrecy

-

Last but not least, Telegram's Secret Chats now support Perfect Forward Secrecy. What this means is that your Secret Chats will now automatically change encryption keys after a period of time, in order to keep past communications safe. This way you no longer need to manually re-create Secret Chats to achieve this level of security.

-

- -

And that's it for today. Stay tuned for more updates coming your way on all platforms!

-
-

December 1, 2014
The Telegram Team

-
- -
- - -
- - -
-
-
- - - - - - - diff --git a/data/telegram.org/blog/voice-2-secret-3.html b/data/telegram.org/blog/voice-2-secret-3.html deleted file mode 100644 index b2ac76b048..0000000000 --- a/data/telegram.org/blog/voice-2-secret-3.html +++ /dev/null @@ -1,245 +0,0 @@ - - - - - Voice Messages 2.0, Secret Chats 3.0 and... - - - - - - - - - - - - - - - - - - - -
-
- -
-
-
- -
-
-

Voice Messages 2.0, Secret Chats 3.0 and...

- -
- -
- -

Voice messages on Telegram just got a completely new interface with waveform visualizations, a brand new player and raise-to-speak functionality.

-

You can now start listening to a long voice message and switch to other media or chats. The message will continue playing in the background. For who are we to defy the god of multi-tasking?

-
- -

New looks for voice messages

-
- -

Recording and listening to voice messages got easier with raise-to-speak and raise-to-listen. When a chat is open, bring your phone to your ear (as if taking a phone call) to listen to new voice messages or record a new one after the signal.

-
- -

Raise to Speak: Preview before sending

-
- -

This feature involves plenty of behind-the-scene magic with proximity sensors, gyroscopes and accelerometers. It works well with most modern devices, but is still experimental. Some phones may require arcane intervention from our devs.

-

Secret Chats 3.0

-

With their self-destruct timers and end-to-end encryption, secret chats are a great way to pass sensitive information. Today we’re bringing the best features from cloud chats over to secret chats: detailed link previews, replies, photo and video captions, sticker sharing, inline bots and GIFs. We’ve also improved key visualizations to make secret chats immune to potential alien invasions.

-
- -

A Secret Chat full of new goodies

-
- -

…and…

-

Privacy. When overly active friends start adding you to random groups or channels, it gets overwhelming quickly. Now you can decide who may add you to groups and channels with granular precision. E.g. “All my contacts. Except those two.”

-

Supergroups. Supergroup creators also get more control. They can now change who may add new members to their group: all existing members or only selected admins. Supergroups can have up to 1000 members, and finding a balance between order and chaos is important if you want them to grow.

-

Sharing extension. Sharing on iOS devices has become way smoother. You can now share any photo, video, audio, document or location to any Telegram chat or channel straight from default iOS apps like Contacts, Maps, Voice Memos and Photos. It is also possible to share stuff to several chats or channels at once.

-

Attachment Menu. Media files will zoom beautifully when you select them in the attachment menu. Note that we’ve moved ‘Image Search’ to the ’Photo or Video’ section (tap the magnifying glass icon in the top right corner).

-

Hotkeys. iPad users with external keyboards get hotkey support. Now you can navigate chats and send messages without ever touching your iPad’s screen. Saves a lot of time.

-

Photo Editor. In the Android corner, we’re introducing additional photo-editing tools – rotate, fade, tint and curves.

-
-
- -

Photo editor

-
-
- -

Curves tool

-
-
- -

We’re not done with updates this month – more features and good news are coming very soon to a Telegram Messenger near you.

-

- - -

February 12, 2016
The Telegram Team

-
- -
- - -
- - -
-
-
- - - - - - -