Repository navigation
Bot API 10.4
Widgets
Added the class Widget and the field widget to the classes Message and ExternalReplyInfo for messages with HTML widgets.
Added the method sendWidget, allowing bots to send messages with HTML widgets. Currently, in the production environment, widgets can be sent only to private chats, and sent widgets automatically have protected content and therefore can't be forwarded.
Added the method sendSharedWidget, allowing bots to send again shared widgets created by the bot.
Added the class WidgetQuery and the field widget_query to the class Update for queries sent to the bot by widgets in messages sent by the bot or via the bot.
Added the class SharedWidgetQuery and the field shared_widget_query to the class Update for queries sent to the bot from forwarded messages with shared widgets.
Added the classes WidgetQueryType, WidgetQueryTypeData, WidgetQueryTypeSignData, WidgetQueryTypeSentTransaction and WidgetQueryWallet, describing the type of a query from a widget. A query can contain data for the bot together with the TON wallet card of the user, data signed by a TON wallet of the user, or a notification about a transaction sent from a TON wallet of the user.
Added the method answerWidgetQuery, allowing bots to answer queries from widgets.
Added the method editMessageWidgetData, allowing bots to change data of a widget in a message.
Added the method editSharedWidgetData, allowing bots to change public data of a shared widget.
Added the classes InputWidgetMessageContent and InputSharedWidgetMessageContent, allowing bots to send widgets in response to inline queries. Currently, widgets can't be sent in response to inline queries in the production environment.
Widget messages can't be copied using the methods copyMessage and copyMessages.
The right can_send_other_messages in the classes ChatPermissions and ChatMemberRestricted now also allows sending widgets.
Ephemeral messages
Allowed bots to send ephemeral replies to callback queries in any chat except channel direct messages chats by specifying callback_query_id without receiver_user_id in the parameter ephemeral_message_parameters of the methods sendMessage, sendRichMessage, sendAnimation, sendAudio, sendContact, sendDocument, sendLivePhoto, sendLocation, sendPhoto, sendSticker, sendVenue, sendVideo, sendVideoNote and sendVoice.
The field receiver_user_id of the class EphemeralMessageParameters and the parameter chat_id of the mentioned methods are optional now.
Quotes from rich messages
Added the field rich_texts to the class TextQuote for quotes chosen from a RichMessage.
Added the field quote_rich_texts to the class ReplyParameters, allowing bots to quote rich messages.
TON wallet
Added the classes TonWalletCard, TonWalletCardSticker, TonNft and TonNftAttribute, and the field ton_wallet_card to the class ChatFullInfo.
Added the class TonWalletTransfer and the field ton_wallet_transfer to the class Message for service messages about transfers with a TON wallet.
Renamed the class StoryAreaPosition to AreaPosition, because it is now also used to describe the position of stickers on TON wallet cards.
Chat share themes
Added the classes ChatShareTheme, ChatShareThemeEmoji and ChatShareThemeUniqueGift, and the field share_theme to the class ChatFullInfo, describing the theme of the screen for sharing a link to a user or a chat.
Added the classes EmojiType, EmojiTypeEmoji and EmojiTypeCustomEmoji.
Added the classes ChatShareThemeBackdrop and ChatShareThemeBackdrops and the method getChatShareThemeBackdrops.
Gifts
Added the method getUniqueGift, allowing bots to get information about a unique gift by its name.
Added the method deleteBusinessAccountGift, allowing bots to delete regular gifts owned by a managed business account without receiving Telegram Stars for them.
General
Allowed users with a Telegram Premium subscription to assign secondary usernames ending with “agent”, “ai”, “app”, “game”, or “gay” to up to 2 owned bots. Such usernames can be suggested in the field suggested_username of the class KeyboardButtonRequestManagedBot.
Added the class RichTextTonAddress representing an address in the TON blockchain in a RichMessage.
Added the type “ton_address” to the class MessageEntity for addresses in the TON blockchain.
Added the type “bank_card_number” to the class MessageEntity for bank card numbers.
Added the parameters custom_description_parse_mode and custom_description_entities to the methods verifyUser and verifyChat.
Added the class PaidMessagesWaived and the field paid_messages_waived to the class Message for service messages about the sender using a link which allows sending messages without paying Telegram Stars.
Added the ability to create links to topics in private chats with the bot in the format https://t.me/<bot_username>/<message_thread_id>. Such a link opens the topic only for the user in the private chat with whom the topic exists.
Full Changelog: 10.3.0...10.4.0