diff --git a/data/web/core.telegram.org/bots/api.html b/data/web/core.telegram.org/bots/api.html index 80913a9dbd..d4721a5200 100644 --- a/data/web/core.telegram.org/bots/api.html +++ b/data/web/core.telegram.org/bots/api.html @@ -53,6 +53,29 @@ To learn how to create…">

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

+

August 12, 2022

+

Bot API 6.2

+

Custom Emoji Support

+ +

Web App Improvements

+ +

Other Changes

+

June 20, 2022

Bot API 6.1

Media in Descriptions

@@ -117,15 +140,6 @@ To learn how to create…">
  • Added the field is_video to the classes Sticker and StickerSet.
  • Added the parameter webm_sticker to the methods createNewStickerSet and addStickerToSet.
  • -

    December 30, 2021

    -

    Bot API 5.6

    -

    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.

    @@ -255,7 +269,7 @@ To learn how to create…">

    getUpdates

    -

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

    +

    Use this method to receive incoming updates using long polling (wiki). Returns an Array of Update objects.

    @@ -567,6 +581,11 @@ To learn how to create…"> + + + + + @@ -973,7 +992,7 @@ To learn how to create…"> - + @@ -1000,6 +1019,11 @@ To learn how to create…"> + + + + +
    Optional. True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user. Returned only in getChat.
    has_restricted_voice_and_video_messagesTrueOptional. True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in getChat.
    join_to_send_messages True Optional. True, if users need to join the supergroup before they can send messages. Returned only in getChat.
    type StringType of the entity. Currently, 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), “spoiler” (spoiler message), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames)Type of the entity. Currently, 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), “spoiler” (spoiler message), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers)
    offsetString Optional. For “pre” only, the programming language of the entity text
    custom_emoji_idStringOptional. For “custom_emoji” only, unique identifier of the custom emoji. Use getCustomEmojiStickers to get full information about the sticker

    PhotoSize

    @@ -3145,7 +3169,7 @@ To learn how to create…"> supports_streaming Boolean -Optional. Pass True, if the uploaded video is suitable for streaming +Optional. Pass True if the uploaded video is suitable for streaming @@ -3413,7 +3437,7 @@ To learn how to create…"> allow_sending_without_reply Boolean Optional -Pass True, if the message should be sent even if the specified replied-to message is not found +Pass True if the message should be sent even if the specified replied-to message is not found reply_markup @@ -3544,7 +3568,7 @@ pre-formatted fixed-width code block written in the Python programming language

    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.

    +

    Use this method to copy messages of any kind. Service messages and invoice messages can't be copied. A quiz poll can be copied only if the value of the field correct_option_id is known to the bot. 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.

    @@ -3613,7 +3637,7 @@ pre-formatted fixed-width code block written in the Python programming language - + @@ -3687,7 +3711,7 @@ pre-formatted fixed-width code block written in the Python programming language - + @@ -3786,7 +3810,7 @@ pre-formatted fixed-width code block written in the Python programming language - + @@ -3872,7 +3896,7 @@ pre-formatted fixed-width code block written in the Python programming language - + @@ -3952,7 +3976,7 @@ pre-formatted fixed-width code block written in the Python programming language - + @@ -3976,7 +4000,7 @@ pre-formatted fixed-width code block written in the Python programming language - + @@ -4074,7 +4098,7 @@ pre-formatted fixed-width code block written in the Python programming language - + @@ -4154,7 +4178,7 @@ pre-formatted fixed-width code block written in the Python programming language - + @@ -4228,7 +4252,7 @@ pre-formatted fixed-width code block written in the Python programming language - + @@ -4284,7 +4308,7 @@ pre-formatted fixed-width code block written in the Python programming language - +
    allow_sending_without_reply Boolean OptionalPass True, if the message should be sent even if the specified replied-to message is not foundPass True if the message should be sent even if the specified replied-to message is not found
    reply_markupallow_sending_without_reply Boolean OptionalPass True, if the message should be sent even if the specified replied-to message is not foundPass True if the message should be sent even if the specified replied-to message is not found
    reply_markupallow_sending_without_reply Boolean OptionalPass True, if the message should be sent even if the specified replied-to message is not foundPass True if the message should be sent even if the specified replied-to message is not found
    reply_markupallow_sending_without_reply Boolean OptionalPass True, if the message should be sent even if the specified replied-to message is not foundPass True if the message should be sent even if the specified replied-to message is not found
    reply_markupsupports_streaming Boolean OptionalPass True, if the uploaded video is suitable for streamingPass True if the uploaded video is suitable for streaming
    disable_notificationallow_sending_without_reply Boolean OptionalPass True, if the message should be sent even if the specified replied-to message is not foundPass True if the message should be sent even if the specified replied-to message is not found
    reply_markupallow_sending_without_reply Boolean OptionalPass True, if the message should be sent even if the specified replied-to message is not foundPass True if the message should be sent even if the specified replied-to message is not found
    reply_markupallow_sending_without_reply Boolean OptionalPass True, if the message should be sent even if the specified replied-to message is not foundPass True if the message should be sent even if the specified replied-to message is not found
    reply_markupallow_sending_without_reply Boolean OptionalPass True, if the message should be sent even if the specified replied-to message is not foundPass True if the message should be sent even if the specified replied-to message is not found
    reply_markupallow_sending_without_reply Boolean OptionalPass True, if the message should be sent even if the specified replied-to message is not foundPass True if the message should be sent even if the specified replied-to message is not found
    @@ -4364,7 +4388,7 @@ pre-formatted fixed-width code block written in the Python programming language allow_sending_without_reply Boolean Optional -Pass True, if the message should be sent even if the specified replied-to message is not found +Pass True if the message should be sent even if the specified replied-to message is not found reply_markup @@ -4568,7 +4592,7 @@ pre-formatted fixed-width code block written in the Python programming language allow_sending_without_reply Boolean Optional -Pass True, if the message should be sent even if the specified replied-to message is not found +Pass True if the message should be sent even if the specified replied-to message is not found reply_markup @@ -4642,7 +4666,7 @@ pre-formatted fixed-width code block written in the Python programming language allow_sending_without_reply Boolean Optional -Pass True, if the message should be sent even if the specified replied-to message is not found +Pass True if the message should be sent even if the specified replied-to message is not found reply_markup @@ -4740,7 +4764,7 @@ pre-formatted fixed-width code block written in the Python programming language is_closed Boolean Optional -Pass True, if the poll needs to be immediately closed. This can be useful for poll preview. +Pass True if the poll needs to be immediately closed. This can be useful for poll preview. disable_notification @@ -4764,7 +4788,7 @@ pre-formatted fixed-width code block written in the Python programming language allow_sending_without_reply Boolean Optional -Pass True, if the message should be sent even if the specified replied-to message is not found +Pass True if the message should be sent even if the specified replied-to message is not found reply_markup @@ -4820,7 +4844,7 @@ pre-formatted fixed-width code block written in the Python programming language allow_sending_without_reply Boolean Optional -Pass True, if the message should be sent even if the specified replied-to message is not found +Pass True if the message should be sent even if the specified replied-to message is not found reply_markup @@ -5049,67 +5073,67 @@ pre-formatted fixed-width code block written in the Python programming language is_anonymous Boolean Optional -Pass True, if the administrator's presence in the chat is hidden +Pass True if the administrator's presence in the chat is hidden can_manage_chat Boolean Optional -Pass 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 +Pass True if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege can_post_messages Boolean Optional -Pass True, if the administrator can create channel posts, channels only +Pass True if the administrator can create channel posts, channels only can_edit_messages Boolean Optional -Pass True, if the administrator can edit messages of other users and can pin messages, channels only +Pass True if the administrator can edit messages of other users and can pin messages, channels only can_delete_messages Boolean Optional -Pass True, if the administrator can delete messages of other users +Pass True if the administrator can delete messages of other users can_manage_video_chats Boolean Optional -Pass True, if the administrator can manage video chats +Pass True if the administrator can manage video chats can_restrict_members Boolean Optional -Pass True, if the administrator can restrict, ban or unban chat members +Pass True if the administrator can restrict, ban or unban chat members can_promote_members Boolean Optional -Pass 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) +Pass 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_info Boolean Optional -Pass True, if the administrator can change chat title, photo and other settings +Pass True if the administrator can change chat title, photo and other settings can_invite_users Boolean Optional -Pass True, if the administrator can invite new users to the chat +Pass True if the administrator can invite new users to the chat can_pin_messages Boolean Optional -Pass True, if the administrator can pin messages, supergroups only +Pass True if the administrator can pin messages, supergroups only @@ -5544,7 +5568,7 @@ pre-formatted fixed-width code block written in the Python programming language disable_notification Boolean Optional -Pass True, if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels and private chats. +Pass True if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels and private chats. @@ -5635,7 +5659,7 @@ pre-formatted fixed-width code block written in the Python programming language

    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.

    +

    Use this method to get a list of administrators in a chat, which aren't bots. Returns an Array of ChatMember objects.

    @@ -5852,7 +5876,7 @@ pre-formatted fixed-width code block written in the Python programming language

    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.

    +

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

    @@ -6256,6 +6280,11 @@ pre-formatted fixed-width code block written in the Python programming language + + + + + @@ -6293,7 +6322,7 @@ pre-formatted fixed-width code block written in the Python programming language - + @@ -6301,6 +6330,11 @@ pre-formatted fixed-width code block written in the Python programming language + + + + + @@ -6329,6 +6363,11 @@ pre-formatted fixed-width code block written in the Python programming language + + + + + @@ -6339,11 +6378,6 @@ pre-formatted fixed-width code block written in the Python programming language - - - - - @@ -6434,7 +6468,7 @@ pre-formatted fixed-width code block written in the Python programming language - + @@ -6464,6 +6498,26 @@ pre-formatted fixed-width code block written in the Python programming language
    Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file.
    typeStringType of the sticker, currently one of “regular”, “mask”, “custom_emoji”. The type of the sticker is independent from its format, which is determined by the fields is_animated and is_video.
    width Integer Sticker width
    premium_animation FileOptional. Premium animation for the sticker, if the sticker is premiumOptional. For premium regular stickers, premium animation for the sticker
    mask_positionOptional. For mask stickers, the position where the mask should be placed
    custom_emoji_idStringOptional. For custom emoji stickers, unique identifier of the custom emoji
    file_size Integer Optional. File size in bytesSticker set title
    sticker_typeStringType of stickers in the set, currently one of “regular”, “mask”, “custom_emoji”
    is_animated Boolean True, if the sticker set contains animated stickersTrue, if the sticker set contains video stickers
    contains_masksBooleanTrue, if the sticker set contains masks
    stickers Array of Sticker List of all set stickersallow_sending_without_reply Boolean OptionalPass True, if the message should be sent even if the specified replied-to message is not foundPass True if the message should be sent even if the specified replied-to message is not found
    reply_markup
    +

    getCustomEmojiStickers

    +

    Use this method to get information about custom emoji stickers by their identifiers. Returns an Array of Sticker objects.

    + + + + + + + + + + + + + + + + + +
    ParameterTypeRequiredDescription
    custom_emoji_idsArray of StringYesList of custom emoji identifiers. At most 200 custom emoji identifiers can be specified.

    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.

    @@ -6539,18 +6593,18 @@ pre-formatted fixed-width code block written in the Python programming language + + + + + + - - - - - - @@ -6772,7 +6826,7 @@ pre-formatted fixed-width code block written in the Python programming language - + @@ -6863,7 +6917,7 @@ pre-formatted fixed-width code block written in the Python programming language - + @@ -8423,37 +8477,37 @@ pre-formatted fixed-width code block written in the Python programming language - + - + - + - + - + - + - +
    WEBM video with the sticker, uploaded using multipart/form-data. See https://core.telegram.org/stickers#video-sticker-requirements for technical requirements
    sticker_typeStringOptionalType of stickers in the set, pass “regular” or “mask”. Custom emoji sticker sets can't be created via the Bot API at the moment. By default, a regular sticker set is created.
    emojis String Yes One or more emoji corresponding to the sticker
    contains_masksBooleanOptionalPass True, if a set of mask stickers should be created
    mask_position MaskPosition Optionalis_personal Boolean OptionalPass 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 queryPass True if results may be cached on the server side only for the user that sent the query. By default, results may be returned to any user who sends the same query
    next_offset
    hide_url BooleanOptional. Pass True, if you don't want the URL to be shown in the messageOptional. Pass True if you don't want the URL to be shown in the message
    description
    need_name BooleanOptional. Pass True, if you require the user's full name to complete the orderOptional. Pass True if you require the user's full name to complete the order
    need_phone_number BooleanOptional. Pass True, if you require the user's phone number to complete the orderOptional. Pass True if you require the user's phone number to complete the order
    need_email BooleanOptional. Pass True, if you require the user's email address to complete the orderOptional. Pass True if you require the user's email address to complete the order
    need_shipping_address BooleanOptional. Pass True, if you require the user's shipping address to complete the orderOptional. Pass True if you require the user's shipping address to complete the order
    send_phone_number_to_provider BooleanOptional. Pass True, if the user's phone number should be sent to providerOptional. Pass True if the user's phone number should be sent to provider
    send_email_to_provider BooleanOptional. Pass True, if the user's email address should be sent to providerOptional. Pass True if the user's email address should be sent to provider
    is_flexible BooleanOptional. Pass True, if the final price depends on the shipping methodOptional. Pass True if the final price depends on the shipping method
    @@ -8648,43 +8702,43 @@ pre-formatted fixed-width code block written in the Python programming language need_name Boolean Optional -Pass True, if you require the user's full name to complete the order +Pass True if you require the user's full name to complete the order need_phone_number Boolean Optional -Pass True, if you require the user's phone number to complete the order +Pass True if you require the user's phone number to complete the order need_email Boolean Optional -Pass True, if you require the user's email address to complete the order +Pass True if you require the user's email address to complete the order need_shipping_address Boolean Optional -Pass True, if you require the user's shipping address to complete the order +Pass True if you require the user's shipping address to complete the order send_phone_number_to_provider Boolean Optional -Pass True, if the user's phone number should be sent to provider +Pass True if the user's phone number should be sent to provider send_email_to_provider Boolean Optional -Pass True, if the user's email address should be sent to provider +Pass True if the user's email address should be sent to provider is_flexible Boolean Optional -Pass True, if the final price depends on the shipping method +Pass True if the final price depends on the shipping method disable_notification @@ -8708,7 +8762,7 @@ pre-formatted fixed-width code block written in the Python programming language allow_sending_without_reply Boolean Optional -Pass True, if the message should be sent even if the specified replied-to message is not found +Pass True if the message should be sent even if the specified replied-to message is not found reply_markup @@ -8812,43 +8866,43 @@ pre-formatted fixed-width code block written in the Python programming language need_name Boolean Optional -Pass True, if you require the user's full name to complete the order +Pass True if you require the user's full name to complete the order need_phone_number Boolean Optional -Pass True, if you require the user's phone number to complete the order +Pass True if you require the user's phone number to complete the order need_email Boolean Optional -Pass True, if you require the user's email address to complete the order +Pass True if you require the user's email address to complete the order need_shipping_address Boolean Optional -Pass True, if you require the user's shipping address to complete the order +Pass True if you require the user's shipping address to complete the order send_phone_number_to_provider Boolean Optional -Pass True, if the user's phone number should be sent to the provider +Pass True if the user's phone number should be sent to the provider send_email_to_provider Boolean Optional -Pass True, if the user's email address should be sent to the provider +Pass True if the user's email address should be sent to the provider is_flexible Boolean Optional -Pass True, if the final price depends on the shipping method +Pass True if the final price depends on the shipping method @@ -8874,7 +8928,7 @@ pre-formatted fixed-width code block written in the Python programming language ok Boolean Yes -Specify 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) +Pass 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_options @@ -8886,7 +8940,7 @@ pre-formatted fixed-width code block written in the Python programming language error_message String Optional -Required 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. +Required 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. @@ -9766,7 +9820,7 @@ pre-formatted fixed-width code block written in the Python programming language allow_sending_without_reply Boolean Optional -Pass True, if the message should be sent even if the specified replied-to message is not found +Pass True if the message should be sent even if the specified replied-to message is not found reply_markup @@ -9849,13 +9903,13 @@ pre-formatted fixed-width code block written in the Python programming language force Boolean Optional -Pass True, if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters +Pass True if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters disable_edit_message Boolean Optional -Pass True, if the game message should not be automatically edited to include the current scoreboard +Pass True if the game message should not be automatically edited to include the current scoreboard chat_id @@ -9878,7 +9932,7 @@ pre-formatted fixed-width code block written in the Python programming language

    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.

    +

    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. 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 their neighbors are not among them. Please note that this behavior is subject to change.