diff --git a/lib/common/src/version.h b/lib/common/src/version.h
index df941b77..b0e74c39 100644
--- a/lib/common/src/version.h
+++ b/lib/common/src/version.h
@@ -7,4 +7,4 @@
#pragma once
-#define NCHAT_VERSION "5.3.3"
+#define NCHAT_VERSION "5.3.4"
diff --git a/lib/tgchat/ext/td/CMakeLists.txt b/lib/tgchat/ext/td/CMakeLists.txt
index cdcf3405..c07dc01e 100644
--- a/lib/tgchat/ext/td/CMakeLists.txt
+++ b/lib/tgchat/ext/td/CMakeLists.txt
@@ -6,7 +6,7 @@ if (POLICY CMP0065)
cmake_policy(SET CMP0065 NEW)
endif()
-project(TDLib VERSION 1.8.36 LANGUAGES CXX C)
+project(TDLib VERSION 1.8.37 LANGUAGES CXX C)
if (NOT DEFINED CMAKE_MODULE_PATH)
set(CMAKE_MODULE_PATH "")
@@ -576,6 +576,8 @@ set(TDLIB_SOURCE_PART2
td/telegram/SharedDialog.cpp
td/telegram/SpecialStickerSetType.cpp
td/telegram/SponsoredMessageManager.cpp
+ td/telegram/StarGift.cpp
+ td/telegram/StarGiftManager.cpp
td/telegram/StarManager.cpp
td/telegram/StarSubscription.cpp
td/telegram/StarSubscriptionPricing.cpp
@@ -749,6 +751,7 @@ set(TDLIB_SOURCE_PART2
td/telegram/files/FileStatsWorker.h
td/telegram/files/FileType.h
td/telegram/files/FileUploader.h
+ td/telegram/files/FileUploadId.h
td/telegram/files/FileUploadManager.h
td/telegram/files/PartsManager.h
td/telegram/files/ResourceManager.h
@@ -877,6 +880,7 @@ set(TDLIB_SOURCE_PART2
td/telegram/PhotoFormat.h
td/telegram/PhotoSize.h
td/telegram/PhotoSizeSource.h
+ td/telegram/PhotoSizeType.h
td/telegram/PollId.h
td/telegram/PollManager.h
td/telegram/Premium.h
@@ -925,6 +929,8 @@ set(TDLIB_SOURCE_PART2
td/telegram/SharedDialog.h
td/telegram/SpecialStickerSetType.h
td/telegram/SponsoredMessageManager.h
+ td/telegram/StarGift.h
+ td/telegram/StarGiftManager.h
td/telegram/StarManager.h
td/telegram/StarSubscription.h
td/telegram/StarSubscriptionPricing.h
@@ -1038,6 +1044,7 @@ set(TDLIB_SOURCE_PART2
td/telegram/Photo.hpp
td/telegram/PhotoSize.hpp
td/telegram/PhotoSizeSource.hpp
+ td/telegram/PhotoSizeType.hpp
td/telegram/PollId.hpp
td/telegram/PollManager.hpp
td/telegram/PremiumGiftOption.hpp
@@ -1052,6 +1059,7 @@ set(TDLIB_SOURCE_PART2
td/telegram/SecureValue.hpp
td/telegram/SendCodeHelper.hpp
td/telegram/SharedDialog.hpp
+ td/telegram/StarGift.hpp
td/telegram/StarSubscriptionPricing.hpp
td/telegram/StickerMaskPosition.hpp
td/telegram/StickerPhotoSize.hpp
diff --git a/lib/tgchat/ext/td/README.md b/lib/tgchat/ext/td/README.md
index 10fc6b89..e348a46a 100644
--- a/lib/tgchat/ext/td/README.md
+++ b/lib/tgchat/ext/td/README.md
@@ -103,7 +103,7 @@ target_link_libraries(YourTarget PRIVATE Td::TdStatic)
Or you could install `TDLib` and then reference it in your CMakeLists.txt like this:
```
-find_package(Td 1.8.36 REQUIRED)
+find_package(Td 1.8.37 REQUIRED)
target_link_libraries(YourTarget PRIVATE Td::TdStatic)
```
See [example/cpp/CMakeLists.txt](https://github.com/tdlib/td/blob/master/example/cpp/CMakeLists.txt).
diff --git a/lib/tgchat/ext/td/SplitSource.php b/lib/tgchat/ext/td/SplitSource.php
index d335df42..62987ec2 100644
--- a/lib/tgchat/ext/td/SplitSource.php
+++ b/lib/tgchat/ext/td/SplitSource.php
@@ -378,7 +378,7 @@ function ($matches) use ($needed_std_headers) {
'message_import_manager[_(-](?![.]get[(][)])|MessageImportManager' => 'MessageImportManager',
'MessageLinkInfo' => 'MessageLinkInfo',
'MessageQuote' => 'MessageQuote',
- 'MessageReaction|UnreadMessageReaction|[a-z_]*message[a-z_]*reaction' => 'MessageReaction',
+ 'MessageReaction|UnreadMessageReaction|[a-z_]*message[a-z_]*reaction|reload_paid_reaction_privacy|get_chosen_tags' => 'MessageReaction',
'MessageReactor' => 'MessageReactor',
'MessageSearchOffset' => 'MessageSearchOffset',
'[a-z_]*_message_sender' => 'MessageSender',
@@ -413,6 +413,8 @@ function ($matches) use ($needed_std_headers) {
'SentEmailCode' => 'SentEmailCode',
'SharedDialog' => 'SharedDialog',
'sponsored_message_manager[_(-](?![.]get[(][)])|SponsoredMessageManager' => 'SponsoredMessageManager',
+ 'StarGift[^M]' => 'StarGift'
+ 'star_gift_manager[_(-](?![.]get[(][)])|StarGiftManager' => 'StarGiftManager',
'star_manager[_(-](?![.]get[(][)])|StarManager' => 'StarManager',
'StarSubscription[^P]' => 'StarSubscription',
'StarSubscriptionPricing' => 'StarSubscriptionPricing',
diff --git a/lib/tgchat/ext/td/example/README.md b/lib/tgchat/ext/td/example/README.md
index 74f26b2c..5a201a94 100644
--- a/lib/tgchat/ext/td/example/README.md
+++ b/lib/tgchat/ext/td/example/README.md
@@ -96,7 +96,7 @@ TDLib can be used from the Java programming language through native [JNI](https:
We provide a generator for JNI bridge methods and Java classes for all TDLib API methods and objects.
See [example/java](https://github.com/tdlib/td/tree/master/example/java) for an example of using TDLib from desktop Java along with detailed building and usage instructions.
-To use TDLib to create Android Java applications, use our [prebuilt library for Android](https://core.telegram.org/tdlib/tdlib.zip).
+See [example/android](https://github.com/tdlib/td/tree/master/example/android) for detailed build instructions for Android.
## Using TDLib in Kotlin projects
diff --git a/lib/tgchat/ext/td/example/android/check-environment.sh b/lib/tgchat/ext/td/example/android/check-environment.sh
index 249df339..7e63287d 100755
--- a/lib/tgchat/ext/td/example/android/check-environment.sh
+++ b/lib/tgchat/ext/td/example/android/check-environment.sh
@@ -46,6 +46,6 @@ if ! perl -MExtUtils::MakeMaker -MLocale::Maketext::Simple -MPod::Usage -e '' >/
fi
if ! java --help >/dev/null 2>&1 ; then
- echo "Error: Java installation is broken. Install JDK from https://www.oracle.com/java/technologies/downloads/."
+ echo "Error: Java installation is broken. Install JDK from https://www.oracle.com/java/technologies/downloads/ or via the package manager."
exit 1
fi
diff --git a/lib/tgchat/ext/td/example/cpp/CMakeLists.txt b/lib/tgchat/ext/td/example/cpp/CMakeLists.txt
index 28343436..3a3d6da4 100644
--- a/lib/tgchat/ext/td/example/cpp/CMakeLists.txt
+++ b/lib/tgchat/ext/td/example/cpp/CMakeLists.txt
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.4 FATAL_ERROR)
project(TdExample VERSION 1.0 LANGUAGES CXX)
-find_package(Td 1.8.36 REQUIRED)
+find_package(Td 1.8.37 REQUIRED)
add_executable(tdjson_example tdjson_example.cpp)
target_link_libraries(tdjson_example PRIVATE Td::TdJson)
diff --git a/lib/tgchat/ext/td/example/uwp/Telegram.Td.UWP.nuspec b/lib/tgchat/ext/td/example/uwp/Telegram.Td.UWP.nuspec
index 44cd8964..20a22873 100644
--- a/lib/tgchat/ext/td/example/uwp/Telegram.Td.UWP.nuspec
+++ b/lib/tgchat/ext/td/example/uwp/Telegram.Td.UWP.nuspec
@@ -2,7 +2,7 @@
Telegram.Td.UWP
- 1.8.36
+ 1.8.37TDLib for Universal Windows PlatformTelegramTelegram
diff --git a/lib/tgchat/ext/td/example/uwp/extension.vsixmanifest b/lib/tgchat/ext/td/example/uwp/extension.vsixmanifest
index 7cb33103..189889fc 100644
--- a/lib/tgchat/ext/td/example/uwp/extension.vsixmanifest
+++ b/lib/tgchat/ext/td/example/uwp/extension.vsixmanifest
@@ -1,6 +1,6 @@
-
+ TDLib for Universal Windows PlatformTDLib is a library for building Telegram clientshttps://core.telegram.org/tdlib
diff --git a/lib/tgchat/ext/td/td/generate/scheme/td_api.tl b/lib/tgchat/ext/td/td/generate/scheme/td_api.tl
index a267cc53..40aa67a4 100644
--- a/lib/tgchat/ext/td/td/generate/scheme/td_api.tl
+++ b/lib/tgchat/ext/td/td/generate/scheme/td_api.tl
@@ -65,7 +65,7 @@ authenticationCodeTypeFirebaseAndroid device_verification_parameters:FirebaseDev
//@description A digit-only authentication code is delivered via Firebase Authentication to the official iOS application
//@receipt Receipt of successful application token validation to compare with receipt from push notification
-//@push_timeout Time after the next authentication method is supposed to be used if verification push notification isn't received, in seconds
+//@push_timeout Time after the next authentication method is expected to be used if verification push notification isn't received, in seconds
//@length Length of the code
authenticationCodeTypeFirebaseIos receipt:string push_timeout:int32 length:int32 = AuthenticationCodeType;
@@ -245,10 +245,10 @@ inputFileRemote id:string = InputFile;
//@description A file defined by a local path @path Local path to the file
inputFileLocal path:string = InputFile;
-//@description A file generated by the application
-//@original_path Local path to a file from which the file is generated; may be empty if there is no such file
+//@description A file generated by the application. The application must handle updates updateFileGenerationStart and updateFileGenerationStop to generate the file when asked by TDLib
+//@original_path Local path to a file from which the file is generated. The path doesn't have to be a valid path and is used by TDLib only to detect name and MIME type of the generated file
//@conversion String specifying the conversion applied to the original file; must be persistent across application restarts. Conversions beginning with '#' are reserved for internal TDLib usage
-//@expected_size Expected size of the generated file, in bytes; 0 if unknown
+//@expected_size Expected size of the generated file, in bytes; pass 0 if unknown
inputFileGenerated original_path:string conversion:string expected_size:int53 = InputFile;
@@ -399,7 +399,7 @@ animation duration:int32 width:int32 height:int32 file_name:string mime_type:str
//@file_name Original name of the file; as defined by the sender
//@mime_type The MIME type of the file; as defined by the sender
//@album_cover_minithumbnail The minithumbnail of the album cover; may be null
-//@album_cover_thumbnail The thumbnail of the album cover in JPEG format; as defined by the sender. The full size thumbnail is supposed to be extracted from the downloaded audio file; may be null
+//@album_cover_thumbnail The thumbnail of the album cover in JPEG format; as defined by the sender. The full size thumbnail is expected to be extracted from the downloaded audio file; may be null
//@external_album_covers Album cover variants to use if the downloaded audio file contains no album cover. Provided thumbnail dimensions are approximate
//@audio File containing the audio
audio duration:int32 title:string performer:string file_name:string mime_type:string album_cover_minithumbnail:minithumbnail album_cover_thumbnail:thumbnail external_album_covers:vector audio:file = Audio;
@@ -438,7 +438,7 @@ sticker id:int64 set_id:int64 width:int32 height:int32 emoji:string format:Stick
//@file_name Original name of the file; as defined by the sender
//@mime_type MIME type of the file; as defined by the sender
//@has_stickers True, if stickers were added to the video. The list of corresponding sticker sets can be received using getAttachedStickerSets
-//@supports_streaming True, if the video is supposed to be streamed
+//@supports_streaming True, if the video is expected to be streamed
//@minithumbnail Video minithumbnail; may be null
//@thumbnail Video thumbnail in JPEG or MPEG4 format; as defined by the sender; may be null
//@video File containing the video
@@ -525,6 +525,15 @@ webApp short_name:string title:string description:string photo:photo animation:a
poll id:int64 question:formattedText options:vector total_voter_count:int32 recent_voter_ids:vector is_anonymous:Bool type:PollType open_period:int32 close_date:int32 is_closed:Bool = Poll;
+//@description Describes an alternative reencoded quality of a video file
+//@width Video width
+//@height Video height
+//@codec Codec used for video file encoding, for example, "h264", "h265", or "av1"
+//@hls_file HLS file describing the video
+//@video File containing the video
+alternativeVideo width:int32 height:int32 codec:string hls_file:file video:file = AlternativeVideo;
+
+
//@description Describes a chat background
//@id Unique background identifier
//@is_default True, if this is one of default backgrounds
@@ -833,7 +842,7 @@ productInfo title:string description:formattedText photo:photo = ProductInfo;
//@currency ISO 4217 currency code for Telegram Premium subscription payment
//@amount The amount to pay, in the smallest units of the currency
//@discount_percentage The discount associated with this option, as a percentage
-//@month_count Number of months the Telegram Premium subscription will be active
+//@month_count Number of months the Telegram Premium subscription will be active. Use getPremiumInfoSticker to get the sticker to be used as representation of the Telegram Premium subscription
//@store_product_id Identifier of the store product associated with the option
//@payment_link An internal link to be opened for buying Telegram Premium to the user if store payment isn't possible; may be null if direct payment isn't available
premiumPaymentOption currency:string amount:int53 discount_percentage:int32 month_count:int32 store_product_id:string payment_link:InternalLinkType = PremiumPaymentOption;
@@ -898,6 +907,35 @@ starGiveawayPaymentOption currency:string amount:int53 star_count:int53 store_pr
//@description Contains a list of options for creating Telegram Star giveaway @options The list of options
starGiveawayPaymentOptions options:vector = StarGiveawayPaymentOptions;
+//@description Describes a gift that can be sent to another user
+//@id Unique identifier of the gift
+//@sticker The sticker representing the gift
+//@star_count Number of Telegram Stars that must be paid for the gift
+//@default_sell_star_count Number of Telegram Stars that can be claimed by the receiver instead of the gift by default. If the gift was paid with just bought Telegram Stars, then full value can be claimed
+//@remaining_count Number of remaining times the gift can be purchased by all users; 0 if not limited
+//@total_count Number of total times the gift can be purchased by all users; 0 if not limited
+gift id:int64 sticker:sticker star_count:int53 default_sell_star_count:int53 remaining_count:int32 total_count:int32 = Gift;
+
+//@description Contains a list of gifts that can be sent to another user @gifts The list of gifts
+gifts gifts:vector = Gifts;
+
+//@description Represents a gift received by a user
+//@sender_user_id Identifier of the user that sent the gift; 0 if unknown
+//@text Message added to the gift
+//@is_private True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone are able to see them
+//@is_saved True, if the gift is displayed on the user's profile page; may be false only for the receiver of the gift
+//@date Point in time (Unix timestamp) when the gift was sent
+//@gift The gift
+//@message_id Identifier of the message with the gift in the chat with the sender of the gift; can be 0 or an identifier of a deleted message; only for the gift receiver
+//@sell_star_count Number of Telegram Stars that can be claimed by the receiver instead of the gift; only for the gift receiver
+userGift sender_user_id:int53 text:formattedText is_private:Bool is_saved:Bool date:int32 gift:gift message_id:int53 sell_star_count:int53 = UserGift;
+
+//@description Represents a list of gifts received by a user
+//@total_count The total number of received gifts
+//@gifts The list of gifts
+//@next_offset The offset for the next request. If empty, then there are no more results
+userGifts total_count:int32 gifts:vector next_offset:string = UserGifts;
+
//@class StarTransactionDirection @description Describes direction of a transaction with Telegram Stars
@@ -938,6 +976,18 @@ chatTransactionPurposeReaction message_id:int53 = ChatTransactionPurpose;
chatTransactionPurposeGiveaway giveaway_message_id:int53 = ChatTransactionPurpose;
+//@class UserTransactionPurpose @description Describes purpose of a transaction with a user
+
+//@description A user gifted Telegram Stars @sticker A sticker to be shown in the transaction information; may be null if unknown
+userTransactionPurposeGiftedStars sticker:sticker = UserTransactionPurpose;
+
+//@description The current user sold a gift received from another user @gift The gift
+userTransactionPurposeGiftSell gift:gift = UserTransactionPurpose;
+
+//@description The current user sent a gift to another user @gift The gift
+userTransactionPurposeGiftSend gift:gift = UserTransactionPurpose;
+
+
//@class StarTransactionPartner @description Describes source or recipient of a transaction with Telegram Stars
//@description The transaction is a transaction with Telegram through a bot
@@ -964,10 +1014,8 @@ starTransactionPartnerBusiness user_id:int53 media:vector = StarTrans
//@description The transaction is a transaction with a supergroup or a channel chat @chat_id Identifier of the chat @purpose Purpose of the transaction
starTransactionPartnerChat chat_id:int53 purpose:ChatTransactionPurpose = StarTransactionPartner;
-//@description The transaction is a gift of Telegram Stars from another user
-//@user_id Identifier of the user; 0 if the gift was anonymous
-//@sticker A sticker to be shown in the transaction information; may be null if unknown
-starTransactionPartnerUser user_id:int53 sticker:sticker = StarTransactionPartner;
+//@description The transaction is a transcation with another user @user_id Identifier of the user; 0 if the user was anonymous @purpose Purpose of the transaction
+starTransactionPartnerUser user_id:int53 purpose:UserTransactionPurpose = StarTransactionPartner;
//@description The transaction is a transaction with unknown partner
starTransactionPartnerUnsupported = StarTransactionPartner;
@@ -1019,7 +1067,7 @@ giveawayInfoOngoing creation_date:int32 status:GiveawayParticipantStatus is_ende
//@creation_date Point in time (Unix timestamp) when the giveaway was created
//@actual_winners_selection_date Point in time (Unix timestamp) when the winners were selected. May be bigger than winners selection date specified in parameters of the giveaway
//@was_refunded True, if the giveaway was canceled and was fully refunded
-//@is_winner True, if the cuurent user is a winner of the giveaway
+//@is_winner True, if the current user is a winner of the giveaway
//@winner_count Number of winners in the giveaway
//@activation_count Number of winners, which activated their gift codes; for Telegram Premium giveaways only
//@gift_code Telegram Premium gift code that was received by the current user; empty if the user isn't a winner in the giveaway or the giveaway isn't a Telegram Premium giveaway
@@ -1144,10 +1192,11 @@ botInfo short_description:string description:string photo:photo animation:animat
//@birthdate Birthdate of the user; may be null if unknown
//@personal_chat_id Identifier of the personal chat of the user; 0 if none
//@premium_gift_options The list of available options for gifting Telegram Premium to the user
+//@gift_count Number of gifts saved to profile by the user
//@group_in_common_count Number of group chats where both the other user and the current user are a member; 0 for the current user
//@business_info Information about business settings for Telegram Business accounts; may be null if none
//@bot_info For bots, information about the bot; may be null if the user isn't a bot
-userFullInfo personal_photo:chatPhoto photo:chatPhoto public_photo:chatPhoto block_list:BlockList can_be_called:Bool supports_video_calls:Bool has_private_calls:Bool has_private_forwards:Bool has_restricted_voice_and_video_note_messages:Bool has_posted_to_profile_stories:Bool has_sponsored_messages_enabled:Bool need_phone_number_privacy_exception:Bool set_chat_background:Bool bio:formattedText birthdate:birthdate personal_chat_id:int53 premium_gift_options:vector group_in_common_count:int32 business_info:businessInfo bot_info:botInfo = UserFullInfo;
+userFullInfo personal_photo:chatPhoto photo:chatPhoto public_photo:chatPhoto block_list:BlockList can_be_called:Bool supports_video_calls:Bool has_private_calls:Bool has_private_forwards:Bool has_restricted_voice_and_video_note_messages:Bool has_posted_to_profile_stories:Bool has_sponsored_messages_enabled:Bool need_phone_number_privacy_exception:Bool set_chat_background:Bool bio:formattedText birthdate:birthdate personal_chat_id:int53 premium_gift_options:vector gift_count:int32 group_in_common_count:int32 business_info:businessInfo bot_info:botInfo = UserFullInfo;
//@description Represents a list of users @total_count Approximate total number of users found @user_ids A list of user identifiers
users total_count:int32 user_ids:vector = Users;
@@ -1548,7 +1597,7 @@ reactionTypePaid = ReactionType;
//@description Contains information about a user that added paid reactions
//@sender_id Identifier of the user or chat that added the reactions; may be null for anonymous reactors that aren't the current user
//@star_count Number of Telegram Stars added
-//@is_top True, if the reactor is one of the most active reactors; can be false if the reactor is the current user
+//@is_top True, if the reactor is one of the most active reactors; may be false if the reactor is the current user
//@is_me True, if the paid reaction was added by the current user
//@is_anonymous True, if the reactor is anonymous
paidReactor sender_id:MessageSender star_count:int32 is_top:Bool is_me:Bool is_anonymous:Bool = PaidReactor;
@@ -1699,7 +1748,7 @@ factCheck text:formattedText country_code:string = FactCheck;
//@is_outgoing True, if the message is outgoing
//@is_pinned True, if the message is pinned
//@is_from_offline True, if the message was sent because of a scheduled action by the message sender, for example, as away, or greeting service message
-//@can_be_saved True, if content of the message can be saved locally or copied
+//@can_be_saved True, if content of the message can be saved locally or copied using inputMessageForwarded or forwardMessages with copy options
//@has_timestamped_media True, if media timestamp entities refers to a media in this message as opposed to a media in the replied message
//@is_channel_post True, if the message is a channel post. All messages to channels are channel posts, all other messages are not channel posts
//@is_topic_message True, if the message is a forum topic message
@@ -1802,7 +1851,7 @@ messageSponsor url:string photo:photo info:string = MessageSponsor;
//@message_id Message identifier; unique for the chat to which the sponsored message belongs among both ordinary and sponsored messages
//@is_recommended True, if the message needs to be labeled as "recommended" instead of "sponsored"
//@can_be_reported True, if the message can be reported to Telegram moderators through reportChatSponsoredMessage
-//@content Content of the message. Currently, can be only of the types messageText, messageAnimation, messagePhoto, or messageVideo
+//@content Content of the message. Currently, can be only of the types messageText, messageAnimation, messagePhoto, or messageVideo. Video messages can be viewed fullscreen
//@sponsor Information about the sponsor of the message
//@title Title of the sponsored message
//@button_text Text for the message action button
@@ -1814,8 +1863,9 @@ sponsoredMessage message_id:int53 is_recommended:Bool can_be_reported:Bool conte
//@description Contains a list of sponsored messages @messages List of sponsored messages @messages_between The minimum number of messages between shown sponsored messages, or 0 if only one sponsored message must be shown after all ordinary messages
sponsoredMessages messages:vector messages_between:int32 = SponsoredMessages;
-//@description Describes an option to report a sponsored message @id Unique identifier of the option @text Text of the option
-reportChatSponsoredMessageOption id:bytes text:string = ReportChatSponsoredMessageOption;
+
+//@description Describes an option to report an entity to Telegram @id Unique identifier of the option @text Text of the option
+reportOption id:bytes text:string = ReportOption;
//@class ReportChatSponsoredMessageResult @description Describes result of sponsored message report
@@ -1827,7 +1877,7 @@ reportChatSponsoredMessageResultOk = ReportChatSponsoredMessageResult;
reportChatSponsoredMessageResultFailed = ReportChatSponsoredMessageResult;
//@description The user must choose an option to report the message and repeat request with the chosen option @title Title for the option choice @options List of available options
-reportChatSponsoredMessageResultOptionRequired title:string options:vector = ReportChatSponsoredMessageResult;
+reportChatSponsoredMessageResultOptionRequired title:string options:vector = ReportChatSponsoredMessageResult;
//@description Sponsored messages were hidden for the user in all chats
reportChatSponsoredMessageResultAdsHidden = ReportChatSponsoredMessageResult;
@@ -2258,6 +2308,9 @@ inlineKeyboardButtonTypeBuy = InlineKeyboardButtonType;
//@description A button with a user reference to be handled in the same way as textEntityTypeMentionName entities @user_id User identifier
inlineKeyboardButtonTypeUser user_id:int53 = InlineKeyboardButtonType;
+//@description A button that copies specified text to clipboard @text The text to copy to clipboard
+inlineKeyboardButtonTypeCopyText text:string = InlineKeyboardButtonType;
+
//@description Represents a single button in an inline keyboard @text Text of the button @type Type of the button
inlineKeyboardButton text:string type:InlineKeyboardButtonType = InlineKeyboardButton;
@@ -2276,7 +2329,7 @@ replyMarkupForceReply is_personal:Bool input_field_placeholder:string = ReplyMar
//@description Contains a custom keyboard layout to quickly reply to bots
//@rows A list of rows of bot keyboard buttons
-//@is_persistent True, if the keyboard is supposed to always be shown when the ordinary keyboard is hidden
+//@is_persistent True, if the keyboard is expected to always be shown when the ordinary keyboard is hidden
//@resize_keyboard True, if the application needs to resize the keyboard vertically
//@one_time True, if the application needs to hide the keyboard after use
//@is_personal True, if the keyboard must automatically be shown to the current user. For outgoing messages, specify true to show the keyboard only for the mentioned users and for the target user of a reply
@@ -3405,11 +3458,12 @@ messageSticker sticker:sticker is_premium:Bool = MessageContent;
//@description A video message
//@video The video description
+//@alternative_videos Alternative qualities of the video
//@caption Video caption
//@show_caption_above_media True, if the caption must be shown above the video; otherwise, the caption must be shown below the video
//@has_spoiler True, if the video preview must be covered by a spoiler animation
//@is_secret True, if the video thumbnail must be blurred and the video must be shown only while tapped
-messageVideo video:video caption:formattedText show_caption_above_media:Bool has_spoiler:Bool is_secret:Bool = MessageContent;
+messageVideo video:video alternative_videos:vector caption:formattedText show_caption_above_media:Bool has_spoiler:Bool is_secret:Bool = MessageContent;
//@description A video note message @video_note The video note description @is_viewed True, if at least one of the recipients has viewed the video note @is_secret True, if the video note thumbnail must be blurred and the video note must be shown only while tapped
messageVideoNote video_note:videoNote is_viewed:Bool is_secret:Bool = MessageContent;
@@ -3481,7 +3535,7 @@ messageInvoice product_info:productInfo currency:string total_amount:int53 start
//@description A message with information about an ended call @is_video True, if the call was a video call @discard_reason Reason why the call was discarded @duration Call duration, in seconds
messageCall is_video:Bool discard_reason:CallDiscardReason duration:int32 = MessageContent;
-//@description A new video chat was scheduled @group_call_id Identifier of the video chat. The video chat can be received through the method getGroupCall @start_date Point in time (Unix timestamp) when the group call is supposed to be started by an administrator
+//@description A new video chat was scheduled @group_call_id Identifier of the video chat. The video chat can be received through the method getGroupCall @start_date Point in time (Unix timestamp) when the group call is expected to be started by an administrator
messageVideoChatScheduled group_call_id:int32 start_date:int32 = MessageContent;
//@description A newly created video chat @group_call_id Identifier of the video chat. The video chat can be received through the method getGroupCall
@@ -3670,7 +3724,7 @@ messageGiveawayWinners boosted_chat_id:int53 giveaway_message_id:int53 additiona
//@sticker A sticker to be shown in the message; may be null if unknown
messageGiftedStars gifter_user_id:int53 receiver_user_id:int53 currency:string amount:int53 cryptocurrency:string cryptocurrency_amount:int64 star_count:int53 transaction_id:string sticker:sticker = MessageContent;
-//@description A Telegram Stars were received by the cuurent user from a giveaway
+//@description A Telegram Stars were received by the current user from a giveaway
//@star_count Number of Telegram Stars that were received
//@transaction_id Identifier of the transaction for Telegram Stars credit
//@boosted_chat_id Identifier of the supergroup or channel chat, which was automatically boosted by the winners of the giveaway
@@ -3679,6 +3733,15 @@ messageGiftedStars gifter_user_id:int53 receiver_user_id:int53 currency:string a
//@sticker A sticker to be shown in the message; may be null if unknown
messageGiveawayPrizeStars star_count:int53 transaction_id:string boosted_chat_id:int53 giveaway_message_id:int53 is_unclaimed:Bool sticker:sticker = MessageContent;
+//@description A gift was received or sent by the current user
+//@gift The gift
+//@text Message added to the gift
+//@sell_star_count Number of Telegram Stars that can be claimed by the receiver instead of the gift
+//@is_private True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them
+//@is_saved True, if the gift is displayed on the user's profile page; only for the receiver of the gift
+//@was_converted True, if the gift was converted to Telegram Stars; only for the receiver of the gift
+messageGift gift:gift text:formattedText sell_star_count:int53 is_private:Bool is_saved:Bool was_converted:Bool = MessageContent;
+
//@description A contact has registered with Telegram
messageContactRegistered = MessageContent;
@@ -3793,7 +3856,7 @@ inputPaidMediaTypePhoto = InputPaidMediaType;
//@description The media is a video
//@duration Duration of the video, in seconds
-//@supports_streaming True, if the video is supposed to be streamed
+//@supports_streaming True, if the video is expected to be streamed
inputPaidMediaTypeVideo duration:int32 supports_streaming:Bool = InputPaidMediaType;
@@ -3840,7 +3903,7 @@ messageSendOptions disable_notification:Bool from_background:Bool protect_conten
//@send_copy True, if content of the message needs to be copied without reference to the original sender. Always true if the message is forwarded to a secret chat or is local
//@replace_caption True, if media caption of the message copy needs to be replaced. Ignored if send_copy is false
//@new_caption New message caption; pass null to copy message without caption. Ignored if replace_caption is false
-//@new_show_caption_above_media True, if new caption must be shown above the animation; otherwise, new caption must be shown below the animation; not supported in secret chats. Ignored if replace_caption is false
+//@new_show_caption_above_media True, if new caption must be shown above the media; otherwise, new caption must be shown below the media; not supported in secret chats. Ignored if replace_caption is false
messageCopyOptions send_copy:Bool replace_caption:Bool new_caption:formattedText new_show_caption_above_media:Bool = MessageCopyOptions;
@@ -3885,7 +3948,7 @@ inputMessageDocument document:InputFile thumbnail:inputThumbnail disable_content
//@star_count The number of Telegram Stars that must be paid to see the media; 1-getOption("paid_media_message_star_count_max")
//@paid_media The content of the paid media
//@caption Message caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters
-//@show_caption_above_media True, if the caption must be shown above the video; otherwise, the caption must be shown below the video; not supported in secret chats
+//@show_caption_above_media True, if the caption must be shown above the media; otherwise, the caption must be shown below the media; not supported in secret chats
//@payload Bot-provided data for the paid media; bots only
inputMessagePaidMedia star_count:int53 paid_media:vector caption:formattedText show_caption_above_media:Bool payload:string = InputMessageContent;
@@ -3910,13 +3973,13 @@ inputMessagePhoto photo:InputFile thumbnail:inputThumbnail added_sticker_file_id
inputMessageSticker sticker:InputFile thumbnail:inputThumbnail width:int32 height:int32 emoji:string = InputMessageContent;
//@description A video message
-//@video Video to be sent
+//@video Video to be sent. The video is expected to be reencoded to MPEG4 format with H.264 codec by the sender
//@thumbnail Video thumbnail; pass null to skip thumbnail uploading
//@added_sticker_file_ids File identifiers of the stickers added to the video, if applicable
//@duration Duration of the video, in seconds
//@width Video width
//@height Video height
-//@supports_streaming True, if the video is supposed to be streamed
+//@supports_streaming True, if the video is expected to be streamed
//@caption Video caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters
//@show_caption_above_media True, if the caption must be shown above the video; otherwise, the caption must be shown below the video; not supported in secret chats
//@self_destruct_type Video self-destruct type; pass null if none; private chats only
@@ -4347,7 +4410,7 @@ inputStoryAreas areas:vector = InputStoryAreas;
//@is_animation True, if the video has no sound
//@minithumbnail Video minithumbnail; may be null
//@thumbnail Video thumbnail in JPEG or MPEG4 format; may be null
-//@preload_prefix_size Size of file prefix, which is supposed to be preloaded, in bytes
+//@preload_prefix_size Size of file prefix, which is expected to be preloaded, in bytes
//@cover_frame_timestamp Timestamp of the frame used as video thumbnail
//@video File containing the video
storyVideo duration:double width:int32 height:int32 has_stickers:Bool is_animation:Bool minithumbnail:minithumbnail thumbnail:thumbnail preload_prefix_size:int32 cover_frame_timestamp:double video:file = StoryVideo;
@@ -4358,7 +4421,7 @@ storyVideo duration:double width:int32 height:int32 has_stickers:Bool is_animati
//@description A photo story @photo The photo
storyContentPhoto photo:photo = StoryContent;
-//@description A video story @video The video in MPEG4 format @alternative_video Alternative version of the video in MPEG4 format, encoded by x264 codec; may be null
+//@description A video story @video The video in MPEG4 format @alternative_video Alternative version of the video in MPEG4 format, encoded with H.264 codec; may be null
storyContentVideo video:storyVideo alternative_video:storyVideo = StoryContent;
//@description A story content that is not supported in the current TDLib version
@@ -4373,7 +4436,7 @@ storyContentUnsupported = StoryContent;
inputStoryContentPhoto photo:InputFile added_sticker_file_ids:vector = InputStoryContent;
//@description A video story
-//@video Video to be sent. The video size must be 720x1280. The video must be streamable and stored in MPEG4 format, after encoding with x265 codec and key frames added each second
+//@video Video to be sent. The video size must be 720x1280. The video must be streamable and stored in MPEG4 format, after encoding with H.265 codec and key frames added each second
//@added_sticker_file_ids File identifiers of the stickers added to the video, if applicable
//@duration Precise duration of the video, in seconds; 0-60
//@cover_frame_timestamp Timestamp of the frame, which will be used as video thumbnail
@@ -4773,7 +4836,7 @@ groupCallRecentSpeaker participant_id:MessageSender is_speaking:Bool = GroupCall
//@description Describes a group call
//@id Group call identifier
//@title Group call title
-//@scheduled_start_date Point in time (Unix timestamp) when the group call is supposed to be started by an administrator; 0 if it is already active or was ended
+//@scheduled_start_date Point in time (Unix timestamp) when the group call is expected to be started by an administrator; 0 if it is already active or was ended
//@enabled_start_notification True, if the group call is scheduled and the current user will receive a notification when the group call starts
//@is_active True, if the call is active
//@is_rtmp_stream True, if the chat is an RTMP stream instead of an ordinary video chat
@@ -6131,6 +6194,9 @@ pushMessageContentPremiumGiftCode month_count:int32 = PushMessageContent;
//@is_pinned True, if the message is a pinned message with the specified content
pushMessageContentGiveaway winner_count:int32 prize:GiveawayPrize is_pinned:Bool = PushMessageContent;
+//@description A message with a gift @star_count Number of Telegram Stars that sender paid for the gift
+pushMessageContentGift star_count:int53 = PushMessageContent;
+
//@description A screenshot of a message in the chat has been taken
pushMessageContentScreenshotTaken = PushMessageContent;
@@ -6561,6 +6627,33 @@ reportReasonPersonalDetails = ReportReason;
reportReasonCustom = ReportReason;
+//@class ReportChatResult @description Describes result of chat report
+
+//@description The chat was reported successfully
+reportChatResultOk = ReportChatResult;
+
+//@description The user must choose an option to report the chat and repeat request with the chosen option @title Title for the option choice @options List of available options
+reportChatResultOptionRequired title:string options:vector = ReportChatResult;
+
+//@description The user must add additional text details to the report @option_id Option identifier for the next reportChat request @is_optional True, if the user can skip text adding
+reportChatResultTextRequired option_id:bytes is_optional:Bool = ReportChatResult;
+
+//@description The user must choose messages to report and repeat the reportChat request with the chosen messages
+reportChatResultMessagesRequired = ReportChatResult;
+
+
+//@class ReportStoryResult @description Describes result of story report
+
+//@description The story was reported successfully
+reportStoryResultOk = ReportStoryResult;
+
+//@description The user must choose an option to report the story and repeat request with the chosen option @title Title for the option choice @options List of available options
+reportStoryResultOptionRequired title:string options:vector = ReportStoryResult;
+
+//@description The user must add additional text details to the report @option_id Option identifier for the next reportStory request @is_optional True, if the user can skip text adding
+reportStoryResultTextRequired option_id:bytes is_optional:Bool = ReportStoryResult;
+
+
//@class TargetChat @description Describes the target chat to be opened
//@description The currently opened chat needs to be kept
@@ -6595,12 +6688,12 @@ internalLinkTypeAttachmentMenuBot target_chat:TargetChat bot_username:string url
//@description The link contains an authentication code. Call checkAuthenticationCode with the code if the current authorization state is authorizationStateWaitCode @code The authentication code
internalLinkTypeAuthenticationCode code:string = InternalLinkType;
-//@description The link is a link to a background. Call searchBackground with the given background name to process the link
+//@description The link is a link to a background. Call searchBackground with the given background name to process the link.
//-If background is found and the user wants to apply it, then call setDefaultBackground
//@background_name Name of the background
internalLinkTypeBackground background_name:string = InternalLinkType;
-//@description The link is a link to a Telegram bot, which is supposed to be added to a channel chat as an administrator. Call searchPublicChat with the given bot username and check that the user is a bot,
+//@description The link is a link to a Telegram bot, which is expected to be added to a channel chat as an administrator. Call searchPublicChat with the given bot username and check that the user is a bot,
//-ask the current user to select a channel chat to add the bot to as an administrator. Then, call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator,
//-check that the current user can edit its administrator rights and combine received rights with the requested administrator rights. Then, show confirmation box to the user, and call setChatMemberStatus with the chosen chat and confirmed rights
//@bot_username Username of the bot
@@ -6614,7 +6707,7 @@ internalLinkTypeBotAddToChannel bot_username:string administrator_rights:chatAdm
//@autostart True, if sendBotStartMessage must be called automatically without showing the START button
internalLinkTypeBotStart bot_username:string start_parameter:string autostart:Bool = InternalLinkType;
-//@description The link is a link to a Telegram bot, which is supposed to be added to a group chat. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to groups,
+//@description The link is a link to a Telegram bot, which is expected to be added to a group chat. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to groups,
//-ask the current user to select a basic group or a supergroup chat to add the bot to, taking into account that bots can be added to a public supergroup only by administrators of the supergroup.
//-If administrator rights are provided by the link, call getChatMember to receive the current bot rights in the chat and if the bot already is an administrator,
//-check that the current user can edit its administrator rights, combine received rights with the requested administrator rights, show confirmation box to the user,
@@ -6742,7 +6835,7 @@ internalLinkTypePrivacyAndSecuritySettings = InternalLinkType;
//@type Type of the proxy
internalLinkTypeProxy server:string port:int32 type:ProxyType = InternalLinkType;
-//@description The link is a link to a chat by its username. Call searchPublicChat with the given chat username to process the link
+//@description The link is a link to a chat by its username. Call searchPublicChat with the given chat username to process the link.
//-If the chat is found, open its profile information screen or the chat itself.
//-If draft text isn't empty and the chat is a private chat with a regular user, then put the draft text in the input field
//@chat_username Username of the chat
@@ -6990,9 +7083,9 @@ networkStatistics since_date:int32 entries:vector = Netw
autoDownloadSettings is_auto_download_enabled:Bool max_photo_file_size:int32 max_video_file_size:int53 max_other_file_size:int53 video_upload_bitrate:int32 preload_large_videos:Bool preload_next_audio:Bool preload_stories:Bool use_less_data_for_calls:Bool = AutoDownloadSettings;
//@description Contains auto-download settings presets for the current user
-//@low Preset with lowest settings; supposed to be used by default when roaming
-//@medium Preset with medium settings; supposed to be used by default when using mobile data
-//@high Preset with highest settings; supposed to be used by default when connected on Wi-Fi
+//@low Preset with lowest settings; expected to be used by default when roaming
+//@medium Preset with medium settings; expected to be used by default when using mobile data
+//@high Preset with highest settings; expected to be used by default when connected on Wi-Fi
autoDownloadSettingsPresets low:autoDownloadSettings medium:autoDownloadSettings high:autoDownloadSettings = AutoDownloadSettingsPresets;
@@ -7041,7 +7134,7 @@ connectionStateConnectingToProxy = ConnectionState;
//@description Establishing a connection to the Telegram servers
connectionStateConnecting = ConnectionState;
-//@description Downloading data supposed to be received while the application was offline
+//@description Downloading data expected to be received while the application was offline
connectionStateUpdating = ConnectionState;
//@description There is a working connection to the Telegram servers
@@ -7502,7 +7595,7 @@ updateMessageUnreadReactions chat_id:int53 message_id:int53 unread_reactions:vec
//@fact_check The new fact-check
updateMessageFactCheck chat_id:int53 message_id:int53 fact_check:factCheck = Update;
-//@description A message with a live location was viewed. When the update is received, the application is supposed to update the live location
+//@description A message with a live location was viewed. When the update is received, the application is expected to update the live location
//@chat_id Identifier of the chat with the live location message
//@message_id Identifier of the message with live location
updateMessageLiveLocationViewed chat_id:int53 message_id:int53 = Update;
@@ -7734,11 +7827,13 @@ updateServiceNotification type:string content:MessageContent = Update;
//@description Information about a file was updated @file New data about the file
updateFile file:file = Update;
-//@description The file generation process needs to be started by the application
+//@description The file generation process needs to be started by the application. Use setFileGenerationProgress and finishFileGeneration to generate the file
//@generation_id Unique identifier for the generation process
-//@original_path The path to a file from which a new file is generated; may be empty
-//@destination_path The path to a file that must be created and where the new file is generated
-//@conversion String specifying the conversion applied to the original file. If conversion is "#url#" than original_path contains an HTTP/HTTPS URL of a file, which must be downloaded by the application
+//@original_path The original path specified by the application in inputFileGenerated
+//@destination_path The path to a file that must be created and where the new file must be generated by the application.
+//-If the application has no access to the path, it can use writeGeneratedFilePart to generate the file
+//@conversion If the conversion is "#url#" than original_path contains an HTTP/HTTPS URL of a file that must be downloaded by the application.
+//-Otherwise, this is the conversion specified by the application in inputFileGenerated
updateFileGenerationStart generation_id:int64 original_path:string destination_path:string conversion:string = Update;
//@description File generation is no longer needed @generation_id Unique identifier for the generation process
@@ -7947,7 +8042,7 @@ updateAnimationSearchParameters provider:string emojis:vector = Update;
//@description The list of suggested to the user actions has changed @added_actions Added suggested actions @removed_actions Removed suggested actions
updateSuggestedActions added_actions:vector removed_actions:vector = Update;
-//@description Download or upload file speed for the user was limited, but it can be restored by subscription to Telegram Premium. The notification can be postponed until a being downloaded or uploaded file is visible to the user
+//@description Download or upload file speed for the user was limited, but it can be restored by subscription to Telegram Premium. The notification can be postponed until a being downloaded or uploaded file is visible to the user.
//-Use getOption("premium_download_speedup") or getOption("premium_upload_speedup") to get expected speedup after subscription to Telegram Premium
//@is_upload True, if upload speed was limited; false, if download speed was limited
updateSpeedLimitNotification is_upload:Bool = Update;
@@ -8336,20 +8431,25 @@ getSecretChat secret_chat_id:int32 = SecretChat;
//@description Returns information about a chat by its identifier; this is an offline request if the current user is not a bot @chat_id Chat identifier
getChat chat_id:int53 = Chat;
-//@description Returns information about a message @chat_id Identifier of the chat the message belongs to @message_id Identifier of the message to get
+//@description Returns information about a message. Returns a 404 error if the message doesn't exist
+//@chat_id Identifier of the chat the message belongs to
+//@message_id Identifier of the message to get
getMessage chat_id:int53 message_id:int53 = Message;
-//@description Returns information about a message, if it is available without sending network request. This is an offline request @chat_id Identifier of the chat the message belongs to @message_id Identifier of the message to get
+//@description Returns information about a message, if it is available without sending network request. Returns a 404 error if message isn't available locally. This is an offline request
+//@chat_id Identifier of the chat the message belongs to
+//@message_id Identifier of the message to get
getMessageLocally chat_id:int53 message_id:int53 = Message;
//@description Returns information about a non-bundled message that is replied by a given message. Also, returns the pinned message, the game message, the invoice message,
//-the message with a previously set same background, the giveaway message, and the topic creation message for messages of the types
-//-messagePinMessage, messageGameScore, messagePaymentSuccessful, messageChatSetBackground, messageGiveawayCompleted and topic messages without non-bundled replied message respectively
+//-messagePinMessage, messageGameScore, messagePaymentSuccessful, messageChatSetBackground, messageGiveawayCompleted and topic messages without non-bundled replied message respectively.
+//-Returns a 404 error if the message doesn't exist
//@chat_id Identifier of the chat the message belongs to
//@message_id Identifier of the reply message
getRepliedMessage chat_id:int53 message_id:int53 = Message;
-//@description Returns information about a newest pinned message in the chat @chat_id Identifier of the chat the message belongs to
+//@description Returns information about a newest pinned message in the chat. Returns a 404 error if the message doesn't exist @chat_id Identifier of the chat the message belongs to
getChatPinnedMessage chat_id:int53 = Message;
//@description Returns information about a message with the callback button that originated a callback query; for bots only @chat_id Identifier of the chat the message belongs to @message_id Message identifier @callback_query_id Identifier of the callback query
@@ -8409,9 +8509,7 @@ searchChats query:string limit:int32 = Chats;
//@description Searches for the specified query in the title and username of already known chats via request to the server. Returns chats in the order seen in the main chat list @query Query to search for @limit The maximum number of chats to be returned
searchChatsOnServer query:string limit:int32 = Chats;
-//@description Returns a list of users and location-based supergroups nearby. The list of users nearby will be updated for 60 seconds after the request by the updates updateUsersNearby.
-//-The request must be sent again every 25 seconds with adjusted location to not miss new chats
-//@location Current user location
+//@description Returns a list of users and location-based supergroups nearby. The method was disabled and returns an empty list of chats now @location Current user location
searchChatsNearby location:location = ChatsNearby;
//@description Returns a list of channel chats recommended to the current user
@@ -8582,7 +8680,7 @@ searchMessages chat_list:ChatList only_in_channels:Bool query:string offset:stri
searchSecretMessages chat_id:int53 query:string offset:string limit:int32 filter:SearchMessagesFilter = FoundMessages;
//@description Searches for messages tagged by the given reaction and with the given words in the Saved Messages chat; for Telegram Premium users only.
-//-Returns the results in reverse chronological order, i.e. in order of decreasing message_id
+//-Returns the results in reverse chronological order, i.e. in order of decreasing message_id.
//-For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit
//@saved_messages_topic_id If not 0, only messages in the specified Saved Messages topic will be considered; pass 0 to consider all messages
//@tag Tag to search for; pass null to return all suitable messages
@@ -8644,7 +8742,9 @@ deleteAllCallMessages revoke:Bool = Ok;
//@description Returns information about the recent locations of chat members that were sent to the chat. Returns up to 1 location message per user @chat_id Chat identifier @limit The maximum number of messages to be returned
searchChatRecentLocationMessages chat_id:int53 limit:int32 = Messages;
-//@description Returns the last message sent in a chat no later than the specified date @chat_id Chat identifier @date Point in time (Unix timestamp) relative to which to search for messages
+//@description Returns the last message sent in a chat no later than the specified date. Returns a 404 error if such message doesn't exist
+//@chat_id Chat identifier
+//@date Point in time (Unix timestamp) relative to which to search for messages
getChatMessageByDate chat_id:int53 date:int32 = Message;
//@description Returns sparse positions of messages of the specified type in the chat to be used for shared media scroll implementation. Returns the results in reverse chronological order (i.e., in order of decreasing message_id).
@@ -8684,10 +8784,12 @@ getChatScheduledMessages chat_id:int53 = Messages;
//@description Returns sponsored messages to be shown in a chat; for channel chats only @chat_id Identifier of the chat
getChatSponsoredMessages chat_id:int53 = SponsoredMessages;
-//@description Informs TDLib that the user opened the sponsored chat via the button, the name, the photo, or a mention in the sponsored message
+//@description Informs TDLib that the user opened the sponsored chat via the button, the name, the chat photo, a mention in the sponsored message text, or the media in the sponsored message
//@chat_id Chat identifier of the sponsored message
//@message_id Identifier of the sponsored message
-clickChatSponsoredMessage chat_id:int53 message_id:int53 = Ok;
+//@is_media_click Pass true if the media was clicked in the sponsored message
+//@from_fullscreen Pass true if the user expanded the video from the sponsored message fullscreen before the click
+clickChatSponsoredMessage chat_id:int53 message_id:int53 is_media_click:Bool from_fullscreen:Bool = Ok;
//@description Reports a sponsored message to Telegram moderators
//@chat_id Chat identifier of the sponsored message
@@ -8871,7 +8973,7 @@ editMessageMedia chat_id:int53 message_id:int53 reply_markup:ReplyMarkup input_m
//@message_id Identifier of the message. Use messageProperties.can_be_edited to check whether the message can be edited
//@reply_markup The new message reply markup; pass null if none; for bots only
//@caption New message content caption; 0-getOption("message_caption_length_max") characters; pass null to remove caption
-//@show_caption_above_media Pass true to show the caption above the media; otherwise, the caption will be shown below the media. Can be true only for animation, photo, and video messages
+//@show_caption_above_media Pass true to show the caption above the media; otherwise, the caption will be shown below the media. May be true only for animation, photo, and video messages
editMessageCaption chat_id:int53 message_id:int53 reply_markup:ReplyMarkup caption:formattedText show_caption_above_media:Bool = Message;
//@description Edits the message reply markup; for bots only. Returns the edited message after the edit is completed on the server side
@@ -8906,7 +9008,7 @@ editInlineMessageMedia inline_message_id:string reply_markup:ReplyMarkup input_m
//@inline_message_id Inline message identifier
//@reply_markup The new message reply markup; pass null if none
//@caption New message content caption; pass null to remove caption; 0-getOption("message_caption_length_max") characters
-//@show_caption_above_media Pass true to show the caption above the media; otherwise, the caption will be shown below the media. Can be true only for animation, photo, and video messages
+//@show_caption_above_media Pass true to show the caption above the media; otherwise, the caption will be shown below the media. May be true only for animation, photo, and video messages
editInlineMessageCaption inline_message_id:string reply_markup:ReplyMarkup caption:formattedText show_caption_above_media:Bool = Ok;
//@description Edits the reply markup of an inline message sent via a bot; for bots only
@@ -8983,7 +9085,7 @@ editBusinessMessageMedia business_connection_id:string chat_id:int53 message_id:
//@message_id Identifier of the message
//@reply_markup The new message reply markup; pass null if none
//@caption New message content caption; pass null to remove caption; 0-getOption("message_caption_length_max") characters
-//@show_caption_above_media Pass true to show the caption above the media; otherwise, the caption will be shown below the media. Can be true only for animation, photo, and video messages
+//@show_caption_above_media Pass true to show the caption above the media; otherwise, the caption will be shown below the media. May be true only for animation, photo, and video messages
editBusinessMessageCaption business_connection_id:string chat_id:int53 message_id:int53 reply_markup:ReplyMarkup caption:formattedText show_caption_above_media:Bool = BusinessMessage;
//@description Edits the reply markup of a message sent on behalf of a business account; for bots only
@@ -9242,7 +9344,7 @@ getFileMimeType file_name:string = Text;
//@description Returns the extension of a file, guessed by its MIME type. Returns an empty string on failure. Can be called synchronously @mime_type The MIME type of the file
getFileExtension mime_type:string = Text;
-//@description Removes potentially dangerous characters from the name of a file. The encoding of the file name is supposed to be UTF-8. Returns an empty string on failure. Can be called synchronously @file_name File name or path to the file
+//@description Removes potentially dangerous characters from the name of a file. Returns an empty string on failure. Can be called synchronously @file_name File name or path to the file
cleanFileName file_name:string = Text;
//@description Returns a string stored in the local database from the specified localization target and language pack by its key. Returns a 404 error if the string is not found. Can be called synchronously
@@ -9657,7 +9759,7 @@ setChatAccentColor chat_id:int53 accent_color_id:int32 background_custom_emoji_i
//@profile_background_custom_emoji_id Identifier of a custom emoji to be shown on the chat's profile photo background; 0 if none. Use chatBoostLevelFeatures.can_set_profile_background_custom_emoji to check whether a custom emoji can be set
setChatProfileAccentColor chat_id:int53 profile_accent_color_id:int32 profile_background_custom_emoji_id:int64 = Ok;
-//@description Changes the message auto-delete or self-destruct (for secret chats) time in a chat. Requires change_info administrator right in basic groups, supergroups and channels
+//@description Changes the message auto-delete or self-destruct (for secret chats) time in a chat. Requires change_info administrator right in basic groups, supergroups and channels.
//-Message auto-delete time can't be changed in a chat with the current user (Saved Messages) and the chat 777000 (Telegram).
//@chat_id Chat identifier
//@message_auto_delete_time New time value, in seconds; unless the chat is secret, it must be from 0 up to 365 * 86400 and be divisible by 86400. If 0, then messages aren't deleted automatically
@@ -9942,7 +10044,7 @@ getChatActiveStories chat_id:int53 = ChatActiveStories;
//-Then, stories are returned in reverse chronological order (i.e., in order of decreasing story_id). For optimal performance, the number of returned stories is chosen by TDLib
//@chat_id Chat identifier
//@from_story_id Identifier of the story starting from which stories must be returned; use 0 to get results from pinned and the newest story
-//@limit The maximum number of stories to be returned
+//@limit The maximum number of stories to be returned.
//-For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit
getChatPostedToChatPageStories chat_id:int53 from_story_id:int32 limit:int32 = Stories;
@@ -9950,7 +10052,7 @@ getChatPostedToChatPageStories chat_id:int53 from_story_id:int32 limit:int32 = S
//-The stories are returned in reverse chronological order (i.e., in order of decreasing story_id). For optimal performance, the number of returned stories is chosen by TDLib
//@chat_id Chat identifier
//@from_story_id Identifier of the story starting from which stories must be returned; use 0 to get results from the last story
-//@limit The maximum number of stories to be returned
+//@limit The maximum number of stories to be returned.
//-For optimal performance, the number of returned stories is chosen by TDLib and can be smaller than the specified limit
getChatArchivedStories chat_id:int53 from_story_id:int32 limit:int32 = Stories;
@@ -10001,9 +10103,9 @@ getChatStoryInteractions story_sender_chat_id:int53 story_id:int32 reaction_type
//@description Reports a story to the Telegram moderators
//@story_sender_chat_id The identifier of the sender of the story to report
//@story_id The identifier of the story to report
-//@reason The reason for reporting the story
-//@text Additional report details; 0-1024 characters
-reportStory story_sender_chat_id:int53 story_id:int32 reason:ReportReason text:string = Ok;
+//@option_id Option identifier chosen by the user; leave empty for the initial request
+//@text Additional report details; 0-1024 characters; leave empty for the initial request
+reportStory story_sender_chat_id:int53 story_id:int32 option_id:bytes text:string = ReportStoryResult;
//@description Activates stealth mode for stories, which hides all views of stories from the current user in the last "story_stealth_mode_past_period" seconds
//-and for the next "story_stealth_mode_future_period" seconds; for Telegram Premium users only
@@ -10104,7 +10206,7 @@ getFileDownloadedPrefixSize file_id:int32 offset:int53 = FileDownloadedPrefixSiz
//@description Stops the downloading of a file. If a file has already been downloaded, does nothing @file_id Identifier of a file to stop downloading @only_if_pending Pass true to stop downloading only if it hasn't been started, i.e. request hasn't been sent to server
cancelDownloadFile file_id:int32 only_if_pending:Bool = Ok;
-//@description Returns suggested name for saving a file in a given directory @file_id Identifier of the file @directory Directory in which the file is supposed to be saved
+//@description Returns suggested name for saving a file in a given directory @file_id Identifier of the file @directory Directory in which the file is expected to be saved
getSuggestedFileName file_id:int32 directory:string = Text;
//@description Preliminary uploads a file to the cloud before sending it in a message, which can be useful for uploading of being recorded voice and video notes.
@@ -10115,7 +10217,7 @@ getSuggestedFileName file_id:int32 directory:string = Text;
//@priority Priority of the upload (1-32). The higher the priority, the earlier the file will be uploaded. If the priorities of two files are equal, then the first one for which preliminaryUploadFile was called will be uploaded first
preliminaryUploadFile file:InputFile file_type:FileType priority:int32 = File;
-//@description Stops the preliminary uploading of a file. Supported only for files uploaded by using preliminaryUploadFile. For other files the behavior is undefined @file_id Identifier of the file to stop uploading
+//@description Stops the preliminary uploading of a file. Supported only for files uploaded by using preliminaryUploadFile @file_id Identifier of the file to stop uploading
cancelPreliminaryUploadFile file_id:int32 = Ok;
//@description Writes a part of a generated file. This method is intended to be used only if the application has no direct access to TDLib's file system, because it is usually slower than a direct write to the destination file
@@ -10218,7 +10320,7 @@ createChatInviteLink chat_id:int53 name:string expiration_date:int32 member_limi
createChatSubscriptionInviteLink chat_id:int53 name:string subscription_pricing:starSubscriptionPricing = ChatInviteLink;
//@description Edits a non-primary invite link for a chat. Available for basic groups, supergroups, and channels.
-//-If the link creates a subscription, then expiration_date, member_limit and creates_join_request must not be used
+//-If the link creates a subscription, then expiration_date, member_limit and creates_join_request must not be used.
//-Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links
//@chat_id Chat identifier
//@invite_link Invite link to be edited
@@ -10337,7 +10439,7 @@ setVideoChatDefaultParticipant chat_id:int53 default_participant_id:MessageSende
//@description Creates a video chat (a group call bound to a chat). Available only for basic groups, supergroups and channels; requires can_manage_video_chats administrator right
//@chat_id Identifier of a chat in which the video chat will be created
//@title Group call title; if empty, chat title will be used
-//@start_date Point in time (Unix timestamp) when the group call is supposed to be started by an administrator; 0 to start the video chat immediately. The date must be at least 10 seconds and at most 8 days in the future
+//@start_date Point in time (Unix timestamp) when the group call is expected to be started by an administrator; 0 to start the video chat immediately. The date must be at least 10 seconds and at most 8 days in the future
//@is_rtmp_stream Pass true to create an RTMP stream instead of an ordinary video chat; requires owner privileges
createVideoChat chat_id:int53 title:string start_date:int32 is_rtmp_stream:Bool = GroupCallId;
@@ -11069,7 +11171,7 @@ toggleSupergroupIsBroadcastGroup supergroup_id:int53 = Ok;
//@description Reports messages in a supergroup as spam; requires administrator rights in the supergroup
//@supergroup_id Supergroup identifier
-//@message_ids Identifiers of messages to report. Use messageProperties.can_be_reported to check whether the message can be reported
+//@message_ids Identifiers of messages to report. Use messageProperties.can_report_supergroup_spam to check whether the message can be reported
reportSupergroupSpam supergroup_id:int53 message_ids:vector = Ok;
//@description Reports a false deletion of a message by aggressive anti-spam checks; requires administrator rights in the supergroup. Can be called only for messages from chatEventMessageDeleted with can_report_anti_spam_false_positive == true
@@ -11136,10 +11238,38 @@ deleteSavedOrderInfo = Ok;
deleteSavedCredentials = Ok;
+//@description Returns gifts that can be sent to other users
+getAvailableGifts = Gifts;
+
+//@description Send a gift to another user
+//@gift_id Identifier of the gift to send
+//@user_id Identifier of the user that will receive the gift
+//@text Text to show along with the gift; 0-getOption("gift_text_length_max") characters. Only Bold, Italic, Underline, Strikethrough, Spoiler, and CustomEmoji entities are allowed
+//@is_private Pass true to show the current user as sender and gift text only to the gift receiver; otherwise, everyone will be able to see them
+sendGift gift_id:int64 user_id:int53 text:formattedText is_private:Bool = Ok;
+
+//@description Sells a gift received by the current user for Telegram Stars
+//@sender_user_id Identifier of the user that sent the gift
+//@message_id Identifier of the message with the gift in the chat with the user
+sellGift sender_user_id:int53 message_id:int53 = Ok;
+
+//@description Toggles whether a gift is shown on the current user's profile page
+//@sender_user_id Identifier of the user that sent the gift
+//@message_id Identifier of the message with the gift in the chat with the user
+//@is_saved Pass true to display the gift on the user's profile page; pass false to remove it from the profile page
+toggleGiftIsSaved sender_user_id:int53 message_id:int53 is_saved:Bool = Ok;
+
+//@description Returns gifts saved to profile by the given user
+//@user_id Identifier of the user
+//@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results
+//@limit The maximum number of gifts to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned objects is chosen by TDLib and can be smaller than the specified limit
+getUserGifts user_id:int53 offset:string limit:int32 = UserGifts;
+
+
//@description Creates a link for the given invoice; for bots only @invoice Information about the invoice of the type inputMessageInvoice
createInvoiceLink invoice:InputMessageContent = HttpUrl;
-//@description Refunds a previously done payment in Telegram Stars
+//@description Refunds a previously done payment in Telegram Stars; for bots only
//@user_id Identifier of the user that did the payment
//@telegram_payment_charge_id Telegram payment identifier
refundStarPayment user_id:int53 telegram_payment_charge_id:string = Ok;
@@ -11285,10 +11415,10 @@ removeChatActionBar chat_id:int53 = Ok;
//@description Reports a chat to the Telegram moderators. A chat can be reported only from the chat action bar, or if chat.can_be_reported
//@chat_id Chat identifier
-//@message_ids Identifiers of reported messages; may be empty to report the whole chat. Use messageProperties.can_be_reported to check whether the message can be reported
-//@reason The reason for reporting the chat
-//@text Additional report details; 0-1024 characters
-reportChat chat_id:int53 message_ids:vector reason:ReportReason text:string = Ok;
+//@option_id Option identifier chosen by the user; leave empty for the initial request
+//@message_ids Identifiers of reported messages. Use messageProperties.can_report_chat to check whether the message can be reported
+//@text Additional report details if asked by the server; 0-1024 characters; leave empty for the initial request
+reportChat chat_id:int53 option_id:bytes message_ids:vector text:string = ReportChatResult;
//@description Reports a chat photo to the Telegram moderators. A chat photo can be reported only if chat.can_be_reported
//@chat_id Chat identifier
@@ -11569,6 +11699,9 @@ getPremiumFeatures source:PremiumSource = PremiumFeatures;
//@description Returns examples of premium stickers for demonstration purposes
getPremiumStickerExamples = Stickers;
+//@description Returns the sticker to be used as representation of the Telegram Premium subscription @month_count Number of months the Telegram Premium subscription will be active
+getPremiumInfoSticker month_count:int32 = Sticker;
+
//@description Informs TDLib that the user viewed detailed information about a Premium feature on the Premium features screen @feature The viewed premium feature
viewPremiumFeature feature:PremiumFeature = Ok;
diff --git a/lib/tgchat/ext/td/td/generate/scheme/telegram_api.tl b/lib/tgchat/ext/td/td/generate/scheme/telegram_api.tl
index 1a02c77f..157b6436 100644
--- a/lib/tgchat/ext/td/td/generate/scheme/telegram_api.tl
+++ b/lib/tgchat/ext/td/td/generate/scheme/telegram_api.tl
@@ -148,7 +148,7 @@ messageMediaPhoto#695150d7 flags:# spoiler:flags.3?true photo:flags.0?Photo ttl_
messageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia;
messageMediaContact#70322949 phone_number:string first_name:string last_name:string vcard:string user_id:long = MessageMedia;
messageMediaUnsupported#9f84f49e = MessageMedia;
-messageMediaDocument#4cf4d72d flags:# nopremium:flags.3?true spoiler:flags.4?true video:flags.6?true round:flags.7?true voice:flags.8?true document:flags.0?Document alt_document:flags.5?Document ttl_seconds:flags.2?int = MessageMedia;
+messageMediaDocument#dd570bd5 flags:# nopremium:flags.3?true spoiler:flags.4?true video:flags.6?true round:flags.7?true voice:flags.8?true document:flags.0?Document alt_documents:flags.5?Vector ttl_seconds:flags.2?int = MessageMedia;
messageMediaWebPage#ddf10c3b flags:# force_large_media:flags.0?true force_small_media:flags.1?true manual:flags.3?true safe:flags.4?true webpage:WebPage = MessageMedia;
messageMediaVenue#2ec0533f geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string = MessageMedia;
messageMediaGame#fdb19008 game:Game = MessageMedia;
@@ -207,6 +207,7 @@ messageActionRequestedPeerSentMe#93b31848 button_id:int peers:Vector wallpaper:flags.24?WallPaper stories:flags.25?PeerStories business_work_hours:flags2.0?BusinessWorkHours business_location:flags2.1?BusinessLocation business_greeting_message:flags2.2?BusinessGreetingMessage business_away_message:flags2.3?BusinessAwayMessage business_intro:flags2.4?BusinessIntro birthday:flags2.5?Birthday personal_channel_id:flags2.6?long personal_channel_message:flags2.6?int = UserFull;
+userFull#1f58e369 flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true voice_messages_forbidden:flags.20?true translations_disabled:flags.23?true stories_pinned_available:flags.26?true blocked_my_stories_from:flags.27?true wallpaper_overridden:flags.28?true contact_require_premium:flags.29?true read_dates_private:flags.30?true flags2:# sponsored_enabled:flags2.7?true id:long about:flags.1?string settings:PeerSettings personal_photo:flags.21?Photo profile_photo:flags.2?Photo fallback_photo:flags.22?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int theme_emoticon:flags.15?string private_forward_name:flags.16?string bot_group_admin_rights:flags.17?ChatAdminRights bot_broadcast_admin_rights:flags.18?ChatAdminRights premium_gifts:flags.19?Vector wallpaper:flags.24?WallPaper stories:flags.25?PeerStories business_work_hours:flags2.0?BusinessWorkHours business_location:flags2.1?BusinessLocation business_greeting_message:flags2.2?BusinessGreetingMessage business_away_message:flags2.3?BusinessAwayMessage business_intro:flags2.4?BusinessIntro birthday:flags2.5?Birthday personal_channel_id:flags2.6?long personal_channel_message:flags2.6?int stargifts_count:flags2.8?int = UserFull;
contact#145ade0b user_id:long mutual:Bool = Contact;
@@ -597,7 +598,7 @@ accountDaysTTL#b8d0afdf days:int = AccountDaysTTL;
documentAttributeImageSize#6c37c15c w:int h:int = DocumentAttribute;
documentAttributeAnimated#11b58939 = DocumentAttribute;
documentAttributeSticker#6319d612 flags:# mask:flags.1?true alt:string stickerset:InputStickerSet mask_coords:flags.0?MaskCoords = DocumentAttribute;
-documentAttributeVideo#17399fad flags:# round_message:flags.0?true supports_streaming:flags.1?true nosound:flags.3?true duration:double w:int h:int preload_prefix_size:flags.2?int video_start_ts:flags.4?double = DocumentAttribute;
+documentAttributeVideo#43c57c48 flags:# round_message:flags.0?true supports_streaming:flags.1?true nosound:flags.3?true duration:double w:int h:int preload_prefix_size:flags.2?int video_start_ts:flags.4?double video_codec:flags.5?string = DocumentAttribute;
documentAttributeAudio#9852f9c6 flags:# voice:flags.10?true duration:int title:flags.0?string performer:flags.1?string waveform:flags.2?bytes = DocumentAttribute;
documentAttributeFilename#15590068 file_name:string = DocumentAttribute;
documentAttributeHasStickers#9801d2f7 = DocumentAttribute;
@@ -677,6 +678,7 @@ keyboardButtonWebView#13767230 text:string url:string = KeyboardButton;
keyboardButtonSimpleWebView#a0c0505c text:string url:string = KeyboardButton;
keyboardButtonRequestPeer#53d7bfd8 text:string button_id:int peer_type:RequestPeerType max_quantity:int = KeyboardButton;
inputKeyboardButtonRequestPeer#c9662d05 flags:# name_requested:flags.0?true username_requested:flags.1?true photo_requested:flags.2?true text:string button_id:int peer_type:RequestPeerType max_quantity:int = KeyboardButton;
+keyboardButtonCopy#75d2698e text:string copy_text:string = KeyboardButton;
keyboardButtonRow#77608b83 buttons:Vector = KeyboardButtonRow;
@@ -938,6 +940,7 @@ upload.webFile#21e753bc size:int mime_type:string file_type:storage.FileType mti
payments.paymentForm#a0058751 flags:# can_save_credentials:flags.2?true password_missing:flags.3?true form_id:long bot_id:long title:string description:string photo:flags.5?WebDocument invoice:Invoice provider_id:long url:string native_provider:flags.4?string native_params:flags.4?DataJSON additional_methods:flags.6?Vector saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?Vector users:Vector = payments.PaymentForm;
payments.paymentFormStars#7bf6b15c flags:# form_id:long bot_id:long title:string description:string photo:flags.5?WebDocument invoice:Invoice users:Vector = payments.PaymentForm;
+payments.paymentFormStarGift#b425cfe1 form_id:long invoice:Invoice = payments.PaymentForm;
payments.validatedRequestedInfo#d1451883 flags:# id:flags.0?string shipping_options:flags.1?Vector = payments.ValidatedRequestedInfo;
@@ -1487,6 +1490,7 @@ inputInvoiceSlug#c326caef slug:string = InputInvoice;
inputInvoicePremiumGiftCode#98986c0d purpose:InputStorePaymentPurpose option:PremiumGiftCodeOption = InputInvoice;
inputInvoiceStars#65f00ce3 purpose:InputStorePaymentPurpose = InputInvoice;
inputInvoiceChatInviteSubscription#34e793f1 hash:string = InputInvoice;
+inputInvoiceStarGift#25d8c1d8 flags:# hide_name:flags.0?true user_id:InputUser gift_id:long message:flags.1?TextWithEntities = InputInvoice;
payments.exportedInvoice#aed0cbd9 url:string = payments.ExportedInvoice;
@@ -1844,7 +1848,7 @@ starsTransactionPeerAds#60682812 = StarsTransactionPeer;
starsTopupOption#bd915c0 flags:# extended:flags.1?true stars:long store_product:flags.0?string currency:string amount:long = StarsTopupOption;
-starsTransaction#ee7522d5 flags:# refund:flags.3?true pending:flags.4?true failed:flags.6?true gift:flags.10?true reaction:flags.11?true id:string stars:long date:int peer:StarsTransactionPeer title:flags.0?string description:flags.1?string photo:flags.2?WebDocument transaction_date:flags.5?int transaction_url:flags.5?string bot_payload:flags.7?bytes msg_id:flags.8?int extended_media:flags.9?Vector subscription_period:flags.12?int giveaway_post_id:flags.13?int = StarsTransaction;
+starsTransaction#a9ee4c2 flags:# refund:flags.3?true pending:flags.4?true failed:flags.6?true gift:flags.10?true reaction:flags.11?true id:string stars:long date:int peer:StarsTransactionPeer title:flags.0?string description:flags.1?string photo:flags.2?WebDocument transaction_date:flags.5?int transaction_url:flags.5?string bot_payload:flags.7?bytes msg_id:flags.8?int extended_media:flags.9?Vector subscription_period:flags.12?int giveaway_post_id:flags.13?int stargift:flags.14?StarGift = StarsTransaction;
payments.starsStatus#bbfa316c flags:# balance:long subscriptions:flags.1?Vector subscriptions_next_offset:flags.2?string subscriptions_missing_balance:flags.4?long history:flags.3?Vector next_offset:flags.0?string chats:Vector users:Vector = payments.StarsStatus;
@@ -1882,6 +1886,21 @@ starsGiveawayOption#94ce852a flags:# extended:flags.0?true default:flags.1?true
starsGiveawayWinnersOption#54236209 flags:# default:flags.0?true users:int per_user_stars:long = StarsGiveawayWinnersOption;
+starGift#aea174ee flags:# limited:flags.0?true id:long sticker:Document stars:long availability_remains:flags.0?int availability_total:flags.0?int convert_stars:long = StarGift;
+
+payments.starGiftsNotModified#a388a368 = payments.StarGifts;
+payments.starGifts#901689ea hash:int gifts:Vector = payments.StarGifts;
+
+userStarGift#eea49a6e flags:# name_hidden:flags.0?true unsaved:flags.5?true from_id:flags.1?long date:int gift:StarGift message:flags.2?TextWithEntities msg_id:flags.3?int convert_stars:flags.4?long = UserStarGift;
+
+payments.userStarGifts#6b65b517 flags:# count:int gifts:Vector next_offset:flags.0?string users:Vector = payments.UserStarGifts;
+
+messageReportOption#7903e3d9 text:string option:bytes = MessageReportOption;
+
+reportResultChooseOption#f0e4e0b6 title:string options:Vector = ReportResult;
+reportResultAddComment#6f09ac31 flags:# optional:flags.0?true option:bytes = ReportResult;
+reportResultReported#8db33c4b = ReportResult;
+
---functions---
invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;
@@ -2078,7 +2097,7 @@ messages.sendMedia#7852834e flags:# silent:flags.5?true background:flags.6?true
messages.forwardMessages#d5039208 flags:# silent:flags.5?true background:flags.6?true with_my_score:flags.8?true drop_author:flags.11?true drop_media_captions:flags.12?true noforwards:flags.14?true from_peer:InputPeer id:Vector random_id:Vector to_peer:InputPeer top_msg_id:flags.9?int schedule_date:flags.10?int send_as:flags.13?InputPeer quick_reply_shortcut:flags.17?InputQuickReplyShortcut = Updates;
messages.reportSpam#cf1592db peer:InputPeer = Bool;
messages.getPeerSettings#efd9a6a2 peer:InputPeer = messages.PeerSettings;
-messages.report#8953ab4e peer:InputPeer id:Vector reason:ReportReason message:string = Bool;
+messages.report#fc78af9b peer:InputPeer id:Vector option:bytes message:string = ReportResult;
messages.getChats#49e9528f id:Vector = messages.Chats;
messages.getFullChat#aeb00b34 chat_id:long = messages.ChatFull;
messages.editChatTitle#73783ffd chat_id:long title:string = Updates;
@@ -2382,7 +2401,7 @@ channels.reorderPinnedForumTopics#2950a18f flags:# force:flags.0?true channel:In
channels.toggleAntiSpam#68f3e4eb channel:InputChannel enabled:Bool = Updates;
channels.reportAntiSpamFalsePositive#a850a693 channel:InputChannel msg_id:int = Bool;
channels.toggleParticipantsHidden#6a6e7854 channel:InputChannel enabled:Bool = Updates;
-channels.clickSponsoredMessage#18afbc93 channel:InputChannel random_id:bytes = Bool;
+channels.clickSponsoredMessage#1445d75 flags:# media:flags.0?true fullscreen:flags.1?true channel:InputChannel random_id:bytes = Bool;
channels.updateColor#d8aa3671 flags:# for_profile:flags.1?true channel:InputChannel color:flags.2?int background_emoji_id:flags.0?long = Updates;
channels.toggleViewForumAsMessages#9738bb15 channel:InputChannel enabled:Bool = Updates;
channels.getChannelRecommendations#25a71742 flags:# channel:flags.0?InputChannel = messages.Chats;
@@ -2436,7 +2455,7 @@ payments.launchPrepaidGiveaway#5ff58f20 peer:InputPeer giveaway_id:long purpose:
payments.getStarsTopupOptions#c00ec7d3 = Vector;
payments.getStarsStatus#104fcfa7 peer:InputPeer = payments.StarsStatus;
payments.getStarsTransactions#69da4557 flags:# inbound:flags.0?true outbound:flags.1?true ascending:flags.2?true subscription_id:flags.3?string peer:InputPeer offset:string limit:int = payments.StarsStatus;
-payments.sendStarsForm#2bb731d flags:# form_id:long invoice:InputInvoice = payments.PaymentResult;
+payments.sendStarsForm#7998c914 form_id:long invoice:InputInvoice = payments.PaymentResult;
payments.refundStarsCharge#25ae8f4a user_id:InputUser charge_id:string = Updates;
payments.getStarsRevenueStats#d91ffad6 flags:# dark:flags.0?true peer:InputPeer = payments.StarsRevenueStats;
payments.getStarsRevenueWithdrawalUrl#13bbe8b3 peer:InputPeer stars:long password:InputCheckPasswordSRP = payments.StarsRevenueWithdrawalUrl;
@@ -2447,6 +2466,10 @@ payments.getStarsSubscriptions#32512c5 flags:# missing_balance:flags.0?true peer
payments.changeStarsSubscription#c7770878 flags:# peer:InputPeer subscription_id:string canceled:flags.0?Bool = Bool;
payments.fulfillStarsSubscription#cc5bebb3 peer:InputPeer subscription_id:string = Bool;
payments.getStarsGiveawayOptions#bd1efd3e = Vector;
+payments.getStarGifts#c4563590 hash:int = payments.StarGifts;
+payments.getUserStarGifts#5e72c7e1 user_id:InputUser offset:string limit:int = payments.UserStarGifts;
+payments.saveStarGift#87acf08e flags:# unsave:flags.0?true user_id:InputUser msg_id:int = Bool;
+payments.convertStarGift#421e027 user_id:InputUser msg_id:int = Bool;
stickers.createStickerSet#9021ab67 flags:# masks:flags.0?true emojis:flags.5?true text_color:flags.6?true user_id:InputUser title:string short_name:string thumb:flags.2?InputDocument stickers:Vector software:flags.3?string = messages.StickerSet;
stickers.removeStickerFromSet#f7760f51 sticker:InputDocument = messages.StickerSet;
@@ -2538,7 +2561,7 @@ stories.incrementStoryViews#b2028afb peer:InputPeer id:Vector = Bool;
stories.getStoryViewsList#7ed23c57 flags:# just_contacts:flags.0?true reactions_first:flags.2?true forwards_first:flags.3?true peer:InputPeer q:flags.1?string id:int offset:string limit:int = stories.StoryViewsList;
stories.getStoriesViews#28e16cc8 peer:InputPeer id:Vector = stories.StoryViews;
stories.exportStoryLink#7b8def20 peer:InputPeer id:int = ExportedStoryLink;
-stories.report#1923fa8c peer:InputPeer id:Vector reason:ReportReason message:string = Bool;
+stories.report#19d8eb45 peer:InputPeer id:Vector option:bytes message:string = ReportResult;
stories.activateStealthMode#57bbd166 flags:# past:flags.0?true future:flags.1?true = Updates;
stories.sendReaction#7fd736b2 flags:# add_to_recent:flags.0?true peer:InputPeer story_id:int reaction:Reaction = Updates;
stories.getPeerStories#2c4ada50 peer:InputPeer = stories.PeerStories;
diff --git a/lib/tgchat/ext/td/td/mtproto/TlsInit.cpp b/lib/tgchat/ext/td/td/mtproto/TlsInit.cpp
index be33b4f4..775effb3 100644
--- a/lib/tgchat/ext/td/td/mtproto/TlsInit.cpp
+++ b/lib/tgchat/ext/td/td/mtproto/TlsInit.cpp
@@ -508,14 +508,14 @@ void TlsInit::send_hello() {
Status TlsInit::wait_hello_response() {
auto it = fd_.input_buffer().clone();
- for (auto first : {Slice("\x16\x03\x03"), Slice("\x14\x03\x03\x00\x01\x01\x17\x03\x03")}) {
- if (it.size() < first.size() + 2) {
+ for (auto prefix : {Slice("\x16\x03\x03"), Slice("\x14\x03\x03\x00\x01\x01\x17\x03\x03")}) {
+ if (it.size() < prefix.size() + 2) {
return Status::OK();
}
- string got_first(first.size(), '\0');
- it.advance(first.size(), got_first);
- if (first != got_first) {
+ string response_prefix(prefix.size(), '\0');
+ it.advance(prefix.size(), response_prefix);
+ if (prefix != response_prefix) {
return Status::Error("First part of response to hello is invalid");
}
diff --git a/lib/tgchat/ext/td/td/telegram/AnimationsManager.cpp b/lib/tgchat/ext/td/td/telegram/AnimationsManager.cpp
index 36ae136b..33dba4bf 100644
--- a/lib/tgchat/ext/td/td/telegram/AnimationsManager.cpp
+++ b/lib/tgchat/ext/td/td/telegram/AnimationsManager.cpp
@@ -251,12 +251,11 @@ FileId AnimationsManager::dup_animation(FileId new_id, FileId old_id) {
const Animation *old_animation = get_animation(old_id);
CHECK(old_animation != nullptr);
auto &new_animation = animations_[new_id];
- CHECK(new_animation == nullptr);
+ if (new_animation != nullptr) {
+ return new_id;
+ }
new_animation = make_unique(*old_animation);
new_animation->file_id = new_id;
- new_animation->thumbnail.file_id = td_->file_manager_->dup_file_id(new_animation->thumbnail.file_id, "dup_animation");
- new_animation->animated_thumbnail.file_id =
- td_->file_manager_->dup_file_id(new_animation->animated_thumbnail.file_id, "dup_animation");
return new_id;
}
@@ -273,9 +272,6 @@ void AnimationsManager::merge_animations(FileId new_id, FileId old_id) {
if (new_ == nullptr) {
dup_animation(new_id, old_id);
} else {
- if (old_->thumbnail != new_->thumbnail) {
- // LOG_STATUS(td_->file_manager_->merge(new_->thumbnail.file_id, old_->thumbnail.file_id));
- }
if (new_->file_name.size() == old_->file_name.size() + 4 && new_->file_name == old_->file_name + ".mp4") {
need_merge = false;
}
@@ -306,8 +302,8 @@ void AnimationsManager::create_animation(FileId file_id, string minithumbnail, P
}
tl_object_ptr AnimationsManager::get_input_media(
- FileId file_id, tl_object_ptr input_file,
- tl_object_ptr input_thumbnail, bool has_spoiler) const {
+ FileId file_id, telegram_api::object_ptr input_file,
+ telegram_api::object_ptr input_thumbnail, bool has_spoiler) const {
auto file_view = td_->file_manager_->get_file_view(file_id);
if (file_view.is_encrypted()) {
return nullptr;
@@ -342,7 +338,7 @@ tl_object_ptr AnimationsManager::get_input_media(
if (mime_type == "video/mp4") {
attributes.push_back(make_tl_object(
0, false /*ignored*/, false /*ignored*/, false /*ignored*/, animation->duration, animation->dimensions.width,
- animation->dimensions.height, 0, 0.0));
+ animation->dimensions.height, 0, 0.0, string()));
} else if (animation->dimensions.width != 0 && animation->dimensions.height != 0) {
if (!begins_with(mime_type, "image/")) {
mime_type = "image/gif";
@@ -372,10 +368,9 @@ tl_object_ptr AnimationsManager::get_input_media(
return nullptr;
}
-SecretInputMedia AnimationsManager::get_secret_input_media(FileId animation_file_id,
- tl_object_ptr input_file,
- const string &caption, BufferSlice thumbnail,
- int32 layer) const {
+SecretInputMedia AnimationsManager::get_secret_input_media(
+ FileId animation_file_id, telegram_api::object_ptr input_file,
+ const string &caption, BufferSlice thumbnail, int32 layer) const {
auto *animation = get_animation(animation_file_id);
CHECK(animation != nullptr);
auto file_view = td_->file_manager_->get_file_view(animation_file_id);
@@ -841,7 +836,7 @@ void AnimationsManager::send_update_saved_animations(bool from_database) {
std::sort(new_saved_animation_file_ids.begin(), new_saved_animation_file_ids.end());
if (new_saved_animation_file_ids != saved_animation_file_ids_) {
td_->file_manager_->change_files_source(get_saved_animations_file_source_id(), saved_animation_file_ids_,
- new_saved_animation_file_ids);
+ new_saved_animation_file_ids, "send_update_saved_animations");
saved_animation_file_ids_ = std::move(new_saved_animation_file_ids);
}
diff --git a/lib/tgchat/ext/td/td/telegram/AnimationsManager.h b/lib/tgchat/ext/td/td/telegram/AnimationsManager.h
index 659eb677..852e2921 100644
--- a/lib/tgchat/ext/td/td/telegram/AnimationsManager.h
+++ b/lib/tgchat/ext/td/td/telegram/AnimationsManager.h
@@ -43,13 +43,12 @@ class AnimationsManager final : public Actor {
bool has_stickers, vector &&sticker_file_ids, string file_name, string mime_type,
int32 duration, Dimensions dimensions, bool replace);
- tl_object_ptr get_input_media(FileId file_id,
- tl_object_ptr input_file,
- tl_object_ptr input_thumbnail,
- bool has_spoiler) const;
+ tl_object_ptr get_input_media(
+ FileId file_id, telegram_api::object_ptr input_file,
+ telegram_api::object_ptr input_thumbnail, bool has_spoiler) const;
SecretInputMedia get_secret_input_media(FileId animation_file_id,
- tl_object_ptr input_file,
+ telegram_api::object_ptr input_file,
const string &caption, BufferSlice thumbnail, int32 layer) const;
FileId get_animation_thumbnail_file_id(FileId file_id) const;
diff --git a/lib/tgchat/ext/td/td/telegram/AttachMenuManager.cpp b/lib/tgchat/ext/td/td/telegram/AttachMenuManager.cpp
index f71d0307..75d6a302 100644
--- a/lib/tgchat/ext/td/td/telegram/AttachMenuManager.cpp
+++ b/lib/tgchat/ext/td/td/telegram/AttachMenuManager.cpp
@@ -763,7 +763,7 @@ void AttachMenuManager::init() {
auto file_source_id = get_attach_menu_bot_file_source_id(attach_menu_bot.user_id_);
auto register_file_source = [&](FileId file_id) {
if (file_id.is_valid()) {
- td_->file_manager_->add_file_source(file_id, file_source_id);
+ td_->file_manager_->add_file_source(file_id, file_source_id, "attach_menu_bot");
}
};
register_file_source(attach_menu_bot.default_icon_file_id_);
@@ -895,7 +895,7 @@ void AttachMenuManager::on_get_web_app(UserId bot_user_id, string web_app_short_
if (!file_ids.empty()) {
auto file_source_id = get_web_app_file_source_id(bot_user_id, web_app_short_name);
for (auto file_id : file_ids) {
- td_->file_manager_->add_file_source(file_id, file_source_id);
+ td_->file_manager_->add_file_source(file_id, file_source_id, "on_get_web_app");
}
}
promise.set_value(td_api::make_object(web_app.get_web_app_object(td_),
@@ -1078,7 +1078,7 @@ Result AttachMenuManager::get_attach_menu_bot(
default:
UNREACHABLE();
}
- td_->file_manager_->add_file_source(parsed_document.file_id, file_source_id);
+ td_->file_manager_->add_file_source(parsed_document.file_id, file_source_id, "get_attach_menu_bot");
if (expect_colors) {
if (icon->colors_.empty()) {
LOG(ERROR) << "Have no colors for attachment menu bot icon for " << user_id;
diff --git a/lib/tgchat/ext/td/td/telegram/AudiosManager.cpp b/lib/tgchat/ext/td/td/telegram/AudiosManager.cpp
index 12ecd846..034cdaea 100644
--- a/lib/tgchat/ext/td/td/telegram/AudiosManager.cpp
+++ b/lib/tgchat/ext/td/td/telegram/AudiosManager.cpp
@@ -143,10 +143,11 @@ FileId AudiosManager::dup_audio(FileId new_id, FileId old_id) {
const Audio *old_audio = get_audio(old_id);
CHECK(old_audio != nullptr);
auto &new_audio = audios_[new_id];
- CHECK(new_audio == nullptr);
+ if (new_audio != nullptr) {
+ return new_id;
+ }
new_audio = make_unique