From 8a64c0a72f840b23d355dcc6f8a9aed4b3c6b81b Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Sun, 14 Nov 2021 11:09:33 +0000 Subject: [PATCH] Update content of files --- .../core.telegram.org/bots/api-changelog.html | 641 ++ data/core.telegram.org/bots/api.html | 9293 +++++++++++++++++ .../constructor/inputCheckPasswordEmpty.html | 132 + .../constructor/messages.historyImport | 150 + .../speakingInGroupCallAction.html | 132 + .../constructor/storage.fileWebp | 132 + .../updates.channelDifferenceEmpty | 165 + .../method/messages.getGameHighScores | 187 + .../method/messages.getReplies | 217 + .../method/messages.readMentions | 181 + .../mtproto/TL-abstract-types.html | 202 + .../mtproto/TL-combinators.html | 251 + .../mtproto/TL-dependent.html | 236 + .../core.telegram.org/mtproto/TL-optargs.html | 151 + .../mtproto/TL-patterns.html | 129 + data/core.telegram.org/mtproto/TL-tl.html | 308 + data/core.telegram.org/mtproto/TL.html | 210 + data/core.telegram.org/tdlib/options.html | 465 + data/core.telegram.org/widgets.html | 141 + data/core.telegram.org/widgets/post.html | 240 + data/corefork.telegram.org/api/threads.html | 182 + .../corefork.telegram.org/api/top-rating.html | 145 + .../channelAdminLogEventsFilter.html | 266 + .../constructor/photoStrippedSize.html | 159 + .../constructor/updateChannelTooLong.html | 161 + .../method/langpack.getDifference | 176 + data/promote.telegram.org/basics.html | 204 + data/promote.telegram.org/guidelines.html | 312 + data/telegram.org/blog/channels-2-0.html | 246 + ...hemes-interactive-emoji-read-receipts.html | 297 + data/telegram.org/blog/coronavirus.html | 254 + .../blog/discover-stickers-and-more.html | 246 + data/telegram.org/blog/games.html | 264 + data/telegram.org/blog/instant-view.html | 268 + data/telegram.org/blog/polls-2-0-vmq.html | 271 + .../blog/privacy-discussions-web-bots.html | 284 + .../blog/stickers-revolution.html | 231 + data/telegram.org/blog/supergroups.html | 251 + data/telegram.org/blog/supergroups5k.html | 232 + data/telegram.org/blog/unread-replace-2x.html | 259 + data/telegram.org/verify.html | 151 + .../what-can-you-do-with-Telegram.html | 283 + 42 files changed, 18705 insertions(+) create mode 100644 data/core.telegram.org/bots/api-changelog.html create mode 100644 data/core.telegram.org/bots/api.html create mode 100644 data/core.telegram.org/constructor/inputCheckPasswordEmpty.html create mode 100644 data/core.telegram.org/constructor/messages.historyImport create mode 100644 data/core.telegram.org/constructor/speakingInGroupCallAction.html create mode 100644 data/core.telegram.org/constructor/storage.fileWebp create mode 100644 data/core.telegram.org/constructor/updates.channelDifferenceEmpty create mode 100644 data/core.telegram.org/method/messages.getGameHighScores create mode 100644 data/core.telegram.org/method/messages.getReplies create mode 100644 data/core.telegram.org/method/messages.readMentions create mode 100644 data/core.telegram.org/mtproto/TL-abstract-types.html create mode 100644 data/core.telegram.org/mtproto/TL-combinators.html create mode 100644 data/core.telegram.org/mtproto/TL-dependent.html create mode 100644 data/core.telegram.org/mtproto/TL-optargs.html create mode 100644 data/core.telegram.org/mtproto/TL-patterns.html create mode 100644 data/core.telegram.org/mtproto/TL-tl.html create mode 100644 data/core.telegram.org/mtproto/TL.html create mode 100644 data/core.telegram.org/tdlib/options.html create mode 100644 data/core.telegram.org/widgets.html create mode 100644 data/core.telegram.org/widgets/post.html create mode 100644 data/corefork.telegram.org/api/threads.html create mode 100644 data/corefork.telegram.org/api/top-rating.html create mode 100644 data/corefork.telegram.org/constructor/channelAdminLogEventsFilter.html create mode 100644 data/corefork.telegram.org/constructor/photoStrippedSize.html create mode 100644 data/corefork.telegram.org/constructor/updateChannelTooLong.html create mode 100644 data/corefork.telegram.org/method/langpack.getDifference create mode 100644 data/promote.telegram.org/basics.html create mode 100644 data/promote.telegram.org/guidelines.html create mode 100644 data/telegram.org/blog/channels-2-0.html create mode 100644 data/telegram.org/blog/chat-themes-interactive-emoji-read-receipts.html create mode 100644 data/telegram.org/blog/coronavirus.html create mode 100644 data/telegram.org/blog/discover-stickers-and-more.html create mode 100644 data/telegram.org/blog/games.html create mode 100644 data/telegram.org/blog/instant-view.html create mode 100644 data/telegram.org/blog/polls-2-0-vmq.html create mode 100644 data/telegram.org/blog/privacy-discussions-web-bots.html create mode 100644 data/telegram.org/blog/stickers-revolution.html create mode 100644 data/telegram.org/blog/supergroups.html create mode 100644 data/telegram.org/blog/supergroups5k.html create mode 100644 data/telegram.org/blog/unread-replace-2x.html create mode 100644 data/telegram.org/verify.html create mode 100644 data/telegram.org/what-can-you-do-with-Telegram.html diff --git a/data/core.telegram.org/bots/api-changelog.html b/data/core.telegram.org/bots/api-changelog.html new file mode 100644 index 0000000000..f7743e51fb --- /dev/null +++ b/data/core.telegram.org/bots/api-changelog.html @@ -0,0 +1,641 @@ + + + + + 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 new file mode 100644 index 0000000000..571b978de8 --- /dev/null +++ b/data/core.telegram.org/bots/api.html @@ -0,0 +1,9293 @@ + + + + + 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/inputCheckPasswordEmpty.html b/data/core.telegram.org/constructor/inputCheckPasswordEmpty.html new file mode 100644 index 0000000000..e622ffe13c --- /dev/null +++ b/data/core.telegram.org/constructor/inputCheckPasswordEmpty.html @@ -0,0 +1,132 @@ + + + + + inputCheckPasswordEmpty + + + + + + + + + + + + + +
+ +
+
+
+ +

inputCheckPasswordEmpty

+ +

There is no password

+

+ +
+
inputCheckPasswordEmpty#9880f658 = InputCheckPasswordSRP;

+

Parameters

+

This constructor does not require any parameters.

+

Type

+

InputCheckPasswordSRP

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/messages.historyImport b/data/core.telegram.org/constructor/messages.historyImport new file mode 100644 index 0000000000..21cd417a1d --- /dev/null +++ b/data/core.telegram.org/constructor/messages.historyImport @@ -0,0 +1,150 @@ + + + + + messages.historyImport + + + + + + + + + + + + + +
+ +
+
+
+ +

messages.historyImport

+ +

ID of a specific chat import session, click here for more info ».

+

+ +
+
messages.historyImport#1662af0b id:long = messages.HistoryImport;

+

Parameters

+ + + + + + + + + + + + + + + +
NameTypeDescription
idlongHistory import ID
+

Type

+

messages.HistoryImport

+

Related pages

+

Imported messages

+

Telegram allows importing messages and media from foreign chat apps.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/speakingInGroupCallAction.html b/data/core.telegram.org/constructor/speakingInGroupCallAction.html new file mode 100644 index 0000000000..6ac0358078 --- /dev/null +++ b/data/core.telegram.org/constructor/speakingInGroupCallAction.html @@ -0,0 +1,132 @@ + + + + + speakingInGroupCallAction + + + + + + + + + + + + + +
+ +
+
+
+ +

speakingInGroupCallAction

+ +

User is currently speaking in the group call

+

+ +
+
speakingInGroupCallAction#d92c2285 = SendMessageAction;

+

Parameters

+

This constructor does not require any parameters.

+

Type

+

SendMessageAction

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/storage.fileWebp b/data/core.telegram.org/constructor/storage.fileWebp new file mode 100644 index 0000000000..edcc4d67a9 --- /dev/null +++ b/data/core.telegram.org/constructor/storage.fileWebp @@ -0,0 +1,132 @@ + + + + + storage.fileWebp + + + + + + + + + + + + + +
+ +
+
+
+ +

storage.fileWebp

+ +

WEBP image. MIME type: image/webp.

+

+ +
+
storage.fileWebp#1081464c = storage.FileType;

+

Parameters

+

This constructor does not require any parameters.

+

Type

+

storage.FileType

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/constructor/updates.channelDifferenceEmpty b/data/core.telegram.org/constructor/updates.channelDifferenceEmpty new file mode 100644 index 0000000000..f7af6d05d9 --- /dev/null +++ b/data/core.telegram.org/constructor/updates.channelDifferenceEmpty @@ -0,0 +1,165 @@ + + + + + updates.channelDifferenceEmpty + + + + + + + + + + + + + +
+ +
+
+
+ +

updates.channelDifferenceEmpty

+ +

There are no new updates

+

+ +
+
updates.channelDifferenceEmpty#3e11affb flags:# final:flags.0?true pts:int timeout:flags.1?int = updates.ChannelDifference;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
flags#Flags, see TL conditional fields
finalflags.0?trueWhether there are more updates that must be fetched (always false)
ptsintThe latest PTS
timeoutflags.1?intClients are supposed to refetch the channel difference after timeout seconds have elapsed
+

Type

+

updates.ChannelDifference

+

Related pages

+

Working with Updates

+

How to subscribe to updates and handle them properly.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/method/messages.getGameHighScores b/data/core.telegram.org/method/messages.getGameHighScores new file mode 100644 index 0000000000..64e9a4cd83 --- /dev/null +++ b/data/core.telegram.org/method/messages.getGameHighScores @@ -0,0 +1,187 @@ + + + + + messages.getGameHighScores + + + + + + + + + + + + + +
+ +
+
+
+ +

messages.getGameHighScores

+ +

Get highscores of a game

+

+ +
+
messages.highScores#9a3bfd99 scores:Vector<HighScore> users:Vector<User> = messages.HighScores;
+---functions---
+messages.getGameHighScores#e822649d peer:InputPeer id:int user_id:InputUser = messages.HighScores;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
peerInputPeerWhere was the game sent
idintID of message with game media attachment
user_idInputUserGet high scores made by a certain user
+

Result

+

messages.HighScores

+

Possible errors

+ + + + + + + + + + + + + + + + + + + + + + + + + +
CodeTypeDescription
400MESSAGE_ID_INVALIDThe provided message id is invalid.
400PEER_ID_INVALIDThe provided peer id is invalid.
400USER_BOT_REQUIREDThis method can only be called by a bot.
+

Bots can use this method

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/method/messages.getReplies b/data/core.telegram.org/method/messages.getReplies new file mode 100644 index 0000000000..02c584f832 --- /dev/null +++ b/data/core.telegram.org/method/messages.getReplies @@ -0,0 +1,217 @@ + + + + + messages.getReplies + + + + + + + + + + + + + +
+ +
+
+
+ +

messages.getReplies

+ +

Get messages in a reply thread

+

+ +
+
messages.messages#8c718e87 messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
+messages.messagesSlice#3a54685e flags:# inexact:flags.1?true count:int next_rate:flags.0?int offset_id_offset:flags.2?int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
+messages.channelMessages#64479808 flags:# inexact:flags.1?true pts:int count:int offset_id_offset:flags.2?int messages:Vector<Message> chats:Vector<Chat> users:Vector<User> = messages.Messages;
+messages.messagesNotModified#74535f21 count:int = messages.Messages;
+---functions---
+messages.getReplies#22ddd30c peer:InputPeer msg_id:int offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
peerInputPeerPeer
msg_idintMessage ID
offset_idintOffsets for pagination, for more info click here
offset_dateintOffsets for pagination, for more info click here
add_offsetintOffsets for pagination, for more info click here
limitintMaximum number of results to return, see pagination
max_idintIf a positive value was transferred, the method will return only messages with ID smaller than max_id
min_idintIf a positive value was transferred, the method will return only messages with ID bigger than min_id
hashlongHash for pagination, for more info click here
+

Result

+

messages.Messages

+

Possible errors

+ + + + + + + + + + + + + + + + + + + + +
CodeTypeDescription
400MSG_ID_INVALIDInvalid message ID provided.
400PEER_ID_INVALIDThe provided peer id is invalid.
+

Related pages

+

Pagination in the API

+

How to fetch results from large lists of objects.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/method/messages.readMentions b/data/core.telegram.org/method/messages.readMentions new file mode 100644 index 0000000000..18f5ea2e5d --- /dev/null +++ b/data/core.telegram.org/method/messages.readMentions @@ -0,0 +1,181 @@ + + + + + messages.readMentions + + + + + + + + + + + + + +
+ +
+
+
+ +

messages.readMentions

+ +

Mark mentions as read

+

+ +
+
messages.affectedHistory#b45c69d1 pts:int pts_count:int offset:int = messages.AffectedHistory;
+---functions---
+messages.readMentions#f0189d3 peer:InputPeer = messages.AffectedHistory;

+

Parameters

+ + + + + + + + + + + + + + + +
NameTypeDescription
peerInputPeerDialog
+

Result

+

messages.AffectedHistory

+

Possible errors

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CodeTypeDescription
400CHANNEL_INVALIDThe provided channel is invalid.
400CHANNEL_PRIVATEYou haven't joined this channel/supergroup.
400MSG_ID_INVALIDInvalid message ID provided.
400PEER_ID_INVALIDThe provided peer id is invalid.
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/mtproto/TL-abstract-types.html b/data/core.telegram.org/mtproto/TL-abstract-types.html new file mode 100644 index 0000000000..3b1af317a3 --- /dev/null +++ b/data/core.telegram.org/mtproto/TL-abstract-types.html @@ -0,0 +1,202 @@ + + + + + Binary serialization and abstract TL types + + + + + + + + + + + + + +
+ +
+
+
+ +

Binary serialization and abstract TL types

+ +

TL Language defines abstract data types in the spirit of a general theory of types (more accurately, Martin-Löf’s theories of dependent intuitionistic types) without specifying the values of these types should be represented in memory, when saved to disk, or transmitted over a network. In contrast, the article on binary serialization discusses the problem of effective serialization of values of abstract types. To this end, the concept of a concrete or serialized type has been defined as the sets of serializations of all possible values of the corresponding abstract type. In this case, the serializations take values in the set A of words in the alphabet A*, which consists of 2^32 characters -- 32-bit integers.

+

In order to use a TL schema (e.g. “program”) in the TL language to describe the serialization of values of abstract types, we should explain how the concrete type [T] (subset [T] of A^) is associated with the abstract type T (defined in TL), and how the values of the abstract type T correspond to the values of the concrete type [T] (i.e. the elements of [T]*).

+

Serialization is the process of constructing an element of [T] based on a value of the abstract type T. The reverse process is deserialization.

+

Values of the abstract type T may be represented in a different way. Typically, some sort of trees or graphs are used in memory or, if desired, a set of nodes may be used, each of which contains a certain tag (“node type”) and several pointers to other nodes and/or values of built-in primitive types such as int. However, for general discussions it is useful to write the values of abstract type T as a string, more specifically, an S-expression. Recall that an S-expression is either an atom (the value of a primitive type, for example, an integer or a string constant in quotation marks; or an identifier that corresponds to a built-in or defined function) or a space-delimited list of S-expressions ending in parentheses. In our case, we use S-expressions, the first element of which is a combinator identifier, while the remaining elements (the number of which depends on the combinator’s arity) are S-expressions representing elements of the chosen combinator’s fields (or parameters). Moreover, the type of the arguments’ S-expressions and the type of the S-expressions of the result (e.g. the associated expression) must match.

+

For example, for the schema

+
pair x:int y:int = Pair;
+pnil = PairList;
+pcons hd:Pair tl:PairList = PairList;
+

the following are examples of the abstract type PairList, written as S-expressions:

+
(pnil)
+(pcons (pair 2 3) (pcons (pair 9 4) (pnil)))
+

We usually write E : T (read "E of type T”) when we want to say that E is a value of type T. We assume there is a built-in type Type whose values are types. Thus, writing T : Type means that T is a type.

+

For example, we can write:

+
PairList : Type;
+(pcons (pair 2 3) (pcons (pair 9 4) (pnil))) : PairList;
+

Converting an abstract value to a serialized value, generally speaking, is straightforward (and, if desired, can be defined by induction):

+
    +
  • +

    It is the serialization of values n of the primitive type int (as a single-symbol word in the alphabet A)

    +
  • +
  • +

    The serialization of a string constant (a value of the primitive type string) is a sequence of the 32-bit numbers defined in Binary serialization.

    +
  • +
  • +

    The serialization of the S-expression (C E1 ... Er) : T, where C is a combinator with arity r with argument types T1, ..., Tr and result type T (e.g. C : T1->T2->...->Tr->T) is the concatenation of the combinator number C (a 32-bit number that unambiguously identifies the combinator, usually equal to the CRC-32 of the string of its TL description) and the serializations of the values E1 of type T1, E2 of type T2, ..., Er of type Tr.

    +
  • +
+

If we use [T] to denote the concrete type corresponding to the abstract T, and [E] to denote an element of [T] corresponding to the value E of type T, then the last rule may be written as:

+
    +
  • [T] is the combination, for each constructor of type C T1->T2->...->Tr->T (i.e. that returns a value of type T), of direct products {C} x [T1] x [T2] x ... x [Tr], where {C} is a single-element set consisting of the combinator number C. Because {C}<>{C'} when C<>C’, this defines a mutually single-valued mapping of the values of the abstract type T (written using S-expressions) to the set [T].
  • +
+

Values of the built-in clothed types Int and String and serialized as if they were defined using int x:int = Int; and string s:string = String;, i.e. the serialization of integer constant or a string is preceded by number of the int or string combinator (constructor). In S-expressions, this may be written as (int 5) or (string "Test").

+

However, what has been described above does not account for certain subtleties, such as the existence of naked types, or the difference between functions (active combinators whose application may be reduced, e.g. calculated) and constructors (passive combinators for which there are not and cannot be reduction rules). Furthermore, we have not explained how to handle polymorphic types and optional combinator parameters. We will attempt to explain this now.

+

Constants, surface values, and functional values

+

By dividing combinators into constructors and functions, we can introduce the following classes of expressions (values) of the abstract type T:

+
    +
  • +

    Constant expressions: for the types int and string, these are all integer/string constants; for T, these are all expressions like (C E1 ... Er) : T, where the combinator C : T1->T2->...->Tr->T is a constructor, and Ei : Ti is constant expressions of types Ti. In other words, a constant expression is an S-expression consisting of only constructors and constant of primitive types.

    +
  • +
  • +

    Surface expressions are expressions that outwardly contain a functional combinator whose arguments, however, are constant expressions of the appropriate types. In other words, the functional combinator is resolved only at the outer level. (This is not entirely true; see the full explanation below).

    +
  • +
  • +

    Functional expressions: These are expressions that may contain any combinators or constants at all levels.

    +
  • +
+

In practice, we most frequently need constant values (for storage and passing any data structures, in particular, responses to RPC queries) and surface expressions (for example, as RPC queries: then the functional combinator of the outer level is the name of the RPC function that we want to call, while its parameters are the arguments, which are constant values, for invoking the function). In some cases, arbitrary functional expressions are helpful (for example, it we want to remotely transmit the result of one RPC query to a different RPC query).

+

We will use c(T) to denote a subtype of the abstract type T, whose values are constant expressions of type T. Clearly, c(T) possesses approximately the same constructors as T itself (with the types of all arguments Ti replaced by c(Ti), but it does not have functional combinators.

+

Analogously, we will use f(T) to denote a subtype of T, whose values are surface expressions of type T. Clearly, the combinators of f(T) are essentially functional combinators of type T, but c() applies to the types of these combinators’ arguments: The combinator A : T1->...->Tr->T turns into A' : c(T1)->...->c(Tr)->f(T). (See the clarification of this rule below.)

+

Thus, we have defined two “functionals” c : Type -> Type and f : Type -> Type, such that forall T : Type, c(T) :- T and forall T : Type, f(T) :- T (writing T :- T' means that T is contained in T', or that T is a subtype of T').

+

We will assume that c and f are idempotent.

+

Naked types

+

From the perspective of abstract type theory, naked types (in contrast to built-in primitive types like int and string are unnecessary. However, they are extremely useful in practice.

+

Therefore, TL introduces the (partially defined) idempotent unary operator %, which turns a standard functional (e.g. an expression of type ...->Type or simply Type) into a different standard functional of the same type. If T is a type, then from an abstract theoretical point of view, %T is equivalent to c(T). In other words, the values of %T are the constant values of T. If T is a k-arity standard expression, then T : S1 -> ... -> Sk -> Type, where each Si=Type or #, then by definition %T is a k-arity standard expression with the same arity, which is defined by the equation (%T) a1 ... ak = % (T a1 ... ak).

+

When a constant value of type %T is serialized, it is first serialized as a value of type T (assuming that T is not already a naked type itself). Then the first character of the serialization is discarded (e.g. the name of the enclosing combinator). Therefore, %T is a only a valid type expression if there is not more than one constructor for %T. The expression %T, where T : S1 -> ... -> Sk -> Type, is valid, if for any choice of parameters a1 : S1, ... , ak : Sk, the type T a1 ... ak does not have more than one constructor. Using % in other instances is incorrect.

+

If for every value of the parameters a1 : S1, ..., ak : Sk, there is exactly one constructor C for T a1 ... ak, then TL allows writing C a1 ... ak instead of %T a1 ... ak or %(T a1 .. ak). In other words, in certain situations the identifier C is a synonym for %T. This is only allowed in the context of a type (when specifying the type of a combinator’s field or result).

+

Moreover, it is assumed that %Int = int and %String = string.

+

! modifier

+

In TL, the idempotent operator ! can modify any type, actually making surface values be allowed when its constant values are serialized. However, if T is a standard function like S1->..->Sr->Type, then !T is defined using the equation (!T) a1 ... ar = !(T a1 ... ar), for any a1:S1, ..., ar:Sr.

+

The ! operator is only allowed in a definition of the types of fields of functional combinators. It is usually used as a type prefix, for example:

+
set_timeout {X:Type} timeout:int f:!X = X;
+

In this case, the set_timeout “wrapper” is defined. It takes two explicit parameters: the integer timeout and a surface expression of type X. X : Type is itself an implicit parameter (it is not explicitly stated, rather it is inferred from the values of the other parameters and their types). A similar kind of wrapper may be helpful for modifying the action of RPC queries (which are surface expressions of various types). For example, suppose we have the function

+
factorial n:int = int;
+

then we can wrap the RPC query (factorial 100) as follows: (set_timeout 200 (factorial 100)). This expression is still a surface value of type int, which means it can be passed as an RPC query.

+

A consecutive pair of two computations is another example:

+
pair {X Y : Type} x:X y:Y = Pair X Y;  // constructor
+seq_pair {X Y : Type} x:!X y:!Y = Pair X Y; // functional wrapper for sequential computation
+par_pair {X Y : Type} x:!X y:!Y = Pair X Y; // functional wrapper for parallel computation
+

Now the RPC query (seq_pair (factorial 2) (factorial 3)) : Pair int int first calculates factorial 2, then factorial 3, and returns the pair (pair 2 6). In this case, the sequence of operations isn’t important, because they do not have side effects. It would have been just as well to use (par_pair (factorial 2) (factorial 3)). However, this is not always the case.

+

We can also define an analogy to a “comma” operation:

+
comma {X Y : Type} x:!X y:!Y = Y;
+

For example, this operation could first calculate x, then forget the result, calculate y, and return y.

+

Note that the semantics of the seq_pair, par_pair and comma wrappers are indeed defined where they are implemented (like the semantics of all other functional combinators), not by their TL declaration.

+

In principle, polymorphic wrappers like set_timeout can also be applied, for example, to “annotate” a RPC response’s constant values. For example, the server might return a response to a query together with the time it was calculated. However, a value of type !X must be constant, because that is what is expected as the enclosing expression’s value. In other words, set_timeout 239 E is a constant/surface value of type X if and only if E is such itself.

+

$ modifier

+

The idempotent modifier $ permits the use of arbitrary functional values of an appropriate type in contexts where only constants or surface values are usually allowed. It recursively transforms all combinators for all of the types involved, canceling the action of % and affixing $ to the parameter types and result of all combinators ($ is also added to the front of the transformed combinators). Moreover, built-in types are also transformed (in the final stage): $int = Int and $string = String.

+

This may be useful to create an RPC query that performs a “deep computation” of the expression passed to it:

+
compute {X:Type} expr:$X = X;
+

For example, now we can transmit the following as an RPC query:

+
(compute ($factorial ($factorial (int 3)))) : int
+

(Note that the three has become clothed; the combinator $factorial has type $int -> $int).

+

This is very powerful tool. It does not have to be implemented in very simple versions of TL. $ is not encountered in currently used TL schemas.

+

More on modifiers

+

In fact, at least in terms of its application to serialization, the TL language by default implies the c() modifier around all combinators’ parameter types and results, while ! and $ cancel it (more accurately, ! only cancels, and in some sense $ reverses the meaning). This is why there is no explicit c() modifier in TL and why it is assumed that all functions only accept constant values and return constant results, unless otherwise specified.

+

You may think that some functional combinators may have a type such as partial_factorial n:int = $int; and that the RPC query (partial_factorial 3) might then unexpectedly return ($product (int 3) ($product (int 2) ($product (int 1) (int 1)))) : $int ...

+

It is probably more correct to think about the ! modifier as follows. All types initially include only constant values (and only constructors). The ! modifier makes a new type (it’s twin) out of each type. This new type has no inherent constructors. Functional combinators differ from constructors in that ! is implicitly added in front of their result’s type. After this, the (local or remote) process of calculating the expression can be represented using the polymorphic function eval : !X -> X.

+

Optional combinator parameters and their values

+

See Optional combinator parameters and their values.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/mtproto/TL-combinators.html b/data/core.telegram.org/mtproto/TL-combinators.html new file mode 100644 index 0000000000..d121629b07 --- /dev/null +++ b/data/core.telegram.org/mtproto/TL-combinators.html @@ -0,0 +1,251 @@ + + + + + Formal description of TL combinators + + + + + + + + + + + + + +
+ +
+
+
+ +

Formal description of TL combinators

+ +

Formal declaration of TL combinators

+

Main article: Formal description of TL. See also TL Language.

+

Combinators in TL are declared as follows:

+
+

combinator-decl ::= full-combinator-id { opt-args } { args } = result-type ;
+full-combinator-id ::= lc-ident-full | _
+combinator-id ::= lc-ident-ns | _
+opt-args ::= { var-ident { var-ident } : [excl-mark] type-expr }
+args ::= var-ident-opt : [ conditional-arg-def ] [ ! ] type-term
+args ::= [ var-ident-opt : ] [ multiplicity *] [ { args } ]
+args ::= ( var-ident-opt { var-ident-opt } : [!] type-term )
+args ::= [ ! ] type-term
+multiplicity ::= nat-term
+var-ident-opt ::= var-ident | _
+conditional-arg-def ::= var-ident [ . nat-const ] ?
+result-type ::= boxed-type-ident { subexpr }
+result-type ::= boxed-type-ident < subexpr { , subexpr } >

+
+

We shall clarify what all this means.

+
    +
  • +

    A combinator identifier is either an identifier starting with a lowercase Latin letter (lc-ident), or a namespace identifier (also lc-ident) followed by a period and another lc-ident. Therefore, cons and lists.get are valid combinator identifiers.

    +
  • +
  • +

    A combinator has a name, also known as a number (not to be confused with the designation) -- a 32-bit number that unambiguously determines it. It is either calculated automatically (see below) or it is explicitly assigned in the declaration. To do this, a hash mark (#) and exactly 8 hexadecimal digits -- the combinator’s name -- are added to the identifier of the combinator being defined.

    +
  • +
  • +

    A combinator’s declaration begins with its identifier, to which its name (separated by a hash mark) may have been added.

    +
  • +
  • +

    After the combinator identifier comes the main part of the declaration, which consists of declarations of fields (or variables), including an indication of their types.

    +
  • +
  • +

    First come declarations of optional fields (of which there may be several or none at all). Then there are the declarations of the required fields (there may not be any of these either).

    +
  • +
  • +

    Any identifier that begins with an uppercase or lowercase letter and which does not contain references to a namespace can be a field (variable) identifier. Using uc-ident for identifiers of variable types and lc-indent for other variables is good practice.

    +
  • +
  • +

    Next a combinator declaration contains the equals sign (=) and the result type (it may be composite or appearing for the first time). The result type may be polymorphic and/or dependent; any fields of the defined constructor’s fields of type Type or # may be returned (as subexpressions).

    +
  • +
  • +

    A combinator declaration is terminated with a semicolon.

    +
  • +
+

In what follows, a constructor’s fields, variables, and arguments mean the same thing.

+

Optional field declarations

+
    +
  • +

    These have the form { field_1 ... field_k : type-expr }, where field_i is a variable (field) identifier that is unique within the scope of the combinator declaration, and type-expr is a type shared by all of the fields.

    +
  • +
  • +

    If k>1, this entry is functionally equivalent to { field_1 : type-expr } ... { field_k : type-expr }.

    +
  • +
  • +

    All optional fields must be explicitly named (using _ instead of field_i is not allowed).

    +
  • +
  • +

    Moreover, at present the names of all optional fields must share the combinator’s result type (possibly more than once) and themselves be of type # (i,e., nat) or Type. Therefore, if the exact result type is known, it is possible to determine the values of all of the combinator’s implicit parameters (possibly obtaining a contradiction of the form 2=3 in doing so, which means that the combinator is not allowed in the context).

    +
  • +
+

Required field declarations

+
    +
  • +

    These may have the form ( field_1 ... field_k : type-expr ), similar to an optional field declaration, but with parentheses. This entry is equivalent to ( field_1 : type-expr ) ... ( field_k : type-expr ), where the fields are defined one at a time.

    +
  • +
  • +

    The underscore sign (_) can be used as names of one or more fields (field_i), indicating that the field is anonymous (the exact name is unimportant).

    +
  • +
  • +

    One field may be declared without outer parentheses, like this: field_id : type-expr. Here, however, if type-expr is a complex type, parentheses may be necessary around type-expr (this is reflected in BNF).

    +
  • +
  • +

    Furthermore, one anonymous field may be declared using a type-expr entry, functionally equivalent to _ : type-expr.

    +
  • +
  • +

    Required field declarations follow one after another, separated by spaces (by any number of whitespace symbols, to be more precise).

    +
  • +
  • +

    The declared field’s type (type-expr) may use the declared combinator’s previously defined variables (fields) as subexpressions (i.e. parameter values). For example:

    +

    nil {X:Type} = List X; +cons {X:Type} hd:X tl:(list X) = List X; +typed_list (X:Type) (l : list X) = TypedList;

    +
  • +
+

Repetitions

+
    +
  • +

    These may only exist among required parameters. They have the form [ field-id : ] [ multiplicity * ] [ args ], where args has the same format as the combinator’s declaration of (several) required fields, except that all of the enclosing combinator’s previously declared fields may be used in the argument types.

    +
  • +
  • +

    The name of a field of an enclosing combinator that receives a repetition as a value may be specified (field-id), or bypassed, which is equivalent to using the underscore sign as a field-id.

    +
  • +
  • +

    The multiplicity field is an expression of the type # (nat), which can be a real constant, the name of a preceding field of type #, or an expression in the form ( c + v ), where c is a real constant and v is the name of a field of type #. The sense of the multiplicity field is to provide the length of the (repetition) vector, each element of which consists of values of the types enumerated in args.

    +
  • +
  • +

    The multiplicity field may be bypassed. In this case, the last preceding parameter of type # from the enclosing combinator is used (it must be).

    +
  • +
  • +

    Functionally, the repetition field-id : multiplicity * [ args ] is equivalent to the declaration of the single field ( field-id : %Tuple %AuxType multiplicity ), where aux_type is an auxiliary type with a new name defined as aux_type *args* = AuxType. If any of the enclosing type’s fields are used within args, they are added to the auxiliary constructor aux_type and to its AuxType result type as the first (optional) parameters.

    +
  • +
  • +

    If args consists of one anonymous field of type some-type, then some-type can be used directly instead of %AuxType.

    +
  • +
  • +

    If during implementation the repetitions are rewritten as indicated above, it is logical to use instead of aux_type and AuxType, some identifiers that contain the name of the outer combinator being defined and the repetition’s index number inside its definition.

    +
  • +
+

Example:

+
matrix {m n : #} a : m* [ n* [ double ] ] = Matrix m n;
+

is functionally equivalent to

+
aux_type {n : #} (_ : %Tuple double n) = AuxType n;
+matrix {m : #} {n : #} (a : %Tuple %(AuxType n) m) = Matrix m n;
+

Moreover, the built-in types Tuple and Vector could be defined as:

+
tnil {X : Type} = Tuple X 0;
+tcons {X : Type} {n : #} hd:X tl:%(Tuple X n) = Tuple X (S n);
+vector {X : Type} (n : #) (v : %(Tuple X n)) = Vector X;
+

Actually, the following equivalent entry is considered the definition of Vector (i.e. it is specifically this entry that is used to compute the name of the vector constructor and its partial applications):

+
vector {t : Type} # [ t ] = Vector t;
+

If we expand it using Tuple, we obtain the previous definition exactly.

+

Conditional fields

+

The construction

+
+

args ::= var-ident-opt : [ conditional-arg-def ] [ ! ] type-term
+conditional-arg-def ::= var-ident [ . nat-const ] ?

+
+

permits assigning fields which are only present if the value of a preceding mandatory or optional field of type # is not null (or if its chosen bit is not zero if the special binary bit-selection operator . is applied). +Example:

+
+

user {fields:#} id:int first_name:(fields.0?string) last_name:(fields.1?string) friends:(fields.2?%(Vector int)) = User fields;
+get_users req_fields:# ids:%(Vector int) = Vector %(User req_fields)

+
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/mtproto/TL-dependent.html b/data/core.telegram.org/mtproto/TL-dependent.html new file mode 100644 index 0000000000..d57455f46a --- /dev/null +++ b/data/core.telegram.org/mtproto/TL-dependent.html @@ -0,0 +1,236 @@ + + + + + TL-dependent + + + + + + + + + + + + + +
+ +
+
+
+ +

TL-dependent

+ +

Main article: TL Language.

+

In certain cases, types may depend not only on other types (polymorphism), but also on the parameters of another type (dependent types). The TL language provides very limited support for this functionality: dependence is only allowed on a natural parameter whose type is designated using # (alias nat, but this is private -- TL doesn’t currently support this synonym). Values of type # are serialized as 32-bit signed numbers from 0 to 2^31-1.

+

Example: integer tuples (vectors)

+

Suppose we want to use induction to define the types “one integer”, “two integers”, and “three integers”. We could try to define them as follows:

+
empty = Empty;
+single x:int = Single;
+pair x:int y:int = Pair;
+triple x:int y:int z:int = Triple;
+quadruple x:int y:int z:int t:int = Quadruple;
+...
+

or as:

+
empty = Empty;
+single x:int empty = Single;
+pair x:int y:single = Pair;
+triple x:int yz:pair = Triple;
+quadruple x:int yzt:triple = Quadruple;
+

or as:

+
tnil = Tuple0;
+tcons0 hd:int tl:Tuple0 = Tuple1;
+tcons1 hd:int tl:Tuple1 = Tuple2;
+tcons2 hd:int tl:Tuple2 = Tuple3;
+...
+tcons_n hd:int tl:Tuple_n = Tuple_(n+1)
+

The first two variations lead to the same serialization. For example, (2 3 9):%triple and (2 (3 9)):%triple serialize as three 32-bit numbers: 2 3 9. The last variation better emphasizes the inductive version of the definition, but it uses boxed types. This is good from a theoretical perspective, but it leads to “superfluous” constructor names in serialization.

+

Therefore, we will write %Type-Ident to indicate the bare type that corresponds to the boxed type Type-Ident with a single constructor. If this constructor is named constructor, then according to the definition %Type-Ident = %constructor. Now we can write our definition like this:

+
tnil = Tuple0;
+tcons_n hd:int tl:%Tuple_n = Tuple_(n+1)
+

If we now abstract n out of the name of the type name and make it like a parameter for a polymorphic (dependent, to be more exact) type, then something like the following can be written in a suitable functional language:

+
NewType Tuple (n : #) :=
+| tnil = Tuple 0
+| tcons n:# hd:int tl:%(Tuple n) = Tuple (S n)
+EndType;
+

In the TL language, it looks like this:

+
tnil = Tuple 0;
+tcons {n:#} hd:int tl:%(Tuple n) = Tuple (S n);
+

The function S : # -> # and the constant O : # (it is 0) are the function for the next natural number (S n = n + 1) and the constant null. Therefore, the type # (alias nat) behaves as if it were defined in TL using the constructors

+
O = nat;
+S nat = nat;
+

or, using syntax more typical of other functional languages,

+
NewType nat :=
+| O
+| S nat
+EndType;
+

Types of all defined combinators:

+
O : #
+S : # -> #
+Tuple : # -> Type
+tnil : Tuple 0
+tcons : forall n : #, int -> Tuple n -> Tuple (S n)
+

or

+
Tuple : forall n : #, Type;
+tcons : forall n : #, forall hd : int, forall tl : Tuple n, Tuple (S n)
+

Note that in this case the constructor tnil does not depend on the parameter n, while tcons does.

+

In an analogous manner, it is possible to define a complete binary tree of height h with strings in the leaf nodes:

+
tleaf value:string = BinTree 0;
+tnode {h:#} left:(BinTree h) right:(BinTree h) = BinTree (S h);
+

Or a random tree whose leaf nodes are all a distance of h from the root and whose nodes are all labeled with integers:

+
hleaf value:int = Tree 0;
+hnode {n:#} left:(Tree n) next:(Tree (S n)) = Tree (S n)
+hnil {n:#} = Tree (S n)
+

Another version:

+
hleaf' value:int = Tree' 0;
+hnode' {n:#} children:(list (Tree' n)) = Tree' (S n)
+

Polymorphic dependent types

+

Let us try to define a type Tuple X n whose values are n-tuples of type X values. In this way, Tuple will be simultaneously polymorphic and dependent:

+
Tuple : Type -> # -> Type;
+

In the familiar syntax of functional languages:

+
NewType Tuple {X : Type} {n : #} :=
+| vnil : Tuple X 0
+| vcons {n:#} hd:X tl:%(Tuple X n) : Tuple X (S n)
+EndType
+

or, in TL syntax,

+
vnil {X:Type} = Tuple X 0;
+vcons {X:Type} {n:#} tl:(%Tuple X n) = Tuple X S n
+

In the end we obtain terms for the following types:

+
vnil : forall X : Type, Tuple X 0
+vcons : forall X : Type, forall n : #, X -> Tuple X n -> Tuple X (S n)
+

or

+
vnil : forall X : Type, Tuple X 0
+vcons : forall X : Type, forall n : #, forall hd : X, forall tl : Tuple X n, Tuple X (S n)
+

Dependent sums

+

The Tuple we just defined differs from the built-in Vector type. Specifically, the Vector type formally depends on a single argument (a type), but our Tuple depends on two (a type and a number):

+
Tuple : Type -> # -> Type;
+Vector : Type -> Type;
+

The built-in Vector could be defined in terms of our Tuple using “summing across all n : #":

+
vector {X:Type} n:# v:(%Tuple X n) = Vector X;
+

Nevertheless, our Tuple has its advantages. For example, we can define data types such as:

+
matrix_10x10 a:(%Tuple (%Tuple double 10) 10) = Matrix_10x10;
+

In any event, remember that during calculation of the matrix_10x10 combinator’s number, all parentheses must be removed and the CRC32 of the string matrix_10x10 a:%Tuple %Tuple double 10 10 = Matrix_10x10 must be computed.

+

Moreover, we can define arbitrarily-sized matrices:

+
matrix {X:Type} m:# n:# a:(%Tuple (%Tuple X m) n) = Matrix X;
+

In this case using vector would result in storing the length of a row (m) in each row, e.g. n times.

+

Note that the serializations of values of type %Tuple X n and vector X (also known as %vector X and %Vector X) nearly match when n > 0: in both cases we obtain a single 32-bit number (equal to n-1 or n depending on the version) followed by the serializations of n objects of type X. (This is slightly untrue: values of type %Tuple X n can only be serialized if n is a constant or value known from one of the preceding fields of the enclosing entry; but then this n won’t be serialized explicitly anywhere).

+

Special syntax for repetitions

+

In view of the importance of the construction presented above, it is built into the TL language in the following manner. A substructure in the form of [ array-field-name ":" ] [ nat-ident "" ] "[" field-descr ... "]” may be used in the declaration of any combinator, where nat-ident* is the name of any previously encountered field of type # (if it is not explicitly indicated, the most recent is used). In abstract, this substructure is equivalent to:

+
aux_type *field-descr* ... = AuxType;
+*current_constructor* ... [ *array-field-name* ":" ] (%Tuple aux_type *nat-ident*)
+

For example, 10x10 matrices, vectors, and arbitrary matrices may be defined in the following way:

+
matrix {X:Type} m:# n:# a:n*[ m*[ X ] ] = Matrix X;
+matrix_10x10 a:10*[ 10*[ double ]] = Matrix_10x10;
+vector {X:Type} # [ X ] = Vector X;
+

We have already encountered the last version as a “definition” of the “built-in type” Vector.

+

Of course, several fields, as complex as desired, may be within the repeating part. Furthermore, besides using n as a repeat counter, one may use expressions of the form (n+const) and (const+n), where const is a small nonnegative constant, which are shorthand for S (S ( ... (S n) ... )):

+
repeat_np1 n:# a:(S n)*[ key:string value:string ] = Dictionary;
+

To calculate the CRC32 these expressions are converted to expressions of the form (const+X) without internal spaces. Additionally, the * in this case is not set off by spaces on the left and right.

+

Serialization of dependent types

+

Serialization of dependent types and polymorphic types is not a fundamental challenge: we have combinators with non-zero arity with Type values. For example, the type Tuple double 10 : Type serializes to 'Tuple' '%double' 10. Note that at present in practice there is virtually no need to serialize types, whether dependent or not.

+

Optional combinator parameters in TL

+

Optional combinator parameters in TL must possess the following properties:

+
    +
  • +

    Optional parameters must be precisely ythe combinator’s first several arguments;

    +
  • +
  • +

    The value of any optional parameter must be entirely determined by the combinator’s result type.

    +
  • +
+

For example, in cons {X:Type} hd:X tl:(list X) = list X the parameter X may be made optional, because it is located at the very beginning of the argument list and is unambiguously determined by the list X result type. Similarly, in tcons {X:Type} {n:#} hd:X tl:(%Tuple X n) = Tuple X (S n) the values of X and n are completely determined based on the Tuple X (S n) result type, therefore they made be made optional parameters.

+

It usually makes sense to move all of a constructor’s arguments satisfying the second condition to the beginning of the list, arrange them in the order they appear in the result type’s parameters, and make them optional. Given such an approach, the full version of a constructor is rarely needed -- only when we want to transmit the value of the polymorphic or dependent type as a value of type Object. In all other cases, the type of the expected value from the context is already known, which means that all optional parameters can be recovered during decomposition.

+

See also Optional combinator parameters and their values.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/mtproto/TL-optargs.html b/data/core.telegram.org/mtproto/TL-optargs.html new file mode 100644 index 0000000000..532c4c216a --- /dev/null +++ b/data/core.telegram.org/mtproto/TL-optargs.html @@ -0,0 +1,151 @@ + + + + + Optional combinator parameters and their values + + + + + + + + + + + + + +
+ +
+
+
+ +

Optional combinator parameters and their values

+ +

TL Language makes it possible to declare a combinator’s first few parameters optional. Subsequently, they are almost never required to be explicitly stated. This is directly related to another important property of TL: polymorphism.

+

All optional parameters are typically required to be part of the result type (at least once).

+

A (sub)expression may be serialized/deserialized in one of two ways:

+
    +
  • +

    The result type is known (for example, we’re parsing the response to a previously sent RPC query and therefore know the value of some type is expected). In this case, the result type may be used to determine the values of the combinator’s implicit parameters.

    +
  • +
  • +

    The result type is not known. It is determined as a result of (de)serialization (for example, we are serializing an RPC query). In this case, it is necessary to explicitly specify (and serialize) all of the combinator’s optional parameters by using the full version of the combinator.

    +
  • +
+

We will assume that the functional combinator only differs from the constructor in that before its result type the ! modifier is implicitly added, and the (remote or local) computation of a functional expression may be presented as the execution of some polymorphic function eval : !X -> X.

+

Moreover, the unknown result type is obviously usually (but not always) bound to the serialization of an expression whose type has been modified by !.

+

We can formulate the following rules. Let there be some constructor

+
C {a1:T1} ... {am:Tm} b1:U1 ... bn:Un = T;
+

Some of its arguments or its result may be marked with the ! modifier (We consider a functional combinator to be a constructor whose result type has been modified by an implicit !).

+

The following conditions must hold:

+
    +
  • +

    Each type T1, ..., Tm, U1, ..., Un, and T may depend on parameters of type Type or #, which have been declared to the left of the use of the given type.

    +
  • +
  • +

    The types of implicit parameters T1, ..., Tm may not be modified by !.

    +
  • +
  • +

    Only implicit parameters of type Type or # are allowed. In other words, Ti is either a Type or a #. (Unlike the previous rule, this rule may be relaxed in the future.)

    +
  • +
  • +

    Each implicit parameter a1, ..., am must be used at least once -- either within one of the Ui types that have a !, or in the result type T, if it does not have an explicit or implicit !.

    +
  • +
  • +

    If an implicit parameter ai is not used in the result type, or if the result type has a !, then its first (leftmost) usage must be within a type Uj that is modified by !.

    +
  • +
+

The idea is this: we assume that during (de)serialization of a value of a type modified by ! that we do not know this type in advance and we will find out what it is only based on the result of the (de)serialization; Conversely, we assume that during (de)serialization of a value of a type that is not modified by ! that we know this type in advance. In this case, complying with the rules stated above lets us always compute the values of all implicit parameters -- either from the (previously known) result type or from the type of one of the bj:!Uj parameters (which was obtained during the serialization process).

+

In fact, ! denotes the direction in which type information is flowing. By default, the result type is the source of information about types (and their parameters), while argument types are the recipients of that information. The use of ! reverses the direction of information flow, making the result type the recipient and the argument type the source of type information.

+

See also Binary serialization and abstract TL types and Polymorphism in TL.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/mtproto/TL-patterns.html b/data/core.telegram.org/mtproto/TL-patterns.html new file mode 100644 index 0000000000..13e5c68d9d --- /dev/null +++ b/data/core.telegram.org/mtproto/TL-patterns.html @@ -0,0 +1,129 @@ + + + + + TL-patterns + + + + + + + + + + + + + +
+ +
+
+
+ +

TL-patterns

+ +
+

partial-app-decl ::= partial-type-app-decl | partial-comb-app-decl
+partial-type-app-decl ::= boxed-type-ident subexpr { subexpr } ; | boxed-type-ident < expr { , expr } > ;
+partial-comb-app-decl ::= combinator-id subexpr { subexpr } ;

+
+

According to the original design, templates must be used to replace concrete values in the first few or all of the optional arguments of a constructor or polymorphic type. For example, if Tuple int 10 is used frequently, you can declare a template for it, which will cause the appropriate constructors to be generated automatically. When using such a constructor there may be nowhere to pass an int type or the tuple size 10. Similarly, it was originally planned to declared templates for Vector int, Vector string, etc. in order to generate constructors for each vector type being used type. These constructors would make it possible during deserialization to determine what kind of array is being transmitted.

+

Templates are not used now. Instead, the same universal constructors (for example, vector {t:Type} [t] = Vector t) are used with the values of the optional parameters being inferred from the type of the result (if we already know from the schema that in this location there must be a Vector int during deserialization, we understand that we will see the universal vector constructor in which t is equal to int).

+

This approach is better in that it is not necessary to define Vector SomeType templates in advance for all possible types in order to generate their own constructors for each of these cases. Nevertheless, there is a drawback. If someone wants to transmit the serialization of a value of the clothed type Vector int as a serialization of a value of type Object, a problem arises during serialization: after seeing the universal vector constructor and then reading the vector length, we cannot determine what type of values should be expected next.

+

In theory, this problem can be solved by using the full form of the constructor (@vector) corresponding to vector (it is automatically defined and is different in that all of the optional parameters become required), or by defining

+
+

object X:Type X = TypedObject

+
+

and passing the object type explicitly. Type serialization is required in both cases.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/mtproto/TL-tl.html b/data/core.telegram.org/mtproto/TL-tl.html new file mode 100644 index 0000000000..1ba2046471 --- /dev/null +++ b/data/core.telegram.org/mtproto/TL-tl.html @@ -0,0 +1,308 @@ + + + + + TL schema for serialization of TL schemas + + + + + + + + + + + + + +
+ +
+
+
+ +

TL schema for serialization of TL schemas

+ +

If necessary, a TL schema can be serialized in binary form. Here, this serialization format is defined by a TL schema (usually stored in the file tl.tl). This can be useful, for example, to make it possible to write a parser one time for converting a TL schema from text form (stored in the file something.tl) to binary form (stored in the file something.tlo). All other programs (for example, auto-generators of TL-(de)serializers for various programming languages) only need to know how to read .tlo files, which only requires generating an automatic deserializer according to the schema presented below.

+

First, a fragment of the file common.tl with certain required built-in types:

+
/////
+//
+// Common Types (source file common.tl, only necessary definitions included)
+//
+/////
+
+// Built-in types
+int ? = Int;
+long ? = Long;
+double ? = Double;
+string ? = String;
+
+// Boolean emulation
+boolFalse = Bool;
+boolTrue = Bool;
+
+// Vector
+vector {t:Type} # [t] = Vector t;
+tuple {t:Type} {n:#} [t] = Tuple t n;
+vectorTotal {t:Type} total_count:int vector:%(Vector t) = VectorTotal t;
+
+Empty False;
+true = True;
+

Next, properly, comes tl.tl itself. Note that the declaration for a fairly complex data type required only twenty lines in TL. This demonstrates the expressiveness and compactness of the TL language.

+
/////
+//
+// Serialized binary TL-schema in TL format, source file tl.tl
+//
+/////
+tls.schema_v2 version:int date:int types_num:# types:types_num*[tls.Type] 
+
+    constructor_num:# constructors:constructor_num*[tls.Combinator] 
+    functions_num:# functions:functions_num*[tls.Combinator] = tls.Schema;
+tls.type name:int id:string constructors_num:int flags:int arity:int params_type:long = tls.Type;
+
+tls.combinator name:int id:string type_name:int left:tls.CombinatorLeft right:tls.CombinatorRight = tls.Combinator;
+tls.combinatorLeftBuiltin = tls.CombinatorLeft;
+tls.combinatorLeft args_num:# args:args_num*[tls.Arg] = tls.CombinatorLeft;
+tls.combinatorRight value:tls.TypeExpr = tls.CombinatorRight;
+
+tls.arg id:string flags:# var_num:flags.1?int exist_var_num:flags.2?int exist_var_bit:flags.2?int type:tls.TypeExpr = tls.Arg;
+
+tls.exprType _:tls.TypeExpr = tls.Expr;
+
+tls.exprNat _:tls.NatExpr = tls.Expr;
+tls.natConst value:int = tls.NatExpr;
+
+tls.natVar dif:int var_num:int = tls.NatExpr;
+tls.typeVar var_num:int flags:int = tls.TypeExpr;
+
+tls.array multiplicity:tls.NatExpr args_num:# args:args_num*[tls.Arg] = tls.TypeExpr;
+tls.typeExpr name:int flags:int children_num:# children:children_num*[tls.Expr] = tls.TypeExpr;
+

Remarks

+

Schema serialization (version 2) always begins with the index number of the tls.schema_v2 constructor for tls.Schema. +Because the CRC32 of the string

+
tls.schema_v2 version:int date:int types_num:# types:types_num*[ tls.Type ] constructor_num:# constructors:constructor_num*[ tls.Combinator ] functions_num:# functions:functions_num*[ tls.Combinator ] = tls.Schema
+

is 0x3a2f9be2, this constant is in fact the magic number for tlo files in the current version’s format. +If the format is extended in the future (for example, if TL’s additional features are supported), then a tls.schema_v3 constructor with a different number will appear.

+

Example

+

If one adds declarations for the used built-in types (like int ? = Int;) from the file common.tl before tl.tl and serialize the resulting schema, the following binary data is obtained (tl.tlo):

+
+

0000: 3a2f9be2 00000000 51fec698 00000015 12eb4386 70659eff 00002301 00000000
+0020: 00000000 00000000 00000000 00000000 12eb4386 250be282 6f6f4204 0000006c
+0040: 00000002 02000010 00000000 00000000 00000000 12eb4386 2210c154 756f4406
+0060: 00656c62 00000001 02000000 00000000 00000000 00000000 12eb4386 00000000
+0080: 6c614605 00006573 00000000 00000401 00000000 00000000 00000000 12eb4386
+00a0: a8509bda 746e4903 00000001 02000001 00000000 00000000 00000000 12eb4386
+00c0: 22076cba 6e6f4c04 00000067 00000001 02000001 00000000 00000000 00000000
+00e0: 12eb4386 b5286e24 72745306 00676e69 00000001 02000001 00000000 00000000
+0100: 00000000 12eb4386 3fedd339 75725404 00000065 00000001 02000000 00000000
+0120: 00000000 00000000 12eb4386 9770768a 70755405 0000656c 00000001 02000000
+0140: 00000002 00000002 00000000 12eb4386 2cecf817 70795404 00000065 00000000
+0160: 00000000 00000000 00000000 00000000 12eb4386 1cb5c415 63655606 00726f74
+0180: 00000001 02000008 00000001 00000000 00000000 12eb4386 10133f47 6365560b
+01a0: 54726f74 6c61746f 00000001 02000000 00000001 00000000 00000000 12eb4386
+01c0: 29dfe61b 736c7407 6772412e 00000001 02000000 00000000 00000000 00000000
+01e0: 12eb4386 5c0a1ed5 736c740e 6d6f432e 616e6962 00726f74 00000001 02000000
+0200: 00000000 00000000 00000000 12eb4386 8133d9ba 736c7412 6d6f432e 616e6962
+0220: 4c726f74 00746665 00000002 02000010 00000000 00000000 00000000 12eb4386
+0240: 2c064372 736c7413 6d6f432e 616e6962 52726f74 74686769 00000001 02000000
+0260: 00000000 00000000 00000000 12eb4386 307d41a0 736c7408 7078452e 00000072
+0280: 00000002 02000010 00000000 00000000 00000000 12eb4386 c2635441 736c740b
+02a0: 74614e2e 72707845 00000002 02000010 00000000 00000000 00000000 12eb4386
+02c0: 3a2f9be2 736c740a 6863532e 00616d65 00000001 02000000 00000000 00000000
+02e0: 00000000 12eb4386 12eb4386 736c7408 7079542e 00000065 00000001 02000000
+0300: 00000000 00000000 00000000 12eb4386 193fd378 736c740c 7079542e 70784565
+0320: 00000072 00000003 02000010 00000000 00000000 00000000 00000018 5c0a1ed5
+0340: bc799737 6f6f6209 6c61466c 00006573 250be282 4c12c6d9 00000000 2c064372
+0360: c1863d08 250be282 00000000 00000000 5c0a1ed5 997275b5 6f6f6208 7572546c
+0380: 00000065 250be282 4c12c6d9 00000000 2c064372 c1863d08 250be282 00000000
+03a0: 00000000 5c0a1ed5 2210c154 756f6406 00656c62 2210c154 cd211f63 2c064372
+03c0: c1863d08 2210c154 00000000 00000000 5c0a1ed5 a8509bda 746e6903 a8509bda
+03e0: cd211f63 2c064372 c1863d08 a8509bda 00000000 00000000 5c0a1ed5 22076cba
+0400: 6e6f6c04 00000067 22076cba cd211f63 2c064372 c1863d08 22076cba 00000000
+0420: 00000000 5c0a1ed5 b5286e24 72747306 00676e69 b5286e24 cd211f63 2c064372
+0440: c1863d08 b5286e24 00000000 00000000 5c0a1ed5 3fedd339 75727404 00000065
+0460: 3fedd339 4c12c6d9 00000000 2c064372 c1863d08 3fedd339 00000000 00000000
+0480: 5c0a1ed5 9770768a 70757405 0000656c 9770768a 4c12c6d9 00000003 29dfe61b
+04a0: 00007401 00020005 00000000 c1863d08 2cecf817 00000000 00000000 29dfe61b
+04c0: 00006e01 00020005 00000001 c1863d08 70659eff 00000000 00000000 29dfe61b
+04e0: 00000000 00000000 d9fb20de 4e8a14f0 00000000 00000001 00000001 29dfe61b
+0500: 00000000 00000000 0142ceae 00000000 00000000 2c064372 c1863d08 9770768a
+0520: 00000000 00000002 ecc9da78 0142ceae 00000000 00000000 dcb49bd8 4e8a14f0
+0540: 00000000 00000001 5c0a1ed5 1cb5c415 63657606 00726f74 1cb5c415 4c12c6d9
+0560: 00000003 29dfe61b 00007401 00020005 00000000 c1863d08 2cecf817 00000000
+0580: 00000000 29dfe61b 00000000 00000004 00000001 c1863d08 70659eff 00000000
+05a0: 00000000 29dfe61b 00000000 00000000 d9fb20de 4e8a14f0 00000000 00000001
+05c0: 00000001 29dfe61b 00000000 00000000 0142ceae 00000000 00000000 2c064372
+05e0: c1863d08 1cb5c415 00000000 00000001 ecc9da78 0142ceae 00000000 00000000
+0600: 5c0a1ed5 10133f47 6365760b 54726f74 6c61746f 10133f47 4c12c6d9 00000003
+0620: 29dfe61b 00007401 00020005 00000000 c1863d08 2cecf817 00000000 00000000
+0640: 29dfe61b 746f740b 635f6c61 746e756f 00000000 c1863d08 a8509bda 00000001
+0660: 00000000 29dfe61b 63657606 00726f74 00000000 c1863d08 1cb5c415 00000001
+0680: 00000001 ecc9da78 0142ceae 00000000 00000000 2c064372 c1863d08 10133f47
+06a0: 00000000 00000001 ecc9da78 0142ceae 00000000 00000000 5c0a1ed5 29dfe61b
+06c0: 736c7407 6772612e 29dfe61b 4c12c6d9 00000006 29dfe61b 00646902 00000000
+06e0: c1863d08 b5286e24 00000001 00000000 29dfe61b 616c6605 00007367 00000004
+0700: 00000000 c1863d08 70659eff 00000000 00000000 29dfe61b 72617607 6d756e5f
+0720: 00000002 00000000 00000001 c1863d08 a8509bda 00000001 00000000 29dfe61b
+0740: 6978650d 765f7473 6e5f7261 00006d75 00000002 00000000 00000002 c1863d08
+0760: a8509bda 00000001 00000000 29dfe61b 6978650d 765f7473 625f7261 00007469
+0780: 00000002 00000000 00000002 c1863d08 a8509bda 00000001 00000000 29dfe61b
+07a0: 70797404 00000065 00000000 c1863d08 193fd378 00000000 00000000 2c064372
+07c0: c1863d08 29dfe61b 00000000 00000000 5c0a1ed5 5c0a1ed5 736c740e 6d6f632e
+07e0: 616e6962 00726f74 5c0a1ed5 4c12c6d9 00000005 29dfe61b 6d616e04 00000065
+0800: 00000000 c1863d08 a8509bda 00000001 00000000 29dfe61b 00646902 00000000
+0820: c1863d08 b5286e24 00000001 00000000 29dfe61b 70797409 616e5f65 0000656d
+0840: 00000000 c1863d08 a8509bda 00000001 00000000 29dfe61b 66656c04 00000074
+0860: 00000000 c1863d08 8133d9ba 00000000 00000000 29dfe61b 67697205 00007468
+0880: 00000000 c1863d08 2c064372 00000000 00000000 2c064372 c1863d08 5c0a1ed5
+08a0: 00000000 00000000 5c0a1ed5 cd211f63 736c7419 6d6f632e 616e6962 4c726f74
+08c0: 42746665 746c6975 00006e69 8133d9ba 4c12c6d9 00000000 2c064372 c1863d08
+08e0: 8133d9ba 00000000 00000000 5c0a1ed5 4c12c6d9 736c7412 6d6f632e 616e6962
+0900: 4c726f74 00746665 8133d9ba 4c12c6d9 00000002 29dfe61b 67726108 756e5f73
+0920: 0000006d 00000004 00000000 c1863d08 70659eff 00000000 00000000 29dfe61b
+0940: 67726104 00000073 00000000 d9fb20de 4e8a14f0 00000000 00000000 00000001
+0960: 29dfe61b 00000000 00000000 c1863d08 29dfe61b 00000000 00000000 2c064372
+0980: c1863d08 8133d9ba 00000000 00000000 5c0a1ed5 2c064372 736c7413 6d6f632e
+09a0: 616e6962 52726f74 74686769 2c064372 4c12c6d9 00000001 29dfe61b 6c617605
+09c0: 00006575 00000000 c1863d08 193fd378 00000000 00000000 2c064372 c1863d08
+09e0: 2c064372 00000000 00000000 5c0a1ed5 ecc9da78 736c740c 7078652e 70795472
+0a00: 00000065 307d41a0 4c12c6d9 00000001 29dfe61b 00000000 00000000 c1863d08
+0a20: 193fd378 00000000 00000000 2c064372 c1863d08 307d41a0 00000000 00000000
+0a40: 5c0a1ed5 dcb49bd8 736c740b 7078652e 74614e72 307d41a0 4c12c6d9 00000001
+0a60: 29dfe61b 00000000 00000000 c1863d08 c2635441 00000000 00000000 2c064372
+0a80: c1863d08 307d41a0 00000000 00000000 5c0a1ed5 8ce940b1 736c740c 74616e2e
+0aa0: 736e6f43 00000074 c2635441 4c12c6d9 00000001 29dfe61b 6c617605 00006575
+0ac0: 00000000 c1863d08 a8509bda 00000001 00000000 2c064372 c1863d08 c2635441
+0ae0: 00000000 00000000 5c0a1ed5 4e8a14f0 736c740a 74616e2e 00726156 c2635441
+0b00: 4c12c6d9 00000002 29dfe61b 66696403 00000000 c1863d08 a8509bda 00000001
+0b20: 00000000 29dfe61b 72617607 6d756e5f 00000000 c1863d08 a8509bda 00000001
+0b40: 00000000 2c064372 c1863d08 c2635441 00000000 00000000 5c0a1ed5 3a2f9be2
+0b60: 736c740d 6863732e 5f616d65 00003276 3a2f9be2 4c12c6d9 00000008 29dfe61b
+0b80: 72657607 6e6f6973 00000000 c1863d08 a8509bda 00000001 00000000 29dfe61b
+0ba0: 74616404 00000065 00000000 c1863d08 a8509bda 00000001 00000000 29dfe61b
+0bc0: 70797409 6e5f7365 00006d75 00000004 00000000 c1863d08 70659eff 00000000
+0be0: 00000000 29dfe61b 70797405 00007365 00000000 d9fb20de 4e8a14f0 00000000
+0c00: 00000000 00000001 29dfe61b 00000000 00000000 c1863d08 12eb4386 00000000
+0c20: 00000000 29dfe61b 6e6f630f 75727473 726f7463 6d756e5f 00000004 00000001
+0c40: c1863d08 70659eff 00000000 00000000 29dfe61b 6e6f630c 75727473 726f7463
+0c60: 00000073 00000000 d9fb20de 4e8a14f0 00000000 00000001 00000001 29dfe61b
+0c80: 00000000 00000000 c1863d08 5c0a1ed5 00000000 00000000 29dfe61b 6e75660d
+0ca0: 6f697463 6e5f736e 00006d75 00000004 00000002 c1863d08 70659eff 00000000
+0cc0: 00000000 29dfe61b 6e756609 6f697463 0000736e 00000000 d9fb20de 4e8a14f0
+0ce0: 00000000 00000002 00000001 29dfe61b 00000000 00000000 c1863d08 5c0a1ed5
+0d00: 00000000 00000000 2c064372 c1863d08 3a2f9be2 00000000 00000000 5c0a1ed5
+0d20: 12eb4386 736c7408 7079742e 00000065 12eb4386 4c12c6d9 00000006 29dfe61b
+0d40: 6d616e04 00000065 00000000 c1863d08 a8509bda 00000001 00000000 29dfe61b
+0d60: 00646902 00000000 c1863d08 b5286e24 00000001 00000000 29dfe61b 6e6f6310
+0d80: 75727473 726f7463 756e5f73 0000006d 00000000 c1863d08 a8509bda 00000001
+0da0: 00000000 29dfe61b 616c6605 00007367 00000000 c1863d08 a8509bda 00000001
+0dc0: 00000000 29dfe61b 69726105 00007974 00000000 c1863d08 a8509bda 00000001
+0de0: 00000000 29dfe61b 7261700b 5f736d61 65707974 00000000 c1863d08 22076cba
+0e00: 00000001 00000000 2c064372 c1863d08 12eb4386 00000000 00000000 5c0a1ed5
+0e20: 0142ceae 736c740b 7079742e 72615665 193fd378 4c12c6d9 00000002 29dfe61b
+0e40: 72617607 6d756e5f 00000000 c1863d08 a8509bda 00000001 00000000 29dfe61b
+0e60: 616c6605 00007367 00000000 c1863d08 a8509bda 00000001 00000000 2c064372
+0e80: c1863d08 193fd378 00000000 00000000 5c0a1ed5 d9fb20de 736c7409 7272612e
+0ea0: 00007961 193fd378 4c12c6d9 00000003 29dfe61b 6c756d0c 6c706974 74696369
+0ec0: 00000079 00000000 c1863d08 c2635441 00000000 00000000 29dfe61b 67726108
+0ee0: 756e5f73 0000006d 00000004 00000000 c1863d08 70659eff 00000000 00000000
+0f00: 29dfe61b 67726104 00000073 00000000 d9fb20de 4e8a14f0 00000000 00000000
+0f20: 00000001 29dfe61b 00000000 00000000 c1863d08 29dfe61b 00000000 00000000
+0f40: 2c064372 c1863d08 193fd378 00000000 00000000 5c0a1ed5 c1863d08 736c740c
+0f60: 7079742e 70784565 00000072 193fd378 4c12c6d9 00000004 29dfe61b 6d616e04
+0f80: 00000065 00000000 c1863d08 a8509bda 00000001 00000000 29dfe61b 616c6605
+0fa0: 00007367 00000000 c1863d08 a8509bda 00000001 00000000 29dfe61b 6968630c
+0fc0: 6572646c 756e5f6e 0000006d 00000004 00000000 c1863d08 70659eff 00000000
+0fe0: 00000000 29dfe61b 69686308 6572646c 0000006e 00000000 d9fb20de 4e8a14f0
+1000: 00000000 00000000 00000001 29dfe61b 00000000 00000000 c1863d08 307d41a0
+1020: 00000000 00000000 2c064372 c1863d08 193fd378 00000000 00000000 00000000

+
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/mtproto/TL.html b/data/core.telegram.org/mtproto/TL.html new file mode 100644 index 0000000000..ebb3c36c6e --- /dev/null +++ b/data/core.telegram.org/mtproto/TL.html @@ -0,0 +1,210 @@ + + + + + TL Language + + + + + + + + + + + + + +
+ +
+
+
+ +

TL Language

+ +

TL (Type Language) serves to describe the used system of types, constructors, and existing functions. In fact, the combinator description format presented in Binary Data Serialization is used.

+

See also:

+ +

Advanced topics:

+ +

Overview

+

A TL program usually consists of two sections separated by keyword ---functions---. The first section consists of declarations of built-in types and aggregate types (i.e. their constructors). The second section consists of the declared functions, i.e. functional combinators.

+

Actually, both the first and second sections consist of combinator declarations, each of which ends with a semicolon. However, the first section contains only constructors, while the second section only involves functions. Each combinator is declared using a “combinator declaration” in the format explained above. However, the combinator number and field names may be explicitly assigned.

+

If additional type declarations are required after functions have been declared, the keyword (section divider) ---types--- is used. Furthermore, a functional combinator may be declared in the type section if its result type begins with an exclamation point (in fact, when the function section is interpreted, this exclamation point is added automatically).

+

To explicitly define 32-bit names of combinators, a hash mark (#) is added immediately after the combinator’s name, followed by 8 hexadecimal digits.

+

Namespaces

+

Composite constructions like <namespace_identifier>.<constructor_identifier> and <namespace_identifier>.<Type_identifier> can be used as constructor- or type identifiers. The portion of the identifier to the left of the period is called the namespace. Moreover, the rule about a first uppercase letter in type identifiers and lowercase letter in constructor identifiers applies to the part of the construction after the period. For example, auth.Message would be a type, while auth.std_message would be a constructor.

+

Namespaces do not require a special declaration.

+

Comments

+

Comments are the same as in C++.

+

Example

+
// built-in types
+int#a8509bda ? = Int;
+long ? = Long;
+double ? = Double;
+string ? = String;
+null = Null;
+
+vector {t:Type} # [ t ] = Vector t;
+coupleInt {alpha:Type} int alpha = CoupleInt<alpha>;
+coupleStr {gamma:Type} string gamma = CoupleStr gamma;  
+/* The name of the type variable is irrelevant: "gamma" could be replaced with "alpha"; 
+   However, the combinator number will depend on the specific choice. */
+
+intHash {alpha:Type} vector<coupleInt<alpha>> = IntHash<alpha>;
+strHash {alpha:Type} (vector (coupleStr alpha)) = StrHash alpha;
+intSortedHash {alpha:Type} intHash<alpha> = IntSortedHash<alpha>;
+strSortedHash {alpha:Type} (strHash alpha) = StrSortedHash alpha;
+
+// custom types
+pair x:Object y:Object = Pair;
+triple x:Object y:Object z:Object = Triple;
+
+user#d23c81a3 id:int first_name:string last_name:string = User;
+no_user#c67599d1 id:int = User;
+group id:int title:string last_name:string = Group;
+no_group = Group;
+
+---functions---
+
+// Maybe some built-in arithmetic functions; inverse quotes make "identifiers" out of arbitrary non-alphanumeric strings
+`+` Int Int = Int;
+`-` Int Int = Int;
+`+` Double Double = Double;
+// ...
+
+// API functions (aka RPC functions)
+getUser#b0f732d5 int = User;
+getUsers#2d84d5f5 (Vector int) = Vector User;
+

In this case, the user constructor has been explicitly assigned a number (0xd23c81a3); In fact, this was not necessary, since this value is the CRC32 of the string "user id:int first_name:string last_name:string = User", which would have been used by default.

+

Special constructors are not required for Vector int, Vector User, Vector Object, etc. -- the same universal constructor can be used everywhere:

+
vector#1cb5c415 {t:Type} # [ t ] = Vector t;
+

Note that when the getUsers (Vector int) = Vector User; constructor number is calculated, the CRC32 of the string "getUsers Vector int = Vector User” is computed (from which all parentheses have been removed).

+

Notation T0<T1,T2,...,Tn> is syntactic sugar for (T0 (T1) (T2) ... (Tn)). For example, Vector<User> and (Vector User) are entirely interchangeable.

+

Example of an RPC query

+

Suppose we want to call getUsers([2,3,4]). This query will be serialized into a sequence of 32-bit integers as follows:

+
0x2d84d5f5 0x1cb5c415 0x3 0x2 0x3 0x4
+

Please note that TL serialization yields sequences of 32-bit integers. When it has to be embedded into a byte stream, for example a network packet, each 32-bit integer is represented by four bytes in little-endian order. In this way the above query corresponds to the following byte stream:

+
F5 D5 84 2D 15 C4 B5 1C 03 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00
+

The response might look something like this:

+
0x1cb5c415 0x3 0xd23c81a3 0x2 0x74655005 0x00007265 0x72615006 0x72656b 0xc67599d1 0x3 0xd23c81a3 0x4 0x686f4a04 0x6e 0x656f4403
+

This roughly corresponds to

+
[{"id":2,"first_name":"Peter", "last_name":"Parker"},{},{"id":4,"first_name":"John","last_name":"Doe"}]
+

Note that in both cases the same universal constructor vector#1cb5c415 is used: in the request to serialize the value of type Vector int, and in the serialization of the value of type Vector User in the response. There is no ambiguity because in both cases the type of the value being (de)serialized is known before its (de)serialization begins. For example, after receiving the query, the server sees that the first part is 0x2d84d5f5, which corresponds to the combinator getUsers#2d84d5f5 (Vector int) = Vector User. Thus, it is understood that what follows will be a value of type Vector int. After receiving the response to this query, the client knows that it must receive a value of type Vector User and it deserializes the response accordingly.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/tdlib/options.html b/data/core.telegram.org/tdlib/options.html new file mode 100644 index 0000000000..1d86d224cf --- /dev/null +++ b/data/core.telegram.org/tdlib/options.html @@ -0,0 +1,465 @@ + + + + + TDLib options + + + + + + + + + + + + + +
+ +
+
+
+ +

TDLib options

+ +

TDLib has many options that affect the behavior of the library. Each option has a name and a value. Value may be of one of the following types:

+ + + + + + + + + + + + + + + + + + + + + + + +
Type of valueDefault valueValue range
Integer064-bit integer
BooleanfalseTrue or false
StringAny Unicode string
+

List of options supported by TDLib

+

Options not mentioned in this list may be safely ignored.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeWritableDescription
always_parse_markdownBooleanYesIf true, text entities will be automatically parsed in all inputMessageText objects
archive_and_mute_new_chats_from_unknown_usersBooleanYesIf true, new chats from non-contacts will be automatically archived and muted. The option can be set only if the option “can_archive_and_mute_new_chats_from_unknown_users” is true. getOption needs to be called explicitly to fetch the latest value of the option, changed from another device
disable_contact_registered_notificationsBooleanYesIf true, notifications about the user's contacts who have joined Telegram will be disabled. User will still receive the corresponding message in the private chat. getOption needs to be called explicitly to fetch the latest value of the option, changed from another device
disable_persistent_network_statisticsBooleanYesIf true, persistent network statistics will be disabled, which significantly reduces disk usage
disable_sent_scheduled_message_notificationsBooleanYesIf true, notifications about outgoing scheduled messages that were sent will be disabled
disable_time_adjustment_protectionBooleanYesIf true, protection from external time adjustment will be disabled, which significantly reduces disk usage
disable_top_chatsBooleanYesIf true, support for top chats and statistics collection is disabled
ignore_background_updatesBooleanYesIf true, allows to skip all updates received while the TDLib instance was not running. The option does nothing if the database or secret chats are used
ignore_default_disable_notificationBooleanYesIf true, the disable_notification value specified in the request will be always used instead of the default value
ignore_inline_thumbnailsBooleanYesIf true, prevents file thumbnails sent by the server along with messages from being saved on the disk
ignore_platform_restrictionsBooleanYesIf true, chat and message restrictions specific to the currently used operating system will be ignored
ignore_sensitive_content_restrictionsBooleanYesIf true, sensitive content will be shown on all user devices. getOption needs to be called explicitly to fetch the latest value of the option, changed from another device
is_location_visibleBooleanYesIf true, other users will be allowed to see the current user's location
language_pack_database_pathStringYesPath to a database for storing language pack strings, so that this database can be shared between different accounts. By default, language pack strings are stored only in memory. Changes of value of this option will be applied only after TDLib restart, so it should be set before call to setTdlibParameters.
language_pack_idStringYesIdentifier of the currently used language pack from the current localization target
localization_targetStringYesName for the current localization target (currently supported: “android”, “android_x”, “ios”, “macos” and “tdesktop”)
message_unload_delayIntegerYesThe maximum time messages are stored in memory before they are unloaded, 60-86400; in seconds. Defaults to 60 for users and 1800 for bots
notification_group_count_maxIntegerYesMaximum number of notification groups to be shown simultaneously, 0-25
notification_group_size_maxIntegerYesMaximum number of simultaneously shown notifications in a group, 1-25. Defaults to 10
onlineBooleanYesOnline status of the current user
prefer_ipv6BooleanYesIf true, IPv6 addresses will be preferred over IPv4 addresses
use_pfsBooleanYesIf true, Perfect Forward Secrecy will be enabled for interaction with the Telegram servers for cloud chats
use_quick_ackBooleanYesIf true, quick acknowledgement will be enabled for outgoing messages
use_storage_optimizerBooleanYesIf true, the background storage optimizer will be enabled
animated_emoji_sticker_set_nameStringNoName of a sticker set with animated emojis
animation_search_bot_usernameStringNoUsername of a bot which can be used in inline mode for animations search
authorization_dateIntegerNoPoint in time (Unix timestamp) when authorization was received
basic_group_size_maxIntegerNoMaximum number of members in a basic group
call_connect_timeout_msIntegerNoMaximum time to wait for call connection creation to be passed to libtgvoip
call_packet_timeout_msIntegerNoMaximum time to wait for call packet delivery to be passed to libtgvoip
can_archive_and_mute_new_chats_from_unknown_usersBooleanNoIf true, the option “archive_and_mute_new_chats_from_unknown_users” can be changed
can_ignore_sensitive_content_restrictionsBooleanNoIf true, the option “ignore_sensitive_content_restrictions” can be changed
enabled_proxy_idIntegerNoIdentifier of the enabled proxy
expect_blockingBooleanNoIf true, access to Telegram is likely blocked for the user
favorite_stickers_limitIntegerNoMaximum number of favorite stickers
forwarded_message_count_maxIntegerNoMaximum number of forwarded messages per one request
group_anonymous_bot_user_idIntegerNoIdentifier of the bot which is shown as the sender of anonymous messages in groups when viewed from an outdated client
message_caption_length_maxIntegerNoMaximum length of a message caption
message_text_length_maxIntegerNoMaximum length of a message text
my_idIntegerNoIdentifier of the current user
pinned_archived_chat_count_maxIntegerNoMaximum number of pinned cloud chats in the Archive chat list. The same amount of secret chats can be pinned locally
pinned_chat_count_maxIntegerNoMaximum number of pinned cloud chats in the Main chat list. The same amount of secret chats can be pinned locally
photo_search_bot_usernameStringNoUsername of a bot which can be used in inline mode for photos search
replies_bot_chat_idIntegerNoIdentifier of the @replies bot
suggested_language_pack_idStringNoIdentifier of the language pack, suggested for the user by the server
supergroup_size_maxIntegerNoMaximum number of members in a supergroup
t_me_urlStringNoCurrent value of t.me URL, i.e. https://t.me/
telegram_service_notifications_chat_idIntegerNoIdentifier of the Telegram Service Notifications chat
test_modeBooleanNoIf true, the test environment is being used instead of the production environment
unix_timeIntegerNoAn estimation of the current Unix timestamp. The option will not be updated automatically unless the difference between the previous estimation and the locally available monotonic clocks changes significantly
venue_search_bot_usernameStringNoUsername of a bot which can be used in inline mode for venues search
versionStringNoTDLib version. This options is guaranteed to come before all other updates since TDLib 1.4.0
+

Additionally any option beginning with 'x' or 'X' is writeable and can be safely used by the application to persistently store some small amount of data.

+
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/widgets.html b/data/core.telegram.org/widgets.html new file mode 100644 index 0000000000..856b4fd1f1 --- /dev/null +++ b/data/core.telegram.org/widgets.html @@ -0,0 +1,141 @@ + + + + + Telegram Widgets + + + + + + + + + + + + + +
+ +
+
+
+
+

Telegram Widgets

+ +

Telegram widgets offer a quick way to add a sharing button to your pages, embed posts from public channels or groups. Widgets can also help your users log in with Telegram or view Telegram Discussions on your website.

+
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+
+ +
+
+ +
+ + + + + + diff --git a/data/core.telegram.org/widgets/post.html b/data/core.telegram.org/widgets/post.html new file mode 100644 index 0000000000..3422164b0b --- /dev/null +++ b/data/core.telegram.org/widgets/post.html @@ -0,0 +1,240 @@ + + + + + Post Widget + + + + + + + + + + + + + + + +
+ +
+
+
+ +

Post Widget

+ +

You can embed messages from public groups and channels anywhere. Here’s what an embed of a Telegram message looks like when included on a web page:

+

+ +

+
+ +

To get the HTML-code for embedding a message, just open its t.me link (e.g., t.me/durov/43) in a web browser and click < > EMBED:

+
+ +
+ +

Configure widget

+

You can choose more options using the form below.

+

+
+ +
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+
+
+
+ +
+ +
+ + + +
+
+ +
+ +
+
+ + + + + + + +
+ + +
+
+ +
+ +
+ +
+
+ +
+
+
+
+
+

+
+ +
+ +
+
+ +
+ + + + + + + + + + diff --git a/data/corefork.telegram.org/api/threads.html b/data/corefork.telegram.org/api/threads.html new file mode 100644 index 0000000000..2462d657a6 --- /dev/null +++ b/data/corefork.telegram.org/api/threads.html @@ -0,0 +1,182 @@ + + + + + Threads + + + + + + + + + + + + + +
+ +
+
+
+ +

Threads

+ +
+ +

Telegram allows commenting on a channel post or on a generic supergroup message, thanks to message threads.

+

Message threads

+

Schema:

+
messageReplyHeader#a6d57763 flags:# reply_to_msg_id:int reply_to_peer_id:flags.0?Peer reply_to_top_id:flags.1?int = MessageReplyHeader;
+
+messageReplies#83d60fc2 flags:# comments:flags.0?true replies:int replies_pts:int recent_repliers:flags.1?Vector<Peer> channel_id:flags.0?long max_id:flags.2?int read_max_id:flags.3?int = MessageReplies;
+
+message#85d6cbe2 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true id:int from_id:flags.8?Peer peer_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long restriction_reason:flags.22?Vector<RestrictionReason> ttl_period:flags.25?int = Message;
+
+---functions---
+
+messages.search#a0fda762 flags:# peer:InputPeer q:string from_id:flags.0?InputPeer top_msg_id:flags.1?int filter:MessagesFilter min_date:int max_date:int offset_id:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages;
+

Threads are usually automatically created when replying to any message in a group.
+For example, all replies to a message with ID 420 are associated to thread with ID 420, unique to this group; this thread ID is contained in the reply_to_top_id field of reply_to messageReplyHeader, along with an eventual reply_to_msg_id, for replies to messages within a thread.
+Replies to messages in a thread are part of the same thread, and do not spawn new threads.

+

When receiving a message from a group that is also the top of a thread (the message with ID 420), the replies optional field will contain a messageReplies constructor, containing the message ID and PTS of the latest reply in the thread, and the message ID of the latest read thread reply, along with the total number of replies in the thread.

+

Replies to a thread can also be manually fetched using messages.search, providing to top_msg_id the thread ID.

+

Channel comments

+
messageReplies#83d60fc2 flags:# comments:flags.0?true replies:int replies_pts:int recent_repliers:flags.1?Vector<Peer> channel_id:flags.0?long max_id:flags.2?int read_max_id:flags.3?int = MessageReplies;
+

The same messageReplies constructor seen above will also be contained in channel posts, this time containing information about the comment section of a specific channel post.
+The comment section of a channel post is simply the message thread of the automatically forwarded channel message in the linked discussion supergroup; the ID of the linked discussion supergroup will be contained in the messageReplies.channel_id field.

+

For channel posts, the recent_repliers field will also contain information about the last few comment posters for a specific thread, to show a small list of commenter profile pictures in client previews.

+

@replies

+
messageFwdHeader#5f777dce flags:# imported:flags.7?true from_id:flags.0?Peer from_name:flags.5?string date:int channel_post:flags.2?int post_author:flags.3?string saved_from_peer:flags.4?Peer saved_from_msg_id:flags.4?int psa_type:flags.6?string = MessageFwdHeader;
+
+messageReplyHeader#a6d57763 flags:# reply_to_msg_id:int reply_to_peer_id:flags.0?Peer reply_to_top_id:flags.1?int = MessageReplyHeader;
+
+message#85d6cbe2 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true id:int from_id:flags.8?Peer peer_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long restriction_reason:flags.22?Vector<RestrictionReason> ttl_period:flags.25?int = Message;
+
+updateNewMessage#1f2b0afd message:Message pts:int pts_count:int = Update;
+updateNewChannelMessage#62ba04d9 message:Message pts:int pts_count:int = Update;
+
+---functions---
+
+contacts.blockFromReplies#29a8962c flags:# delete_message:flags.0?true delete_history:flags.1?true report_spam:flags.2?true msg_id:int = Updates;
+
+contacts.resolveUsername#f93ccba3 username:string = contacts.ResolvedPeer;
+

Since a user can comment in channel posts without joining the actual discussion supergroup, there must be a way for them to receive notifications about replies in comment sections.
+For this reason, a special @replies username is provided. +Its ID for main and testing endpoints can be seen in the tdlib sources.

+

When someone replies to one of our messages in the comment section of a channel post, and the user is not subscribed to the discussion group, the client will receive two updates:

+
    +
  • An updateNewChannelMessage from the discussion group itself, structured just like any other update coming from a subscribed group, with:
      +
    • id set to the ID of the reply
    • +
    • from_id set to the peer that replied to us
    • +
    • peer_id set to the peer of the discussion group
    • +
    • reply_to.reply_to_msg_id set to the ID of our message
    • +
    • reply_to.reply_to_top_id set to the thread ID.
    • +
    +
  • +
  • An updateNewMessage
      +
    • id set to the common ID sequence for users
    • +
    • from_id set to the peer of @replies
    • +
    • peer_id set to our own peer
    • +
    • fwd_from.saved_from_msg_id set to the ID of the reply
    • +
    • fwd_from.from_id set to the the peer that replied to us
    • +
    • reply_to.reply_to_peer_id set to the peer of the discussion group
    • +
    • reply_to.reply_to_msg_id set to the ID of our message
    • +
    • reply_to.reply_to_top_id set to the thread ID
    • +
    +
  • +
+

Clients should display messages coming from @replies as a read-only supergroup, with each reply displayed as a separate message from the author of the reply, with a "View in chat" button like for channel comments.

+ +
+ +
+
+ +
+ + + + + + + + diff --git a/data/corefork.telegram.org/api/top-rating.html b/data/corefork.telegram.org/api/top-rating.html new file mode 100644 index 0000000000..9dadfb5109 --- /dev/null +++ b/data/corefork.telegram.org/api/top-rating.html @@ -0,0 +1,145 @@ + + + + + Top peer rating + + + + + + + + + + + + + +
+ +
+
+
+ +

Top peer rating

+ +

If enabled, the rating of top peers indicates the relevance of a frequently used peer in a certain category (frequently messaged users, frequently used bots, inline bots, frequently visited channels and so on).

+

Schema:

+
topPeer#edcdc05b peer:Peer rating:double = TopPeer;
+
+topPeerCategoryBotsPM#ab661b5b = TopPeerCategory;
+topPeerCategoryBotsInline#148677e2 = TopPeerCategory;
+topPeerCategoryCorrespondents#637b7ed = TopPeerCategory;
+topPeerCategoryGroups#bd17a14a = TopPeerCategory;
+topPeerCategoryChannels#161d9628 = TopPeerCategory;
+topPeerCategoryPhoneCalls#1e76a78c = TopPeerCategory;
+topPeerCategoryForwardUsers#a8406ca9 = TopPeerCategory;
+topPeerCategoryForwardChats#fbeec0f0 = TopPeerCategory;
+
+topPeerCategoryPeers#fb834291 category:TopPeerCategory count:int peers:Vector<TopPeer> = TopPeerCategoryPeers;
+
+contacts.topPeersNotModified#de266ef5 = contacts.TopPeers;
+contacts.topPeers#70b772a8 categories:Vector<TopPeerCategoryPeers> chats:Vector<Chat> users:Vector<User> = contacts.TopPeers;
+contacts.topPeersDisabled#b52c939d = contacts.TopPeers;
+
+---functions---
+
+contacts.getTopPeers#973478b6 flags:# correspondents:flags.0?true bots_pm:flags.1?true bots_inline:flags.2?true phone_calls:flags.3?true forward_users:flags.4?true forward_chats:flags.5?true groups:flags.10?true channels:flags.15?true offset:int limit:int hash:long = contacts.TopPeers;
+

The rate delta is computed by taking the time delta between the last time the user used a certain peer and the last time the rating for that peer was received and dividing it by the exponential decay from config.

+

Example: +Client-side, every time a user opens chat 123456789 the following operation must be done on the cached top peer info.

+
    +
  • dateOpened indicates when was the peer used
  • +
  • normalizeRate is an arbitrary time in the recent past. +When ratings are received from the server using contacts.getTopPeers and the schema described above, it is the time when they were received.
  • +
+
topPeer.rating += e^((dateOpened - normalizeRate) / config.rating_e_decay)
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/corefork.telegram.org/constructor/channelAdminLogEventsFilter.html b/data/corefork.telegram.org/constructor/channelAdminLogEventsFilter.html new file mode 100644 index 0000000000..da43eefd2d --- /dev/null +++ b/data/corefork.telegram.org/constructor/channelAdminLogEventsFilter.html @@ -0,0 +1,266 @@ + + + + + channelAdminLogEventsFilter + + + + + + + + + + + + + +
+ +
+
+
+ +

channelAdminLogEventsFilter

+ +

Filter only certain admin log events

+

+ +
+
channelAdminLogEventsFilter#ea107ae4 flags:# join:flags.0?true leave:flags.1?true invite:flags.2?true ban:flags.3?true unban:flags.4?true kick:flags.5?true unkick:flags.6?true promote:flags.7?true demote:flags.8?true info:flags.9?true settings:flags.10?true pinned:flags.11?true edit:flags.12?true delete:flags.13?true group_call:flags.14?true invites:flags.15?true = ChannelAdminLogEventsFilter;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
flags#Flags, see TL conditional fields
joinflags.0?trueJoin events
leaveflags.1?trueLeave events
inviteflags.2?trueInvite events
banflags.3?trueBan events
unbanflags.4?trueUnban events
kickflags.5?trueKick events
unkickflags.6?trueUnkick events
promoteflags.7?trueAdmin promotion events
demoteflags.8?trueAdmin demotion events
infoflags.9?trueInfo change events (when about, linked chat, location, photo, stickerset, title or username data of a channel gets modified)
settingsflags.10?trueSettings change events (invites, hidden prehistory, signatures, default banned rights)
pinnedflags.11?trueMessage pin events
editflags.12?trueMessage edit events
deleteflags.13?trueMessage deletion events
group_callflags.14?trueGroup call events
invitesflags.15?trueInvite events
+

Type

+

ChannelAdminLogEventsFilter

+

Related pages

+

channelAdminLogEventActionParticipantJoin

+

A user has joined the group (in the case of big groups, info of the user that has joined isn't shown)

+

channelAdminLogEventActionParticipantLeave

+

A user left the channel/supergroup (in the case of big groups, info of the user that has joined isn't shown)

+

channelAdminLogEventActionParticipantInvite

+

A user was invited to the group

+

channelAdminLogEventActionParticipantToggleBan

+

The banned rights of a user were changed

+

channelAdminLogEventActionParticipantToggleAdmin

+

The admin rights of a user were changed

+

channelAdminLogEventActionChangeAbout

+

The description was changed

+

channelAdminLogEventActionChangeLinkedChat

+

The linked chat was changed

+

channelAdminLogEventActionChangeLocation

+

The geogroup location was changed

+

channelAdminLogEventActionChangePhoto

+

The channel/supergroup's picture was changed

+

channelAdminLogEventActionChangeStickerSet

+

The supergroup's stickerset was changed

+

channelAdminLogEventActionChangeTitle

+

Channel/supergroup title was changed

+

channelAdminLogEventActionChangeUsername

+

Channel/supergroup username was changed

+

channelAdminLogEventActionToggleInvites

+

Invites were enabled/disabled

+

channelAdminLogEventActionTogglePreHistoryHidden

+

The hidden prehistory setting was changed

+

channelAdminLogEventActionToggleSignatures

+

Channel signatures were enabled/disabled

+

channelAdminLogEventActionDefaultBannedRights

+

The default banned rights were modified

+

channelAdminLogEventActionUpdatePinned

+

A message was pinned

+

channelAdminLogEventActionEditMessage

+

A message was edited

+

channelAdminLogEventActionDeleteMessage

+

A message was deleted

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/corefork.telegram.org/constructor/photoStrippedSize.html b/data/corefork.telegram.org/constructor/photoStrippedSize.html new file mode 100644 index 0000000000..7b68536ab0 --- /dev/null +++ b/data/corefork.telegram.org/constructor/photoStrippedSize.html @@ -0,0 +1,159 @@ + + + + + photoStrippedSize + + + + + + + + + + + + + +
+ +
+
+
+ +

photoStrippedSize

+ +

A low-resolution compressed JPG payload

+

+ +
+
photoStrippedSize#e0b0bc2e type:string bytes:bytes = PhotoSize;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
typestringThumbnail type
bytesbytesThumbnail data, see here for more info on decompression »
+

Type

+

PhotoSize

+

Thumbnail type and its sizes

+

See the photoSize constructor.

+

Related pages

+

Uploading and Downloading Files

+

How to transfer large data batches correctly.

+

photoSize

+

Image description.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/corefork.telegram.org/constructor/updateChannelTooLong.html b/data/corefork.telegram.org/constructor/updateChannelTooLong.html new file mode 100644 index 0000000000..6ce4cd981f --- /dev/null +++ b/data/corefork.telegram.org/constructor/updateChannelTooLong.html @@ -0,0 +1,161 @@ + + + + + updateChannelTooLong + + + + + + + + + + + + + +
+ +
+
+
+ +

updateChannelTooLong

+ +

There are new updates in the specified channel, the client must fetch them.
+If the difference is too long or if the channel isn't currently in the states, start fetching from the specified pts.

+

+ +
+
updateChannelTooLong#108d941f flags:# channel_id:long pts:flags.0?int = Update;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
flags#Flags, see TL conditional fields
channel_idlongThe channel
ptsflags.0?intThe PTS.
+

Type

+

Update

+

Related pages

+

Working with Updates

+

How to subscribe to updates and handle them properly.

+ +
+ +
+
+ +
+ + + + + + diff --git a/data/corefork.telegram.org/method/langpack.getDifference b/data/corefork.telegram.org/method/langpack.getDifference new file mode 100644 index 0000000000..6301dcafba --- /dev/null +++ b/data/corefork.telegram.org/method/langpack.getDifference @@ -0,0 +1,176 @@ + + + + + langpack.getDifference + + + + + + + + + + + + + +
+ +
+
+
+ +

langpack.getDifference

+ +

Get new strings in languagepack

+

+ +
+
langPackDifference#f385c1f6 lang_code:string from_version:int version:int strings:Vector<LangPackString> = LangPackDifference;
+---functions---
+langpack.getDifference#cd984aa5 lang_pack:string lang_code:string from_version:int = LangPackDifference;

+

Parameters

+ + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
lang_packstringLanguage pack
lang_codestringLanguage code
from_versionintPrevious localization pack version
+

Result

+

LangPackDifference

+

Possible errors

+ + + + + + + + + + + + + + + +
CodeTypeDescription
400LANG_PACK_INVALIDThe provided language pack is invalid.
+ +
+ +
+
+ +
+ + + + + + diff --git a/data/promote.telegram.org/basics.html b/data/promote.telegram.org/basics.html new file mode 100644 index 0000000000..c2247a9bbf --- /dev/null +++ b/data/promote.telegram.org/basics.html @@ -0,0 +1,204 @@ + + + + + Telegram Ads + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+ +
+
+

Telegram Ad Platform

+ +

Telegram provides a free and secure messaging service for more than 500 million monthly active users around the world. In addition to sending private messages and chatting in private groups, Telegram users can subscribe to public one-to-many channels.

+

Every month, Telegram users generate over 500 billion views in one-to-many channels.

+
+ +
+ +

+

Advertising on Telegram

+

Sponsored messages on Telegram are displayed in large public one-to-many channels with 1000+ subscribers and are limited to 160 characters. Sponsored Messages are based solely on the topic of the public channels in which they are shown.

+

This means that no user data is mined or analyzed to display ads, and every user viewing a particular channel on Telegram sees the same sponsored messages.

+
+ +
+ +

Context-based advertising

+

Advertisers can choose the language and approximate topics of channels where their ads will be displayed. It is also possible to choose specific channels where a certain ad will be shown – or add specific channels where it will not be displayed.

+

This allows advertisers to serve precise and efficient ads while preserving user privacy.

+

Privacy-conscious ads

+

Unlike other apps, Telegram doesn't track whether users tap on a sponsored message and doesn't profile them based on their activity. We also prevent external links in sponsored messages to ensure that third parties can’t spy on our users. We believe that everyone has the right to privacy, and technological platforms should respect that.

+

Revenue sharing with channel owners

+

Sponsored Messages are currently in test mode. Once they are fully launched and allow Telegram to cover its basic costs, we will start sharing ad revenue with the owners of public channels in which sponsored messages are displayed.

+

Getting started

+

Telegram welcomes all responsible advertisers. Anyone can study Telegram's Ad Policies and Guidelines, create an account on the Ad Platform and try out the interface. For a detailed overview of the platform, see this guide.

+

+
+ +
+
+ +
+
+
+
+ + + + + + + + + + + + + + + + diff --git a/data/promote.telegram.org/guidelines.html b/data/promote.telegram.org/guidelines.html new file mode 100644 index 0000000000..1873c02a4c --- /dev/null +++ b/data/promote.telegram.org/guidelines.html @@ -0,0 +1,312 @@ + + + + + Telegram Ads + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+ +
+
  1. Ad Policies and Guidelines
+
+
+
+

Ad Policies and Guidelines

+ +

These Ad Policies and Guidelines apply to all ads displayed on the Telegram Ad Platform and describe what ad content is allowed on Telegram.

+

Advertisers are responsible for their ads and for complying with these Ad Policies and Guidelines, the Telegram Ad Platform Terms of Service, the Telegram Terms of Service and Privacy Policy.

+
+

1. Ad format
2. Editorial requirements
3. Link format
4. Destination
5. Prohibited content
5.1. Graphic, shocking, or sexual content
5.2. Hate, violence, harassment
5.3. Third party rights
5.4. Deceptive, misleading, or predatory advertising
5.5. Election or political ads
5.6. Gambling
5.7. Deceptive or harmful financial products or services
5.8. Medical services, medications, supplements
5.9. Drugs, alcohol, tobacco, fast food
5.10. Weapons, firearms, explosives, ammunition
5.11. Spam software, malware, hacking
5.12. Products of questionable legality

+
+

1. Ad format

+

Ads can only promote products inside Telegram, such as channels or bots. Each ad consists of an ad text and a button that opens a link to the advertised product. The maximum length of the ad text is 160 characters including spaces.

+

2. Editorial requirements

+

Standard requirements of style, clarity, spelling and punctuation apply to all ads. Numbers, marks and symbols must be used properly. The following is not allowed:

+
    +
  • Profanity or vulgarity, including slur acronyms and spelling variations, in any language, and masked vulgarity (e.g., f**k)
  • +
  • Unrecognizable or unclear meaning, such as overbroad or vague descriptions, repetition of words and phrases
  • +
  • Excessive or gimmicky use of CaPiTaLiZaTiOn, highlighting, s p a c i n g and s,y,m,b,o,l,s, including Unicode art, ASCII art and box-drawing
  • +
  • Intrusive, excessive or gimmicky use of emoji and other emoticons
  • +
  • Line breaks, bullet points, numbering lists
  • +
+

3. Link format

+

In addition to the main ad link submitted in the ‘URL’ field, ads may also include one optional link in the ad text itself, using the format t.me/link or @link. The ad link and the link in the ad text must both lead to the same channel or bot on Telegram.

+

If the destination is a Telegram bot, links may include start parameters for the bot.

+

Links must be used properly. Particularly, the following is not allowed:

+
    +
  • Using more than one link in the ad text
  • +
  • Using any external links, such as URL shorteners or links to any other websites, even if users are ultimately redirected to the channel or bot
  • +
+

4. Destination

+

The destination channel or bot on Telegram must be technically and visually complete and functional, and its content should be consistent with the ad. Destination channels must be public. Particularly, the following is not allowed:

+
    +
  • Destinations solely designed for displaying ads
  • +
  • Unrelated destinations, such as when the destination link doesn’t correspond with the ad text
  • +
  • Invalid or unsupported destinations, such as external links, etc.
  • +
+

5. Prohibited content

+

These Ad Policies and Guidelines prohibit some types of content to ensure a safe and pleasant experience for Telegram users. The following requirements apply to ads on the Telegram Ad Platform and to the products they promote, whether implied or explicit. All examples given are non-exhaustive.

+

5.1. Graphic, shocking, or sexual content

+

Ads must not promote graphic, shocking, or sexual content, products and services.

+

Examples:

+
    +
  • Gruesome, disgusting, or shocking imagery, including gore, bodily fluids, accident photos, graphic details of torture
  • +
  • Nudity, sexually explicit and sexually suggestive content, including excessively exposed intimate body parts, sexual merchandize and entertainment, dating services
  • +
+

5.2. Hate, violence, harassment

+

Ads must not promote hatred, intolerance, harassment, discrimination, violence, or abuse.

+

Examples:

+
    +
  • Violence and its promotion, including supporting organizations or movements with ties to violence
  • +
  • Promoting harassment or bullying, including dehumanizing speech, statements of inferiority, defamatory content, disclosing contact details or personal data
  • +
  • Discrimination towards individuals, groups, or organizations, including hateful messages on the basis of race, religion, color, national or ethnic origin, age, beliefs, sexual orientation or practices, physical or mental abilities
  • +
+

5.3. Third party rights

+

Ads and promoted content must not violate third party rights, including trademark, copyright, privacy or other personal or proprietary rights.

+

Examples:

+
    +
  • Unauthorized distribution of copyrighted content, including pirated software and content such as movies, music, or books
  • +
  • Plagiarism, including impersonating public figures or brands, misusing brand logos or assets, e.g., the Telegram logo
  • +
+

5.4. Deceptive, misleading, or predatory advertising

+

Ads must not contain information that is false, misleading or simply does not match the product. This includes false statements, claims or offers, together with predatory advertising practices.

+

Examples:

+
    +
  • Clickbait or similar unrealistic statements, including you-just-won-X claims, shock or scare tactics
  • +
  • Exaggerated comparisons and absolute claims, including unsupported use of comparatives and superlatives: “highest incomes”, “best company”, and comparing your brand to a different one
  • +
  • Asserting personal attributes, including by using words ‘your’, ‘other’ and derivatives, such as “We know that your family prefers Telegram”
  • +
  • Capitalizing on tragedies, health crises or acts of mass violence
  • +
+

5.5. Election or political ads

+

Ads must not promote political campaigns, elections, political parties, movements, or candidates.

+

Examples:

+
    +
  • Advocating for or against a politician, political party, or political movement
  • +
  • Exploiting political controversy, including encouraging political unrest, disrupting public order
  • +
+

5.6. Gambling

+

Ads must not promote online or offline gambling, gaming, or casino-based activities involving real money, prizes, or goods of any value.

+

Examples:

+
    +
  • Games of chance or casinos, including sports betting, lotteries, bingo, fantasy sports
  • +
  • Tips, odds, forecasts, including sports picks, odds calculators
  • +
+

5.7. Deceptive or harmful financial products or services

+

Ads must not promote content, products, or services associated with deceptive or harmful financial practices.

+

Examples:

+
    +
  • Payday loans, cash loans, predatory lending, including short-term loans
  • +
  • Get-rich-quick offers, pyramid schemes, multilevel marketing, including offers of investment with guaranteed return, claims on providing insider tips on investments
  • +
+

5.8. Medical services, medications, supplements

+

Ads must not promote content, products, or services related to health and wellness.

+

Examples:

+
    +
  • Nutrition products, including weight loss products, herbal drugs, dietary supplements, vitamins, pregnancy, and fertility-related products
  • +
  • Medical devices, services, and treatments, including medical masks, plastic surgeries, pregnancy termination, therapies
  • +
  • Products with claims of healthful, curative or stimulating effects
  • +
  • Prescriptions for medications
  • +
+

5.9. Drugs, alcohol, tobacco, fast food

+

Ads must not promote psychoactive substances, alcoholic beverages, tobacco products or fast food.

+

Examples:

+
    +
  • Alcoholic beverages, including home brewing kits, non-alcoholic beer
  • +
  • Tobacco, including e-cigarettes, rolling papers, chewing tobacco
  • +
  • Recreational drugs, including equipment and paraphernalia, e.g., pipes, bongs
  • +
  • Instructions on producing drugs
  • +
  • Fast food, including fast-food chains, etc.
  • +
+

5.10. Weapons, firearms, explosives, ammunition

+

Ads must not promote the sale of weapons, explosives or ammunition, or any related content.

+

Examples:

+
    +
  • Firearms, including sporting, recreational guns, or any antique functioning guns that can cause harm
  • +
  • Ammunition or accessories, including any firearm parts or components, even unfinished, such as magazines, scopes, silencers
  • +
  • Knives and other melee weapons, including pepper spray, daggers, axes
  • +
  • Explosives, including bombs, grenades, fireworks, or firecrackers
  • +
  • Instructions on assembling or acquiring any product covered in this section
  • +
+

5.11. Spam software, malware, hacking

+

Ads must not promote content, products, or services that facilitate unsolicited communications, are intended to harm or gain unauthorized access to a user's device, or cause deceptive or unexpected consequences.

+

Examples:

+
    +
  • Social media growth manipulation, including encouraging growth of social media profiles
  • +
  • Incentivized or automated clicks, including requests to perform actions on websites or services, complete online surveys
  • +
  • Services for generating automated traffic, including services for inflating metrics/followers, sending automated content to social media platforms or other services
  • +
  • Phishing, including promotion of services that trick a user into providing personal or other information
  • +
  • Software causing deceptive or unexpected consequences, including modified apps containing malware, viruses, or any other malicious code
  • +
+

5.12. Products of questionable legality

+

Ads must not promote content, products, or services of questionable legality.

+

Examples:

+
    +
  • Forgery, including fake IDs, passports, visas, official documents
  • +
  • Human-trafficking, including marriage brokering
  • +
  • Stolen or leaked data, including carding, passwords to subscription services
  • +
  • Sale of body parts, including bodily fluids
  • +
  • Counterfeit products, including fake or bootleg goods, inauthentic artwork or digital goods, counterfeit currency
  • +
+
+

All examples on this page are non-exhaustive.

+
+ +
+
+ + + + + + + + + + + + + + + + diff --git a/data/telegram.org/blog/channels-2-0.html b/data/telegram.org/blog/channels-2-0.html new file mode 100644 index 0000000000..3b74bf057e --- /dev/null +++ b/data/telegram.org/blog/channels-2-0.html @@ -0,0 +1,246 @@ + + + + + Channels 2.0 and More + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Channels 2.0 and More

+ +
+ +
+ +

Telegram channels are becoming a worldwide trend. Each day they get more than 400,000,000 views. Today we are introducing several features that will make channels and bots even more powerful tools for connecting with your audience.

+

Links to Posts

+

The Quick Share menu now allows you to copy links to individual messages inside a channel. You can send these links to friends outside of Telegram or post them to other social networks. Following such links will open the channel and highlight the message.

+
+ +

Copy Share Link

+
+ +

Silent Messages

+

“Is it OK to post now?” “Is this urgent enough to notify everyone?” If you're a channel admin, you know these questions too well. Luckily, you can now send silent messages that will not notify your subscribers. This is very useful for late night or non-urgent updates. Tap on the bell icon to toggle silent messages on and off.

+
+ +

Silent messages

+
+ +

Admin Signatures

+

There are times when it‘s important to know who posted a certain message. Starting today, you can enable signatures in Channel Info. New messages will be signed with the posting admin’s chosen screen name but will not link to their profile.

+
+
+ +

Channel Settings

+
+
+ +

Signed Messages

+
+ +

Edit Messages in Channels and Supergroups

+

Made a typo? Missed a word? Itching to add something? As of today, you can edit your messages after they were posted. Tap the message (double tap on iOS), then press ‘Edit’. This feature works with supergroups and channels because they both use the same underlying technology.

+

Quick Share Button for Bots

+

Many news organizations are building bots to provide tailored subscriptions. In this update we've made it easier to share the links, pictures and videos you get from bots. Check out the new official @forbesbot to see how this works.

+
+ +

Quick Share button for bots

+
+ +

Bonus: Sticker Previews

+

In other news, sticker previews now work everywhere including sticker suggestions when you type an emoji and the ‘Add stickers’ screen. Tap and hold on a sticker to see it in full size before sending. The devil's in the details, right?

+

Try it out with the Harry set: https://telegram.me/addstickers/harry

+

+ +

And that‘s all we’ve got for you this month.
Stay tuned for more updates in March!

+

+ +

February 24, 2016
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/chat-themes-interactive-emoji-read-receipts.html b/data/telegram.org/blog/chat-themes-interactive-emoji-read-receipts.html new file mode 100644 index 0000000000..190e5c6c3c --- /dev/null +++ b/data/telegram.org/blog/chat-themes-interactive-emoji-read-receipts.html @@ -0,0 +1,297 @@ + + + + + Chat Themes, Interactive Emoji, Read Receipts in Groups and Live Stream Recording + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Chat Themes, Interactive Emoji, Read Receipts in Groups and Live Stream Recording

+ +
+
+
+ + +
+ Introducing Chat Themes, Interactive Emoji, Read Receipts in Groups and Live Stream Recording +
+ +

Today's update lets you set different themes for individual chats, share your feelings with loved ones using interactive emoji with fullscreen effects, see detailed read receipts in groups and record video and audio from live broadcasts.

+

Chat Themes

+

Telegram has dozens of features to organize your chats and customize their appearance, from Chat Folders to Animated Backgrounds. In this update, coordination and decoration come together with new themes for individual chats.

+

Our designers created 8 new themes that you can apply to specific private chats. Each of the new themes features colorful gradient message bubbles, beautifully animated backgrounds and unique background patterns.

+
+ +
+ +

Both you and your chat partner can choose the theme for both sides and make any conversation easy to recognize, even when you can't find your glasses. This way you can set different themes for chats with co-workers and family members, so you won't accidentally send that video to your boss again.

+
+

To set a theme for your chat on Android, tap ⋮ > Change Colors. On iOS, tap the Chat Header > ⋯ > Change Colors. Your chat partner will see the theme if they are using the latest version of Telegram.

+
+

Each theme comes with a day and night version and will follow your app's night mode settings – whether you keep it dark all day, or have your chats follow the sun.

+

These first 8 themes are just the beginning – our designers are already working on adding more.

+

Interactive Emoji

+

We love animating emoji, but there are times when even a big red beating heart – that makes your phone vibrate with each beat! – is simply not enough to express your feelings.

+

With a little code, a little drawing and a lot of dark magic, we've created a new way of sharing emotion in real time. Send a single 🎆 🎉 🎈 👍 💩 or ❤️ to any private chat, then tap on the animated emoji to unleash a fullscreen effect.

+

If both you and your chat partner have the chat open, the animations and vibrations play simultaneously on your devices, so you feel close even when you're far apart.

+
+ +
+ +
+

Your chat partner will only see the effects if they are using the latest version of Telegram.

+
+

Our artists are already back in the dungeons, working on new fullscreen effects for more animated emoji.

+

Read Receipts in Small Groups

+

Both chat themes and interactive emoji currently only work in private chats. But this update also includes a big change for groups.

+

Group messages are marked as read (✓✓) as soon as one other member sees them. In small groups, you can now also select a message you sent to see which group members have read it.

+
+ +
+ +
+

To protect users' privacy, read receipts in groups are only stored for 7 days after the message was sent. It is not Telegram's business to keep a record of everything you've ever seen.

+
+

Record Live Streams and Video Chats

+

Telegram hosts millions of communities that can create live events for unlimited viewers. Whether it's a once-in-a-lifetime concert or an everyday algebra class, admins can now record Live Streams and Video Chats to publish them for those who missed the live version.

+ + +
+ +
+ +

Admins can start a recording right from the Live Stream or Video Chat menu – with options to record Video and Audio or Only Audio. To record video, choose an orientation for the final video file, Portrait or Landscape. After you finish recording or end the broadcast, the file is instantly uploaded to your Saved Messages.

+
+

Tap ⋮ or ⋯ to open the broadcast menu and start recording. While recording, a red dot appears next to the title of the broadcast.

+
+ + +

And that should give you enough things to do until we're back with the next update. As always, it shouldn't take us long.

+

+ +

September 19, 2021
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + + diff --git a/data/telegram.org/blog/coronavirus.html b/data/telegram.org/blog/coronavirus.html new file mode 100644 index 0000000000..aa30643a4c --- /dev/null +++ b/data/telegram.org/blog/coronavirus.html @@ -0,0 +1,254 @@ + + + + + Coronavirus News and Verified Channels + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Coronavirus News and Verified Channels

+ +
+ +
+ +
+ Verified Channels and Coronavirus Info +
+ +

Telegram Channels are a powerful tool for broadcasting your messages to unlimited audiences. Since 2015, media organizations and public figures have been using them to reach readers, voters and fans – especially in countries where freedom of speech is limited.

+

Recently, we noticed a new type of channel gaining popularity: those created by Ministries of Health from around the world. India, Malaysia, Israel and many other countries now send news updates, warnings and tips via Telegram.

+
+ +
+ +
+

More about Channels and their features »

+
+

New Verification Tools

+

To help users distinguish trustworthy sources from fake news, we're launching a streamlined verification process today.

+

If you have verified accounts on other social media services, simply contact our new @VerifyBot to get a verification badge for your channel, group or bot.

+
+

More about Telegram Verification Guidelines »

+
+

Notifications for Users

+

Information is the most powerful weapon in the fight for global health – at least until we get a vaccine. To do our part, we've been sending notifications to all users in countries that have official channels with updates about the virus, offering them to join.

+

We invite all health officials to collaborate on keeping people informed. If you work for your country's Ministry of Health and would like to promote its channel, please verify it first using @VerifyBot, then contact us at corona@telegram.org.

+

Coronavirus Info

+

To make sure users find accurate and relevant information about the pandemic in their region, we've created a special channel which shows up as the top result for all coronavirus-related keywords in Search. It contains a list of official news sources by country:

+

+ +

Beyond Channels: Groups and Bots

+

Telegram Channels are good for massive one-way broadcasts, but if you're looking for more interactive ways to inform people, try groups or bots.

+

Telegram Groups can have up to 200,000 members each and offer powerful tools for maintaining order. For example, doctors from the Indian state of Karnataka are using this public group to answer questions from users.

+
+

More about Telegram Groups »

+
+

Telegram Bots are third-party apps that you can interact with right from your chat list. You talk to them using buttons – and they reply with messages and media of all kinds. Bots are extremely flexible and can be used for anything from providing information to integrating with other web services.

+

For example, check out @QuizBot which can create and run quizzes like this one.

+
+

More about Telegram Bots »

+
+

And One More Thing

+

We couldn't do anything about the shortage of masks in the real world, but our artists found a way to squeeze an inexhaustible supply into your app.

+

You can apply masks from this set to any pictures you send using Telegram's Photo Editor. Whether to raise awareness, maintain digital hygiene, or simply to hide your nose is up to you.

+
+ +
+ +

Stay home. Wash your hands. Be safe. And stay tuned for our next updates!

+

+ +

April 3, 2020,
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/discover-stickers-and-more.html b/data/telegram.org/blog/discover-stickers-and-more.html new file mode 100644 index 0000000000..37242dd853 --- /dev/null +++ b/data/telegram.org/blog/discover-stickers-and-more.html @@ -0,0 +1,246 @@ + + + + + Sticker Search, Multiple Photos, and More + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Sticker Search, Multiple Photos, and More

+ +
+ +
+ +
+ +
+ +
+

In other news: Telegram has now reached 200 million monthly active users.

+
+

Today we're launching Telegram 4.8 for iOS and Telegram 4.8.5 for Android which make it much easier to discover new stickers. From now on, when you type one emoji, you will see suggestions not just from the sticker sets you've added, but also from other popular sets.

+
+ +

Suggested Stickers

+
+ +

Sticker Search

+

We've added search for sticker sets. Scroll up in the sticker panel to find the new search field that will help you find something quickly – be it a set you've added, or a brand new pack of easter bears.

+
+ +
+ +

Multi-Shot Sending

+

Need a couple of extra selfies to maximize dramatic effect? Dog can't stop doing adorable tricks? Not a problem. Use the new + button when taking a photo to take and send multiple media one after another.

+
+ +

Take & Send Multiple Photos

+
+ +

Auto-Night Mode and Connected Websites

+

Telegram for iOS v.4.8 also includes some of the goodies which Android users have been enjoying since the previous release. With Auto-Night Mode settings you can automatically switch to the dark version of the interface after nightfall or in low-light conditions:

+
+ +

Auto-Night Mode Settings on iOS

+
+ +

As of v.4.8, the iOS app also supports text formatting in media captions, reporting individual messages in public entities, and has a section where you can manage connected websites.

+

Oh, and we've optimized battery usage so that you can enjoy all of the above even longer on a single charge.

+

+ +

March 22, 2018,
The Telegram Team

+

+ +
+

P.S. In case you missed this, Telegram has now reached 200 million active users.

+
+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/games.html b/data/telegram.org/blog/games.html new file mode 100644 index 0000000000..b4d684d484 --- /dev/null +++ b/data/telegram.org/blog/games.html @@ -0,0 +1,264 @@ + + + + + Gaming Platform 1.0 + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Gaming Platform 1.0

+ +
+ +
+ +

Last year we launched a Bot Platform for Telegram. Free, powerful, and open, it was an instant hit among users and developers. Today we are aiming to push the boundaries further by launching a bot-powered Gaming Platform on Telegram. That’s right: you can now use bots to play games in your chats, complete with graphics and sound.

+
+
+ +
+
+ +

Ready to Play

+

Hundreds of games are headed your way, but about 30 are ready to be played on Telegram now, most of them published by @gamee. You can start a game by interacting with their bot directly, or by invoking it from any of your chats. To do that, try typing “@gamee “ in a group and choose a game to start playing with your friends:

+
+ +

Select a game

+
+ +

If you spot a great game on Telegram, you can challenge your friends from other chats by sharing the game with them.

+
+ +

Challenge your friends

+
+ +

Better with Friends

+

The best part of the Telegram Gaming Platform is the competition across all your existing chats. We save high scores for every game played in every chat, and you can instantly check out how you and your friends are doing against each other. Every time there’s a new leader in the game, other playing members of the chat are notified that they need to step it up.

+
+
+ +

In-game high scores

+
+
+ +

New high score in chat

+
+ +

Easy to Build

+

Building games for Telegram is easy (check out the API). Here’s MathBattle, a game that took our developer only 3 hours to build. You can launch it from any chat by typing @gamebot and choosing Math Battle:

+
+
+ +
+
+ +

This is Corsairs, a demo game that took its dev just 5 hours to build and set up. That includes sound, graphics and animations:

+
+
+ +
+
+ +

While these demos look basic, Telegram games can be anything from simple arcades and puzzles to multiplayer 3D-shooters and real-time strategy games. The underlying technology is HTML5, so games are loaded on-demand as needed, just like ordinary webpages. Games will work on iPhones 4 and newer and on Android 4.4 devices and newer. Note that your friends will need Telegram 3.13 or higher to play.

+

If you are a developer, take a look at our Introduction to Games. Also, feel free to subscribe to our official @BotNews channel to stay up to date on platform news.

+

No Added Calories

+

We know you love Telegram because it’s lean and efficient. This is why the new Gaming Platform requires 0 bytes of disk space and won’t add a single byte to the size of our apps. The only thing we're adding today is countless more fun moments in your chats.

+

+ +

And now let's see how high you can score.

+

+ +

October 3, 2016
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/instant-view.html b/data/telegram.org/blog/instant-view.html new file mode 100644 index 0000000000..6633932adc --- /dev/null +++ b/data/telegram.org/blog/instant-view.html @@ -0,0 +1,268 @@ + + + + + Instant View, Telegraph, and Other Goodies + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Instant View, Telegraph, and Other Goodies

+ +
+ +
+ + +
+ +
+ +
Meet Instant View, an elegant way to view your dog articles with zero pageload time. To try it out, use Telegram version 3.14 to share a link to a Medium post or a TechCrunch article. This will get you an Instant View button that immediately shows a native page, saving you time and data.
+ +
+
+ +

Instant View button

+
+
+ +

Saves time and data

+
+ +

If you have feedback about the way an Instant View page was generated, ping our @previews bot. Only a handful of websites are supported at the moment, but we'll be adding more as we go. Eventually we want to provide Instant View pages for every story on the Web and thus devour the entire Internet (*evil laugh*).

+

Telegraph

+

Today we are launching Telegraph – a publishing tool that lets you create richly formatted posts with photos and all sorts of embedded stuff. Telegraph posts get beautiful Instant View pages on Telegram.

+

To try it, go to telegra.ph, publish a story, and share it on Telegram. With Telegraph, your Telegram channel can run stories just like the mainstream media (although you may find it tricky to become as biased).

+

Jump to Date

+

You can now travel in time to any moment in the past. Just tap Search inside a chat and choose a day using the Calendar tool.

+
+
+ +

Calendar button

+
+
+ +

Pick a day

+
+ +

Unfortunately, this doesn't work with dates from the future. Sorry, no flying cars and hoverboards for you today.

+

View Pack for Recent Stickers

+

Remember all those times when you had a sad Pepe among your recently sent stickers? If you‘re like us, your natural desire would’ve been to reunite the sad Pepe with the rest of his family by scrolling to the Pepe pack in your sticker panel.

+

You can now do that in an instant: try a long tap (or 3D-touch on iOS) on a recent sticker, then choose ‘View Pack’. Hey presto! For some mysterious reason, this also works with non-Pepe stickers.

+
+
+ +
+
+ + + +

Groups in Common

+

Sometimes you want to find a group in your chats, but can‘t recall the title. Here’s a life-hack for you: think about a contact of yours that was also a member in that group. This association technique may help you bring back the title too. If it doesn‘t, open that contact’s profile and tap Groups in Common.

+

Android Strikes Back

+

Some of you Android users told us we loved iPhones more than Androids. That almost made us cry (remember the sad Pepe in our recent stickers?). To make things right with you, we fired our iOS dev, who was too good.

+

Well, not really. We simply locked ourselves in the coding basement for several weeks to bring you this:

+
    +
  • A slick new interface for creating groups and selecting users in privacy settings (shiny animations included).
  • +
  • A new beautiful interface for notification settings.
  • +
  • Improved security for passcode locks (your chats won't be seen in the task switcher now). This one also works on iOS.
  • +
  • Improved camera speed when taking photos and videos.
  • +
  • Better video compression.
  • +
  • An improved and less obstructive photo viewer.
  • +
  • Easier editing of messages and adding captions to photos.
  • +
+

And that's just getting us warmed up. Make Android Great Again!

+

Also

+

Something big is brewing in our secret dungeons. Stay tuned.

+

+ +

November 22, 2016
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/polls-2-0-vmq.html b/data/telegram.org/blog/polls-2-0-vmq.html new file mode 100644 index 0000000000..997bafc1f0 --- /dev/null +++ b/data/telegram.org/blog/polls-2-0-vmq.html @@ -0,0 +1,271 @@ + + + + + Polls 2.0: Visible Votes, Multiple Answers, and Quiz Mode + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Polls 2.0: Visible Votes, Multiple Answers, and Quiz Mode

+ +
+ +
+ +
+ Introducing Polls 2.0: Visible Votes, Multiple Answers, and Quiz Mode +
+ +

Since we first added polls for groups and channels, they've been used for everything from deciding where to have lunch to organizing leaderless protests. Today we're expanding the range of possibilities with three new kinds of Telegram polls.

+
+ +
+ +

Visible Votes

+

Previously, all polls on Telegram were anonymous. With this update, you can create polls that allow everyone in the group to see who voted for what. Now you will know exactly which friends you disagree with on the matter of pineapple and pizza.

+
+ A poll that shows who voted for which option +
+ +

Naturally, you can still create anonymous polls to make sure nobody finds out it was you who voted for broccoli instead of cookies.

+

Multiple Answers

+

One of the best ways to settle the score is with polls that allow people to select multiple answers. Scheduling events, or choosing a playlist of songs for a party – sometimes you need more than one choice.

+
+ A poll that allows people to select multiple answers +
+ +

Our aunt who has a knack for statistics and exploring bizarre correlations kept asking for this feature – and we just couldn't say no. (33% of developers who didn't refuse this request were also found to be addicted to cheese.)

+

Quiz Mode

+

For the game show guru and “Who Wants To Be A Millionaire” contestant in all of us, polls now have Quiz Mode. Such polls have one correct answer and can power anything from trivia games to public service exams.

+
+ Quiz mode +
+ +

As if guessing right wasn't sweet enough, correct answers will trigger a shower of confetti.

+

Creating Polls

+

Polls can be created in groups or channels (they feel lonely in one-on-one chats). Simply choose the “Poll” option in the attachment menu. Type in your question, add answer options, choose the settings that fit your purpose best – and you're ready to go:

+
+ +
+ +

Bot API and Quiz Bot

+

All the new poll types are supported in today's update to our Bot API, so bot developers can build on this new functionality.

+

As an example, we've created a Quiz Bot that lets you create multi-question quizzes and share them with others. It also lets you add text or media before questions to help create exam-style prompts with graphs and tables – or better yet, your own Know Your Meme tests.

+

Once your quiz is ready, you can share it to a group or channel – or invite users to answer questions privately, in a chat with the bot. To see how this works, try our demo quiz: Who is Who in the 'Great Minds' sticker pack.

+
+ Demo Quiz +
+ +

The bot will keep tabs on how many questions users got right and how much time it took them to complete the quiz. It also keeps a global leaderboard for each quiz you create.

+

Message Corners

+

In addition to the new polls, our apps just got a new visual setting. If you find your Telegram messages too hip to be square (or round, depending on your platform), you can tweak the appearance of message bubbles in Settings:

+
+ +
+ +

Download Progress Counters on Android

+

Just like on iOS, Android users can now see exact progress counters when downloading or uploading files – if they're in the mood to count bits and bytes.

+
+ Download progress counters on Android +
+ +

And that's it for today. Here's to a good new year full of updates. Stay tuned!

+

+ +

January 23, 2020
The Telegram Team

+
+ +
+ +
+ +
+
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/privacy-discussions-web-bots.html b/data/telegram.org/blog/privacy-discussions-web-bots.html new file mode 100644 index 0000000000..90b6aa1e7b --- /dev/null +++ b/data/telegram.org/blog/privacy-discussions-web-bots.html @@ -0,0 +1,284 @@ + + + + + Focused Privacy, Discussion Groups, Seamless Web Bots and More + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Focused Privacy, Discussion Groups, Seamless Web Bots and More

+ +
+ +
+ +
+ +
+ +

Telegram is about privacy. In 2014 we pioneered granular privacy settings in messaging. Today we are making them even more flexible with exceptions for group chats.

+

From now on, you can make something visible for all your classmates in one group chat and keep it private from, say, all your colleagues in another – with just two taps:

+
+ +
+ +

Settings will adjust automatically as people join and leave the groups. So when your half-brother unexpectedly gets a job as a data broker, you'll just need to kick him out of one group to update all your settings.

+

Who can see my phone number?

+

On Telegram, you can send messages in private chats and groups without making your phone number visible. But there may be cases when you want to make your number known (e.g. to all your coworkers), so we added a new dedicated privacy control – Who Can See My Number.

+
+ A screenshot of the redesigned Privacy & Security settings screen +

Redesigned privacy settings on iOS

+
+ + +

Meet Seamless Web Bots

+

We've made it easier to integrate bots with web services. Bots can now help you log in with your Telegram account on a website when you open a link. If you allow them to, you'll be logged in by the time the page loads in the browser:

+
+ A confirmation dialog that offers to open a link and optionally authorize on the website +
+ +

While this is purely optional, it opens the door for a vast variety of new bots. To try out this seamless authorization, press the ‘comments’ button under this post.

+

You can also make our sample @discussbot an admin in any of your broadcast channels to get a comments button under the posts you publish. The comments button opens a website where you are already logged in and ready to leave a comment. The bot will notify you if someone replies to what you wrote there.

+

Anyone can create similar bots to connect their existing services to Telegram on the fly. Integrating all kinds of social, gaming, productivity, dating or e-commerce services into your channels is now a breeze.

+

Broadcasts meet Group Chats

+

Telegram channels are a tool for broadcasting your thoughts to unlimited audiences. Telegram group chats offer a democratic way for communities of up to 200,000 members to discuss things.

+

Ever since we launched channels and groups, users have been asking us to add discussions to channels and announcements to groups. With this update, admins can add a group chat to their channel to serve as a discussion board:

+
+ +
+ +

Subscribers will see a ‘Discuss’ link on the bottom panel, and each new post from the channel will be automatically forwarded to and pinned in the discussion group.

+
+ +
+ +

View public channels

+

Speaking of channels, you can now view any public channel from the web – even if you aren‘t logged in to Telegram. The same also goes for those retro people who don’t have a Telegram account at all. Yet.

+
+ A public channel, as seen from the web +
+ +

Simply open the channel link in a browser and select “Preview channel” to see something like this: t.me/s/telegram

+

Scam Alerts

+

Telegram apps will now show a scam label for suspicious accounts.

+
+ Chat with a scammer +
+ +

iOS Goodies

+

In other news, Telegram 5.7 for iOS introduces thumbnails for PDF files. Keep in mind that Telegram lets you share files of any type, up to 1,5GB each in size (so you can telegram a PDF payload worthy of Elon's rockets).

+
+ PDF file with a thumbnail +
+ +

Telegram for iOS also catches up with the rest of our apps in terms of text links. You can now make any text a link to a website, keeping all the cords under the carpet.

+
+ Creating a text link on iOS +
+ +

Mind that people will get a warning about where exactly the link leads when they open it. (Hint: use URL shorteners if you want to rick-roll people).

+

Android Delights

+

As for Android, we've redesigned the majority of confirmation dialogs in the app, and improved the design for message search and adding people to groups. Additionally, the app got a new theme switcher in Chat Settings.

+
+ +
+ +

Have fun with all that and stay tuned for our next updates.

+

+ +

May 31, 2019
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/stickers-revolution.html b/data/telegram.org/blog/stickers-revolution.html new file mode 100644 index 0000000000..8f8fe7f8b0 --- /dev/null +++ b/data/telegram.org/blog/stickers-revolution.html @@ -0,0 +1,231 @@ + + + + + Custom Sticker Sets + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Custom Sticker Sets

+ +
+ +
+ +
+

Check out Pavel's Channel for some cool sticker sets »

+
+

Starting today, artists can submit their custom sticker sets via the Telegram @stickers bot. Each sticker set gets a permanent link, so that users can easily add new stickers and share them with friends.

+

This enables artists of the world to unleash their creativity and help Telegram users customize their experience. Our in-house artist (responsible for the graphic art in this blog) created the Animals set as an example. If you have Telegram installed and updated, this link will open the set: https://telegram.me/addstickers/Animals.

+
+ +

+
+ +

Independent designers already began submitting their sticker sets, and we notice stickers like Flags of the World or Vicky uploaded to the @stickers bot.

+

Sharing Stickers

+

Sending a link isn‘t the only way to share a sticker set. When you receive a sticker from a set you do not currently have installed, simply tap on it and choose ’Add to Stickers‘ (’Info' on iOS) to preview and add the whole set.

+
+ + +

+
+ +

Once you've added a set, its stickers become available via emoji tooltips or the dedicated sticker panel. The iOS app now has one too — you can manually switch it on/off in Chat Settings — Stickers.

+

The new Stickers menu allows you to view, uninstall and share your sticker sets.

+
+ +

+
+ +

This update is available for Android and iOS and is coming to other apps soon. Sticker sets on Telegram are now fully equipped to spread virally and devour the world.

+

+ +

The Telegram Team,
May 19, 2015

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/supergroups.html b/data/telegram.org/blog/supergroups.html new file mode 100644 index 0000000000..e5e0cb911a --- /dev/null +++ b/data/telegram.org/blog/supergroups.html @@ -0,0 +1,251 @@ + + + + + Admins, Supergroups and More + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Admins, Supergroups and More

+ +
+ +
+ +

Telegram groups are democratic by design. Everyone can invite new members and change the group‘s name and photo, which is ideal for small bands of friends or coworkers. But Telegram can also support much larger communities that need more administration. To make life easier in big groups, we’re introducing admins today.

+

From now on, you can choose how your groups will operate. By default, all members are still in control. But if you want more order, you can throw the switch and appoint additional administrators to your group.

+
+ +

+
+ +

If you enable the new restricted mode, only administrators will be able to add new people and change the name and photo of the group. Admins also have the power to remove other members from the group.

+

Supergroups

+
+

UPD: Check out Supergroups 2.0: Pinned posts, Public groups, new moderation tools!

+
+

Telegram groups have always been several steps ahead of the competition. You could have groups of up to 200 people communicating efficiently using replies, mentions and hashtags. Now it's time to go further.

+

Ever since our launch in 2013, our users have been telling us they would like to migrate even larger communities to Telegram. As of today, once your group is full, you can upgrade it to a supergroup that supports up to 5000 members.

+
+ +

+
+ +

Supergroups are optimized to host large online communities and will load quickly, even if you‘ve missed many messages while away. Here’s what you need to know about how they work:

+
    +
  • New members can see the entire message history when they join.
  • +
  • Deleted messages will disappear for all members.
  • +
  • Ordinary members can only delete their own messages.
  • +
  • Supergroups are muted by default and send fewer joined/left notifications.
  • +
+

All official Telegram clients are getting this update today.

+
+

Please note that you need the latest version of Telegram to access a supergroup. You may want to wait a little bit before upgrading your groups so that the update rolls out to all Telegram users, and they can see their groups.

+
+

iOS Bonus: Best In-App Notifications Ever

+

iOS users will enjoy our new in-app notifications. Pull down on a notification to expand it, view the full text of the message or preview attached media.

+
+ +

+
+ +

You can immediately send a quick reply or a sticker — all without leaving that particular spot in some other conversation.

+

Android Bonus: Quick Share for Channels

+

Meanwhile, Android users can enjoy the new quick sharing menu in channels. Just tap on the forwarding buttons right next to channel messages.

+
+ +
+
+ +
+

We have a few more surprises up our sleeve for this year. Stay tuned for more updates!

+

+ +

The Telegram Team,
November 25, 2015

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/supergroups5k.html b/data/telegram.org/blog/supergroups5k.html new file mode 100644 index 0000000000..c990a9d124 --- /dev/null +++ b/data/telegram.org/blog/supergroups5k.html @@ -0,0 +1,232 @@ + + + + + Supergroups 5000: Public Groups, Pinned Posts + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Supergroups 5000: Public Groups, Pinned Posts

+ +
+ +
+ +

Telegram is famous for its awesome group chats. Today’s update makes them even more awesome. To begin with, we’re increasing the number of people who can join a supergroup from 1000 to 5000 members. That's 5 times as good.

+

Supergroup admins can now inform all members about important news using pinned messages. Pinned messages are displayed at the top of the chat screen. All members will get a notification — even if they muted ordinary messages from the group.

+
+ +

A pinned message

+
+ +

Starting today, supergroups can become public and get a short link, like telegram.me/publictestgroup. This way, anybody can view the group's entire chat history and join to post messages.

+
+ +

A public group

+
+ +

We know what you’re thinking. What about spammers? To prevent potential spam issues, we're introducing powerful moderation tools for group admins. From now on, they can quickly delete all messages from a specific member, block and report them.

+
+ +

New tools for admins

+
+ +

These features work only in supergroups, but starting today, any group can be converted to a supergroup by its creator. Group admins are now shown in group members’ lists, so ping your group admin if you think this would be cool.

+
+

Good old groups still work great for smaller communities, so there's no need to convert your group right away.

+
+

And that's it for today, watch out for more updates coming soon!

+

+ +

March 13, 2016
The Telegram Team

+

+ +

P.S. Please note that we’ll be rolling out public groups gradually. They’re already live in Europe and America, but are currently not available in several countries in Asia, from which we detected significant spam activity in the past.

+

We’ll be making the feature available in more countries as we improve our anti-spam algorithms and scale our abuse team.

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/blog/unread-replace-2x.html b/data/telegram.org/blog/unread-replace-2x.html new file mode 100644 index 0000000000..88083ff4a7 --- /dev/null +++ b/data/telegram.org/blog/unread-replace-2x.html @@ -0,0 +1,259 @@ + + + + + Replace Media, Share vCards, Mark as Unread, 2X Voice Messages, and More + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ +
+
+

Replace Media, Share vCards, Mark as Unread, 2X Voice Messages, and More

+ +
+ +
+ +
+ +
+ +

Telegram 4.8.3 for iOS and 4.8.10 for Android are out today, bringing several nifty features and improvements.

+

Replace Media and Add Captions

+

Sending the wrong picture by accident is rarely fun. On Telegram, it was already possible to delete the message for everyone and send a new one instead. Now you can just replace photos or videos with the correct versions right away:

+
+ +
+ +

Start editing the message, then tap the paperclip button to replace the attached media. You can also add captions to photos or videos that didn't have one.

+

Double-Time Playback for Voice and Video Messages

+

You'll like this one if your friends enjoy sending long and thoughtful voice notes. From now on, you can switch to 2X playback and hear people get to the point faster.

+
+ +

Works with voice and video messages

+
+ +

We‘ve spent a few extra hours to ensure that your friends don’t sound like Helium-breathing chipmunks as a result. Well, most of the times.

+

Mark as Read or Unread

+
+ +
+ +

This offers a quick way to get less important messages out of the way and highlight the chats that require your future attention.

+

Share Detailed Contact Info

+

Sometimes you want to share more info about a contact than just one number. With this update, you can select what data you want to send when sharing a contact. For example, several phone numbers or other vCard fields.

+
+ +

Choose which fields to share

+
+ +

Try sharing a contact that has multiple fields with data to check this out.

+

One More Thing

+

When you open a chat from Global Search and then go back, you will return to the search results and keep your position in the list.

+

And Three More (on Android 💪)

+

Android users are getting a few extra goodies with version 4.8.10. Tap and hold on profile pictures in the chats list to preview chats:

+
+ +

Tap and hold on the profile picture

+
+ +

Use the “create link” option in the formatting menu to make text URLs:

+
+ +

Select some text, then tap '...'

+
+ +

Last but not least, it is now possible to cancel sending messages before they are sent.

+

And that's it for today, stay tuned for our next updates!

+

+ +

June 27, 2018
The Telegram Team

+
+ +
+ + +
+ + +
+
+
+ + + + + + + diff --git a/data/telegram.org/verify.html b/data/telegram.org/verify.html new file mode 100644 index 0000000000..bbad161620 --- /dev/null +++ b/data/telegram.org/verify.html @@ -0,0 +1,151 @@ + + + + + Page Verification Guidelines + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+
+
+

Page Verification Guidelines

+ +
+ Verification +
+ +

The Telegram team generally verifies active official channels, bots or public groups that have verified accounts on at least two of these services:

+
    +
  1. TikTok
  2. +
  3. Instagram
  4. +
  5. Facebook
  6. +
  7. YouTube
  8. +
  9. Twitter
  10. +
  11. VK
  12. +
  13. Snapchat
  14. +
+

Please add a link to your Telegram channel to your profiles on these services — so that we can confirm that they indeed belong to you. Once this is done, please contact our @VerifyBot for verification.

+

What if I don't have a verified account on two of these services?

+

If you have an undisputed page on Wikipedia, that satisfies Wikipedia's Notability Guidelines – and that page lists a link to your channel, bot or public group on Telegram – it can be counted as one of the missing verified accounts.

+

In the case of organizations, a link to the Telegram channel from the official website of the organization may also be taken into account. The bot will offer to submit additional data and comments after checking the social media links.

+
+

If you're using a Wikipedia or Official Website link instead of one of the social media accounts, please make sure that they include a link to the channel, group or bot you want to verify on Telegram.

+
+

Can my user account be verified?

+

Sorry, Telegram doesn’t verify user accounts at the moment. Verification is only available for big and active official channels, groups and bots.

+

Do I need verification?

+

Note that verification doesn't give any additional abilities in Telegram - it is simply one of the ways to demonstrate that your channel, group or bot is official. A link to Telegram on your official site or other official accounts elsewhere can achieve a similar result.

+

How do I change the name or short link after verification?

+

A verified channel, group or bot can't change its name or short link (t.me/…). If changes are necessary, you can remove verification status first. Contact @VerifyBot and send /unverify. You can then reobtain verification using the bot.

+
+ +
+
+ +
+
+
+ + + + + + + diff --git a/data/telegram.org/what-can-you-do-with-Telegram.html b/data/telegram.org/what-can-you-do-with-Telegram.html new file mode 100644 index 0000000000..c0e4ea965b --- /dev/null +++ b/data/telegram.org/what-can-you-do-with-Telegram.html @@ -0,0 +1,283 @@ + + + + + Telegram Messenger + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+
+ + + + + + +
+ +

Why Telegram?

+ +
+
+
+
+

Simple

+
Telegram is so simple you already know how to use it.
+
+
+ +
+
+
+

Private

+
Telegram messages are heavily encrypted and can self-destruct.
+
+
+ +
+
+
+

Synced

+
Telegram lets you access your chats from multiple devices.
+
+
+ +
+
+
+

Fast

+
Telegram delivers messages faster than any other application.
+
+
+ +
+
+
+

Powerful

+
Telegram has no limits on the size of your media and chats.
+
+
+ +
+
+
+

Open

+
Telegram has an open API and source code free for everyone.
+
+
+ +
+
+
+

Secure

+
Telegram keeps your messages safe from hacker attacks.
+
+
+ +
+
+
+

Social

+
Telegram groups can hold up to 200,000 members.
+
+
+ +
+
+
+

Expressive

+
Telegram lets you completely customize your messenger.
+
+
+
+
+ +
+ +
+
+
+ + + + + + + +