From bbbea000d6065d2e7b38a1c8d8a1dccf53082443 Mon Sep 17 00:00:00 2001 From: GitHub Date: Sun, 6 Oct 2024 07:44:54 +0000 Subject: [PATCH] feat(schema): update TDLib to the latest layer --- _schema/tdapi.tl | 271 ++- tdapi/tl_alternative_video_gen.go | 329 ++++ tdapi/tl_audio_gen.go | 2 +- tdapi/tl_authentication_code_type_gen.go | 2 +- .../tl_auto_download_settings_presets_gen.go | 6 +- tdapi/tl_click_chat_sponsored_message_gen.go | 99 +- tdapi/tl_create_video_chat_gen.go | 2 +- tdapi/tl_edit_business_message_caption_gen.go | 2 +- tdapi/tl_edit_inline_message_caption_gen.go | 2 +- tdapi/tl_edit_message_caption_gen.go | 2 +- tdapi/tl_get_available_gifts_gen.go | 169 ++ tdapi/tl_get_premium_info_sticker_gen.go | 206 ++ tdapi/tl_get_suggested_file_name_gen.go | 2 +- tdapi/tl_get_user_gifts_gen.go | 274 +++ tdapi/tl_gift_gen.go | 365 ++++ tdapi/tl_gifts_gen.go | 221 +++ tdapi/tl_giveaway_info_gen.go | 2 +- tdapi/tl_group_call_gen.go | 2 +- tdapi/tl_inline_keyboard_button_type_gen.go | 181 ++ tdapi/tl_input_file_gen.go | 7 +- tdapi/tl_input_message_content_gen.go | 9 +- tdapi/tl_input_paid_media_type_gen.go | 2 +- tdapi/tl_input_story_content_gen.go | 2 +- tdapi/tl_message_content_gen.go | 471 ++++- tdapi/tl_message_copy_options_gen.go | 6 +- tdapi/tl_message_gen.go | 3 +- tdapi/tl_paid_reactor_gen.go | 2 +- tdapi/tl_premium_payment_option_gen.go | 4 +- tdapi/tl_push_message_content_gen.go | 181 ++ tdapi/tl_registry_gen.go | 1715 +++++++++-------- tdapi/tl_reply_markup_gen.go | 2 +- tdapi/tl_report_chat_gen.go | 127 +- tdapi/tl_report_chat_result_gen.go | 889 +++++++++ ...eport_chat_sponsored_message_option_gen.go | 227 --- ...eport_chat_sponsored_message_result_gen.go | 52 +- tdapi/tl_report_option_gen.go | 227 +++ tdapi/tl_report_story_gen.go | 92 +- tdapi/tl_report_story_result_gen.go | 743 +++++++ tdapi/tl_report_supergroup_spam_gen.go | 4 +- tdapi/tl_sell_gift_gen.go | 237 +++ tdapi/tl_send_gift_gen.go | 307 +++ tdapi/tl_sponsored_message_gen.go | 3 +- tdapi/tl_star_transaction_partner_gen.go | 78 +- tdapi/tl_story_content_gen.go | 3 +- tdapi/tl_story_video_gen.go | 2 +- tdapi/tl_toggle_gift_is_saved_gen.go | 272 +++ tdapi/tl_update_gen.go | 10 +- tdapi/tl_user_full_info_gen.go | 178 +- tdapi/tl_user_gift_gen.go | 435 +++++ tdapi/tl_user_gifts_gen.go | 289 +++ tdapi/tl_user_transaction_purpose_gen.go | 682 +++++++ tdapi/tl_video_gen.go | 2 +- 52 files changed, 7963 insertions(+), 1439 deletions(-) create mode 100644 tdapi/tl_alternative_video_gen.go create mode 100644 tdapi/tl_get_available_gifts_gen.go create mode 100644 tdapi/tl_get_premium_info_sticker_gen.go create mode 100644 tdapi/tl_get_user_gifts_gen.go create mode 100644 tdapi/tl_gift_gen.go create mode 100644 tdapi/tl_gifts_gen.go create mode 100644 tdapi/tl_report_chat_result_gen.go delete mode 100644 tdapi/tl_report_chat_sponsored_message_option_gen.go create mode 100644 tdapi/tl_report_option_gen.go create mode 100644 tdapi/tl_report_story_result_gen.go create mode 100644 tdapi/tl_sell_gift_gen.go create mode 100644 tdapi/tl_send_gift_gen.go create mode 100644 tdapi/tl_toggle_gift_is_saved_gen.go create mode 100644 tdapi/tl_user_gift_gen.go create mode 100644 tdapi/tl_user_gifts_gen.go create mode 100644 tdapi/tl_user_transaction_purpose_gen.go diff --git a/_schema/tdapi.tl b/_schema/tdapi.tl index eadec73893..f013e0f570 100644 --- a/_schema/tdapi.tl +++ b/_schema/tdapi.tl @@ -1,7 +1,7 @@ // Code generated by ./cmd/dltl, DO NOT EDIT. // // Source: https://raw.githubusercontent.com/tdlib/td/master/td/generate/scheme/td_api.tl -// SHA256: e7ace9ca079e7c195546d81cd1bd921d5725316b31a16aaa9800e6cbea5ba8c1 +// SHA256: a624d4bf3c7a0a3cb3dc9f91e3b51cbd955292befe703c7ca29ab2912568c84e double#2210c154 ? = Double; @@ -70,7 +70,7 @@ authenticationCodeTypeFirebaseAndroid#6f9bb51e device_verification_parameters:Fi //@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#ff55aa93 receipt:string push_timeout:int32 length:int32 = AuthenticationCodeType; @@ -253,10 +253,10 @@ inputFileRemote#f9968b3e id:string = InputFile; //@path Local path to the file inputFileLocal#7a8c8ac7 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#b0862800 original_path:string conversion:string expected_size:int53 = InputFile; //@description Describes an image in JPEG format @@ -403,7 +403,7 @@ animation#cc00db3e duration:int32 width:int32 height:int32 file_name:string mime //@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#a3769600 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; @@ -442,7 +442,7 @@ sticker#849ad6a1 id:int64 set_id:int64 width:int32 height:int32 emoji:string for //@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 @@ -528,6 +528,14 @@ webApp#605ba8f3 short_name:string title:string description:string photo:photo an //@is_closed True, if the poll is closed poll#71d4870c 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#bfda3bb3 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 @@ -843,7 +851,7 @@ productInfo#87e47ca4 title:string description:formattedText photo:photo = Produc //@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#8c0c5fb2 currency:string amount:int53 discount_percentage:int32 month_count:int32 store_product_id:string payment_link:InternalLinkType = PremiumPaymentOption; @@ -911,6 +919,36 @@ starGiveawayPaymentOption#bca2d5e5 currency:string amount:int53 star_count:int53 //@options The list of options starGiveawayPaymentOptions#909fbf18 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#2acb4d76 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#7ea494b8 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#494eb721 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#e274219f total_count:int32 gifts:vector next_offset:string = UserGifts; + //@class StarTransactionDirection @description Describes direction of a transaction with Telegram Stars //@description The transaction is incoming and increases the number of owned Telegram Stars @@ -950,6 +988,20 @@ chatTransactionPurposeReaction#7a5f9888 message_id:int53 = ChatTransactionPurpos //@giveaway_message_id Identifier of the message with giveaway; can be 0 or an identifier of a deleted message chatTransactionPurposeGiveaway#384c8b7f 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#1fb3401 sticker:sticker = UserTransactionPurpose; + +//@description The current user sold a gift received from another user +//@gift The gift +userTransactionPurposeGiftSell#195fcd8e gift:gift = UserTransactionPurpose; + +//@description The current user sent a gift to another user +//@gift The gift +userTransactionPurposeGiftSend#b36e54df 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 @@ -983,10 +1035,10 @@ starTransactionPartnerBusiness#7af9fb52 user_id:int53 media:vector = //@purpose Purpose of the transaction starTransactionPartnerChat#71db4d40 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#2cf89d66 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#6f4d43d1 user_id:int53 purpose:UserTransactionPurpose = StarTransactionPartner; //@description The transaction is a transaction with unknown partner starTransactionPartnerUnsupported#c4b20d73 = StarTransactionPartner; @@ -1037,7 +1089,7 @@ giveawayInfoOngoing#624ee050 creation_date:int32 status:GiveawayParticipantStatu //@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 @@ -1157,10 +1209,11 @@ botInfo#9902b940 short_description:string description:string photo:photo animati //@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#b61c9c5 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#8388276a 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 @@ -1574,7 +1627,7 @@ reactionTypePaid#1a0152ed = 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#9d379008 sender_id:MessageSender star_count:int32 is_top:Bool is_me:Bool is_anonymous:Bool = PaidReactor; @@ -1720,7 +1773,7 @@ factCheck#c185f918 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 @@ -1839,7 +1892,7 @@ messageSponsor#77c251de 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 @@ -1853,10 +1906,10 @@ sponsoredMessage#b78d4c25 message_id:int53 is_recommended:Bool can_be_reported:B //@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#e402a0f messages:vector messages_between:int32 = SponsoredMessages; -//@description Describes an option to report a sponsored message +//@description Describes an option to report an entity to Telegram //@id Unique identifier of the option //@text Text of the option -reportChatSponsoredMessageOption#aabd054a id:bytes text:string = ReportChatSponsoredMessageOption; +reportOption#41f22c20 id:bytes text:string = ReportOption; //@class ReportChatSponsoredMessageResult @description Describes result of sponsored message report @@ -1869,7 +1922,7 @@ reportChatSponsoredMessageResultFailed#7f1f9bc6 = ReportChatSponsoredMessageResu //@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#314c2d73 title:string options:vector = ReportChatSponsoredMessageResult; +reportChatSponsoredMessageResultOptionRequired#34fc24b2 title:string options:vector = ReportChatSponsoredMessageResult; //@description Sponsored messages were hidden for the user in all chats reportChatSponsoredMessageResultAdsHidden#e8eade1e = ReportChatSponsoredMessageResult; @@ -2316,6 +2369,10 @@ inlineKeyboardButtonTypeBuy#511b3c70 = InlineKeyboardButtonType; //@user_id User identifier inlineKeyboardButtonTypeUser#6d77e5a2 user_id:int53 = InlineKeyboardButtonType; +//@description A button that copies specified text to clipboard +//@text The text to copy to clipboard +inlineKeyboardButtonTypeCopyText#41b1306 text:string = InlineKeyboardButtonType; + //@description Represents a single button in an inline keyboard //@text Text of the button //@type Type of the button @@ -2334,7 +2391,7 @@ replyMarkupForceReply#41a6f99f is_personal:Bool input_field_placeholder:string = //@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 @@ -3585,11 +3642,12 @@ messageSticker#e5f0dcca 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#adc2be09 video:video caption:formattedText show_caption_above_media:Bool has_spoiler:Bool is_secret:Bool = MessageContent; +messageVideo#fdcc35d5 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 @@ -3678,7 +3736,7 @@ messageCall#201ede00 is_video:Bool discard_reason:CallDiscardReason duration:int //@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 +//@start_date Point in time (Unix timestamp) when the group call is expected to be started by an administrator messageVideoChatScheduled#916c1db7 group_call_id:int32 start_date:int32 = MessageContent; //@description A newly created video chat @@ -3895,7 +3953,7 @@ messageGiveawayWinners#1d99a27a boosted_chat_id:int53 giveaway_message_id:int53 //@sticker A sticker to be shown in the message; may be null if unknown messageGiftedStars#41bdbea7 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 @@ -3904,6 +3962,15 @@ messageGiftedStars#41bdbea7 gifter_user_id:int53 receiver_user_id:int53 currency //@sticker A sticker to be shown in the message; may be null if unknown messageGiveawayPrizeStars#aa0f5de3 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#982ec167 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#a678fcff = MessageContent; @@ -4034,7 +4101,7 @@ inputPaidMediaTypePhoto#d299fd1a = 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#b053f9fc duration:int32 supports_streaming:Bool = InputPaidMediaType; //@description Describes a paid media to be sent @@ -4079,7 +4146,7 @@ messageSendOptions#828489ae disable_notification:Bool from_background:Bool prote //@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#405c03ba send_copy:Bool replace_caption:Bool new_caption:formattedText new_show_caption_above_media:Bool = MessageCopyOptions; //@class InputMessageContent @description The content of a message to send @@ -4122,7 +4189,7 @@ inputMessageDocument#615b72b9 document:InputFile thumbnail:inputThumbnail disabl //@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#370c4490 star_count:int53 paid_media:vector caption:formattedText show_caption_above_media:Bool payload:string = InputMessageContent; @@ -4147,13 +4214,13 @@ inputMessagePhoto#bc78dbcc photo:InputFile thumbnail:inputThumbnail added_sticke inputMessageSticker#3ff1b6f9 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 @@ -4603,7 +4670,7 @@ inputStoryAreas#b8ba29fe 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#562b0a45 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; @@ -4616,7 +4683,7 @@ storyContentPhoto#d45f0050 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 +//@alternative_video Alternative version of the video in MPEG4 format, encoded with H.264 codec; may be null storyContentVideo#b30162a6 video:storyVideo alternative_video:storyVideo = StoryContent; //@description A story content that is not supported in the current TDLib version @@ -4630,7 +4697,7 @@ storyContentUnsupported#86c7f56e = StoryContent; inputStoryContentPhoto#3286fbe0 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 @@ -5034,7 +5101,7 @@ groupCallRecentSpeaker#6c73a9cc participant_id:MessageSender is_speaking:Bool = //@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 @@ -6530,6 +6597,10 @@ pushMessageContentPremiumGiftCode#18a15025 month_count:int32 = PushMessageConten //@is_pinned True, if the message is a pinned message with the specified content pushMessageContentGiveaway#d63e7f8e 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#84a8cd0b star_count:int53 = PushMessageContent; + //@description A screenshot of a message in the chat has been taken pushMessageContentScreenshotTaken#cc51ff9 = PushMessageContent; @@ -6981,6 +7052,39 @@ reportReasonPersonalDetails#a14b9412 = ReportReason; //@description A custom reason provided by the user reportReasonCustom#adb7da73 = ReportReason; +//@class ReportChatResult @description Describes result of chat report + +//@description The chat was reported successfully +reportChatResultOk#481a557d = 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#2d89acaa 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#8bcc30c1 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#6521790 = ReportChatResult; + +//@class ReportStoryResult @description Describes result of story report + +//@description The story was reported successfully +reportStoryResultOk#ac3c63b3 = 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#bf79aa9b 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#13ed9d91 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 @@ -7016,7 +7120,7 @@ internalLinkTypeAuthenticationCode#f3874ff2 code:string = InternalLinkType; //@background_name Name of the background internalLinkTypeBackground#b0d2908 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, //@bot_username Username of the bot //@administrator_rights Expected administrator rights for the bot internalLinkTypeBotAddToChannel#538ac2c0 bot_username:string administrator_rights:chatAdministratorRights = InternalLinkType; @@ -7027,7 +7131,7 @@ internalLinkTypeBotAddToChannel#538ac2c0 bot_username:string administrator_right //@autostart True, if sendBotStartMessage must be called automatically without showing the START button internalLinkTypeBotStart#3f985fed 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, //@bot_username Username of the bot //@start_parameter The parameter to be passed to sendBotStartMessage //@administrator_rights Expected administrator rights for the bot; may be null @@ -7375,9 +7479,9 @@ networkStatistics#d86acb3c since_date:int32 entries: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 @@ -11900,11 +12006,38 @@ deleteSavedOrderInfo#61197474 = Ok; //@description Deletes saved credentials for all payment provider bots deleteSavedCredentials#314056d2 = Ok; +//@description Returns gifts that can be sent to other users +getAvailableGifts#f6d565eb = 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#32c9796d 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#671b88b4 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#91c2f183 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#b7cdbc7c 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#cebe921 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#9476a055 user_id:int53 telegram_payment_charge_id:string = Ok; @@ -12060,10 +12193,10 @@ removeChatActionBar#9d9839fa 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#d92c3a8a 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#54f7972f 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 @@ -12366,6 +12499,10 @@ getPremiumFeatures#b4dc2649 source:PremiumSource = PremiumFeatures; //@description Returns examples of premium stickers for demonstration purposes getPremiumStickerExamples#5369cb98 = 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#79ce4a9b 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#b8031b2 feature:PremiumFeature = Ok; diff --git a/tdapi/tl_alternative_video_gen.go b/tdapi/tl_alternative_video_gen.go new file mode 100644 index 0000000000..e79f30def1 --- /dev/null +++ b/tdapi/tl_alternative_video_gen.go @@ -0,0 +1,329 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tdapi + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// AlternativeVideo represents TL type `alternativeVideo#bfda3bb3`. +type AlternativeVideo struct { + // Video width + Width int32 + // Video height + Height int32 + // Codec used for video file encoding, for example, "h264", "h265", or "av1" + Codec string + // HLS file describing the video + HlsFile File + // File containing the video + Video File +} + +// AlternativeVideoTypeID is TL type id of AlternativeVideo. +const AlternativeVideoTypeID = 0xbfda3bb3 + +// Ensuring interfaces in compile-time for AlternativeVideo. +var ( + _ bin.Encoder = &AlternativeVideo{} + _ bin.Decoder = &AlternativeVideo{} + _ bin.BareEncoder = &AlternativeVideo{} + _ bin.BareDecoder = &AlternativeVideo{} +) + +func (a *AlternativeVideo) Zero() bool { + if a == nil { + return true + } + if !(a.Width == 0) { + return false + } + if !(a.Height == 0) { + return false + } + if !(a.Codec == "") { + return false + } + if !(a.HlsFile.Zero()) { + return false + } + if !(a.Video.Zero()) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (a *AlternativeVideo) String() string { + if a == nil { + return "AlternativeVideo(nil)" + } + type Alias AlternativeVideo + return fmt.Sprintf("AlternativeVideo%+v", Alias(*a)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*AlternativeVideo) TypeID() uint32 { + return AlternativeVideoTypeID +} + +// TypeName returns name of type in TL schema. +func (*AlternativeVideo) TypeName() string { + return "alternativeVideo" +} + +// TypeInfo returns info about TL type. +func (a *AlternativeVideo) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "alternativeVideo", + ID: AlternativeVideoTypeID, + } + if a == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Width", + SchemaName: "width", + }, + { + Name: "Height", + SchemaName: "height", + }, + { + Name: "Codec", + SchemaName: "codec", + }, + { + Name: "HlsFile", + SchemaName: "hls_file", + }, + { + Name: "Video", + SchemaName: "video", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (a *AlternativeVideo) Encode(b *bin.Buffer) error { + if a == nil { + return fmt.Errorf("can't encode alternativeVideo#bfda3bb3 as nil") + } + b.PutID(AlternativeVideoTypeID) + return a.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (a *AlternativeVideo) EncodeBare(b *bin.Buffer) error { + if a == nil { + return fmt.Errorf("can't encode alternativeVideo#bfda3bb3 as nil") + } + b.PutInt32(a.Width) + b.PutInt32(a.Height) + b.PutString(a.Codec) + if err := a.HlsFile.Encode(b); err != nil { + return fmt.Errorf("unable to encode alternativeVideo#bfda3bb3: field hls_file: %w", err) + } + if err := a.Video.Encode(b); err != nil { + return fmt.Errorf("unable to encode alternativeVideo#bfda3bb3: field video: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (a *AlternativeVideo) Decode(b *bin.Buffer) error { + if a == nil { + return fmt.Errorf("can't decode alternativeVideo#bfda3bb3 to nil") + } + if err := b.ConsumeID(AlternativeVideoTypeID); err != nil { + return fmt.Errorf("unable to decode alternativeVideo#bfda3bb3: %w", err) + } + return a.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (a *AlternativeVideo) DecodeBare(b *bin.Buffer) error { + if a == nil { + return fmt.Errorf("can't decode alternativeVideo#bfda3bb3 to nil") + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode alternativeVideo#bfda3bb3: field width: %w", err) + } + a.Width = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode alternativeVideo#bfda3bb3: field height: %w", err) + } + a.Height = value + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode alternativeVideo#bfda3bb3: field codec: %w", err) + } + a.Codec = value + } + { + if err := a.HlsFile.Decode(b); err != nil { + return fmt.Errorf("unable to decode alternativeVideo#bfda3bb3: field hls_file: %w", err) + } + } + { + if err := a.Video.Decode(b); err != nil { + return fmt.Errorf("unable to decode alternativeVideo#bfda3bb3: field video: %w", err) + } + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (a *AlternativeVideo) EncodeTDLibJSON(b tdjson.Encoder) error { + if a == nil { + return fmt.Errorf("can't encode alternativeVideo#bfda3bb3 as nil") + } + b.ObjStart() + b.PutID("alternativeVideo") + b.Comma() + b.FieldStart("width") + b.PutInt32(a.Width) + b.Comma() + b.FieldStart("height") + b.PutInt32(a.Height) + b.Comma() + b.FieldStart("codec") + b.PutString(a.Codec) + b.Comma() + b.FieldStart("hls_file") + if err := a.HlsFile.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode alternativeVideo#bfda3bb3: field hls_file: %w", err) + } + b.Comma() + b.FieldStart("video") + if err := a.Video.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode alternativeVideo#bfda3bb3: field video: %w", err) + } + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (a *AlternativeVideo) DecodeTDLibJSON(b tdjson.Decoder) error { + if a == nil { + return fmt.Errorf("can't decode alternativeVideo#bfda3bb3 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("alternativeVideo"); err != nil { + return fmt.Errorf("unable to decode alternativeVideo#bfda3bb3: %w", err) + } + case "width": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode alternativeVideo#bfda3bb3: field width: %w", err) + } + a.Width = value + case "height": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode alternativeVideo#bfda3bb3: field height: %w", err) + } + a.Height = value + case "codec": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode alternativeVideo#bfda3bb3: field codec: %w", err) + } + a.Codec = value + case "hls_file": + if err := a.HlsFile.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode alternativeVideo#bfda3bb3: field hls_file: %w", err) + } + case "video": + if err := a.Video.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode alternativeVideo#bfda3bb3: field video: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetWidth returns value of Width field. +func (a *AlternativeVideo) GetWidth() (value int32) { + if a == nil { + return + } + return a.Width +} + +// GetHeight returns value of Height field. +func (a *AlternativeVideo) GetHeight() (value int32) { + if a == nil { + return + } + return a.Height +} + +// GetCodec returns value of Codec field. +func (a *AlternativeVideo) GetCodec() (value string) { + if a == nil { + return + } + return a.Codec +} + +// GetHlsFile returns value of HlsFile field. +func (a *AlternativeVideo) GetHlsFile() (value File) { + if a == nil { + return + } + return a.HlsFile +} + +// GetVideo returns value of Video field. +func (a *AlternativeVideo) GetVideo() (value File) { + if a == nil { + return + } + return a.Video +} diff --git a/tdapi/tl_audio_gen.go b/tdapi/tl_audio_gen.go index 98447a1056..1ac06068ea 100644 --- a/tdapi/tl_audio_gen.go +++ b/tdapi/tl_audio_gen.go @@ -46,7 +46,7 @@ type Audio struct { // The minithumbnail of the album cover; may be null AlbumCoverMinithumbnail Minithumbnail // 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 + // size thumbnail is expected to be extracted from the downloaded audio file; may be null AlbumCoverThumbnail Thumbnail // Album cover variants to use if the downloaded audio file contains no album cover. // Provided thumbnail dimensions are approximate diff --git a/tdapi/tl_authentication_code_type_gen.go b/tdapi/tl_authentication_code_type_gen.go index aeeb4152a7..df37c7e03d 100644 --- a/tdapi/tl_authentication_code_type_gen.go +++ b/tdapi/tl_authentication_code_type_gen.go @@ -1642,7 +1642,7 @@ type AuthenticationCodeTypeFirebaseIos struct { // Receipt of successful application token validation to compare with receipt from push // notification Receipt string - // Time after the next authentication method is supposed to be used if verification push + // Time after the next authentication method is expected to be used if verification push // notification isn't received, in seconds PushTimeout int32 // Length of the code diff --git a/tdapi/tl_auto_download_settings_presets_gen.go b/tdapi/tl_auto_download_settings_presets_gen.go index bfb4169f3d..7149b492d4 100644 --- a/tdapi/tl_auto_download_settings_presets_gen.go +++ b/tdapi/tl_auto_download_settings_presets_gen.go @@ -33,11 +33,11 @@ var ( // AutoDownloadSettingsPresets represents TL type `autoDownloadSettingsPresets#d1621d22`. type AutoDownloadSettingsPresets struct { - // Preset with lowest settings; supposed to be used by default when roaming + // Preset with lowest settings; expected to be used by default when roaming Low AutoDownloadSettings - // Preset with medium settings; supposed to be used by default when using mobile data + // Preset with medium settings; expected to be used by default when using mobile data Medium AutoDownloadSettings - // Preset with highest settings; supposed to be used by default when connected on Wi-Fi + // Preset with highest settings; expected to be used by default when connected on Wi-Fi High AutoDownloadSettings } diff --git a/tdapi/tl_click_chat_sponsored_message_gen.go b/tdapi/tl_click_chat_sponsored_message_gen.go index 8fb5276c12..649f75df6d 100644 --- a/tdapi/tl_click_chat_sponsored_message_gen.go +++ b/tdapi/tl_click_chat_sponsored_message_gen.go @@ -31,16 +31,21 @@ var ( _ = tdjson.Encoder{} ) -// ClickChatSponsoredMessageRequest represents TL type `clickChatSponsoredMessage#d9c09feb`. +// ClickChatSponsoredMessageRequest represents TL type `clickChatSponsoredMessage#39ef7a17`. type ClickChatSponsoredMessageRequest struct { // Chat identifier of the sponsored message ChatID int64 // Identifier of the sponsored message MessageID int64 + // Pass true if the media was clicked in the sponsored message + IsMediaClick bool + // Pass true if the user expanded the video from the sponsored message fullscreen before + // the click + FromFullscreen bool } // ClickChatSponsoredMessageRequestTypeID is TL type id of ClickChatSponsoredMessageRequest. -const ClickChatSponsoredMessageRequestTypeID = 0xd9c09feb +const ClickChatSponsoredMessageRequestTypeID = 0x39ef7a17 // Ensuring interfaces in compile-time for ClickChatSponsoredMessageRequest. var ( @@ -60,6 +65,12 @@ func (c *ClickChatSponsoredMessageRequest) Zero() bool { if !(c.MessageID == 0) { return false } + if !(c.IsMediaClick == false) { + return false + } + if !(c.FromFullscreen == false) { + return false + } return true } @@ -104,6 +115,14 @@ func (c *ClickChatSponsoredMessageRequest) TypeInfo() tdp.Type { Name: "MessageID", SchemaName: "message_id", }, + { + Name: "IsMediaClick", + SchemaName: "is_media_click", + }, + { + Name: "FromFullscreen", + SchemaName: "from_fullscreen", + }, } return typ } @@ -111,7 +130,7 @@ func (c *ClickChatSponsoredMessageRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (c *ClickChatSponsoredMessageRequest) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode clickChatSponsoredMessage#d9c09feb as nil") + return fmt.Errorf("can't encode clickChatSponsoredMessage#39ef7a17 as nil") } b.PutID(ClickChatSponsoredMessageRequestTypeID) return c.EncodeBare(b) @@ -120,20 +139,22 @@ func (c *ClickChatSponsoredMessageRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (c *ClickChatSponsoredMessageRequest) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode clickChatSponsoredMessage#d9c09feb as nil") + return fmt.Errorf("can't encode clickChatSponsoredMessage#39ef7a17 as nil") } b.PutInt53(c.ChatID) b.PutInt53(c.MessageID) + b.PutBool(c.IsMediaClick) + b.PutBool(c.FromFullscreen) return nil } // Decode implements bin.Decoder. func (c *ClickChatSponsoredMessageRequest) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode clickChatSponsoredMessage#d9c09feb to nil") + return fmt.Errorf("can't decode clickChatSponsoredMessage#39ef7a17 to nil") } if err := b.ConsumeID(ClickChatSponsoredMessageRequestTypeID); err != nil { - return fmt.Errorf("unable to decode clickChatSponsoredMessage#d9c09feb: %w", err) + return fmt.Errorf("unable to decode clickChatSponsoredMessage#39ef7a17: %w", err) } return c.DecodeBare(b) } @@ -141,29 +162,43 @@ func (c *ClickChatSponsoredMessageRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (c *ClickChatSponsoredMessageRequest) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode clickChatSponsoredMessage#d9c09feb to nil") + return fmt.Errorf("can't decode clickChatSponsoredMessage#39ef7a17 to nil") } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode clickChatSponsoredMessage#d9c09feb: field chat_id: %w", err) + return fmt.Errorf("unable to decode clickChatSponsoredMessage#39ef7a17: field chat_id: %w", err) } c.ChatID = value } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode clickChatSponsoredMessage#d9c09feb: field message_id: %w", err) + return fmt.Errorf("unable to decode clickChatSponsoredMessage#39ef7a17: field message_id: %w", err) } c.MessageID = value } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode clickChatSponsoredMessage#39ef7a17: field is_media_click: %w", err) + } + c.IsMediaClick = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode clickChatSponsoredMessage#39ef7a17: field from_fullscreen: %w", err) + } + c.FromFullscreen = value + } return nil } // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (c *ClickChatSponsoredMessageRequest) EncodeTDLibJSON(b tdjson.Encoder) error { if c == nil { - return fmt.Errorf("can't encode clickChatSponsoredMessage#d9c09feb as nil") + return fmt.Errorf("can't encode clickChatSponsoredMessage#39ef7a17 as nil") } b.ObjStart() b.PutID("clickChatSponsoredMessage") @@ -174,6 +209,12 @@ func (c *ClickChatSponsoredMessageRequest) EncodeTDLibJSON(b tdjson.Encoder) err b.FieldStart("message_id") b.PutInt53(c.MessageID) b.Comma() + b.FieldStart("is_media_click") + b.PutBool(c.IsMediaClick) + b.Comma() + b.FieldStart("from_fullscreen") + b.PutBool(c.FromFullscreen) + b.Comma() b.StripComma() b.ObjEnd() return nil @@ -182,27 +223,39 @@ func (c *ClickChatSponsoredMessageRequest) EncodeTDLibJSON(b tdjson.Encoder) err // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (c *ClickChatSponsoredMessageRequest) DecodeTDLibJSON(b tdjson.Decoder) error { if c == nil { - return fmt.Errorf("can't decode clickChatSponsoredMessage#d9c09feb to nil") + return fmt.Errorf("can't decode clickChatSponsoredMessage#39ef7a17 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("clickChatSponsoredMessage"); err != nil { - return fmt.Errorf("unable to decode clickChatSponsoredMessage#d9c09feb: %w", err) + return fmt.Errorf("unable to decode clickChatSponsoredMessage#39ef7a17: %w", err) } case "chat_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode clickChatSponsoredMessage#d9c09feb: field chat_id: %w", err) + return fmt.Errorf("unable to decode clickChatSponsoredMessage#39ef7a17: field chat_id: %w", err) } c.ChatID = value case "message_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode clickChatSponsoredMessage#d9c09feb: field message_id: %w", err) + return fmt.Errorf("unable to decode clickChatSponsoredMessage#39ef7a17: field message_id: %w", err) } c.MessageID = value + case "is_media_click": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode clickChatSponsoredMessage#39ef7a17: field is_media_click: %w", err) + } + c.IsMediaClick = value + case "from_fullscreen": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode clickChatSponsoredMessage#39ef7a17: field from_fullscreen: %w", err) + } + c.FromFullscreen = value default: return b.Skip() } @@ -226,7 +279,23 @@ func (c *ClickChatSponsoredMessageRequest) GetMessageID() (value int64) { return c.MessageID } -// ClickChatSponsoredMessage invokes method clickChatSponsoredMessage#d9c09feb returning error if any. +// GetIsMediaClick returns value of IsMediaClick field. +func (c *ClickChatSponsoredMessageRequest) GetIsMediaClick() (value bool) { + if c == nil { + return + } + return c.IsMediaClick +} + +// GetFromFullscreen returns value of FromFullscreen field. +func (c *ClickChatSponsoredMessageRequest) GetFromFullscreen() (value bool) { + if c == nil { + return + } + return c.FromFullscreen +} + +// ClickChatSponsoredMessage invokes method clickChatSponsoredMessage#39ef7a17 returning error if any. func (c *Client) ClickChatSponsoredMessage(ctx context.Context, request *ClickChatSponsoredMessageRequest) error { var ok Ok diff --git a/tdapi/tl_create_video_chat_gen.go b/tdapi/tl_create_video_chat_gen.go index 4b876e974c..5f013b2d1d 100644 --- a/tdapi/tl_create_video_chat_gen.go +++ b/tdapi/tl_create_video_chat_gen.go @@ -37,7 +37,7 @@ type CreateVideoChatRequest struct { ChatID int64 // Group call title; if empty, chat title will be used Title string - // Point in time (Unix timestamp) when the group call is supposed to be started by an + // 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 StartDate int32 diff --git a/tdapi/tl_edit_business_message_caption_gen.go b/tdapi/tl_edit_business_message_caption_gen.go index 3d485ea881..90ebafe849 100644 --- a/tdapi/tl_edit_business_message_caption_gen.go +++ b/tdapi/tl_edit_business_message_caption_gen.go @@ -45,7 +45,7 @@ type EditBusinessMessageCaptionRequest struct { // 0-getOption("message_caption_length_max") characters Caption FormattedText // 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 + // below the media. May be true only for animation, photo, and video messages ShowCaptionAboveMedia bool } diff --git a/tdapi/tl_edit_inline_message_caption_gen.go b/tdapi/tl_edit_inline_message_caption_gen.go index 7abbf85e8f..793a412f6b 100644 --- a/tdapi/tl_edit_inline_message_caption_gen.go +++ b/tdapi/tl_edit_inline_message_caption_gen.go @@ -41,7 +41,7 @@ type EditInlineMessageCaptionRequest struct { // 0-getOption("message_caption_length_max") characters Caption FormattedText // 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 + // below the media. May be true only for animation, photo, and video messages ShowCaptionAboveMedia bool } diff --git a/tdapi/tl_edit_message_caption_gen.go b/tdapi/tl_edit_message_caption_gen.go index 7fdb6de645..dba48cc480 100644 --- a/tdapi/tl_edit_message_caption_gen.go +++ b/tdapi/tl_edit_message_caption_gen.go @@ -44,7 +44,7 @@ type EditMessageCaptionRequest struct { // pass null to remove caption Caption FormattedText // 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 + // below the media. May be true only for animation, photo, and video messages ShowCaptionAboveMedia bool } diff --git a/tdapi/tl_get_available_gifts_gen.go b/tdapi/tl_get_available_gifts_gen.go new file mode 100644 index 0000000000..7f3cb7422d --- /dev/null +++ b/tdapi/tl_get_available_gifts_gen.go @@ -0,0 +1,169 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tdapi + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// GetAvailableGiftsRequest represents TL type `getAvailableGifts#f6d565eb`. +type GetAvailableGiftsRequest struct { +} + +// GetAvailableGiftsRequestTypeID is TL type id of GetAvailableGiftsRequest. +const GetAvailableGiftsRequestTypeID = 0xf6d565eb + +// Ensuring interfaces in compile-time for GetAvailableGiftsRequest. +var ( + _ bin.Encoder = &GetAvailableGiftsRequest{} + _ bin.Decoder = &GetAvailableGiftsRequest{} + _ bin.BareEncoder = &GetAvailableGiftsRequest{} + _ bin.BareDecoder = &GetAvailableGiftsRequest{} +) + +func (g *GetAvailableGiftsRequest) Zero() bool { + if g == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (g *GetAvailableGiftsRequest) String() string { + if g == nil { + return "GetAvailableGiftsRequest(nil)" + } + type Alias GetAvailableGiftsRequest + return fmt.Sprintf("GetAvailableGiftsRequest%+v", Alias(*g)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*GetAvailableGiftsRequest) TypeID() uint32 { + return GetAvailableGiftsRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*GetAvailableGiftsRequest) TypeName() string { + return "getAvailableGifts" +} + +// TypeInfo returns info about TL type. +func (g *GetAvailableGiftsRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "getAvailableGifts", + ID: GetAvailableGiftsRequestTypeID, + } + if g == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (g *GetAvailableGiftsRequest) Encode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getAvailableGifts#f6d565eb as nil") + } + b.PutID(GetAvailableGiftsRequestTypeID) + return g.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (g *GetAvailableGiftsRequest) EncodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getAvailableGifts#f6d565eb as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (g *GetAvailableGiftsRequest) Decode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getAvailableGifts#f6d565eb to nil") + } + if err := b.ConsumeID(GetAvailableGiftsRequestTypeID); err != nil { + return fmt.Errorf("unable to decode getAvailableGifts#f6d565eb: %w", err) + } + return g.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (g *GetAvailableGiftsRequest) DecodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getAvailableGifts#f6d565eb to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (g *GetAvailableGiftsRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if g == nil { + return fmt.Errorf("can't encode getAvailableGifts#f6d565eb as nil") + } + b.ObjStart() + b.PutID("getAvailableGifts") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (g *GetAvailableGiftsRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if g == nil { + return fmt.Errorf("can't decode getAvailableGifts#f6d565eb to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("getAvailableGifts"); err != nil { + return fmt.Errorf("unable to decode getAvailableGifts#f6d565eb: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetAvailableGifts invokes method getAvailableGifts#f6d565eb returning error if any. +func (c *Client) GetAvailableGifts(ctx context.Context) (*Gifts, error) { + var result Gifts + + request := &GetAvailableGiftsRequest{} + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return &result, nil +} diff --git a/tdapi/tl_get_premium_info_sticker_gen.go b/tdapi/tl_get_premium_info_sticker_gen.go new file mode 100644 index 0000000000..0cc436596d --- /dev/null +++ b/tdapi/tl_get_premium_info_sticker_gen.go @@ -0,0 +1,206 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tdapi + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// GetPremiumInfoStickerRequest represents TL type `getPremiumInfoSticker#79ce4a9b`. +type GetPremiumInfoStickerRequest struct { + // Number of months the Telegram Premium subscription will be active + MonthCount int32 +} + +// GetPremiumInfoStickerRequestTypeID is TL type id of GetPremiumInfoStickerRequest. +const GetPremiumInfoStickerRequestTypeID = 0x79ce4a9b + +// Ensuring interfaces in compile-time for GetPremiumInfoStickerRequest. +var ( + _ bin.Encoder = &GetPremiumInfoStickerRequest{} + _ bin.Decoder = &GetPremiumInfoStickerRequest{} + _ bin.BareEncoder = &GetPremiumInfoStickerRequest{} + _ bin.BareDecoder = &GetPremiumInfoStickerRequest{} +) + +func (g *GetPremiumInfoStickerRequest) Zero() bool { + if g == nil { + return true + } + if !(g.MonthCount == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (g *GetPremiumInfoStickerRequest) String() string { + if g == nil { + return "GetPremiumInfoStickerRequest(nil)" + } + type Alias GetPremiumInfoStickerRequest + return fmt.Sprintf("GetPremiumInfoStickerRequest%+v", Alias(*g)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*GetPremiumInfoStickerRequest) TypeID() uint32 { + return GetPremiumInfoStickerRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*GetPremiumInfoStickerRequest) TypeName() string { + return "getPremiumInfoSticker" +} + +// TypeInfo returns info about TL type. +func (g *GetPremiumInfoStickerRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "getPremiumInfoSticker", + ID: GetPremiumInfoStickerRequestTypeID, + } + if g == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "MonthCount", + SchemaName: "month_count", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (g *GetPremiumInfoStickerRequest) Encode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getPremiumInfoSticker#79ce4a9b as nil") + } + b.PutID(GetPremiumInfoStickerRequestTypeID) + return g.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (g *GetPremiumInfoStickerRequest) EncodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getPremiumInfoSticker#79ce4a9b as nil") + } + b.PutInt32(g.MonthCount) + return nil +} + +// Decode implements bin.Decoder. +func (g *GetPremiumInfoStickerRequest) Decode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getPremiumInfoSticker#79ce4a9b to nil") + } + if err := b.ConsumeID(GetPremiumInfoStickerRequestTypeID); err != nil { + return fmt.Errorf("unable to decode getPremiumInfoSticker#79ce4a9b: %w", err) + } + return g.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (g *GetPremiumInfoStickerRequest) DecodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getPremiumInfoSticker#79ce4a9b to nil") + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode getPremiumInfoSticker#79ce4a9b: field month_count: %w", err) + } + g.MonthCount = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (g *GetPremiumInfoStickerRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if g == nil { + return fmt.Errorf("can't encode getPremiumInfoSticker#79ce4a9b as nil") + } + b.ObjStart() + b.PutID("getPremiumInfoSticker") + b.Comma() + b.FieldStart("month_count") + b.PutInt32(g.MonthCount) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (g *GetPremiumInfoStickerRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if g == nil { + return fmt.Errorf("can't decode getPremiumInfoSticker#79ce4a9b to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("getPremiumInfoSticker"); err != nil { + return fmt.Errorf("unable to decode getPremiumInfoSticker#79ce4a9b: %w", err) + } + case "month_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode getPremiumInfoSticker#79ce4a9b: field month_count: %w", err) + } + g.MonthCount = value + default: + return b.Skip() + } + return nil + }) +} + +// GetMonthCount returns value of MonthCount field. +func (g *GetPremiumInfoStickerRequest) GetMonthCount() (value int32) { + if g == nil { + return + } + return g.MonthCount +} + +// GetPremiumInfoSticker invokes method getPremiumInfoSticker#79ce4a9b returning error if any. +func (c *Client) GetPremiumInfoSticker(ctx context.Context, monthcount int32) (*Sticker, error) { + var result Sticker + + request := &GetPremiumInfoStickerRequest{ + MonthCount: monthcount, + } + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return &result, nil +} diff --git a/tdapi/tl_get_suggested_file_name_gen.go b/tdapi/tl_get_suggested_file_name_gen.go index 3fd320d153..ad02b13460 100644 --- a/tdapi/tl_get_suggested_file_name_gen.go +++ b/tdapi/tl_get_suggested_file_name_gen.go @@ -35,7 +35,7 @@ var ( type GetSuggestedFileNameRequest struct { // Identifier of the file FileID int32 - // Directory in which the file is supposed to be saved + // Directory in which the file is expected to be saved Directory string } diff --git a/tdapi/tl_get_user_gifts_gen.go b/tdapi/tl_get_user_gifts_gen.go new file mode 100644 index 0000000000..b779d91589 --- /dev/null +++ b/tdapi/tl_get_user_gifts_gen.go @@ -0,0 +1,274 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tdapi + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// GetUserGiftsRequest represents TL type `getUserGifts#b7cdbc7c`. +type GetUserGiftsRequest struct { + // Identifier of the user + UserID int64 + // Offset of the first entry to return as received from the previous request; use empty + // string to get the first chunk of results + Offset string + // 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 + Limit int32 +} + +// GetUserGiftsRequestTypeID is TL type id of GetUserGiftsRequest. +const GetUserGiftsRequestTypeID = 0xb7cdbc7c + +// Ensuring interfaces in compile-time for GetUserGiftsRequest. +var ( + _ bin.Encoder = &GetUserGiftsRequest{} + _ bin.Decoder = &GetUserGiftsRequest{} + _ bin.BareEncoder = &GetUserGiftsRequest{} + _ bin.BareDecoder = &GetUserGiftsRequest{} +) + +func (g *GetUserGiftsRequest) Zero() bool { + if g == nil { + return true + } + if !(g.UserID == 0) { + return false + } + if !(g.Offset == "") { + return false + } + if !(g.Limit == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (g *GetUserGiftsRequest) String() string { + if g == nil { + return "GetUserGiftsRequest(nil)" + } + type Alias GetUserGiftsRequest + return fmt.Sprintf("GetUserGiftsRequest%+v", Alias(*g)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*GetUserGiftsRequest) TypeID() uint32 { + return GetUserGiftsRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*GetUserGiftsRequest) TypeName() string { + return "getUserGifts" +} + +// TypeInfo returns info about TL type. +func (g *GetUserGiftsRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "getUserGifts", + ID: GetUserGiftsRequestTypeID, + } + if g == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "UserID", + SchemaName: "user_id", + }, + { + Name: "Offset", + SchemaName: "offset", + }, + { + Name: "Limit", + SchemaName: "limit", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (g *GetUserGiftsRequest) Encode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getUserGifts#b7cdbc7c as nil") + } + b.PutID(GetUserGiftsRequestTypeID) + return g.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (g *GetUserGiftsRequest) EncodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getUserGifts#b7cdbc7c as nil") + } + b.PutInt53(g.UserID) + b.PutString(g.Offset) + b.PutInt32(g.Limit) + return nil +} + +// Decode implements bin.Decoder. +func (g *GetUserGiftsRequest) Decode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getUserGifts#b7cdbc7c to nil") + } + if err := b.ConsumeID(GetUserGiftsRequestTypeID); err != nil { + return fmt.Errorf("unable to decode getUserGifts#b7cdbc7c: %w", err) + } + return g.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (g *GetUserGiftsRequest) DecodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getUserGifts#b7cdbc7c to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode getUserGifts#b7cdbc7c: field user_id: %w", err) + } + g.UserID = value + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode getUserGifts#b7cdbc7c: field offset: %w", err) + } + g.Offset = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode getUserGifts#b7cdbc7c: field limit: %w", err) + } + g.Limit = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (g *GetUserGiftsRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if g == nil { + return fmt.Errorf("can't encode getUserGifts#b7cdbc7c as nil") + } + b.ObjStart() + b.PutID("getUserGifts") + b.Comma() + b.FieldStart("user_id") + b.PutInt53(g.UserID) + b.Comma() + b.FieldStart("offset") + b.PutString(g.Offset) + b.Comma() + b.FieldStart("limit") + b.PutInt32(g.Limit) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (g *GetUserGiftsRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if g == nil { + return fmt.Errorf("can't decode getUserGifts#b7cdbc7c to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("getUserGifts"); err != nil { + return fmt.Errorf("unable to decode getUserGifts#b7cdbc7c: %w", err) + } + case "user_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode getUserGifts#b7cdbc7c: field user_id: %w", err) + } + g.UserID = value + case "offset": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode getUserGifts#b7cdbc7c: field offset: %w", err) + } + g.Offset = value + case "limit": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode getUserGifts#b7cdbc7c: field limit: %w", err) + } + g.Limit = value + default: + return b.Skip() + } + return nil + }) +} + +// GetUserID returns value of UserID field. +func (g *GetUserGiftsRequest) GetUserID() (value int64) { + if g == nil { + return + } + return g.UserID +} + +// GetOffset returns value of Offset field. +func (g *GetUserGiftsRequest) GetOffset() (value string) { + if g == nil { + return + } + return g.Offset +} + +// GetLimit returns value of Limit field. +func (g *GetUserGiftsRequest) GetLimit() (value int32) { + if g == nil { + return + } + return g.Limit +} + +// GetUserGifts invokes method getUserGifts#b7cdbc7c returning error if any. +func (c *Client) GetUserGifts(ctx context.Context, request *GetUserGiftsRequest) (*UserGifts, error) { + var result UserGifts + + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return &result, nil +} diff --git a/tdapi/tl_gift_gen.go b/tdapi/tl_gift_gen.go new file mode 100644 index 0000000000..84b11a4342 --- /dev/null +++ b/tdapi/tl_gift_gen.go @@ -0,0 +1,365 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tdapi + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// Gift represents TL type `gift#2acb4d76`. +type Gift struct { + // Unique identifier of the gift + ID int64 + // The sticker representing the gift + Sticker Sticker + // Number of Telegram Stars that must be paid for the gift + StarCount int64 + // 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 + DefaultSellStarCount int64 + // Number of remaining times the gift can be purchased by all users; 0 if not limited + RemainingCount int32 + // Number of total times the gift can be purchased by all users; 0 if not limited + TotalCount int32 +} + +// GiftTypeID is TL type id of Gift. +const GiftTypeID = 0x2acb4d76 + +// Ensuring interfaces in compile-time for Gift. +var ( + _ bin.Encoder = &Gift{} + _ bin.Decoder = &Gift{} + _ bin.BareEncoder = &Gift{} + _ bin.BareDecoder = &Gift{} +) + +func (g *Gift) Zero() bool { + if g == nil { + return true + } + if !(g.ID == 0) { + return false + } + if !(g.Sticker.Zero()) { + return false + } + if !(g.StarCount == 0) { + return false + } + if !(g.DefaultSellStarCount == 0) { + return false + } + if !(g.RemainingCount == 0) { + return false + } + if !(g.TotalCount == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (g *Gift) String() string { + if g == nil { + return "Gift(nil)" + } + type Alias Gift + return fmt.Sprintf("Gift%+v", Alias(*g)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*Gift) TypeID() uint32 { + return GiftTypeID +} + +// TypeName returns name of type in TL schema. +func (*Gift) TypeName() string { + return "gift" +} + +// TypeInfo returns info about TL type. +func (g *Gift) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "gift", + ID: GiftTypeID, + } + if g == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "ID", + SchemaName: "id", + }, + { + Name: "Sticker", + SchemaName: "sticker", + }, + { + Name: "StarCount", + SchemaName: "star_count", + }, + { + Name: "DefaultSellStarCount", + SchemaName: "default_sell_star_count", + }, + { + Name: "RemainingCount", + SchemaName: "remaining_count", + }, + { + Name: "TotalCount", + SchemaName: "total_count", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (g *Gift) Encode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode gift#2acb4d76 as nil") + } + b.PutID(GiftTypeID) + return g.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (g *Gift) EncodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode gift#2acb4d76 as nil") + } + b.PutLong(g.ID) + if err := g.Sticker.Encode(b); err != nil { + return fmt.Errorf("unable to encode gift#2acb4d76: field sticker: %w", err) + } + b.PutInt53(g.StarCount) + b.PutInt53(g.DefaultSellStarCount) + b.PutInt32(g.RemainingCount) + b.PutInt32(g.TotalCount) + return nil +} + +// Decode implements bin.Decoder. +func (g *Gift) Decode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode gift#2acb4d76 to nil") + } + if err := b.ConsumeID(GiftTypeID); err != nil { + return fmt.Errorf("unable to decode gift#2acb4d76: %w", err) + } + return g.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (g *Gift) DecodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode gift#2acb4d76 to nil") + } + { + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode gift#2acb4d76: field id: %w", err) + } + g.ID = value + } + { + if err := g.Sticker.Decode(b); err != nil { + return fmt.Errorf("unable to decode gift#2acb4d76: field sticker: %w", err) + } + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode gift#2acb4d76: field star_count: %w", err) + } + g.StarCount = value + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode gift#2acb4d76: field default_sell_star_count: %w", err) + } + g.DefaultSellStarCount = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode gift#2acb4d76: field remaining_count: %w", err) + } + g.RemainingCount = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode gift#2acb4d76: field total_count: %w", err) + } + g.TotalCount = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (g *Gift) EncodeTDLibJSON(b tdjson.Encoder) error { + if g == nil { + return fmt.Errorf("can't encode gift#2acb4d76 as nil") + } + b.ObjStart() + b.PutID("gift") + b.Comma() + b.FieldStart("id") + b.PutLong(g.ID) + b.Comma() + b.FieldStart("sticker") + if err := g.Sticker.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode gift#2acb4d76: field sticker: %w", err) + } + b.Comma() + b.FieldStart("star_count") + b.PutInt53(g.StarCount) + b.Comma() + b.FieldStart("default_sell_star_count") + b.PutInt53(g.DefaultSellStarCount) + b.Comma() + b.FieldStart("remaining_count") + b.PutInt32(g.RemainingCount) + b.Comma() + b.FieldStart("total_count") + b.PutInt32(g.TotalCount) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (g *Gift) DecodeTDLibJSON(b tdjson.Decoder) error { + if g == nil { + return fmt.Errorf("can't decode gift#2acb4d76 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("gift"); err != nil { + return fmt.Errorf("unable to decode gift#2acb4d76: %w", err) + } + case "id": + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode gift#2acb4d76: field id: %w", err) + } + g.ID = value + case "sticker": + if err := g.Sticker.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode gift#2acb4d76: field sticker: %w", err) + } + case "star_count": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode gift#2acb4d76: field star_count: %w", err) + } + g.StarCount = value + case "default_sell_star_count": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode gift#2acb4d76: field default_sell_star_count: %w", err) + } + g.DefaultSellStarCount = value + case "remaining_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode gift#2acb4d76: field remaining_count: %w", err) + } + g.RemainingCount = value + case "total_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode gift#2acb4d76: field total_count: %w", err) + } + g.TotalCount = value + default: + return b.Skip() + } + return nil + }) +} + +// GetID returns value of ID field. +func (g *Gift) GetID() (value int64) { + if g == nil { + return + } + return g.ID +} + +// GetSticker returns value of Sticker field. +func (g *Gift) GetSticker() (value Sticker) { + if g == nil { + return + } + return g.Sticker +} + +// GetStarCount returns value of StarCount field. +func (g *Gift) GetStarCount() (value int64) { + if g == nil { + return + } + return g.StarCount +} + +// GetDefaultSellStarCount returns value of DefaultSellStarCount field. +func (g *Gift) GetDefaultSellStarCount() (value int64) { + if g == nil { + return + } + return g.DefaultSellStarCount +} + +// GetRemainingCount returns value of RemainingCount field. +func (g *Gift) GetRemainingCount() (value int32) { + if g == nil { + return + } + return g.RemainingCount +} + +// GetTotalCount returns value of TotalCount field. +func (g *Gift) GetTotalCount() (value int32) { + if g == nil { + return + } + return g.TotalCount +} diff --git a/tdapi/tl_gifts_gen.go b/tdapi/tl_gifts_gen.go new file mode 100644 index 0000000000..04bc3ab4b5 --- /dev/null +++ b/tdapi/tl_gifts_gen.go @@ -0,0 +1,221 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tdapi + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// Gifts represents TL type `gifts#7ea494b8`. +type Gifts struct { + // The list of gifts + Gifts []Gift +} + +// GiftsTypeID is TL type id of Gifts. +const GiftsTypeID = 0x7ea494b8 + +// Ensuring interfaces in compile-time for Gifts. +var ( + _ bin.Encoder = &Gifts{} + _ bin.Decoder = &Gifts{} + _ bin.BareEncoder = &Gifts{} + _ bin.BareDecoder = &Gifts{} +) + +func (g *Gifts) Zero() bool { + if g == nil { + return true + } + if !(g.Gifts == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (g *Gifts) String() string { + if g == nil { + return "Gifts(nil)" + } + type Alias Gifts + return fmt.Sprintf("Gifts%+v", Alias(*g)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*Gifts) TypeID() uint32 { + return GiftsTypeID +} + +// TypeName returns name of type in TL schema. +func (*Gifts) TypeName() string { + return "gifts" +} + +// TypeInfo returns info about TL type. +func (g *Gifts) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "gifts", + ID: GiftsTypeID, + } + if g == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Gifts", + SchemaName: "gifts", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (g *Gifts) Encode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode gifts#7ea494b8 as nil") + } + b.PutID(GiftsTypeID) + return g.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (g *Gifts) EncodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode gifts#7ea494b8 as nil") + } + b.PutInt(len(g.Gifts)) + for idx, v := range g.Gifts { + if err := v.EncodeBare(b); err != nil { + return fmt.Errorf("unable to encode bare gifts#7ea494b8: field gifts element with index %d: %w", idx, err) + } + } + return nil +} + +// Decode implements bin.Decoder. +func (g *Gifts) Decode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode gifts#7ea494b8 to nil") + } + if err := b.ConsumeID(GiftsTypeID); err != nil { + return fmt.Errorf("unable to decode gifts#7ea494b8: %w", err) + } + return g.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (g *Gifts) DecodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode gifts#7ea494b8 to nil") + } + { + headerLen, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode gifts#7ea494b8: field gifts: %w", err) + } + + if headerLen > 0 { + g.Gifts = make([]Gift, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + var value Gift + if err := value.DecodeBare(b); err != nil { + return fmt.Errorf("unable to decode bare gifts#7ea494b8: field gifts: %w", err) + } + g.Gifts = append(g.Gifts, value) + } + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (g *Gifts) EncodeTDLibJSON(b tdjson.Encoder) error { + if g == nil { + return fmt.Errorf("can't encode gifts#7ea494b8 as nil") + } + b.ObjStart() + b.PutID("gifts") + b.Comma() + b.FieldStart("gifts") + b.ArrStart() + for idx, v := range g.Gifts { + if err := v.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode gifts#7ea494b8: field gifts element with index %d: %w", idx, err) + } + b.Comma() + } + b.StripComma() + b.ArrEnd() + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (g *Gifts) DecodeTDLibJSON(b tdjson.Decoder) error { + if g == nil { + return fmt.Errorf("can't decode gifts#7ea494b8 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("gifts"); err != nil { + return fmt.Errorf("unable to decode gifts#7ea494b8: %w", err) + } + case "gifts": + if err := b.Arr(func(b tdjson.Decoder) error { + var value Gift + if err := value.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode gifts#7ea494b8: field gifts: %w", err) + } + g.Gifts = append(g.Gifts, value) + return nil + }); err != nil { + return fmt.Errorf("unable to decode gifts#7ea494b8: field gifts: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetGifts returns value of Gifts field. +func (g *Gifts) GetGifts() (value []Gift) { + if g == nil { + return + } + return g.Gifts +} diff --git a/tdapi/tl_giveaway_info_gen.go b/tdapi/tl_giveaway_info_gen.go index edecfa2ab0..111db14314 100644 --- a/tdapi/tl_giveaway_info_gen.go +++ b/tdapi/tl_giveaway_info_gen.go @@ -284,7 +284,7 @@ type GiveawayInfoCompleted struct { ActualWinnersSelectionDate int32 // True, if the giveaway was canceled and was fully refunded WasRefunded bool - // True, if the cuurent user is a winner of the giveaway + // True, if the current user is a winner of the giveaway IsWinner bool // Number of winners in the giveaway WinnerCount int32 diff --git a/tdapi/tl_group_call_gen.go b/tdapi/tl_group_call_gen.go index a93541b652..b75b930a1f 100644 --- a/tdapi/tl_group_call_gen.go +++ b/tdapi/tl_group_call_gen.go @@ -37,7 +37,7 @@ type GroupCall struct { ID int32 // Group call title Title string - // Point in time (Unix timestamp) when the group call is supposed to be started by an + // 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 ScheduledStartDate int32 // True, if the group call is scheduled and the current user will receive a notification diff --git a/tdapi/tl_inline_keyboard_button_type_gen.go b/tdapi/tl_inline_keyboard_button_type_gen.go index 9a666c691b..b9b40fb341 100644 --- a/tdapi/tl_inline_keyboard_button_type_gen.go +++ b/tdapi/tl_inline_keyboard_button_type_gen.go @@ -1570,6 +1570,172 @@ func (i *InlineKeyboardButtonTypeUser) GetUserID() (value int64) { return i.UserID } +// InlineKeyboardButtonTypeCopyText represents TL type `inlineKeyboardButtonTypeCopyText#41b1306`. +type InlineKeyboardButtonTypeCopyText struct { + // The text to copy to clipboard + Text string +} + +// InlineKeyboardButtonTypeCopyTextTypeID is TL type id of InlineKeyboardButtonTypeCopyText. +const InlineKeyboardButtonTypeCopyTextTypeID = 0x41b1306 + +// construct implements constructor of InlineKeyboardButtonTypeClass. +func (i InlineKeyboardButtonTypeCopyText) construct() InlineKeyboardButtonTypeClass { return &i } + +// Ensuring interfaces in compile-time for InlineKeyboardButtonTypeCopyText. +var ( + _ bin.Encoder = &InlineKeyboardButtonTypeCopyText{} + _ bin.Decoder = &InlineKeyboardButtonTypeCopyText{} + _ bin.BareEncoder = &InlineKeyboardButtonTypeCopyText{} + _ bin.BareDecoder = &InlineKeyboardButtonTypeCopyText{} + + _ InlineKeyboardButtonTypeClass = &InlineKeyboardButtonTypeCopyText{} +) + +func (i *InlineKeyboardButtonTypeCopyText) Zero() bool { + if i == nil { + return true + } + if !(i.Text == "") { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (i *InlineKeyboardButtonTypeCopyText) String() string { + if i == nil { + return "InlineKeyboardButtonTypeCopyText(nil)" + } + type Alias InlineKeyboardButtonTypeCopyText + return fmt.Sprintf("InlineKeyboardButtonTypeCopyText%+v", Alias(*i)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*InlineKeyboardButtonTypeCopyText) TypeID() uint32 { + return InlineKeyboardButtonTypeCopyTextTypeID +} + +// TypeName returns name of type in TL schema. +func (*InlineKeyboardButtonTypeCopyText) TypeName() string { + return "inlineKeyboardButtonTypeCopyText" +} + +// TypeInfo returns info about TL type. +func (i *InlineKeyboardButtonTypeCopyText) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "inlineKeyboardButtonTypeCopyText", + ID: InlineKeyboardButtonTypeCopyTextTypeID, + } + if i == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Text", + SchemaName: "text", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (i *InlineKeyboardButtonTypeCopyText) Encode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode inlineKeyboardButtonTypeCopyText#41b1306 as nil") + } + b.PutID(InlineKeyboardButtonTypeCopyTextTypeID) + return i.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (i *InlineKeyboardButtonTypeCopyText) EncodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode inlineKeyboardButtonTypeCopyText#41b1306 as nil") + } + b.PutString(i.Text) + return nil +} + +// Decode implements bin.Decoder. +func (i *InlineKeyboardButtonTypeCopyText) Decode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode inlineKeyboardButtonTypeCopyText#41b1306 to nil") + } + if err := b.ConsumeID(InlineKeyboardButtonTypeCopyTextTypeID); err != nil { + return fmt.Errorf("unable to decode inlineKeyboardButtonTypeCopyText#41b1306: %w", err) + } + return i.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (i *InlineKeyboardButtonTypeCopyText) DecodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode inlineKeyboardButtonTypeCopyText#41b1306 to nil") + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode inlineKeyboardButtonTypeCopyText#41b1306: field text: %w", err) + } + i.Text = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (i *InlineKeyboardButtonTypeCopyText) EncodeTDLibJSON(b tdjson.Encoder) error { + if i == nil { + return fmt.Errorf("can't encode inlineKeyboardButtonTypeCopyText#41b1306 as nil") + } + b.ObjStart() + b.PutID("inlineKeyboardButtonTypeCopyText") + b.Comma() + b.FieldStart("text") + b.PutString(i.Text) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (i *InlineKeyboardButtonTypeCopyText) DecodeTDLibJSON(b tdjson.Decoder) error { + if i == nil { + return fmt.Errorf("can't decode inlineKeyboardButtonTypeCopyText#41b1306 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("inlineKeyboardButtonTypeCopyText"); err != nil { + return fmt.Errorf("unable to decode inlineKeyboardButtonTypeCopyText#41b1306: %w", err) + } + case "text": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode inlineKeyboardButtonTypeCopyText#41b1306: field text: %w", err) + } + i.Text = value + default: + return b.Skip() + } + return nil + }) +} + +// GetText returns value of Text field. +func (i *InlineKeyboardButtonTypeCopyText) GetText() (value string) { + if i == nil { + return + } + return i.Text +} + // InlineKeyboardButtonTypeClassName is schema name of InlineKeyboardButtonTypeClass. const InlineKeyboardButtonTypeClassName = "InlineKeyboardButtonType" @@ -1591,6 +1757,7 @@ const InlineKeyboardButtonTypeClassName = "InlineKeyboardButtonType" // case *tdapi.InlineKeyboardButtonTypeSwitchInline: // inlineKeyboardButtonTypeSwitchInline#207a9cf5 // case *tdapi.InlineKeyboardButtonTypeBuy: // inlineKeyboardButtonTypeBuy#511b3c70 // case *tdapi.InlineKeyboardButtonTypeUser: // inlineKeyboardButtonTypeUser#6d77e5a2 +// case *tdapi.InlineKeyboardButtonTypeCopyText: // inlineKeyboardButtonTypeCopyText#41b1306 // default: panic(v) // } type InlineKeyboardButtonTypeClass interface { @@ -1685,6 +1852,13 @@ func DecodeInlineKeyboardButtonType(buf *bin.Buffer) (InlineKeyboardButtonTypeCl return nil, fmt.Errorf("unable to decode InlineKeyboardButtonTypeClass: %w", err) } return &v, nil + case InlineKeyboardButtonTypeCopyTextTypeID: + // Decoding inlineKeyboardButtonTypeCopyText#41b1306. + v := InlineKeyboardButtonTypeCopyText{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode InlineKeyboardButtonTypeClass: %w", err) + } + return &v, nil default: return nil, fmt.Errorf("unable to decode InlineKeyboardButtonTypeClass: %w", bin.NewUnexpectedID(id)) } @@ -1760,6 +1934,13 @@ func DecodeTDLibJSONInlineKeyboardButtonType(buf tdjson.Decoder) (InlineKeyboard return nil, fmt.Errorf("unable to decode InlineKeyboardButtonTypeClass: %w", err) } return &v, nil + case "inlineKeyboardButtonTypeCopyText": + // Decoding inlineKeyboardButtonTypeCopyText#41b1306. + v := InlineKeyboardButtonTypeCopyText{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode InlineKeyboardButtonTypeClass: %w", err) + } + return &v, nil default: return nil, fmt.Errorf("unable to decode InlineKeyboardButtonTypeClass: %w", tdjson.NewUnexpectedID(id)) } diff --git a/tdapi/tl_input_file_gen.go b/tdapi/tl_input_file_gen.go index 029a78b00d..32708398d8 100644 --- a/tdapi/tl_input_file_gen.go +++ b/tdapi/tl_input_file_gen.go @@ -531,14 +531,15 @@ func (i *InputFileLocal) GetPath() (value string) { // InputFileGenerated represents TL type `inputFileGenerated#b0862800`. type InputFileGenerated struct { - // Local path to a file from which the file is generated; may be empty if there is no - // such file + // 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 OriginalPath string // String specifying the conversion applied to the original file; must be persistent // across application restarts. Conversions beginning with '#' are reserved for internal // TDLib usage Conversion string - // Expected size of the generated file, in bytes; 0 if unknown + // Expected size of the generated file, in bytes; pass 0 if unknown ExpectedSize int64 } diff --git a/tdapi/tl_input_message_content_gen.go b/tdapi/tl_input_message_content_gen.go index 09c07faa71..71f542ddee 100644 --- a/tdapi/tl_input_message_content_gen.go +++ b/tdapi/tl_input_message_content_gen.go @@ -1380,8 +1380,8 @@ type InputMessagePaidMedia struct { // Message caption; pass null to use an empty caption; // 0-getOption("message_caption_length_max") characters Caption FormattedText - // True, if the caption must be shown above the video; otherwise, the caption must be - // shown below the video; not supported in secret chats + // True, if the caption must be shown above the media; otherwise, the caption must be + // shown below the media; not supported in secret chats ShowCaptionAboveMedia bool // Bot-provided data for the paid media; bots only Payload string @@ -2504,7 +2504,8 @@ func (i *InputMessageSticker) GetEmoji() (value string) { // InputMessageVideo represents TL type `inputMessageVideo#1a64cc26`. type InputMessageVideo struct { - // Video to be sent + // Video to be sent. The video is expected to be reencoded to MPEG4 format with H.264 + // codec by the sender Video InputFileClass // Video thumbnail; pass null to skip thumbnail uploading Thumbnail InputThumbnail @@ -2516,7 +2517,7 @@ type InputMessageVideo struct { Width int32 // Video height Height int32 - // True, if the video is supposed to be streamed + // True, if the video is expected to be streamed SupportsStreaming bool // Video caption; pass null to use an empty caption; // 0-getOption("message_caption_length_max") characters diff --git a/tdapi/tl_input_paid_media_type_gen.go b/tdapi/tl_input_paid_media_type_gen.go index c9bd8b7935..7f5060b1ea 100644 --- a/tdapi/tl_input_paid_media_type_gen.go +++ b/tdapi/tl_input_paid_media_type_gen.go @@ -166,7 +166,7 @@ func (i *InputPaidMediaTypePhoto) DecodeTDLibJSON(b tdjson.Decoder) error { type InputPaidMediaTypeVideo struct { // Duration of the video, in seconds Duration int32 - // True, if the video is supposed to be streamed + // True, if the video is expected to be streamed SupportsStreaming bool } diff --git a/tdapi/tl_input_story_content_gen.go b/tdapi/tl_input_story_content_gen.go index ee9730ccb4..8cf9f85b44 100644 --- a/tdapi/tl_input_story_content_gen.go +++ b/tdapi/tl_input_story_content_gen.go @@ -269,7 +269,7 @@ func (i *InputStoryContentPhoto) GetAddedStickerFileIDs() (value []int32) { // InputStoryContentVideo represents TL type `inputStoryContentVideo#cc1e4239`. type InputStoryContentVideo struct { // 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 + // stored in MPEG4 format, after encoding with H.265 codec and key frames added each // second Video InputFileClass // File identifiers of the stickers added to the video, if applicable diff --git a/tdapi/tl_message_content_gen.go b/tdapi/tl_message_content_gen.go index 07fe73506a..73d6d56c76 100644 --- a/tdapi/tl_message_content_gen.go +++ b/tdapi/tl_message_content_gen.go @@ -1776,10 +1776,12 @@ func (m *MessageSticker) GetIsPremium() (value bool) { return m.IsPremium } -// MessageVideo represents TL type `messageVideo#adc2be09`. +// MessageVideo represents TL type `messageVideo#fdcc35d5`. type MessageVideo struct { // The video description Video Video + // Alternative qualities of the video + AlternativeVideos []AlternativeVideo // Video caption Caption FormattedText // True, if the caption must be shown above the video; otherwise, the caption must be @@ -1793,7 +1795,7 @@ type MessageVideo struct { } // MessageVideoTypeID is TL type id of MessageVideo. -const MessageVideoTypeID = 0xadc2be09 +const MessageVideoTypeID = 0xfdcc35d5 // construct implements constructor of MessageContentClass. func (m MessageVideo) construct() MessageContentClass { return &m } @@ -1815,6 +1817,9 @@ func (m *MessageVideo) Zero() bool { if !(m.Video.Zero()) { return false } + if !(m.AlternativeVideos == nil) { + return false + } if !(m.Caption.Zero()) { return false } @@ -1867,6 +1872,10 @@ func (m *MessageVideo) TypeInfo() tdp.Type { Name: "Video", SchemaName: "video", }, + { + Name: "AlternativeVideos", + SchemaName: "alternative_videos", + }, { Name: "Caption", SchemaName: "caption", @@ -1890,7 +1899,7 @@ func (m *MessageVideo) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (m *MessageVideo) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageVideo#adc2be09 as nil") + return fmt.Errorf("can't encode messageVideo#fdcc35d5 as nil") } b.PutID(MessageVideoTypeID) return m.EncodeBare(b) @@ -1899,13 +1908,19 @@ func (m *MessageVideo) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (m *MessageVideo) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageVideo#adc2be09 as nil") + return fmt.Errorf("can't encode messageVideo#fdcc35d5 as nil") } if err := m.Video.Encode(b); err != nil { - return fmt.Errorf("unable to encode messageVideo#adc2be09: field video: %w", err) + return fmt.Errorf("unable to encode messageVideo#fdcc35d5: field video: %w", err) + } + b.PutInt(len(m.AlternativeVideos)) + for idx, v := range m.AlternativeVideos { + if err := v.EncodeBare(b); err != nil { + return fmt.Errorf("unable to encode bare messageVideo#fdcc35d5: field alternative_videos element with index %d: %w", idx, err) + } } if err := m.Caption.Encode(b); err != nil { - return fmt.Errorf("unable to encode messageVideo#adc2be09: field caption: %w", err) + return fmt.Errorf("unable to encode messageVideo#fdcc35d5: field caption: %w", err) } b.PutBool(m.ShowCaptionAboveMedia) b.PutBool(m.HasSpoiler) @@ -1916,10 +1931,10 @@ func (m *MessageVideo) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (m *MessageVideo) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageVideo#adc2be09 to nil") + return fmt.Errorf("can't decode messageVideo#fdcc35d5 to nil") } if err := b.ConsumeID(MessageVideoTypeID); err != nil { - return fmt.Errorf("unable to decode messageVideo#adc2be09: %w", err) + return fmt.Errorf("unable to decode messageVideo#fdcc35d5: %w", err) } return m.DecodeBare(b) } @@ -1927,36 +1942,53 @@ func (m *MessageVideo) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (m *MessageVideo) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageVideo#adc2be09 to nil") + return fmt.Errorf("can't decode messageVideo#fdcc35d5 to nil") } { if err := m.Video.Decode(b); err != nil { - return fmt.Errorf("unable to decode messageVideo#adc2be09: field video: %w", err) + return fmt.Errorf("unable to decode messageVideo#fdcc35d5: field video: %w", err) + } + } + { + headerLen, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode messageVideo#fdcc35d5: field alternative_videos: %w", err) + } + + if headerLen > 0 { + m.AlternativeVideos = make([]AlternativeVideo, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + var value AlternativeVideo + if err := value.DecodeBare(b); err != nil { + return fmt.Errorf("unable to decode bare messageVideo#fdcc35d5: field alternative_videos: %w", err) + } + m.AlternativeVideos = append(m.AlternativeVideos, value) } } { if err := m.Caption.Decode(b); err != nil { - return fmt.Errorf("unable to decode messageVideo#adc2be09: field caption: %w", err) + return fmt.Errorf("unable to decode messageVideo#fdcc35d5: field caption: %w", err) } } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode messageVideo#adc2be09: field show_caption_above_media: %w", err) + return fmt.Errorf("unable to decode messageVideo#fdcc35d5: field show_caption_above_media: %w", err) } m.ShowCaptionAboveMedia = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode messageVideo#adc2be09: field has_spoiler: %w", err) + return fmt.Errorf("unable to decode messageVideo#fdcc35d5: field has_spoiler: %w", err) } m.HasSpoiler = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode messageVideo#adc2be09: field is_secret: %w", err) + return fmt.Errorf("unable to decode messageVideo#fdcc35d5: field is_secret: %w", err) } m.IsSecret = value } @@ -1966,19 +1998,30 @@ func (m *MessageVideo) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (m *MessageVideo) EncodeTDLibJSON(b tdjson.Encoder) error { if m == nil { - return fmt.Errorf("can't encode messageVideo#adc2be09 as nil") + return fmt.Errorf("can't encode messageVideo#fdcc35d5 as nil") } b.ObjStart() b.PutID("messageVideo") b.Comma() b.FieldStart("video") if err := m.Video.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode messageVideo#adc2be09: field video: %w", err) + return fmt.Errorf("unable to encode messageVideo#fdcc35d5: field video: %w", err) + } + b.Comma() + b.FieldStart("alternative_videos") + b.ArrStart() + for idx, v := range m.AlternativeVideos { + if err := v.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode messageVideo#fdcc35d5: field alternative_videos element with index %d: %w", idx, err) + } + b.Comma() } + b.StripComma() + b.ArrEnd() b.Comma() b.FieldStart("caption") if err := m.Caption.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode messageVideo#adc2be09: field caption: %w", err) + return fmt.Errorf("unable to encode messageVideo#fdcc35d5: field caption: %w", err) } b.Comma() b.FieldStart("show_caption_above_media") @@ -1998,39 +2041,50 @@ func (m *MessageVideo) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (m *MessageVideo) DecodeTDLibJSON(b tdjson.Decoder) error { if m == nil { - return fmt.Errorf("can't decode messageVideo#adc2be09 to nil") + return fmt.Errorf("can't decode messageVideo#fdcc35d5 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("messageVideo"); err != nil { - return fmt.Errorf("unable to decode messageVideo#adc2be09: %w", err) + return fmt.Errorf("unable to decode messageVideo#fdcc35d5: %w", err) } case "video": if err := m.Video.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode messageVideo#adc2be09: field video: %w", err) + return fmt.Errorf("unable to decode messageVideo#fdcc35d5: field video: %w", err) + } + case "alternative_videos": + if err := b.Arr(func(b tdjson.Decoder) error { + var value AlternativeVideo + if err := value.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode messageVideo#fdcc35d5: field alternative_videos: %w", err) + } + m.AlternativeVideos = append(m.AlternativeVideos, value) + return nil + }); err != nil { + return fmt.Errorf("unable to decode messageVideo#fdcc35d5: field alternative_videos: %w", err) } case "caption": if err := m.Caption.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode messageVideo#adc2be09: field caption: %w", err) + return fmt.Errorf("unable to decode messageVideo#fdcc35d5: field caption: %w", err) } case "show_caption_above_media": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode messageVideo#adc2be09: field show_caption_above_media: %w", err) + return fmt.Errorf("unable to decode messageVideo#fdcc35d5: field show_caption_above_media: %w", err) } m.ShowCaptionAboveMedia = value case "has_spoiler": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode messageVideo#adc2be09: field has_spoiler: %w", err) + return fmt.Errorf("unable to decode messageVideo#fdcc35d5: field has_spoiler: %w", err) } m.HasSpoiler = value case "is_secret": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode messageVideo#adc2be09: field is_secret: %w", err) + return fmt.Errorf("unable to decode messageVideo#fdcc35d5: field is_secret: %w", err) } m.IsSecret = value default: @@ -2048,6 +2102,14 @@ func (m *MessageVideo) GetVideo() (value Video) { return m.Video } +// GetAlternativeVideos returns value of AlternativeVideos field. +func (m *MessageVideo) GetAlternativeVideos() (value []AlternativeVideo) { + if m == nil { + return + } + return m.AlternativeVideos +} + // GetCaption returns value of Caption field. func (m *MessageVideo) GetCaption() (value FormattedText) { if m == nil { @@ -5501,7 +5563,7 @@ type MessageVideoChatScheduled struct { // Identifier of the video chat. The video chat can be received through the method // getGroupCall GroupCallID int32 - // Point in time (Unix timestamp) when the group call is supposed to be started by an + // Point in time (Unix timestamp) when the group call is expected to be started by an // administrator StartDate int32 } @@ -14569,6 +14631,344 @@ func (m *MessageGiveawayPrizeStars) GetSticker() (value Sticker) { return m.Sticker } +// MessageGift represents TL type `messageGift#982ec167`. +type MessageGift struct { + // The gift + Gift Gift + // Message added to the gift + Text FormattedText + // Number of Telegram Stars that can be claimed by the receiver instead of the gift + SellStarCount int64 + // True, if the sender and gift text are shown only to the gift receiver; otherwise, + // everyone will be able to see them + IsPrivate bool + // True, if the gift is displayed on the user's profile page; only for the receiver of + // the gift + IsSaved bool + // True, if the gift was converted to Telegram Stars; only for the receiver of the gift + WasConverted bool +} + +// MessageGiftTypeID is TL type id of MessageGift. +const MessageGiftTypeID = 0x982ec167 + +// construct implements constructor of MessageContentClass. +func (m MessageGift) construct() MessageContentClass { return &m } + +// Ensuring interfaces in compile-time for MessageGift. +var ( + _ bin.Encoder = &MessageGift{} + _ bin.Decoder = &MessageGift{} + _ bin.BareEncoder = &MessageGift{} + _ bin.BareDecoder = &MessageGift{} + + _ MessageContentClass = &MessageGift{} +) + +func (m *MessageGift) Zero() bool { + if m == nil { + return true + } + if !(m.Gift.Zero()) { + return false + } + if !(m.Text.Zero()) { + return false + } + if !(m.SellStarCount == 0) { + return false + } + if !(m.IsPrivate == false) { + return false + } + if !(m.IsSaved == false) { + return false + } + if !(m.WasConverted == false) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (m *MessageGift) String() string { + if m == nil { + return "MessageGift(nil)" + } + type Alias MessageGift + return fmt.Sprintf("MessageGift%+v", Alias(*m)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*MessageGift) TypeID() uint32 { + return MessageGiftTypeID +} + +// TypeName returns name of type in TL schema. +func (*MessageGift) TypeName() string { + return "messageGift" +} + +// TypeInfo returns info about TL type. +func (m *MessageGift) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "messageGift", + ID: MessageGiftTypeID, + } + if m == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Gift", + SchemaName: "gift", + }, + { + Name: "Text", + SchemaName: "text", + }, + { + Name: "SellStarCount", + SchemaName: "sell_star_count", + }, + { + Name: "IsPrivate", + SchemaName: "is_private", + }, + { + Name: "IsSaved", + SchemaName: "is_saved", + }, + { + Name: "WasConverted", + SchemaName: "was_converted", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (m *MessageGift) Encode(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't encode messageGift#982ec167 as nil") + } + b.PutID(MessageGiftTypeID) + return m.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (m *MessageGift) EncodeBare(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't encode messageGift#982ec167 as nil") + } + if err := m.Gift.Encode(b); err != nil { + return fmt.Errorf("unable to encode messageGift#982ec167: field gift: %w", err) + } + if err := m.Text.Encode(b); err != nil { + return fmt.Errorf("unable to encode messageGift#982ec167: field text: %w", err) + } + b.PutInt53(m.SellStarCount) + b.PutBool(m.IsPrivate) + b.PutBool(m.IsSaved) + b.PutBool(m.WasConverted) + return nil +} + +// Decode implements bin.Decoder. +func (m *MessageGift) Decode(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't decode messageGift#982ec167 to nil") + } + if err := b.ConsumeID(MessageGiftTypeID); err != nil { + return fmt.Errorf("unable to decode messageGift#982ec167: %w", err) + } + return m.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (m *MessageGift) DecodeBare(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't decode messageGift#982ec167 to nil") + } + { + if err := m.Gift.Decode(b); err != nil { + return fmt.Errorf("unable to decode messageGift#982ec167: field gift: %w", err) + } + } + { + if err := m.Text.Decode(b); err != nil { + return fmt.Errorf("unable to decode messageGift#982ec167: field text: %w", err) + } + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode messageGift#982ec167: field sell_star_count: %w", err) + } + m.SellStarCount = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode messageGift#982ec167: field is_private: %w", err) + } + m.IsPrivate = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode messageGift#982ec167: field is_saved: %w", err) + } + m.IsSaved = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode messageGift#982ec167: field was_converted: %w", err) + } + m.WasConverted = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (m *MessageGift) EncodeTDLibJSON(b tdjson.Encoder) error { + if m == nil { + return fmt.Errorf("can't encode messageGift#982ec167 as nil") + } + b.ObjStart() + b.PutID("messageGift") + b.Comma() + b.FieldStart("gift") + if err := m.Gift.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode messageGift#982ec167: field gift: %w", err) + } + b.Comma() + b.FieldStart("text") + if err := m.Text.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode messageGift#982ec167: field text: %w", err) + } + b.Comma() + b.FieldStart("sell_star_count") + b.PutInt53(m.SellStarCount) + b.Comma() + b.FieldStart("is_private") + b.PutBool(m.IsPrivate) + b.Comma() + b.FieldStart("is_saved") + b.PutBool(m.IsSaved) + b.Comma() + b.FieldStart("was_converted") + b.PutBool(m.WasConverted) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (m *MessageGift) DecodeTDLibJSON(b tdjson.Decoder) error { + if m == nil { + return fmt.Errorf("can't decode messageGift#982ec167 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("messageGift"); err != nil { + return fmt.Errorf("unable to decode messageGift#982ec167: %w", err) + } + case "gift": + if err := m.Gift.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode messageGift#982ec167: field gift: %w", err) + } + case "text": + if err := m.Text.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode messageGift#982ec167: field text: %w", err) + } + case "sell_star_count": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode messageGift#982ec167: field sell_star_count: %w", err) + } + m.SellStarCount = value + case "is_private": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode messageGift#982ec167: field is_private: %w", err) + } + m.IsPrivate = value + case "is_saved": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode messageGift#982ec167: field is_saved: %w", err) + } + m.IsSaved = value + case "was_converted": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode messageGift#982ec167: field was_converted: %w", err) + } + m.WasConverted = value + default: + return b.Skip() + } + return nil + }) +} + +// GetGift returns value of Gift field. +func (m *MessageGift) GetGift() (value Gift) { + if m == nil { + return + } + return m.Gift +} + +// GetText returns value of Text field. +func (m *MessageGift) GetText() (value FormattedText) { + if m == nil { + return + } + return m.Text +} + +// GetSellStarCount returns value of SellStarCount field. +func (m *MessageGift) GetSellStarCount() (value int64) { + if m == nil { + return + } + return m.SellStarCount +} + +// GetIsPrivate returns value of IsPrivate field. +func (m *MessageGift) GetIsPrivate() (value bool) { + if m == nil { + return + } + return m.IsPrivate +} + +// GetIsSaved returns value of IsSaved field. +func (m *MessageGift) GetIsSaved() (value bool) { + if m == nil { + return + } + return m.IsSaved +} + +// GetWasConverted returns value of WasConverted field. +func (m *MessageGift) GetWasConverted() (value bool) { + if m == nil { + return + } + return m.WasConverted +} + // MessageContactRegistered represents TL type `messageContactRegistered#a678fcff`. type MessageContactRegistered struct { } @@ -16502,7 +16902,7 @@ const MessageContentClassName = "MessageContent" // case *tdapi.MessagePaidMedia: // messagePaidMedia#3e5fd7c2 // case *tdapi.MessagePhoto: // messagePhoto#754c7e1f // case *tdapi.MessageSticker: // messageSticker#e5f0dcca -// case *tdapi.MessageVideo: // messageVideo#adc2be09 +// case *tdapi.MessageVideo: // messageVideo#fdcc35d5 // case *tdapi.MessageVideoNote: // messageVideoNote#396b2486 // case *tdapi.MessageVoiceNote: // messageVoiceNote#1f753ff5 // case *tdapi.MessageExpiredPhoto: // messageExpiredPhoto#ac46ddf7 @@ -16558,6 +16958,7 @@ const MessageContentClassName = "MessageContent" // case *tdapi.MessageGiveawayWinners: // messageGiveawayWinners#1d99a27a // case *tdapi.MessageGiftedStars: // messageGiftedStars#41bdbea7 // case *tdapi.MessageGiveawayPrizeStars: // messageGiveawayPrizeStars#aa0f5de3 +// case *tdapi.MessageGift: // messageGift#982ec167 // case *tdapi.MessageContactRegistered: // messageContactRegistered#a678fcff // case *tdapi.MessageUsersShared: // messageUsersShared#7f1f4a22 // case *tdapi.MessageChatShared: // messageChatShared#aec6d961 @@ -16649,7 +17050,7 @@ func DecodeMessageContent(buf *bin.Buffer) (MessageContentClass, error) { } return &v, nil case MessageVideoTypeID: - // Decoding messageVideo#adc2be09. + // Decoding messageVideo#fdcc35d5. v := MessageVideo{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode MessageContentClass: %w", err) @@ -17040,6 +17441,13 @@ func DecodeMessageContent(buf *bin.Buffer) (MessageContentClass, error) { return nil, fmt.Errorf("unable to decode MessageContentClass: %w", err) } return &v, nil + case MessageGiftTypeID: + // Decoding messageGift#982ec167. + v := MessageGift{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode MessageContentClass: %w", err) + } + return &v, nil case MessageContactRegisteredTypeID: // Decoding messageContactRegistered#a678fcff. v := MessageContactRegistered{} @@ -17172,7 +17580,7 @@ func DecodeTDLibJSONMessageContent(buf tdjson.Decoder) (MessageContentClass, err } return &v, nil case "messageVideo": - // Decoding messageVideo#adc2be09. + // Decoding messageVideo#fdcc35d5. v := MessageVideo{} if err := v.DecodeTDLibJSON(buf); err != nil { return nil, fmt.Errorf("unable to decode MessageContentClass: %w", err) @@ -17563,6 +17971,13 @@ func DecodeTDLibJSONMessageContent(buf tdjson.Decoder) (MessageContentClass, err return nil, fmt.Errorf("unable to decode MessageContentClass: %w", err) } return &v, nil + case "messageGift": + // Decoding messageGift#982ec167. + v := MessageGift{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode MessageContentClass: %w", err) + } + return &v, nil case "messageContactRegistered": // Decoding messageContactRegistered#a678fcff. v := MessageContactRegistered{} diff --git a/tdapi/tl_message_copy_options_gen.go b/tdapi/tl_message_copy_options_gen.go index 9d304c0f83..734adc51c4 100644 --- a/tdapi/tl_message_copy_options_gen.go +++ b/tdapi/tl_message_copy_options_gen.go @@ -42,9 +42,9 @@ type MessageCopyOptions struct { // New message caption; pass null to copy message without caption. Ignored if // replace_caption is false NewCaption FormattedText - // 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 + // 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 NewShowCaptionAboveMedia bool } diff --git a/tdapi/tl_message_gen.go b/tdapi/tl_message_gen.go index 949d1b0152..2c248924c6 100644 --- a/tdapi/tl_message_gen.go +++ b/tdapi/tl_message_gen.go @@ -51,7 +51,8 @@ type Message struct { // True, if the message was sent because of a scheduled action by the message sender, for // example, as away, or greeting service message IsFromOffline bool - // True, if content of the message can be saved locally or copied + // True, if content of the message can be saved locally or copied using + // inputMessageForwarded or forwardMessages with copy options CanBeSaved bool // True, if media timestamp entities refers to a media in this message as opposed to a // media in the replied message diff --git a/tdapi/tl_paid_reactor_gen.go b/tdapi/tl_paid_reactor_gen.go index 899ceac36b..af9396d422 100644 --- a/tdapi/tl_paid_reactor_gen.go +++ b/tdapi/tl_paid_reactor_gen.go @@ -38,7 +38,7 @@ type PaidReactor struct { SenderID MessageSenderClass // Number of Telegram Stars added StarCount int32 - // True, if the reactor is one of the most active reactors; can be false if the reactor + // True, if the reactor is one of the most active reactors; may be false if the reactor // is the current user IsTop bool // True, if the paid reaction was added by the current user diff --git a/tdapi/tl_premium_payment_option_gen.go b/tdapi/tl_premium_payment_option_gen.go index 397f4af0a6..1c68c48680 100644 --- a/tdapi/tl_premium_payment_option_gen.go +++ b/tdapi/tl_premium_payment_option_gen.go @@ -39,7 +39,9 @@ type PremiumPaymentOption struct { Amount int64 // The discount associated with this option, as a percentage DiscountPercentage int32 - // Number of months the Telegram Premium subscription will be active + // 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 MonthCount int32 // Identifier of the store product associated with the option StoreProductID string diff --git a/tdapi/tl_push_message_content_gen.go b/tdapi/tl_push_message_content_gen.go index e173ab851e..3e7b81989d 100644 --- a/tdapi/tl_push_message_content_gen.go +++ b/tdapi/tl_push_message_content_gen.go @@ -3110,6 +3110,172 @@ func (p *PushMessageContentGiveaway) GetIsPinned() (value bool) { return p.IsPinned } +// PushMessageContentGift represents TL type `pushMessageContentGift#84a8cd0b`. +type PushMessageContentGift struct { + // Number of Telegram Stars that sender paid for the gift + StarCount int64 +} + +// PushMessageContentGiftTypeID is TL type id of PushMessageContentGift. +const PushMessageContentGiftTypeID = 0x84a8cd0b + +// construct implements constructor of PushMessageContentClass. +func (p PushMessageContentGift) construct() PushMessageContentClass { return &p } + +// Ensuring interfaces in compile-time for PushMessageContentGift. +var ( + _ bin.Encoder = &PushMessageContentGift{} + _ bin.Decoder = &PushMessageContentGift{} + _ bin.BareEncoder = &PushMessageContentGift{} + _ bin.BareDecoder = &PushMessageContentGift{} + + _ PushMessageContentClass = &PushMessageContentGift{} +) + +func (p *PushMessageContentGift) Zero() bool { + if p == nil { + return true + } + if !(p.StarCount == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (p *PushMessageContentGift) String() string { + if p == nil { + return "PushMessageContentGift(nil)" + } + type Alias PushMessageContentGift + return fmt.Sprintf("PushMessageContentGift%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PushMessageContentGift) TypeID() uint32 { + return PushMessageContentGiftTypeID +} + +// TypeName returns name of type in TL schema. +func (*PushMessageContentGift) TypeName() string { + return "pushMessageContentGift" +} + +// TypeInfo returns info about TL type. +func (p *PushMessageContentGift) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "pushMessageContentGift", + ID: PushMessageContentGiftTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "StarCount", + SchemaName: "star_count", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (p *PushMessageContentGift) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode pushMessageContentGift#84a8cd0b as nil") + } + b.PutID(PushMessageContentGiftTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PushMessageContentGift) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode pushMessageContentGift#84a8cd0b as nil") + } + b.PutInt53(p.StarCount) + return nil +} + +// Decode implements bin.Decoder. +func (p *PushMessageContentGift) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode pushMessageContentGift#84a8cd0b to nil") + } + if err := b.ConsumeID(PushMessageContentGiftTypeID); err != nil { + return fmt.Errorf("unable to decode pushMessageContentGift#84a8cd0b: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PushMessageContentGift) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode pushMessageContentGift#84a8cd0b to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode pushMessageContentGift#84a8cd0b: field star_count: %w", err) + } + p.StarCount = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PushMessageContentGift) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode pushMessageContentGift#84a8cd0b as nil") + } + b.ObjStart() + b.PutID("pushMessageContentGift") + b.Comma() + b.FieldStart("star_count") + b.PutInt53(p.StarCount) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PushMessageContentGift) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode pushMessageContentGift#84a8cd0b to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("pushMessageContentGift"); err != nil { + return fmt.Errorf("unable to decode pushMessageContentGift#84a8cd0b: %w", err) + } + case "star_count": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode pushMessageContentGift#84a8cd0b: field star_count: %w", err) + } + p.StarCount = value + default: + return b.Skip() + } + return nil + }) +} + +// GetStarCount returns value of StarCount field. +func (p *PushMessageContentGift) GetStarCount() (value int64) { + if p == nil { + return + } + return p.StarCount +} + // PushMessageContentScreenshotTaken represents TL type `pushMessageContentScreenshotTaken#cc51ff9`. type PushMessageContentScreenshotTaken struct { } @@ -6792,6 +6958,7 @@ const PushMessageContentClassName = "PushMessageContent" // case *tdapi.PushMessageContentPoll: // pushMessageContentPoll#fd5a743a // case *tdapi.PushMessageContentPremiumGiftCode: // pushMessageContentPremiumGiftCode#18a15025 // case *tdapi.PushMessageContentGiveaway: // pushMessageContentGiveaway#d63e7f8e +// case *tdapi.PushMessageContentGift: // pushMessageContentGift#84a8cd0b // case *tdapi.PushMessageContentScreenshotTaken: // pushMessageContentScreenshotTaken#cc51ff9 // case *tdapi.PushMessageContentSticker: // pushMessageContentSticker#5c98bdd3 // case *tdapi.PushMessageContentStory: // pushMessageContentStory#996471c9 @@ -6948,6 +7115,13 @@ func DecodePushMessageContent(buf *bin.Buffer) (PushMessageContentClass, error) return nil, fmt.Errorf("unable to decode PushMessageContentClass: %w", err) } return &v, nil + case PushMessageContentGiftTypeID: + // Decoding pushMessageContentGift#84a8cd0b. + v := PushMessageContentGift{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode PushMessageContentClass: %w", err) + } + return &v, nil case PushMessageContentScreenshotTakenTypeID: // Decoding pushMessageContentScreenshotTaken#cc51ff9. v := PushMessageContentScreenshotTaken{} @@ -7205,6 +7379,13 @@ func DecodeTDLibJSONPushMessageContent(buf tdjson.Decoder) (PushMessageContentCl return nil, fmt.Errorf("unable to decode PushMessageContentClass: %w", err) } return &v, nil + case "pushMessageContentGift": + // Decoding pushMessageContentGift#84a8cd0b. + v := PushMessageContentGift{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode PushMessageContentClass: %w", err) + } + return &v, nil case "pushMessageContentScreenshotTaken": // Decoding pushMessageContentScreenshotTaken#cc51ff9. v := PushMessageContentScreenshotTaken{} diff --git a/tdapi/tl_registry_gen.go b/tdapi/tl_registry_gen.go index 82433d2d68..2904fb1d14 100644 --- a/tdapi/tl_registry_gen.go +++ b/tdapi/tl_registry_gen.go @@ -132,6 +132,7 @@ func TypesMap() map[uint32]string { GameTypeID: "game#a2aedfc8", WebAppTypeID: "webApp#605ba8f3", PollTypeID: "poll#71d4870c", + AlternativeVideoTypeID: "alternativeVideo#bfda3bb3", BackgroundTypeID: "background#e65f291c", BackgroundsTypeID: "backgrounds#b4671319", ChatBackgroundTypeID: "chatBackground#62891968", @@ -190,6 +191,10 @@ func TypesMap() map[uint32]string { StarGiveawayWinnerOptionTypeID: "starGiveawayWinnerOption#cc639607", StarGiveawayPaymentOptionTypeID: "starGiveawayPaymentOption#bca2d5e5", StarGiveawayPaymentOptionsTypeID: "starGiveawayPaymentOptions#909fbf18", + GiftTypeID: "gift#2acb4d76", + GiftsTypeID: "gifts#7ea494b8", + UserGiftTypeID: "userGift#494eb721", + UserGiftsTypeID: "userGifts#e274219f", StarTransactionDirectionIncomingTypeID: "starTransactionDirectionIncoming#b2cabe46", StarTransactionDirectionOutgoingTypeID: "starTransactionDirectionOutgoing#6e83b5a0", BotTransactionPurposePaidMediaTypeID: "botTransactionPurposePaidMedia#62952496", @@ -198,6 +203,9 @@ func TypesMap() map[uint32]string { ChatTransactionPurposeJoinTypeID: "chatTransactionPurposeJoin#5b31327a", ChatTransactionPurposeReactionTypeID: "chatTransactionPurposeReaction#7a5f9888", ChatTransactionPurposeGiveawayTypeID: "chatTransactionPurposeGiveaway#384c8b7f", + UserTransactionPurposeGiftedStarsTypeID: "userTransactionPurposeGiftedStars#1fb3401", + UserTransactionPurposeGiftSellTypeID: "userTransactionPurposeGiftSell#195fcd8e", + UserTransactionPurposeGiftSendTypeID: "userTransactionPurposeGiftSend#b36e54df", StarTransactionPartnerTelegramTypeID: "starTransactionPartnerTelegram#7a899cc0", StarTransactionPartnerAppStoreTypeID: "starTransactionPartnerAppStore#e34026dc", StarTransactionPartnerGooglePlayTypeID: "starTransactionPartnerGooglePlay#f229f2a0", @@ -206,7 +214,7 @@ func TypesMap() map[uint32]string { StarTransactionPartnerBotTypeID: "starTransactionPartnerBot#4ece3a40", StarTransactionPartnerBusinessTypeID: "starTransactionPartnerBusiness#7af9fb52", StarTransactionPartnerChatTypeID: "starTransactionPartnerChat#71db4d40", - StarTransactionPartnerUserTypeID: "starTransactionPartnerUser#2cf89d66", + StarTransactionPartnerUserTypeID: "starTransactionPartnerUser#6f4d43d1", StarTransactionPartnerUnsupportedTypeID: "starTransactionPartnerUnsupported#c4b20d73", StarTransactionTypeID: "starTransaction#ce1084a8", StarTransactionsTypeID: "starTransactions#306a010e", @@ -227,7 +235,7 @@ func TypesMap() map[uint32]string { UsernamesTypeID: "usernames#bf343063", UserTypeID: "user#18552c62", BotInfoTypeID: "botInfo#9902b940", - UserFullInfoTypeID: "userFullInfo#b61c9c5", + UserFullInfoTypeID: "userFullInfo#8388276a", UsersTypeID: "users#9d955a12", FoundUsersTypeID: "foundUsers#c531e854", ChatAdministratorTypeID: "chatAdministrator#7277bd2c", @@ -341,10 +349,10 @@ func TypesMap() map[uint32]string { MessageSponsorTypeID: "messageSponsor#77c251de", SponsoredMessageTypeID: "sponsoredMessage#b78d4c25", SponsoredMessagesTypeID: "sponsoredMessages#e402a0f", - ReportChatSponsoredMessageOptionTypeID: "reportChatSponsoredMessageOption#aabd054a", + ReportOptionTypeID: "reportOption#41f22c20", ReportChatSponsoredMessageResultOkTypeID: "reportChatSponsoredMessageResultOk#754f721f", ReportChatSponsoredMessageResultFailedTypeID: "reportChatSponsoredMessageResultFailed#7f1f9bc6", - ReportChatSponsoredMessageResultOptionRequiredTypeID: "reportChatSponsoredMessageResultOptionRequired#314c2d73", + ReportChatSponsoredMessageResultOptionRequiredTypeID: "reportChatSponsoredMessageResultOptionRequired#34fc24b2", ReportChatSponsoredMessageResultAdsHiddenTypeID: "reportChatSponsoredMessageResultAdsHidden#e8eade1e", ReportChatSponsoredMessageResultPremiumRequiredTypeID: "reportChatSponsoredMessageResultPremiumRequired#770c2ed0", FileDownloadTypeID: "fileDownload#834d1354", @@ -419,6 +427,7 @@ func TypesMap() map[uint32]string { InlineKeyboardButtonTypeSwitchInlineTypeID: "inlineKeyboardButtonTypeSwitchInline#207a9cf5", InlineKeyboardButtonTypeBuyTypeID: "inlineKeyboardButtonTypeBuy#511b3c70", InlineKeyboardButtonTypeUserTypeID: "inlineKeyboardButtonTypeUser#6d77e5a2", + InlineKeyboardButtonTypeCopyTextTypeID: "inlineKeyboardButtonTypeCopyText#41b1306", InlineKeyboardButtonTypeID: "inlineKeyboardButton#e9d21e18", ReplyMarkupRemoveKeyboardTypeID: "replyMarkupRemoveKeyboard#d6cc5171", ReplyMarkupForceReplyTypeID: "replyMarkupForceReply#41a6f99f", @@ -653,7 +662,7 @@ func TypesMap() map[uint32]string { MessagePaidMediaTypeID: "messagePaidMedia#3e5fd7c2", MessagePhotoTypeID: "messagePhoto#754c7e1f", MessageStickerTypeID: "messageSticker#e5f0dcca", - MessageVideoTypeID: "messageVideo#adc2be09", + MessageVideoTypeID: "messageVideo#fdcc35d5", MessageVideoNoteTypeID: "messageVideoNote#396b2486", MessageVoiceNoteTypeID: "messageVoiceNote#1f753ff5", MessageExpiredPhotoTypeID: "messageExpiredPhoto#ac46ddf7", @@ -709,6 +718,7 @@ func TypesMap() map[uint32]string { MessageGiveawayWinnersTypeID: "messageGiveawayWinners#1d99a27a", MessageGiftedStarsTypeID: "messageGiftedStars#41bdbea7", MessageGiveawayPrizeStarsTypeID: "messageGiveawayPrizeStars#aa0f5de3", + MessageGiftTypeID: "messageGift#982ec167", MessageContactRegisteredTypeID: "messageContactRegistered#a678fcff", MessageUsersSharedTypeID: "messageUsersShared#7f1f4a22", MessageChatSharedTypeID: "messageChatShared#aec6d961", @@ -1202,6 +1212,7 @@ func TypesMap() map[uint32]string { PushMessageContentPollTypeID: "pushMessageContentPoll#fd5a743a", PushMessageContentPremiumGiftCodeTypeID: "pushMessageContentPremiumGiftCode#18a15025", PushMessageContentGiveawayTypeID: "pushMessageContentGiveaway#d63e7f8e", + PushMessageContentGiftTypeID: "pushMessageContentGift#84a8cd0b", PushMessageContentScreenshotTakenTypeID: "pushMessageContentScreenshotTaken#cc51ff9", PushMessageContentStickerTypeID: "pushMessageContentSticker#5c98bdd3", PushMessageContentStoryTypeID: "pushMessageContentStory#996471c9", @@ -1309,6 +1320,13 @@ func TypesMap() map[uint32]string { ReportReasonIllegalDrugsTypeID: "reportReasonIllegalDrugs#fc541220", ReportReasonPersonalDetailsTypeID: "reportReasonPersonalDetails#a14b9412", ReportReasonCustomTypeID: "reportReasonCustom#adb7da73", + ReportChatResultOkTypeID: "reportChatResultOk#481a557d", + ReportChatResultOptionRequiredTypeID: "reportChatResultOptionRequired#2d89acaa", + ReportChatResultTextRequiredTypeID: "reportChatResultTextRequired#8bcc30c1", + ReportChatResultMessagesRequiredTypeID: "reportChatResultMessagesRequired#6521790", + ReportStoryResultOkTypeID: "reportStoryResultOk#ac3c63b3", + ReportStoryResultOptionRequiredTypeID: "reportStoryResultOptionRequired#bf79aa9b", + ReportStoryResultTextRequiredTypeID: "reportStoryResultTextRequired#13ed9d91", TargetChatCurrentTypeID: "targetChatCurrent#e729d110", TargetChatChosenTypeID: "targetChatChosen#edaccad2", TargetChatInternalLinkTypeID: "targetChatInternalLink#dd788fe0", @@ -1776,7 +1794,7 @@ func TypesMap() map[uint32]string { GetChatMessagePositionRequestTypeID: "getChatMessagePosition#81bfcc7", GetChatScheduledMessagesRequestTypeID: "getChatScheduledMessages#df3d2ffb", GetChatSponsoredMessagesRequestTypeID: "getChatSponsoredMessages#50a84098", - ClickChatSponsoredMessageRequestTypeID: "clickChatSponsoredMessage#d9c09feb", + ClickChatSponsoredMessageRequestTypeID: "clickChatSponsoredMessage#39ef7a17", ReportChatSponsoredMessageRequestTypeID: "reportChatSponsoredMessage#cc3e53be", RemoveNotificationRequestTypeID: "removeNotification#336ab34e", RemoveNotificationGroupRequestTypeID: "removeNotificationGroup#661a638e", @@ -2023,7 +2041,7 @@ func TypesMap() map[uint32]string { SetStoryReactionRequestTypeID: "setStoryReaction#ac8b4fa7", GetStoryInteractionsRequestTypeID: "getStoryInteractions#1cd1400d", GetChatStoryInteractionsRequestTypeID: "getChatStoryInteractions#c5ec7376", - ReportStoryRequestTypeID: "reportStory#9b5f709b", + ReportStoryRequestTypeID: "reportStory#78de7310", ActivateStoryStealthModeRequestTypeID: "activateStoryStealthMode#c3db8491", GetStoryPublicForwardsRequestTypeID: "getStoryPublicForwards#68f7dcbb", GetChatBoostLevelFeaturesRequestTypeID: "getChatBoostLevelFeatures#45e63e8b", @@ -2279,6 +2297,11 @@ func TypesMap() map[uint32]string { GetSavedOrderInfoRequestTypeID: "getSavedOrderInfo#bb559edd", DeleteSavedOrderInfoRequestTypeID: "deleteSavedOrderInfo#61197474", DeleteSavedCredentialsRequestTypeID: "deleteSavedCredentials#314056d2", + GetAvailableGiftsRequestTypeID: "getAvailableGifts#f6d565eb", + SendGiftRequestTypeID: "sendGift#32c9796d", + SellGiftRequestTypeID: "sellGift#671b88b4", + ToggleGiftIsSavedRequestTypeID: "toggleGiftIsSaved#91c2f183", + GetUserGiftsRequestTypeID: "getUserGifts#b7cdbc7c", CreateInvoiceLinkRequestTypeID: "createInvoiceLink#cebe921", RefundStarPaymentRequestTypeID: "refundStarPayment#9476a055", GetSupportUserRequestTypeID: "getSupportUser#98acec9c", @@ -2317,7 +2340,7 @@ func TypesMap() map[uint32]string { SetDefaultMessageAutoDeleteTimeRequestTypeID: "setDefaultMessageAutoDeleteTime#965cd36c", GetDefaultMessageAutoDeleteTimeRequestTypeID: "getDefaultMessageAutoDeleteTime#e520759a", RemoveChatActionBarRequestTypeID: "removeChatActionBar#9d9839fa", - ReportChatRequestTypeID: "reportChat#d92c3a8a", + ReportChatRequestTypeID: "reportChat#54f7972f", ReportChatPhotoRequestTypeID: "reportChatPhoto#d9701288", ReportMessageReactionsRequestTypeID: "reportMessageReactions#36c88827", GetChatRevenueStatisticsRequestTypeID: "getChatRevenueStatistics#29d79b3c", @@ -2378,6 +2401,7 @@ func TypesMap() map[uint32]string { GetPremiumLimitRequestTypeID: "getPremiumLimit#4017fcea", GetPremiumFeaturesRequestTypeID: "getPremiumFeatures#b4dc2649", GetPremiumStickerExamplesRequestTypeID: "getPremiumStickerExamples#5369cb98", + GetPremiumInfoStickerRequestTypeID: "getPremiumInfoSticker#79ce4a9b", ViewPremiumFeatureRequestTypeID: "viewPremiumFeature#b8031b2", ClickPremiumSubscriptionButtonRequestTypeID: "clickPremiumSubscriptionButton#e9fca306", GetPremiumStateRequestTypeID: "getPremiumState#278e3ae2", @@ -2547,6 +2571,7 @@ func NamesMap() map[string]uint32 { "game": GameTypeID, "webApp": WebAppTypeID, "poll": PollTypeID, + "alternativeVideo": AlternativeVideoTypeID, "background": BackgroundTypeID, "backgrounds": BackgroundsTypeID, "chatBackground": ChatBackgroundTypeID, @@ -2563,809 +2588,818 @@ func NamesMap() map[string]uint32 { "birthdate": BirthdateTypeID, "closeBirthdayUser": CloseBirthdayUserTypeID, "businessAwayMessageScheduleAlways": BusinessAwayMessageScheduleAlwaysTypeID, - "businessAwayMessageScheduleOutsideOfOpeningHours": BusinessAwayMessageScheduleOutsideOfOpeningHoursTypeID, - "businessAwayMessageScheduleCustom": BusinessAwayMessageScheduleCustomTypeID, - "businessLocation": BusinessLocationTypeID, - "businessRecipients": BusinessRecipientsTypeID, - "businessAwayMessageSettings": BusinessAwayMessageSettingsTypeID, - "businessGreetingMessageSettings": BusinessGreetingMessageSettingsTypeID, - "businessConnectedBot": BusinessConnectedBotTypeID, - "businessStartPage": BusinessStartPageTypeID, - "inputBusinessStartPage": InputBusinessStartPageTypeID, - "businessOpeningHoursInterval": BusinessOpeningHoursIntervalTypeID, - "businessOpeningHours": BusinessOpeningHoursTypeID, - "businessInfo": BusinessInfoTypeID, - "businessChatLink": BusinessChatLinkTypeID, - "businessChatLinks": BusinessChatLinksTypeID, - "inputBusinessChatLink": InputBusinessChatLinkTypeID, - "businessChatLinkInfo": BusinessChatLinkInfoTypeID, - "chatPhotoStickerTypeRegularOrMask": ChatPhotoStickerTypeRegularOrMaskTypeID, - "chatPhotoStickerTypeCustomEmoji": ChatPhotoStickerTypeCustomEmojiTypeID, - "chatPhotoSticker": ChatPhotoStickerTypeID, - "animatedChatPhoto": AnimatedChatPhotoTypeID, - "chatPhoto": ChatPhotoTypeID, - "chatPhotos": ChatPhotosTypeID, - "inputChatPhotoPrevious": InputChatPhotoPreviousTypeID, - "inputChatPhotoStatic": InputChatPhotoStaticTypeID, - "inputChatPhotoAnimation": InputChatPhotoAnimationTypeID, - "inputChatPhotoSticker": InputChatPhotoStickerTypeID, - "chatPermissions": ChatPermissionsTypeID, - "chatAdministratorRights": ChatAdministratorRightsTypeID, - "starSubscriptionPricing": StarSubscriptionPricingTypeID, - "starSubscription": StarSubscriptionTypeID, - "starSubscriptions": StarSubscriptionsTypeID, - "productInfo": ProductInfoTypeID, - "premiumPaymentOption": PremiumPaymentOptionTypeID, - "premiumStatePaymentOption": PremiumStatePaymentOptionTypeID, - "premiumGiftCodePaymentOption": PremiumGiftCodePaymentOptionTypeID, - "premiumGiftCodePaymentOptions": PremiumGiftCodePaymentOptionsTypeID, - "premiumGiftCodeInfo": PremiumGiftCodeInfoTypeID, - "starPaymentOption": StarPaymentOptionTypeID, - "starPaymentOptions": StarPaymentOptionsTypeID, - "starGiveawayWinnerOption": StarGiveawayWinnerOptionTypeID, - "starGiveawayPaymentOption": StarGiveawayPaymentOptionTypeID, - "starGiveawayPaymentOptions": StarGiveawayPaymentOptionsTypeID, - "starTransactionDirectionIncoming": StarTransactionDirectionIncomingTypeID, - "starTransactionDirectionOutgoing": StarTransactionDirectionOutgoingTypeID, - "botTransactionPurposePaidMedia": BotTransactionPurposePaidMediaTypeID, - "botTransactionPurposeInvoicePayment": BotTransactionPurposeInvoicePaymentTypeID, - "chatTransactionPurposePaidMedia": ChatTransactionPurposePaidMediaTypeID, - "chatTransactionPurposeJoin": ChatTransactionPurposeJoinTypeID, - "chatTransactionPurposeReaction": ChatTransactionPurposeReactionTypeID, - "chatTransactionPurposeGiveaway": ChatTransactionPurposeGiveawayTypeID, - "starTransactionPartnerTelegram": StarTransactionPartnerTelegramTypeID, - "starTransactionPartnerAppStore": StarTransactionPartnerAppStoreTypeID, - "starTransactionPartnerGooglePlay": StarTransactionPartnerGooglePlayTypeID, - "starTransactionPartnerFragment": StarTransactionPartnerFragmentTypeID, - "starTransactionPartnerTelegramAds": StarTransactionPartnerTelegramAdsTypeID, - "starTransactionPartnerBot": StarTransactionPartnerBotTypeID, - "starTransactionPartnerBusiness": StarTransactionPartnerBusinessTypeID, - "starTransactionPartnerChat": StarTransactionPartnerChatTypeID, - "starTransactionPartnerUser": StarTransactionPartnerUserTypeID, - "starTransactionPartnerUnsupported": StarTransactionPartnerUnsupportedTypeID, - "starTransaction": StarTransactionTypeID, - "starTransactions": StarTransactionsTypeID, - "giveawayParticipantStatusEligible": GiveawayParticipantStatusEligibleTypeID, - "giveawayParticipantStatusParticipating": GiveawayParticipantStatusParticipatingTypeID, - "giveawayParticipantStatusAlreadyWasMember": GiveawayParticipantStatusAlreadyWasMemberTypeID, - "giveawayParticipantStatusAdministrator": GiveawayParticipantStatusAdministratorTypeID, - "giveawayParticipantStatusDisallowedCountry": GiveawayParticipantStatusDisallowedCountryTypeID, - "giveawayInfoOngoing": GiveawayInfoOngoingTypeID, - "giveawayInfoCompleted": GiveawayInfoCompletedTypeID, - "giveawayPrizePremium": GiveawayPrizePremiumTypeID, - "giveawayPrizeStars": GiveawayPrizeStarsTypeID, - "accentColor": AccentColorTypeID, - "profileAccentColors": ProfileAccentColorsTypeID, - "profileAccentColor": ProfileAccentColorTypeID, - "emojiStatus": EmojiStatusTypeID, - "emojiStatuses": EmojiStatusesTypeID, - "usernames": UsernamesTypeID, - "user": UserTypeID, - "botInfo": BotInfoTypeID, - "userFullInfo": UserFullInfoTypeID, - "users": UsersTypeID, - "foundUsers": FoundUsersTypeID, - "chatAdministrator": ChatAdministratorTypeID, - "chatAdministrators": ChatAdministratorsTypeID, - "chatMemberStatusCreator": ChatMemberStatusCreatorTypeID, - "chatMemberStatusAdministrator": ChatMemberStatusAdministratorTypeID, - "chatMemberStatusMember": ChatMemberStatusMemberTypeID, - "chatMemberStatusRestricted": ChatMemberStatusRestrictedTypeID, - "chatMemberStatusLeft": ChatMemberStatusLeftTypeID, - "chatMemberStatusBanned": ChatMemberStatusBannedTypeID, - "chatMember": ChatMemberTypeID, - "chatMembers": ChatMembersTypeID, - "chatMembersFilterContacts": ChatMembersFilterContactsTypeID, - "chatMembersFilterAdministrators": ChatMembersFilterAdministratorsTypeID, - "chatMembersFilterMembers": ChatMembersFilterMembersTypeID, - "chatMembersFilterMention": ChatMembersFilterMentionTypeID, - "chatMembersFilterRestricted": ChatMembersFilterRestrictedTypeID, - "chatMembersFilterBanned": ChatMembersFilterBannedTypeID, - "chatMembersFilterBots": ChatMembersFilterBotsTypeID, - "supergroupMembersFilterRecent": SupergroupMembersFilterRecentTypeID, - "supergroupMembersFilterContacts": SupergroupMembersFilterContactsTypeID, - "supergroupMembersFilterAdministrators": SupergroupMembersFilterAdministratorsTypeID, - "supergroupMembersFilterSearch": SupergroupMembersFilterSearchTypeID, - "supergroupMembersFilterRestricted": SupergroupMembersFilterRestrictedTypeID, - "supergroupMembersFilterBanned": SupergroupMembersFilterBannedTypeID, - "supergroupMembersFilterMention": SupergroupMembersFilterMentionTypeID, - "supergroupMembersFilterBots": SupergroupMembersFilterBotsTypeID, - "chatInviteLink": ChatInviteLinkTypeID, - "chatInviteLinks": ChatInviteLinksTypeID, - "chatInviteLinkCount": ChatInviteLinkCountTypeID, - "chatInviteLinkCounts": ChatInviteLinkCountsTypeID, - "chatInviteLinkMember": ChatInviteLinkMemberTypeID, - "chatInviteLinkMembers": ChatInviteLinkMembersTypeID, - "inviteLinkChatTypeBasicGroup": InviteLinkChatTypeBasicGroupTypeID, - "inviteLinkChatTypeSupergroup": InviteLinkChatTypeSupergroupTypeID, - "inviteLinkChatTypeChannel": InviteLinkChatTypeChannelTypeID, - "chatInviteLinkSubscriptionInfo": ChatInviteLinkSubscriptionInfoTypeID, - "chatInviteLinkInfo": ChatInviteLinkInfoTypeID, - "chatJoinRequest": ChatJoinRequestTypeID, - "chatJoinRequests": ChatJoinRequestsTypeID, - "chatJoinRequestsInfo": ChatJoinRequestsInfoTypeID, - "basicGroup": BasicGroupTypeID, - "basicGroupFullInfo": BasicGroupFullInfoTypeID, - "supergroup": SupergroupTypeID, - "supergroupFullInfo": SupergroupFullInfoTypeID, - "secretChatStatePending": SecretChatStatePendingTypeID, - "secretChatStateReady": SecretChatStateReadyTypeID, - "secretChatStateClosed": SecretChatStateClosedTypeID, - "secretChat": SecretChatTypeID, - "messageSenderUser": MessageSenderUserTypeID, - "messageSenderChat": MessageSenderChatTypeID, - "messageSenders": MessageSendersTypeID, - "chatMessageSender": ChatMessageSenderTypeID, - "chatMessageSenders": ChatMessageSendersTypeID, - "messageReadDateRead": MessageReadDateReadTypeID, - "messageReadDateUnread": MessageReadDateUnreadTypeID, - "messageReadDateTooOld": MessageReadDateTooOldTypeID, - "messageReadDateUserPrivacyRestricted": MessageReadDateUserPrivacyRestrictedTypeID, - "messageReadDateMyPrivacyRestricted": MessageReadDateMyPrivacyRestrictedTypeID, - "messageViewer": MessageViewerTypeID, - "messageViewers": MessageViewersTypeID, - "messageOriginUser": MessageOriginUserTypeID, - "messageOriginHiddenUser": MessageOriginHiddenUserTypeID, - "messageOriginChat": MessageOriginChatTypeID, - "messageOriginChannel": MessageOriginChannelTypeID, - "forwardSource": ForwardSourceTypeID, - "reactionTypeEmoji": ReactionTypeEmojiTypeID, - "reactionTypeCustomEmoji": ReactionTypeCustomEmojiTypeID, - "reactionTypePaid": ReactionTypePaidTypeID, - "paidReactor": PaidReactorTypeID, - "messageForwardInfo": MessageForwardInfoTypeID, - "messageImportInfo": MessageImportInfoTypeID, - "messageReplyInfo": MessageReplyInfoTypeID, - "messageReaction": MessageReactionTypeID, - "messageReactions": MessageReactionsTypeID, - "messageInteractionInfo": MessageInteractionInfoTypeID, - "unreadReaction": UnreadReactionTypeID, - "messageEffectTypeEmojiReaction": MessageEffectTypeEmojiReactionTypeID, - "messageEffectTypePremiumSticker": MessageEffectTypePremiumStickerTypeID, - "messageEffect": MessageEffectTypeID, - "messageSendingStatePending": MessageSendingStatePendingTypeID, - "messageSendingStateFailed": MessageSendingStateFailedTypeID, - "textQuote": TextQuoteTypeID, - "inputTextQuote": InputTextQuoteTypeID, - "messageReplyToMessage": MessageReplyToMessageTypeID, - "messageReplyToStory": MessageReplyToStoryTypeID, - "inputMessageReplyToMessage": InputMessageReplyToMessageTypeID, - "inputMessageReplyToExternalMessage": InputMessageReplyToExternalMessageTypeID, - "inputMessageReplyToStory": InputMessageReplyToStoryTypeID, - "factCheck": FactCheckTypeID, - "message": MessageTypeID, - "messages": MessagesTypeID, - "foundMessages": FoundMessagesTypeID, - "foundChatMessages": FoundChatMessagesTypeID, - "messagePosition": MessagePositionTypeID, - "messagePositions": MessagePositionsTypeID, - "messageCalendarDay": MessageCalendarDayTypeID, - "messageCalendar": MessageCalendarTypeID, - "businessMessage": BusinessMessageTypeID, - "businessMessages": BusinessMessagesTypeID, - "messageSourceChatHistory": MessageSourceChatHistoryTypeID, - "messageSourceMessageThreadHistory": MessageSourceMessageThreadHistoryTypeID, - "messageSourceForumTopicHistory": MessageSourceForumTopicHistoryTypeID, - "messageSourceHistoryPreview": MessageSourceHistoryPreviewTypeID, - "messageSourceChatList": MessageSourceChatListTypeID, - "messageSourceSearch": MessageSourceSearchTypeID, - "messageSourceChatEventLog": MessageSourceChatEventLogTypeID, - "messageSourceNotification": MessageSourceNotificationTypeID, - "messageSourceScreenshot": MessageSourceScreenshotTypeID, - "messageSourceOther": MessageSourceOtherTypeID, - "messageSponsor": MessageSponsorTypeID, - "sponsoredMessage": SponsoredMessageTypeID, - "sponsoredMessages": SponsoredMessagesTypeID, - "reportChatSponsoredMessageOption": ReportChatSponsoredMessageOptionTypeID, - "reportChatSponsoredMessageResultOk": ReportChatSponsoredMessageResultOkTypeID, - "reportChatSponsoredMessageResultFailed": ReportChatSponsoredMessageResultFailedTypeID, - "reportChatSponsoredMessageResultOptionRequired": ReportChatSponsoredMessageResultOptionRequiredTypeID, - "reportChatSponsoredMessageResultAdsHidden": ReportChatSponsoredMessageResultAdsHiddenTypeID, - "reportChatSponsoredMessageResultPremiumRequired": ReportChatSponsoredMessageResultPremiumRequiredTypeID, - "fileDownload": FileDownloadTypeID, - "downloadedFileCounts": DownloadedFileCountsTypeID, - "foundFileDownloads": FoundFileDownloadsTypeID, - "notificationSettingsScopePrivateChats": NotificationSettingsScopePrivateChatsTypeID, - "notificationSettingsScopeGroupChats": NotificationSettingsScopeGroupChatsTypeID, - "notificationSettingsScopeChannelChats": NotificationSettingsScopeChannelChatsTypeID, - "chatNotificationSettings": ChatNotificationSettingsTypeID, - "scopeNotificationSettings": ScopeNotificationSettingsTypeID, - "reactionNotificationSourceNone": ReactionNotificationSourceNoneTypeID, - "reactionNotificationSourceContacts": ReactionNotificationSourceContactsTypeID, - "reactionNotificationSourceAll": ReactionNotificationSourceAllTypeID, - "reactionNotificationSettings": ReactionNotificationSettingsTypeID, - "draftMessage": DraftMessageTypeID, - "chatTypePrivate": ChatTypePrivateTypeID, - "chatTypeBasicGroup": ChatTypeBasicGroupTypeID, - "chatTypeSupergroup": ChatTypeSupergroupTypeID, - "chatTypeSecret": ChatTypeSecretTypeID, - "chatFolderIcon": ChatFolderIconTypeID, - "chatFolder": ChatFolderTypeID, - "chatFolderInfo": ChatFolderInfoTypeID, - "chatFolderInviteLink": ChatFolderInviteLinkTypeID, - "chatFolderInviteLinks": ChatFolderInviteLinksTypeID, - "chatFolderInviteLinkInfo": ChatFolderInviteLinkInfoTypeID, - "recommendedChatFolder": RecommendedChatFolderTypeID, - "recommendedChatFolders": RecommendedChatFoldersTypeID, - "archiveChatListSettings": ArchiveChatListSettingsTypeID, - "chatListMain": ChatListMainTypeID, - "chatListArchive": ChatListArchiveTypeID, - "chatListFolder": ChatListFolderTypeID, - "chatLists": ChatListsTypeID, - "chatSourceMtprotoProxy": ChatSourceMtprotoProxyTypeID, - "chatSourcePublicServiceAnnouncement": ChatSourcePublicServiceAnnouncementTypeID, - "chatPosition": ChatPositionTypeID, - "chatAvailableReactionsAll": ChatAvailableReactionsAllTypeID, - "chatAvailableReactionsSome": ChatAvailableReactionsSomeTypeID, - "savedMessagesTag": SavedMessagesTagTypeID, - "savedMessagesTags": SavedMessagesTagsTypeID, - "businessBotManageBar": BusinessBotManageBarTypeID, - "videoChat": VideoChatTypeID, - "chat": ChatTypeID, - "chats": ChatsTypeID, - "failedToAddMember": FailedToAddMemberTypeID, - "failedToAddMembers": FailedToAddMembersTypeID, - "createdBasicGroupChat": CreatedBasicGroupChatTypeID, - "chatNearby": ChatNearbyTypeID, - "chatsNearby": ChatsNearbyTypeID, - "publicChatTypeHasUsername": PublicChatTypeHasUsernameTypeID, - "publicChatTypeIsLocationBased": PublicChatTypeIsLocationBasedTypeID, - "chatActionBarReportSpam": ChatActionBarReportSpamTypeID, - "chatActionBarReportUnrelatedLocation": ChatActionBarReportUnrelatedLocationTypeID, - "chatActionBarInviteMembers": ChatActionBarInviteMembersTypeID, - "chatActionBarReportAddBlock": ChatActionBarReportAddBlockTypeID, - "chatActionBarAddContact": ChatActionBarAddContactTypeID, - "chatActionBarSharePhoneNumber": ChatActionBarSharePhoneNumberTypeID, - "chatActionBarJoinRequest": ChatActionBarJoinRequestTypeID, - "keyboardButtonTypeText": KeyboardButtonTypeTextTypeID, - "keyboardButtonTypeRequestPhoneNumber": KeyboardButtonTypeRequestPhoneNumberTypeID, - "keyboardButtonTypeRequestLocation": KeyboardButtonTypeRequestLocationTypeID, - "keyboardButtonTypeRequestPoll": KeyboardButtonTypeRequestPollTypeID, - "keyboardButtonTypeRequestUsers": KeyboardButtonTypeRequestUsersTypeID, - "keyboardButtonTypeRequestChat": KeyboardButtonTypeRequestChatTypeID, - "keyboardButtonTypeWebApp": KeyboardButtonTypeWebAppTypeID, - "keyboardButton": KeyboardButtonTypeID, - "inlineKeyboardButtonTypeUrl": InlineKeyboardButtonTypeURLTypeID, - "inlineKeyboardButtonTypeLoginUrl": InlineKeyboardButtonTypeLoginURLTypeID, - "inlineKeyboardButtonTypeWebApp": InlineKeyboardButtonTypeWebAppTypeID, - "inlineKeyboardButtonTypeCallback": InlineKeyboardButtonTypeCallbackTypeID, - "inlineKeyboardButtonTypeCallbackWithPassword": InlineKeyboardButtonTypeCallbackWithPasswordTypeID, - "inlineKeyboardButtonTypeCallbackGame": InlineKeyboardButtonTypeCallbackGameTypeID, - "inlineKeyboardButtonTypeSwitchInline": InlineKeyboardButtonTypeSwitchInlineTypeID, - "inlineKeyboardButtonTypeBuy": InlineKeyboardButtonTypeBuyTypeID, - "inlineKeyboardButtonTypeUser": InlineKeyboardButtonTypeUserTypeID, - "inlineKeyboardButton": InlineKeyboardButtonTypeID, - "replyMarkupRemoveKeyboard": ReplyMarkupRemoveKeyboardTypeID, - "replyMarkupForceReply": ReplyMarkupForceReplyTypeID, - "replyMarkupShowKeyboard": ReplyMarkupShowKeyboardTypeID, - "replyMarkupInlineKeyboard": ReplyMarkupInlineKeyboardTypeID, - "loginUrlInfoOpen": LoginURLInfoOpenTypeID, - "loginUrlInfoRequestConfirmation": LoginURLInfoRequestConfirmationTypeID, - "foundWebApp": FoundWebAppTypeID, - "webAppInfo": WebAppInfoTypeID, - "mainWebApp": MainWebAppTypeID, - "messageThreadInfo": MessageThreadInfoTypeID, - "savedMessagesTopicTypeMyNotes": SavedMessagesTopicTypeMyNotesTypeID, - "savedMessagesTopicTypeAuthorHidden": SavedMessagesTopicTypeAuthorHiddenTypeID, - "savedMessagesTopicTypeSavedFromChat": SavedMessagesTopicTypeSavedFromChatTypeID, - "savedMessagesTopic": SavedMessagesTopicTypeID, - "forumTopicIcon": ForumTopicIconTypeID, - "forumTopicInfo": ForumTopicInfoTypeID, - "forumTopic": ForumTopicTypeID, - "forumTopics": ForumTopicsTypeID, - "linkPreviewOptions": LinkPreviewOptionsTypeID, - "sharedUser": SharedUserTypeID, - "sharedChat": SharedChatTypeID, - "themeSettings": ThemeSettingsTypeID, - "richTextPlain": RichTextPlainTypeID, - "richTextBold": RichTextBoldTypeID, - "richTextItalic": RichTextItalicTypeID, - "richTextUnderline": RichTextUnderlineTypeID, - "richTextStrikethrough": RichTextStrikethroughTypeID, - "richTextFixed": RichTextFixedTypeID, - "richTextUrl": RichTextURLTypeID, - "richTextEmailAddress": RichTextEmailAddressTypeID, - "richTextSubscript": RichTextSubscriptTypeID, - "richTextSuperscript": RichTextSuperscriptTypeID, - "richTextMarked": RichTextMarkedTypeID, - "richTextPhoneNumber": RichTextPhoneNumberTypeID, - "richTextIcon": RichTextIconTypeID, - "richTextReference": RichTextReferenceTypeID, - "richTextAnchor": RichTextAnchorTypeID, - "richTextAnchorLink": RichTextAnchorLinkTypeID, - "richTexts": RichTextsTypeID, - "pageBlockCaption": PageBlockCaptionTypeID, - "pageBlockListItem": PageBlockListItemTypeID, - "pageBlockHorizontalAlignmentLeft": PageBlockHorizontalAlignmentLeftTypeID, - "pageBlockHorizontalAlignmentCenter": PageBlockHorizontalAlignmentCenterTypeID, - "pageBlockHorizontalAlignmentRight": PageBlockHorizontalAlignmentRightTypeID, - "pageBlockVerticalAlignmentTop": PageBlockVerticalAlignmentTopTypeID, - "pageBlockVerticalAlignmentMiddle": PageBlockVerticalAlignmentMiddleTypeID, - "pageBlockVerticalAlignmentBottom": PageBlockVerticalAlignmentBottomTypeID, - "pageBlockTableCell": PageBlockTableCellTypeID, - "pageBlockRelatedArticle": PageBlockRelatedArticleTypeID, - "pageBlockTitle": PageBlockTitleTypeID, - "pageBlockSubtitle": PageBlockSubtitleTypeID, - "pageBlockAuthorDate": PageBlockAuthorDateTypeID, - "pageBlockHeader": PageBlockHeaderTypeID, - "pageBlockSubheader": PageBlockSubheaderTypeID, - "pageBlockKicker": PageBlockKickerTypeID, - "pageBlockParagraph": PageBlockParagraphTypeID, - "pageBlockPreformatted": PageBlockPreformattedTypeID, - "pageBlockFooter": PageBlockFooterTypeID, - "pageBlockDivider": PageBlockDividerTypeID, - "pageBlockAnchor": PageBlockAnchorTypeID, - "pageBlockList": PageBlockListTypeID, - "pageBlockBlockQuote": PageBlockBlockQuoteTypeID, - "pageBlockPullQuote": PageBlockPullQuoteTypeID, - "pageBlockAnimation": PageBlockAnimationTypeID, - "pageBlockAudio": PageBlockAudioTypeID, - "pageBlockPhoto": PageBlockPhotoTypeID, - "pageBlockVideo": PageBlockVideoTypeID, - "pageBlockVoiceNote": PageBlockVoiceNoteTypeID, - "pageBlockCover": PageBlockCoverTypeID, - "pageBlockEmbedded": PageBlockEmbeddedTypeID, - "pageBlockEmbeddedPost": PageBlockEmbeddedPostTypeID, - "pageBlockCollage": PageBlockCollageTypeID, - "pageBlockSlideshow": PageBlockSlideshowTypeID, - "pageBlockChatLink": PageBlockChatLinkTypeID, - "pageBlockTable": PageBlockTableTypeID, - "pageBlockDetails": PageBlockDetailsTypeID, - "pageBlockRelatedArticles": PageBlockRelatedArticlesTypeID, - "pageBlockMap": PageBlockMapTypeID, - "webPageInstantView": WebPageInstantViewTypeID, - "linkPreviewAlbumMediaPhoto": LinkPreviewAlbumMediaPhotoTypeID, - "linkPreviewAlbumMediaVideo": LinkPreviewAlbumMediaVideoTypeID, - "linkPreviewTypeAlbum": LinkPreviewTypeAlbumTypeID, - "linkPreviewTypeAnimation": LinkPreviewTypeAnimationTypeID, - "linkPreviewTypeApp": LinkPreviewTypeAppTypeID, - "linkPreviewTypeArticle": LinkPreviewTypeArticleTypeID, - "linkPreviewTypeAudio": LinkPreviewTypeAudioTypeID, - "linkPreviewTypeBackground": LinkPreviewTypeBackgroundTypeID, - "linkPreviewTypeChannelBoost": LinkPreviewTypeChannelBoostTypeID, - "linkPreviewTypeChat": LinkPreviewTypeChatTypeID, - "linkPreviewTypeDocument": LinkPreviewTypeDocumentTypeID, - "linkPreviewTypeEmbeddedAnimationPlayer": LinkPreviewTypeEmbeddedAnimationPlayerTypeID, - "linkPreviewTypeEmbeddedAudioPlayer": LinkPreviewTypeEmbeddedAudioPlayerTypeID, - "linkPreviewTypeEmbeddedVideoPlayer": LinkPreviewTypeEmbeddedVideoPlayerTypeID, - "linkPreviewTypeExternalAudio": LinkPreviewTypeExternalAudioTypeID, - "linkPreviewTypeExternalVideo": LinkPreviewTypeExternalVideoTypeID, - "linkPreviewTypeInvoice": LinkPreviewTypeInvoiceTypeID, - "linkPreviewTypeMessage": LinkPreviewTypeMessageTypeID, - "linkPreviewTypePhoto": LinkPreviewTypePhotoTypeID, - "linkPreviewTypePremiumGiftCode": LinkPreviewTypePremiumGiftCodeTypeID, - "linkPreviewTypeShareableChatFolder": LinkPreviewTypeShareableChatFolderTypeID, - "linkPreviewTypeSticker": LinkPreviewTypeStickerTypeID, - "linkPreviewTypeStickerSet": LinkPreviewTypeStickerSetTypeID, - "linkPreviewTypeStory": LinkPreviewTypeStoryTypeID, - "linkPreviewTypeSupergroupBoost": LinkPreviewTypeSupergroupBoostTypeID, - "linkPreviewTypeTheme": LinkPreviewTypeThemeTypeID, - "linkPreviewTypeUnsupported": LinkPreviewTypeUnsupportedTypeID, - "linkPreviewTypeUser": LinkPreviewTypeUserTypeID, - "linkPreviewTypeVideo": LinkPreviewTypeVideoTypeID, - "linkPreviewTypeVideoChat": LinkPreviewTypeVideoChatTypeID, - "linkPreviewTypeVideoNote": LinkPreviewTypeVideoNoteTypeID, - "linkPreviewTypeVoiceNote": LinkPreviewTypeVoiceNoteTypeID, - "linkPreviewTypeWebApp": LinkPreviewTypeWebAppTypeID, - "linkPreview": LinkPreviewTypeID, - "countryInfo": CountryInfoTypeID, - "countries": CountriesTypeID, - "phoneNumberInfo": PhoneNumberInfoTypeID, - "collectibleItemTypeUsername": CollectibleItemTypeUsernameTypeID, - "collectibleItemTypePhoneNumber": CollectibleItemTypePhoneNumberTypeID, - "collectibleItemInfo": CollectibleItemInfoTypeID, - "bankCardActionOpenUrl": BankCardActionOpenURLTypeID, - "bankCardInfo": BankCardInfoTypeID, - "address": AddressTypeID, - "locationAddress": LocationAddressTypeID, - "themeParameters": ThemeParametersTypeID, - "labeledPricePart": LabeledPricePartTypeID, - "invoice": InvoiceTypeID, - "orderInfo": OrderInfoTypeID, - "shippingOption": ShippingOptionTypeID, - "savedCredentials": SavedCredentialsTypeID, - "inputCredentialsSaved": InputCredentialsSavedTypeID, - "inputCredentialsNew": InputCredentialsNewTypeID, - "inputCredentialsApplePay": InputCredentialsApplePayTypeID, - "inputCredentialsGooglePay": InputCredentialsGooglePayTypeID, - "paymentProviderSmartGlocal": PaymentProviderSmartGlocalTypeID, - "paymentProviderStripe": PaymentProviderStripeTypeID, - "paymentProviderOther": PaymentProviderOtherTypeID, - "paymentOption": PaymentOptionTypeID, - "paymentFormTypeRegular": PaymentFormTypeRegularTypeID, - "paymentFormTypeStars": PaymentFormTypeStarsTypeID, - "paymentForm": PaymentFormTypeID, - "validatedOrderInfo": ValidatedOrderInfoTypeID, - "paymentResult": PaymentResultTypeID, - "paymentReceiptTypeRegular": PaymentReceiptTypeRegularTypeID, - "paymentReceiptTypeStars": PaymentReceiptTypeStarsTypeID, - "paymentReceipt": PaymentReceiptTypeID, - "inputInvoiceMessage": InputInvoiceMessageTypeID, - "inputInvoiceName": InputInvoiceNameTypeID, - "inputInvoiceTelegram": InputInvoiceTelegramTypeID, - "paidMediaPreview": PaidMediaPreviewTypeID, - "paidMediaPhoto": PaidMediaPhotoTypeID, - "paidMediaVideo": PaidMediaVideoTypeID, - "paidMediaUnsupported": PaidMediaUnsupportedTypeID, - "giveawayParameters": GiveawayParametersTypeID, - "datedFile": DatedFileTypeID, - "passportElementTypePersonalDetails": PassportElementTypePersonalDetailsTypeID, - "passportElementTypePassport": PassportElementTypePassportTypeID, - "passportElementTypeDriverLicense": PassportElementTypeDriverLicenseTypeID, - "passportElementTypeIdentityCard": PassportElementTypeIdentityCardTypeID, - "passportElementTypeInternalPassport": PassportElementTypeInternalPassportTypeID, - "passportElementTypeAddress": PassportElementTypeAddressTypeID, - "passportElementTypeUtilityBill": PassportElementTypeUtilityBillTypeID, - "passportElementTypeBankStatement": PassportElementTypeBankStatementTypeID, - "passportElementTypeRentalAgreement": PassportElementTypeRentalAgreementTypeID, - "passportElementTypePassportRegistration": PassportElementTypePassportRegistrationTypeID, - "passportElementTypeTemporaryRegistration": PassportElementTypeTemporaryRegistrationTypeID, - "passportElementTypePhoneNumber": PassportElementTypePhoneNumberTypeID, - "passportElementTypeEmailAddress": PassportElementTypeEmailAddressTypeID, - "date": DateTypeID, - "personalDetails": PersonalDetailsTypeID, - "identityDocument": IdentityDocumentTypeID, - "inputIdentityDocument": InputIdentityDocumentTypeID, - "personalDocument": PersonalDocumentTypeID, - "inputPersonalDocument": InputPersonalDocumentTypeID, - "passportElementPersonalDetails": PassportElementPersonalDetailsTypeID, - "passportElementPassport": PassportElementPassportTypeID, - "passportElementDriverLicense": PassportElementDriverLicenseTypeID, - "passportElementIdentityCard": PassportElementIdentityCardTypeID, - "passportElementInternalPassport": PassportElementInternalPassportTypeID, - "passportElementAddress": PassportElementAddressTypeID, - "passportElementUtilityBill": PassportElementUtilityBillTypeID, - "passportElementBankStatement": PassportElementBankStatementTypeID, - "passportElementRentalAgreement": PassportElementRentalAgreementTypeID, - "passportElementPassportRegistration": PassportElementPassportRegistrationTypeID, - "passportElementTemporaryRegistration": PassportElementTemporaryRegistrationTypeID, - "passportElementPhoneNumber": PassportElementPhoneNumberTypeID, - "passportElementEmailAddress": PassportElementEmailAddressTypeID, - "inputPassportElementPersonalDetails": InputPassportElementPersonalDetailsTypeID, - "inputPassportElementPassport": InputPassportElementPassportTypeID, - "inputPassportElementDriverLicense": InputPassportElementDriverLicenseTypeID, - "inputPassportElementIdentityCard": InputPassportElementIdentityCardTypeID, - "inputPassportElementInternalPassport": InputPassportElementInternalPassportTypeID, - "inputPassportElementAddress": InputPassportElementAddressTypeID, - "inputPassportElementUtilityBill": InputPassportElementUtilityBillTypeID, - "inputPassportElementBankStatement": InputPassportElementBankStatementTypeID, - "inputPassportElementRentalAgreement": InputPassportElementRentalAgreementTypeID, - "inputPassportElementPassportRegistration": InputPassportElementPassportRegistrationTypeID, - "inputPassportElementTemporaryRegistration": InputPassportElementTemporaryRegistrationTypeID, - "inputPassportElementPhoneNumber": InputPassportElementPhoneNumberTypeID, - "inputPassportElementEmailAddress": InputPassportElementEmailAddressTypeID, - "passportElements": PassportElementsTypeID, - "passportElementErrorSourceUnspecified": PassportElementErrorSourceUnspecifiedTypeID, - "passportElementErrorSourceDataField": PassportElementErrorSourceDataFieldTypeID, - "passportElementErrorSourceFrontSide": PassportElementErrorSourceFrontSideTypeID, - "passportElementErrorSourceReverseSide": PassportElementErrorSourceReverseSideTypeID, - "passportElementErrorSourceSelfie": PassportElementErrorSourceSelfieTypeID, - "passportElementErrorSourceTranslationFile": PassportElementErrorSourceTranslationFileTypeID, - "passportElementErrorSourceTranslationFiles": PassportElementErrorSourceTranslationFilesTypeID, - "passportElementErrorSourceFile": PassportElementErrorSourceFileTypeID, - "passportElementErrorSourceFiles": PassportElementErrorSourceFilesTypeID, - "passportElementError": PassportElementErrorTypeID, - "passportSuitableElement": PassportSuitableElementTypeID, - "passportRequiredElement": PassportRequiredElementTypeID, - "passportAuthorizationForm": PassportAuthorizationFormTypeID, - "passportElementsWithErrors": PassportElementsWithErrorsTypeID, - "encryptedCredentials": EncryptedCredentialsTypeID, - "encryptedPassportElement": EncryptedPassportElementTypeID, - "inputPassportElementErrorSourceUnspecified": InputPassportElementErrorSourceUnspecifiedTypeID, - "inputPassportElementErrorSourceDataField": InputPassportElementErrorSourceDataFieldTypeID, - "inputPassportElementErrorSourceFrontSide": InputPassportElementErrorSourceFrontSideTypeID, - "inputPassportElementErrorSourceReverseSide": InputPassportElementErrorSourceReverseSideTypeID, - "inputPassportElementErrorSourceSelfie": InputPassportElementErrorSourceSelfieTypeID, - "inputPassportElementErrorSourceTranslationFile": InputPassportElementErrorSourceTranslationFileTypeID, - "inputPassportElementErrorSourceTranslationFiles": InputPassportElementErrorSourceTranslationFilesTypeID, - "inputPassportElementErrorSourceFile": InputPassportElementErrorSourceFileTypeID, - "inputPassportElementErrorSourceFiles": InputPassportElementErrorSourceFilesTypeID, - "inputPassportElementError": InputPassportElementErrorTypeID, - "messageText": MessageTextTypeID, - "messageAnimation": MessageAnimationTypeID, - "messageAudio": MessageAudioTypeID, - "messageDocument": MessageDocumentTypeID, - "messagePaidMedia": MessagePaidMediaTypeID, - "messagePhoto": MessagePhotoTypeID, - "messageSticker": MessageStickerTypeID, - "messageVideo": MessageVideoTypeID, - "messageVideoNote": MessageVideoNoteTypeID, - "messageVoiceNote": MessageVoiceNoteTypeID, - "messageExpiredPhoto": MessageExpiredPhotoTypeID, - "messageExpiredVideo": MessageExpiredVideoTypeID, - "messageExpiredVideoNote": MessageExpiredVideoNoteTypeID, - "messageExpiredVoiceNote": MessageExpiredVoiceNoteTypeID, - "messageLocation": MessageLocationTypeID, - "messageVenue": MessageVenueTypeID, - "messageContact": MessageContactTypeID, - "messageAnimatedEmoji": MessageAnimatedEmojiTypeID, - "messageDice": MessageDiceTypeID, - "messageGame": MessageGameTypeID, - "messagePoll": MessagePollTypeID, - "messageStory": MessageStoryTypeID, - "messageInvoice": MessageInvoiceTypeID, - "messageCall": MessageCallTypeID, - "messageVideoChatScheduled": MessageVideoChatScheduledTypeID, - "messageVideoChatStarted": MessageVideoChatStartedTypeID, - "messageVideoChatEnded": MessageVideoChatEndedTypeID, - "messageInviteVideoChatParticipants": MessageInviteVideoChatParticipantsTypeID, - "messageBasicGroupChatCreate": MessageBasicGroupChatCreateTypeID, - "messageSupergroupChatCreate": MessageSupergroupChatCreateTypeID, - "messageChatChangeTitle": MessageChatChangeTitleTypeID, - "messageChatChangePhoto": MessageChatChangePhotoTypeID, - "messageChatDeletePhoto": MessageChatDeletePhotoTypeID, - "messageChatAddMembers": MessageChatAddMembersTypeID, - "messageChatJoinByLink": MessageChatJoinByLinkTypeID, - "messageChatJoinByRequest": MessageChatJoinByRequestTypeID, - "messageChatDeleteMember": MessageChatDeleteMemberTypeID, - "messageChatUpgradeTo": MessageChatUpgradeToTypeID, - "messageChatUpgradeFrom": MessageChatUpgradeFromTypeID, - "messagePinMessage": MessagePinMessageTypeID, - "messageScreenshotTaken": MessageScreenshotTakenTypeID, - "messageChatSetBackground": MessageChatSetBackgroundTypeID, - "messageChatSetTheme": MessageChatSetThemeTypeID, - "messageChatSetMessageAutoDeleteTime": MessageChatSetMessageAutoDeleteTimeTypeID, - "messageChatBoost": MessageChatBoostTypeID, - "messageForumTopicCreated": MessageForumTopicCreatedTypeID, - "messageForumTopicEdited": MessageForumTopicEditedTypeID, - "messageForumTopicIsClosedToggled": MessageForumTopicIsClosedToggledTypeID, - "messageForumTopicIsHiddenToggled": MessageForumTopicIsHiddenToggledTypeID, - "messageSuggestProfilePhoto": MessageSuggestProfilePhotoTypeID, - "messageCustomServiceAction": MessageCustomServiceActionTypeID, - "messageGameScore": MessageGameScoreTypeID, - "messagePaymentSuccessful": MessagePaymentSuccessfulTypeID, - "messagePaymentSuccessfulBot": MessagePaymentSuccessfulBotTypeID, - "messagePaymentRefunded": MessagePaymentRefundedTypeID, - "messageGiftedPremium": MessageGiftedPremiumTypeID, - "messagePremiumGiftCode": MessagePremiumGiftCodeTypeID, - "messageGiveawayCreated": MessageGiveawayCreatedTypeID, - "messageGiveaway": MessageGiveawayTypeID, - "messageGiveawayCompleted": MessageGiveawayCompletedTypeID, - "messageGiveawayWinners": MessageGiveawayWinnersTypeID, - "messageGiftedStars": MessageGiftedStarsTypeID, - "messageGiveawayPrizeStars": MessageGiveawayPrizeStarsTypeID, - "messageContactRegistered": MessageContactRegisteredTypeID, - "messageUsersShared": MessageUsersSharedTypeID, - "messageChatShared": MessageChatSharedTypeID, - "messageBotWriteAccessAllowed": MessageBotWriteAccessAllowedTypeID, - "messageWebAppDataSent": MessageWebAppDataSentTypeID, - "messageWebAppDataReceived": MessageWebAppDataReceivedTypeID, - "messagePassportDataSent": MessagePassportDataSentTypeID, - "messagePassportDataReceived": MessagePassportDataReceivedTypeID, - "messageProximityAlertTriggered": MessageProximityAlertTriggeredTypeID, - "messageUnsupported": MessageUnsupportedTypeID, - "textEntityTypeMention": TextEntityTypeMentionTypeID, - "textEntityTypeHashtag": TextEntityTypeHashtagTypeID, - "textEntityTypeCashtag": TextEntityTypeCashtagTypeID, - "textEntityTypeBotCommand": TextEntityTypeBotCommandTypeID, - "textEntityTypeUrl": TextEntityTypeURLTypeID, - "textEntityTypeEmailAddress": TextEntityTypeEmailAddressTypeID, - "textEntityTypePhoneNumber": TextEntityTypePhoneNumberTypeID, - "textEntityTypeBankCardNumber": TextEntityTypeBankCardNumberTypeID, - "textEntityTypeBold": TextEntityTypeBoldTypeID, - "textEntityTypeItalic": TextEntityTypeItalicTypeID, - "textEntityTypeUnderline": TextEntityTypeUnderlineTypeID, - "textEntityTypeStrikethrough": TextEntityTypeStrikethroughTypeID, - "textEntityTypeSpoiler": TextEntityTypeSpoilerTypeID, - "textEntityTypeCode": TextEntityTypeCodeTypeID, - "textEntityTypePre": TextEntityTypePreTypeID, - "textEntityTypePreCode": TextEntityTypePreCodeTypeID, - "textEntityTypeBlockQuote": TextEntityTypeBlockQuoteTypeID, - "textEntityTypeExpandableBlockQuote": TextEntityTypeExpandableBlockQuoteTypeID, - "textEntityTypeTextUrl": TextEntityTypeTextURLTypeID, - "textEntityTypeMentionName": TextEntityTypeMentionNameTypeID, - "textEntityTypeCustomEmoji": TextEntityTypeCustomEmojiTypeID, - "textEntityTypeMediaTimestamp": TextEntityTypeMediaTimestampTypeID, - "inputThumbnail": InputThumbnailTypeID, - "inputPaidMediaTypePhoto": InputPaidMediaTypePhotoTypeID, - "inputPaidMediaTypeVideo": InputPaidMediaTypeVideoTypeID, - "inputPaidMedia": InputPaidMediaTypeID, - "messageSchedulingStateSendAtDate": MessageSchedulingStateSendAtDateTypeID, - "messageSchedulingStateSendWhenOnline": MessageSchedulingStateSendWhenOnlineTypeID, - "messageSelfDestructTypeTimer": MessageSelfDestructTypeTimerTypeID, - "messageSelfDestructTypeImmediately": MessageSelfDestructTypeImmediatelyTypeID, - "messageSendOptions": MessageSendOptionsTypeID, - "messageCopyOptions": MessageCopyOptionsTypeID, - "inputMessageText": InputMessageTextTypeID, - "inputMessageAnimation": InputMessageAnimationTypeID, - "inputMessageAudio": InputMessageAudioTypeID, - "inputMessageDocument": InputMessageDocumentTypeID, - "inputMessagePaidMedia": InputMessagePaidMediaTypeID, - "inputMessagePhoto": InputMessagePhotoTypeID, - "inputMessageSticker": InputMessageStickerTypeID, - "inputMessageVideo": InputMessageVideoTypeID, - "inputMessageVideoNote": InputMessageVideoNoteTypeID, - "inputMessageVoiceNote": InputMessageVoiceNoteTypeID, - "inputMessageLocation": InputMessageLocationTypeID, - "inputMessageVenue": InputMessageVenueTypeID, - "inputMessageContact": InputMessageContactTypeID, - "inputMessageDice": InputMessageDiceTypeID, - "inputMessageGame": InputMessageGameTypeID, - "inputMessageInvoice": InputMessageInvoiceTypeID, - "inputMessagePoll": InputMessagePollTypeID, - "inputMessageStory": InputMessageStoryTypeID, - "inputMessageForwarded": InputMessageForwardedTypeID, - "messageProperties": MessagePropertiesTypeID, - "searchMessagesFilterEmpty": SearchMessagesFilterEmptyTypeID, - "searchMessagesFilterAnimation": SearchMessagesFilterAnimationTypeID, - "searchMessagesFilterAudio": SearchMessagesFilterAudioTypeID, - "searchMessagesFilterDocument": SearchMessagesFilterDocumentTypeID, - "searchMessagesFilterPhoto": SearchMessagesFilterPhotoTypeID, - "searchMessagesFilterVideo": SearchMessagesFilterVideoTypeID, - "searchMessagesFilterVoiceNote": SearchMessagesFilterVoiceNoteTypeID, - "searchMessagesFilterPhotoAndVideo": SearchMessagesFilterPhotoAndVideoTypeID, - "searchMessagesFilterUrl": SearchMessagesFilterURLTypeID, - "searchMessagesFilterChatPhoto": SearchMessagesFilterChatPhotoTypeID, - "searchMessagesFilterVideoNote": SearchMessagesFilterVideoNoteTypeID, - "searchMessagesFilterVoiceAndVideoNote": SearchMessagesFilterVoiceAndVideoNoteTypeID, - "searchMessagesFilterMention": SearchMessagesFilterMentionTypeID, - "searchMessagesFilterUnreadMention": SearchMessagesFilterUnreadMentionTypeID, - "searchMessagesFilterUnreadReaction": SearchMessagesFilterUnreadReactionTypeID, - "searchMessagesFilterFailedToSend": SearchMessagesFilterFailedToSendTypeID, - "searchMessagesFilterPinned": SearchMessagesFilterPinnedTypeID, - "chatActionTyping": ChatActionTypingTypeID, - "chatActionRecordingVideo": ChatActionRecordingVideoTypeID, - "chatActionUploadingVideo": ChatActionUploadingVideoTypeID, - "chatActionRecordingVoiceNote": ChatActionRecordingVoiceNoteTypeID, - "chatActionUploadingVoiceNote": ChatActionUploadingVoiceNoteTypeID, - "chatActionUploadingPhoto": ChatActionUploadingPhotoTypeID, - "chatActionUploadingDocument": ChatActionUploadingDocumentTypeID, - "chatActionChoosingSticker": ChatActionChoosingStickerTypeID, - "chatActionChoosingLocation": ChatActionChoosingLocationTypeID, - "chatActionChoosingContact": ChatActionChoosingContactTypeID, - "chatActionStartPlayingGame": ChatActionStartPlayingGameTypeID, - "chatActionRecordingVideoNote": ChatActionRecordingVideoNoteTypeID, - "chatActionUploadingVideoNote": ChatActionUploadingVideoNoteTypeID, - "chatActionWatchingAnimations": ChatActionWatchingAnimationsTypeID, - "chatActionCancel": ChatActionCancelTypeID, - "userStatusEmpty": UserStatusEmptyTypeID, - "userStatusOnline": UserStatusOnlineTypeID, - "userStatusOffline": UserStatusOfflineTypeID, - "userStatusRecently": UserStatusRecentlyTypeID, - "userStatusLastWeek": UserStatusLastWeekTypeID, - "userStatusLastMonth": UserStatusLastMonthTypeID, - "emojiKeyword": EmojiKeywordTypeID, - "emojiKeywords": EmojiKeywordsTypeID, - "stickers": StickersTypeID, - "emojis": EmojisTypeID, - "stickerSet": StickerSetTypeID, - "stickerSetInfo": StickerSetInfoTypeID, - "stickerSets": StickerSetsTypeID, - "trendingStickerSets": TrendingStickerSetsTypeID, - "emojiCategorySourceSearch": EmojiCategorySourceSearchTypeID, - "emojiCategorySourcePremium": EmojiCategorySourcePremiumTypeID, - "emojiCategory": EmojiCategoryTypeID, - "emojiCategories": EmojiCategoriesTypeID, - "emojiCategoryTypeDefault": EmojiCategoryTypeDefaultTypeID, - "emojiCategoryTypeRegularStickers": EmojiCategoryTypeRegularStickersTypeID, - "emojiCategoryTypeEmojiStatus": EmojiCategoryTypeEmojiStatusTypeID, - "emojiCategoryTypeChatPhoto": EmojiCategoryTypeChatPhotoTypeID, - "currentWeather": CurrentWeatherTypeID, - "storyAreaPosition": StoryAreaPositionTypeID, - "storyAreaTypeLocation": StoryAreaTypeLocationTypeID, - "storyAreaTypeVenue": StoryAreaTypeVenueTypeID, - "storyAreaTypeSuggestedReaction": StoryAreaTypeSuggestedReactionTypeID, - "storyAreaTypeMessage": StoryAreaTypeMessageTypeID, - "storyAreaTypeLink": StoryAreaTypeLinkTypeID, - "storyAreaTypeWeather": StoryAreaTypeWeatherTypeID, - "storyArea": StoryAreaTypeID, - "inputStoryAreaTypeLocation": InputStoryAreaTypeLocationTypeID, - "inputStoryAreaTypeFoundVenue": InputStoryAreaTypeFoundVenueTypeID, - "inputStoryAreaTypePreviousVenue": InputStoryAreaTypePreviousVenueTypeID, - "inputStoryAreaTypeSuggestedReaction": InputStoryAreaTypeSuggestedReactionTypeID, - "inputStoryAreaTypeMessage": InputStoryAreaTypeMessageTypeID, - "inputStoryAreaTypeLink": InputStoryAreaTypeLinkTypeID, - "inputStoryAreaTypeWeather": InputStoryAreaTypeWeatherTypeID, - "inputStoryArea": InputStoryAreaTypeID, - "inputStoryAreas": InputStoryAreasTypeID, - "storyVideo": StoryVideoTypeID, - "storyContentPhoto": StoryContentPhotoTypeID, - "storyContentVideo": StoryContentVideoTypeID, - "storyContentUnsupported": StoryContentUnsupportedTypeID, - "inputStoryContentPhoto": InputStoryContentPhotoTypeID, - "inputStoryContentVideo": InputStoryContentVideoTypeID, - "storyListMain": StoryListMainTypeID, - "storyListArchive": StoryListArchiveTypeID, - "storyOriginPublicStory": StoryOriginPublicStoryTypeID, - "storyOriginHiddenUser": StoryOriginHiddenUserTypeID, - "storyRepostInfo": StoryRepostInfoTypeID, - "storyInteractionInfo": StoryInteractionInfoTypeID, - "story": StoryTypeID, - "stories": StoriesTypeID, - "foundStories": FoundStoriesTypeID, - "storyFullId": StoryFullIDTypeID, - "storyInfo": StoryInfoTypeID, - "chatActiveStories": ChatActiveStoriesTypeID, - "storyInteractionTypeView": StoryInteractionTypeViewTypeID, - "storyInteractionTypeForward": StoryInteractionTypeForwardTypeID, - "storyInteractionTypeRepost": StoryInteractionTypeRepostTypeID, - "storyInteraction": StoryInteractionTypeID, - "storyInteractions": StoryInteractionsTypeID, - "quickReplyMessage": QuickReplyMessageTypeID, - "quickReplyMessages": QuickReplyMessagesTypeID, - "quickReplyShortcut": QuickReplyShortcutTypeID, - "publicForwardMessage": PublicForwardMessageTypeID, - "publicForwardStory": PublicForwardStoryTypeID, - "publicForwards": PublicForwardsTypeID, - "botMediaPreview": BotMediaPreviewTypeID, - "botMediaPreviews": BotMediaPreviewsTypeID, - "botMediaPreviewInfo": BotMediaPreviewInfoTypeID, - "chatBoostLevelFeatures": ChatBoostLevelFeaturesTypeID, - "chatBoostFeatures": ChatBoostFeaturesTypeID, - "chatBoostSourceGiftCode": ChatBoostSourceGiftCodeTypeID, - "chatBoostSourceGiveaway": ChatBoostSourceGiveawayTypeID, - "chatBoostSourcePremium": ChatBoostSourcePremiumTypeID, - "prepaidGiveaway": PrepaidGiveawayTypeID, - "chatBoostStatus": ChatBoostStatusTypeID, - "chatBoost": ChatBoostTypeID, - "foundChatBoosts": FoundChatBoostsTypeID, - "chatBoostSlot": ChatBoostSlotTypeID, - "chatBoostSlots": ChatBoostSlotsTypeID, - "resendCodeReasonUserRequest": ResendCodeReasonUserRequestTypeID, - "resendCodeReasonVerificationFailed": ResendCodeReasonVerificationFailedTypeID, - "callDiscardReasonEmpty": CallDiscardReasonEmptyTypeID, - "callDiscardReasonMissed": CallDiscardReasonMissedTypeID, - "callDiscardReasonDeclined": CallDiscardReasonDeclinedTypeID, - "callDiscardReasonDisconnected": CallDiscardReasonDisconnectedTypeID, - "callDiscardReasonHungUp": CallDiscardReasonHungUpTypeID, - "callProtocol": CallProtocolTypeID, - "callServerTypeTelegramReflector": CallServerTypeTelegramReflectorTypeID, - "callServerTypeWebrtc": CallServerTypeWebrtcTypeID, - "callServer": CallServerTypeID, - "callId": CallIDTypeID, - "groupCallId": GroupCallIDTypeID, - "callStatePending": CallStatePendingTypeID, - "callStateExchangingKeys": CallStateExchangingKeysTypeID, - "callStateReady": CallStateReadyTypeID, - "callStateHangingUp": CallStateHangingUpTypeID, - "callStateDiscarded": CallStateDiscardedTypeID, - "callStateError": CallStateErrorTypeID, - "groupCallVideoQualityThumbnail": GroupCallVideoQualityThumbnailTypeID, - "groupCallVideoQualityMedium": GroupCallVideoQualityMediumTypeID, - "groupCallVideoQualityFull": GroupCallVideoQualityFullTypeID, - "groupCallStream": GroupCallStreamTypeID, - "groupCallStreams": GroupCallStreamsTypeID, - "rtmpUrl": RtmpURLTypeID, - "groupCallRecentSpeaker": GroupCallRecentSpeakerTypeID, - "groupCall": GroupCallTypeID, - "groupCallVideoSourceGroup": GroupCallVideoSourceGroupTypeID, - "groupCallParticipantVideoInfo": GroupCallParticipantVideoInfoTypeID, - "groupCallParticipant": GroupCallParticipantTypeID, - "callProblemEcho": CallProblemEchoTypeID, - "callProblemNoise": CallProblemNoiseTypeID, - "callProblemInterruptions": CallProblemInterruptionsTypeID, - "callProblemDistortedSpeech": CallProblemDistortedSpeechTypeID, - "callProblemSilentLocal": CallProblemSilentLocalTypeID, - "callProblemSilentRemote": CallProblemSilentRemoteTypeID, - "callProblemDropped": CallProblemDroppedTypeID, - "callProblemDistortedVideo": CallProblemDistortedVideoTypeID, - "callProblemPixelatedVideo": CallProblemPixelatedVideoTypeID, - "call": CallTypeID, - "firebaseAuthenticationSettingsAndroid": FirebaseAuthenticationSettingsAndroidTypeID, - "firebaseAuthenticationSettingsIos": FirebaseAuthenticationSettingsIosTypeID, - "phoneNumberAuthenticationSettings": PhoneNumberAuthenticationSettingsTypeID, - "addedReaction": AddedReactionTypeID, - "addedReactions": AddedReactionsTypeID, - "availableReaction": AvailableReactionTypeID, - "availableReactions": AvailableReactionsTypeID, - "emojiReaction": EmojiReactionTypeID, - "reactionUnavailabilityReasonAnonymousAdministrator": ReactionUnavailabilityReasonAnonymousAdministratorTypeID, - "reactionUnavailabilityReasonGuest": ReactionUnavailabilityReasonGuestTypeID, - "animations": AnimationsTypeID, - "diceStickersRegular": DiceStickersRegularTypeID, - "diceStickersSlotMachine": DiceStickersSlotMachineTypeID, - "importedContacts": ImportedContactsTypeID, - "speechRecognitionResultPending": SpeechRecognitionResultPendingTypeID, - "speechRecognitionResultText": SpeechRecognitionResultTextTypeID, - "speechRecognitionResultError": SpeechRecognitionResultErrorTypeID, - "businessConnection": BusinessConnectionTypeID, - "attachmentMenuBotColor": AttachmentMenuBotColorTypeID, - "attachmentMenuBot": AttachmentMenuBotTypeID, - "sentWebAppMessage": SentWebAppMessageTypeID, - "botWriteAccessAllowReasonConnectedWebsite": BotWriteAccessAllowReasonConnectedWebsiteTypeID, - "botWriteAccessAllowReasonAddedToAttachmentMenu": BotWriteAccessAllowReasonAddedToAttachmentMenuTypeID, - "botWriteAccessAllowReasonLaunchedWebApp": BotWriteAccessAllowReasonLaunchedWebAppTypeID, - "botWriteAccessAllowReasonAcceptedRequest": BotWriteAccessAllowReasonAcceptedRequestTypeID, + "businessAwayMessageScheduleOutsideOfOpeningHours": BusinessAwayMessageScheduleOutsideOfOpeningHoursTypeID, + "businessAwayMessageScheduleCustom": BusinessAwayMessageScheduleCustomTypeID, + "businessLocation": BusinessLocationTypeID, + "businessRecipients": BusinessRecipientsTypeID, + "businessAwayMessageSettings": BusinessAwayMessageSettingsTypeID, + "businessGreetingMessageSettings": BusinessGreetingMessageSettingsTypeID, + "businessConnectedBot": BusinessConnectedBotTypeID, + "businessStartPage": BusinessStartPageTypeID, + "inputBusinessStartPage": InputBusinessStartPageTypeID, + "businessOpeningHoursInterval": BusinessOpeningHoursIntervalTypeID, + "businessOpeningHours": BusinessOpeningHoursTypeID, + "businessInfo": BusinessInfoTypeID, + "businessChatLink": BusinessChatLinkTypeID, + "businessChatLinks": BusinessChatLinksTypeID, + "inputBusinessChatLink": InputBusinessChatLinkTypeID, + "businessChatLinkInfo": BusinessChatLinkInfoTypeID, + "chatPhotoStickerTypeRegularOrMask": ChatPhotoStickerTypeRegularOrMaskTypeID, + "chatPhotoStickerTypeCustomEmoji": ChatPhotoStickerTypeCustomEmojiTypeID, + "chatPhotoSticker": ChatPhotoStickerTypeID, + "animatedChatPhoto": AnimatedChatPhotoTypeID, + "chatPhoto": ChatPhotoTypeID, + "chatPhotos": ChatPhotosTypeID, + "inputChatPhotoPrevious": InputChatPhotoPreviousTypeID, + "inputChatPhotoStatic": InputChatPhotoStaticTypeID, + "inputChatPhotoAnimation": InputChatPhotoAnimationTypeID, + "inputChatPhotoSticker": InputChatPhotoStickerTypeID, + "chatPermissions": ChatPermissionsTypeID, + "chatAdministratorRights": ChatAdministratorRightsTypeID, + "starSubscriptionPricing": StarSubscriptionPricingTypeID, + "starSubscription": StarSubscriptionTypeID, + "starSubscriptions": StarSubscriptionsTypeID, + "productInfo": ProductInfoTypeID, + "premiumPaymentOption": PremiumPaymentOptionTypeID, + "premiumStatePaymentOption": PremiumStatePaymentOptionTypeID, + "premiumGiftCodePaymentOption": PremiumGiftCodePaymentOptionTypeID, + "premiumGiftCodePaymentOptions": PremiumGiftCodePaymentOptionsTypeID, + "premiumGiftCodeInfo": PremiumGiftCodeInfoTypeID, + "starPaymentOption": StarPaymentOptionTypeID, + "starPaymentOptions": StarPaymentOptionsTypeID, + "starGiveawayWinnerOption": StarGiveawayWinnerOptionTypeID, + "starGiveawayPaymentOption": StarGiveawayPaymentOptionTypeID, + "starGiveawayPaymentOptions": StarGiveawayPaymentOptionsTypeID, + "gift": GiftTypeID, + "gifts": GiftsTypeID, + "userGift": UserGiftTypeID, + "userGifts": UserGiftsTypeID, + "starTransactionDirectionIncoming": StarTransactionDirectionIncomingTypeID, + "starTransactionDirectionOutgoing": StarTransactionDirectionOutgoingTypeID, + "botTransactionPurposePaidMedia": BotTransactionPurposePaidMediaTypeID, + "botTransactionPurposeInvoicePayment": BotTransactionPurposeInvoicePaymentTypeID, + "chatTransactionPurposePaidMedia": ChatTransactionPurposePaidMediaTypeID, + "chatTransactionPurposeJoin": ChatTransactionPurposeJoinTypeID, + "chatTransactionPurposeReaction": ChatTransactionPurposeReactionTypeID, + "chatTransactionPurposeGiveaway": ChatTransactionPurposeGiveawayTypeID, + "userTransactionPurposeGiftedStars": UserTransactionPurposeGiftedStarsTypeID, + "userTransactionPurposeGiftSell": UserTransactionPurposeGiftSellTypeID, + "userTransactionPurposeGiftSend": UserTransactionPurposeGiftSendTypeID, + "starTransactionPartnerTelegram": StarTransactionPartnerTelegramTypeID, + "starTransactionPartnerAppStore": StarTransactionPartnerAppStoreTypeID, + "starTransactionPartnerGooglePlay": StarTransactionPartnerGooglePlayTypeID, + "starTransactionPartnerFragment": StarTransactionPartnerFragmentTypeID, + "starTransactionPartnerTelegramAds": StarTransactionPartnerTelegramAdsTypeID, + "starTransactionPartnerBot": StarTransactionPartnerBotTypeID, + "starTransactionPartnerBusiness": StarTransactionPartnerBusinessTypeID, + "starTransactionPartnerChat": StarTransactionPartnerChatTypeID, + "starTransactionPartnerUser": StarTransactionPartnerUserTypeID, + "starTransactionPartnerUnsupported": StarTransactionPartnerUnsupportedTypeID, + "starTransaction": StarTransactionTypeID, + "starTransactions": StarTransactionsTypeID, + "giveawayParticipantStatusEligible": GiveawayParticipantStatusEligibleTypeID, + "giveawayParticipantStatusParticipating": GiveawayParticipantStatusParticipatingTypeID, + "giveawayParticipantStatusAlreadyWasMember": GiveawayParticipantStatusAlreadyWasMemberTypeID, + "giveawayParticipantStatusAdministrator": GiveawayParticipantStatusAdministratorTypeID, + "giveawayParticipantStatusDisallowedCountry": GiveawayParticipantStatusDisallowedCountryTypeID, + "giveawayInfoOngoing": GiveawayInfoOngoingTypeID, + "giveawayInfoCompleted": GiveawayInfoCompletedTypeID, + "giveawayPrizePremium": GiveawayPrizePremiumTypeID, + "giveawayPrizeStars": GiveawayPrizeStarsTypeID, + "accentColor": AccentColorTypeID, + "profileAccentColors": ProfileAccentColorsTypeID, + "profileAccentColor": ProfileAccentColorTypeID, + "emojiStatus": EmojiStatusTypeID, + "emojiStatuses": EmojiStatusesTypeID, + "usernames": UsernamesTypeID, + "user": UserTypeID, + "botInfo": BotInfoTypeID, + "userFullInfo": UserFullInfoTypeID, + "users": UsersTypeID, + "foundUsers": FoundUsersTypeID, + "chatAdministrator": ChatAdministratorTypeID, + "chatAdministrators": ChatAdministratorsTypeID, + "chatMemberStatusCreator": ChatMemberStatusCreatorTypeID, + "chatMemberStatusAdministrator": ChatMemberStatusAdministratorTypeID, + "chatMemberStatusMember": ChatMemberStatusMemberTypeID, + "chatMemberStatusRestricted": ChatMemberStatusRestrictedTypeID, + "chatMemberStatusLeft": ChatMemberStatusLeftTypeID, + "chatMemberStatusBanned": ChatMemberStatusBannedTypeID, + "chatMember": ChatMemberTypeID, + "chatMembers": ChatMembersTypeID, + "chatMembersFilterContacts": ChatMembersFilterContactsTypeID, + "chatMembersFilterAdministrators": ChatMembersFilterAdministratorsTypeID, + "chatMembersFilterMembers": ChatMembersFilterMembersTypeID, + "chatMembersFilterMention": ChatMembersFilterMentionTypeID, + "chatMembersFilterRestricted": ChatMembersFilterRestrictedTypeID, + "chatMembersFilterBanned": ChatMembersFilterBannedTypeID, + "chatMembersFilterBots": ChatMembersFilterBotsTypeID, + "supergroupMembersFilterRecent": SupergroupMembersFilterRecentTypeID, + "supergroupMembersFilterContacts": SupergroupMembersFilterContactsTypeID, + "supergroupMembersFilterAdministrators": SupergroupMembersFilterAdministratorsTypeID, + "supergroupMembersFilterSearch": SupergroupMembersFilterSearchTypeID, + "supergroupMembersFilterRestricted": SupergroupMembersFilterRestrictedTypeID, + "supergroupMembersFilterBanned": SupergroupMembersFilterBannedTypeID, + "supergroupMembersFilterMention": SupergroupMembersFilterMentionTypeID, + "supergroupMembersFilterBots": SupergroupMembersFilterBotsTypeID, + "chatInviteLink": ChatInviteLinkTypeID, + "chatInviteLinks": ChatInviteLinksTypeID, + "chatInviteLinkCount": ChatInviteLinkCountTypeID, + "chatInviteLinkCounts": ChatInviteLinkCountsTypeID, + "chatInviteLinkMember": ChatInviteLinkMemberTypeID, + "chatInviteLinkMembers": ChatInviteLinkMembersTypeID, + "inviteLinkChatTypeBasicGroup": InviteLinkChatTypeBasicGroupTypeID, + "inviteLinkChatTypeSupergroup": InviteLinkChatTypeSupergroupTypeID, + "inviteLinkChatTypeChannel": InviteLinkChatTypeChannelTypeID, + "chatInviteLinkSubscriptionInfo": ChatInviteLinkSubscriptionInfoTypeID, + "chatInviteLinkInfo": ChatInviteLinkInfoTypeID, + "chatJoinRequest": ChatJoinRequestTypeID, + "chatJoinRequests": ChatJoinRequestsTypeID, + "chatJoinRequestsInfo": ChatJoinRequestsInfoTypeID, + "basicGroup": BasicGroupTypeID, + "basicGroupFullInfo": BasicGroupFullInfoTypeID, + "supergroup": SupergroupTypeID, + "supergroupFullInfo": SupergroupFullInfoTypeID, + "secretChatStatePending": SecretChatStatePendingTypeID, + "secretChatStateReady": SecretChatStateReadyTypeID, + "secretChatStateClosed": SecretChatStateClosedTypeID, + "secretChat": SecretChatTypeID, + "messageSenderUser": MessageSenderUserTypeID, + "messageSenderChat": MessageSenderChatTypeID, + "messageSenders": MessageSendersTypeID, + "chatMessageSender": ChatMessageSenderTypeID, + "chatMessageSenders": ChatMessageSendersTypeID, + "messageReadDateRead": MessageReadDateReadTypeID, + "messageReadDateUnread": MessageReadDateUnreadTypeID, + "messageReadDateTooOld": MessageReadDateTooOldTypeID, + "messageReadDateUserPrivacyRestricted": MessageReadDateUserPrivacyRestrictedTypeID, + "messageReadDateMyPrivacyRestricted": MessageReadDateMyPrivacyRestrictedTypeID, + "messageViewer": MessageViewerTypeID, + "messageViewers": MessageViewersTypeID, + "messageOriginUser": MessageOriginUserTypeID, + "messageOriginHiddenUser": MessageOriginHiddenUserTypeID, + "messageOriginChat": MessageOriginChatTypeID, + "messageOriginChannel": MessageOriginChannelTypeID, + "forwardSource": ForwardSourceTypeID, + "reactionTypeEmoji": ReactionTypeEmojiTypeID, + "reactionTypeCustomEmoji": ReactionTypeCustomEmojiTypeID, + "reactionTypePaid": ReactionTypePaidTypeID, + "paidReactor": PaidReactorTypeID, + "messageForwardInfo": MessageForwardInfoTypeID, + "messageImportInfo": MessageImportInfoTypeID, + "messageReplyInfo": MessageReplyInfoTypeID, + "messageReaction": MessageReactionTypeID, + "messageReactions": MessageReactionsTypeID, + "messageInteractionInfo": MessageInteractionInfoTypeID, + "unreadReaction": UnreadReactionTypeID, + "messageEffectTypeEmojiReaction": MessageEffectTypeEmojiReactionTypeID, + "messageEffectTypePremiumSticker": MessageEffectTypePremiumStickerTypeID, + "messageEffect": MessageEffectTypeID, + "messageSendingStatePending": MessageSendingStatePendingTypeID, + "messageSendingStateFailed": MessageSendingStateFailedTypeID, + "textQuote": TextQuoteTypeID, + "inputTextQuote": InputTextQuoteTypeID, + "messageReplyToMessage": MessageReplyToMessageTypeID, + "messageReplyToStory": MessageReplyToStoryTypeID, + "inputMessageReplyToMessage": InputMessageReplyToMessageTypeID, + "inputMessageReplyToExternalMessage": InputMessageReplyToExternalMessageTypeID, + "inputMessageReplyToStory": InputMessageReplyToStoryTypeID, + "factCheck": FactCheckTypeID, + "message": MessageTypeID, + "messages": MessagesTypeID, + "foundMessages": FoundMessagesTypeID, + "foundChatMessages": FoundChatMessagesTypeID, + "messagePosition": MessagePositionTypeID, + "messagePositions": MessagePositionsTypeID, + "messageCalendarDay": MessageCalendarDayTypeID, + "messageCalendar": MessageCalendarTypeID, + "businessMessage": BusinessMessageTypeID, + "businessMessages": BusinessMessagesTypeID, + "messageSourceChatHistory": MessageSourceChatHistoryTypeID, + "messageSourceMessageThreadHistory": MessageSourceMessageThreadHistoryTypeID, + "messageSourceForumTopicHistory": MessageSourceForumTopicHistoryTypeID, + "messageSourceHistoryPreview": MessageSourceHistoryPreviewTypeID, + "messageSourceChatList": MessageSourceChatListTypeID, + "messageSourceSearch": MessageSourceSearchTypeID, + "messageSourceChatEventLog": MessageSourceChatEventLogTypeID, + "messageSourceNotification": MessageSourceNotificationTypeID, + "messageSourceScreenshot": MessageSourceScreenshotTypeID, + "messageSourceOther": MessageSourceOtherTypeID, + "messageSponsor": MessageSponsorTypeID, + "sponsoredMessage": SponsoredMessageTypeID, + "sponsoredMessages": SponsoredMessagesTypeID, + "reportOption": ReportOptionTypeID, + "reportChatSponsoredMessageResultOk": ReportChatSponsoredMessageResultOkTypeID, + "reportChatSponsoredMessageResultFailed": ReportChatSponsoredMessageResultFailedTypeID, + "reportChatSponsoredMessageResultOptionRequired": ReportChatSponsoredMessageResultOptionRequiredTypeID, + "reportChatSponsoredMessageResultAdsHidden": ReportChatSponsoredMessageResultAdsHiddenTypeID, + "reportChatSponsoredMessageResultPremiumRequired": ReportChatSponsoredMessageResultPremiumRequiredTypeID, + "fileDownload": FileDownloadTypeID, + "downloadedFileCounts": DownloadedFileCountsTypeID, + "foundFileDownloads": FoundFileDownloadsTypeID, + "notificationSettingsScopePrivateChats": NotificationSettingsScopePrivateChatsTypeID, + "notificationSettingsScopeGroupChats": NotificationSettingsScopeGroupChatsTypeID, + "notificationSettingsScopeChannelChats": NotificationSettingsScopeChannelChatsTypeID, + "chatNotificationSettings": ChatNotificationSettingsTypeID, + "scopeNotificationSettings": ScopeNotificationSettingsTypeID, + "reactionNotificationSourceNone": ReactionNotificationSourceNoneTypeID, + "reactionNotificationSourceContacts": ReactionNotificationSourceContactsTypeID, + "reactionNotificationSourceAll": ReactionNotificationSourceAllTypeID, + "reactionNotificationSettings": ReactionNotificationSettingsTypeID, + "draftMessage": DraftMessageTypeID, + "chatTypePrivate": ChatTypePrivateTypeID, + "chatTypeBasicGroup": ChatTypeBasicGroupTypeID, + "chatTypeSupergroup": ChatTypeSupergroupTypeID, + "chatTypeSecret": ChatTypeSecretTypeID, + "chatFolderIcon": ChatFolderIconTypeID, + "chatFolder": ChatFolderTypeID, + "chatFolderInfo": ChatFolderInfoTypeID, + "chatFolderInviteLink": ChatFolderInviteLinkTypeID, + "chatFolderInviteLinks": ChatFolderInviteLinksTypeID, + "chatFolderInviteLinkInfo": ChatFolderInviteLinkInfoTypeID, + "recommendedChatFolder": RecommendedChatFolderTypeID, + "recommendedChatFolders": RecommendedChatFoldersTypeID, + "archiveChatListSettings": ArchiveChatListSettingsTypeID, + "chatListMain": ChatListMainTypeID, + "chatListArchive": ChatListArchiveTypeID, + "chatListFolder": ChatListFolderTypeID, + "chatLists": ChatListsTypeID, + "chatSourceMtprotoProxy": ChatSourceMtprotoProxyTypeID, + "chatSourcePublicServiceAnnouncement": ChatSourcePublicServiceAnnouncementTypeID, + "chatPosition": ChatPositionTypeID, + "chatAvailableReactionsAll": ChatAvailableReactionsAllTypeID, + "chatAvailableReactionsSome": ChatAvailableReactionsSomeTypeID, + "savedMessagesTag": SavedMessagesTagTypeID, + "savedMessagesTags": SavedMessagesTagsTypeID, + "businessBotManageBar": BusinessBotManageBarTypeID, + "videoChat": VideoChatTypeID, + "chat": ChatTypeID, + "chats": ChatsTypeID, + "failedToAddMember": FailedToAddMemberTypeID, + "failedToAddMembers": FailedToAddMembersTypeID, + "createdBasicGroupChat": CreatedBasicGroupChatTypeID, + "chatNearby": ChatNearbyTypeID, + "chatsNearby": ChatsNearbyTypeID, + "publicChatTypeHasUsername": PublicChatTypeHasUsernameTypeID, + "publicChatTypeIsLocationBased": PublicChatTypeIsLocationBasedTypeID, + "chatActionBarReportSpam": ChatActionBarReportSpamTypeID, + "chatActionBarReportUnrelatedLocation": ChatActionBarReportUnrelatedLocationTypeID, + "chatActionBarInviteMembers": ChatActionBarInviteMembersTypeID, + "chatActionBarReportAddBlock": ChatActionBarReportAddBlockTypeID, + "chatActionBarAddContact": ChatActionBarAddContactTypeID, + "chatActionBarSharePhoneNumber": ChatActionBarSharePhoneNumberTypeID, + "chatActionBarJoinRequest": ChatActionBarJoinRequestTypeID, + "keyboardButtonTypeText": KeyboardButtonTypeTextTypeID, + "keyboardButtonTypeRequestPhoneNumber": KeyboardButtonTypeRequestPhoneNumberTypeID, + "keyboardButtonTypeRequestLocation": KeyboardButtonTypeRequestLocationTypeID, + "keyboardButtonTypeRequestPoll": KeyboardButtonTypeRequestPollTypeID, + "keyboardButtonTypeRequestUsers": KeyboardButtonTypeRequestUsersTypeID, + "keyboardButtonTypeRequestChat": KeyboardButtonTypeRequestChatTypeID, + "keyboardButtonTypeWebApp": KeyboardButtonTypeWebAppTypeID, + "keyboardButton": KeyboardButtonTypeID, + "inlineKeyboardButtonTypeUrl": InlineKeyboardButtonTypeURLTypeID, + "inlineKeyboardButtonTypeLoginUrl": InlineKeyboardButtonTypeLoginURLTypeID, + "inlineKeyboardButtonTypeWebApp": InlineKeyboardButtonTypeWebAppTypeID, + "inlineKeyboardButtonTypeCallback": InlineKeyboardButtonTypeCallbackTypeID, + "inlineKeyboardButtonTypeCallbackWithPassword": InlineKeyboardButtonTypeCallbackWithPasswordTypeID, + "inlineKeyboardButtonTypeCallbackGame": InlineKeyboardButtonTypeCallbackGameTypeID, + "inlineKeyboardButtonTypeSwitchInline": InlineKeyboardButtonTypeSwitchInlineTypeID, + "inlineKeyboardButtonTypeBuy": InlineKeyboardButtonTypeBuyTypeID, + "inlineKeyboardButtonTypeUser": InlineKeyboardButtonTypeUserTypeID, + "inlineKeyboardButtonTypeCopyText": InlineKeyboardButtonTypeCopyTextTypeID, + "inlineKeyboardButton": InlineKeyboardButtonTypeID, + "replyMarkupRemoveKeyboard": ReplyMarkupRemoveKeyboardTypeID, + "replyMarkupForceReply": ReplyMarkupForceReplyTypeID, + "replyMarkupShowKeyboard": ReplyMarkupShowKeyboardTypeID, + "replyMarkupInlineKeyboard": ReplyMarkupInlineKeyboardTypeID, + "loginUrlInfoOpen": LoginURLInfoOpenTypeID, + "loginUrlInfoRequestConfirmation": LoginURLInfoRequestConfirmationTypeID, + "foundWebApp": FoundWebAppTypeID, + "webAppInfo": WebAppInfoTypeID, + "mainWebApp": MainWebAppTypeID, + "messageThreadInfo": MessageThreadInfoTypeID, + "savedMessagesTopicTypeMyNotes": SavedMessagesTopicTypeMyNotesTypeID, + "savedMessagesTopicTypeAuthorHidden": SavedMessagesTopicTypeAuthorHiddenTypeID, + "savedMessagesTopicTypeSavedFromChat": SavedMessagesTopicTypeSavedFromChatTypeID, + "savedMessagesTopic": SavedMessagesTopicTypeID, + "forumTopicIcon": ForumTopicIconTypeID, + "forumTopicInfo": ForumTopicInfoTypeID, + "forumTopic": ForumTopicTypeID, + "forumTopics": ForumTopicsTypeID, + "linkPreviewOptions": LinkPreviewOptionsTypeID, + "sharedUser": SharedUserTypeID, + "sharedChat": SharedChatTypeID, + "themeSettings": ThemeSettingsTypeID, + "richTextPlain": RichTextPlainTypeID, + "richTextBold": RichTextBoldTypeID, + "richTextItalic": RichTextItalicTypeID, + "richTextUnderline": RichTextUnderlineTypeID, + "richTextStrikethrough": RichTextStrikethroughTypeID, + "richTextFixed": RichTextFixedTypeID, + "richTextUrl": RichTextURLTypeID, + "richTextEmailAddress": RichTextEmailAddressTypeID, + "richTextSubscript": RichTextSubscriptTypeID, + "richTextSuperscript": RichTextSuperscriptTypeID, + "richTextMarked": RichTextMarkedTypeID, + "richTextPhoneNumber": RichTextPhoneNumberTypeID, + "richTextIcon": RichTextIconTypeID, + "richTextReference": RichTextReferenceTypeID, + "richTextAnchor": RichTextAnchorTypeID, + "richTextAnchorLink": RichTextAnchorLinkTypeID, + "richTexts": RichTextsTypeID, + "pageBlockCaption": PageBlockCaptionTypeID, + "pageBlockListItem": PageBlockListItemTypeID, + "pageBlockHorizontalAlignmentLeft": PageBlockHorizontalAlignmentLeftTypeID, + "pageBlockHorizontalAlignmentCenter": PageBlockHorizontalAlignmentCenterTypeID, + "pageBlockHorizontalAlignmentRight": PageBlockHorizontalAlignmentRightTypeID, + "pageBlockVerticalAlignmentTop": PageBlockVerticalAlignmentTopTypeID, + "pageBlockVerticalAlignmentMiddle": PageBlockVerticalAlignmentMiddleTypeID, + "pageBlockVerticalAlignmentBottom": PageBlockVerticalAlignmentBottomTypeID, + "pageBlockTableCell": PageBlockTableCellTypeID, + "pageBlockRelatedArticle": PageBlockRelatedArticleTypeID, + "pageBlockTitle": PageBlockTitleTypeID, + "pageBlockSubtitle": PageBlockSubtitleTypeID, + "pageBlockAuthorDate": PageBlockAuthorDateTypeID, + "pageBlockHeader": PageBlockHeaderTypeID, + "pageBlockSubheader": PageBlockSubheaderTypeID, + "pageBlockKicker": PageBlockKickerTypeID, + "pageBlockParagraph": PageBlockParagraphTypeID, + "pageBlockPreformatted": PageBlockPreformattedTypeID, + "pageBlockFooter": PageBlockFooterTypeID, + "pageBlockDivider": PageBlockDividerTypeID, + "pageBlockAnchor": PageBlockAnchorTypeID, + "pageBlockList": PageBlockListTypeID, + "pageBlockBlockQuote": PageBlockBlockQuoteTypeID, + "pageBlockPullQuote": PageBlockPullQuoteTypeID, + "pageBlockAnimation": PageBlockAnimationTypeID, + "pageBlockAudio": PageBlockAudioTypeID, + "pageBlockPhoto": PageBlockPhotoTypeID, + "pageBlockVideo": PageBlockVideoTypeID, + "pageBlockVoiceNote": PageBlockVoiceNoteTypeID, + "pageBlockCover": PageBlockCoverTypeID, + "pageBlockEmbedded": PageBlockEmbeddedTypeID, + "pageBlockEmbeddedPost": PageBlockEmbeddedPostTypeID, + "pageBlockCollage": PageBlockCollageTypeID, + "pageBlockSlideshow": PageBlockSlideshowTypeID, + "pageBlockChatLink": PageBlockChatLinkTypeID, + "pageBlockTable": PageBlockTableTypeID, + "pageBlockDetails": PageBlockDetailsTypeID, + "pageBlockRelatedArticles": PageBlockRelatedArticlesTypeID, + "pageBlockMap": PageBlockMapTypeID, + "webPageInstantView": WebPageInstantViewTypeID, + "linkPreviewAlbumMediaPhoto": LinkPreviewAlbumMediaPhotoTypeID, + "linkPreviewAlbumMediaVideo": LinkPreviewAlbumMediaVideoTypeID, + "linkPreviewTypeAlbum": LinkPreviewTypeAlbumTypeID, + "linkPreviewTypeAnimation": LinkPreviewTypeAnimationTypeID, + "linkPreviewTypeApp": LinkPreviewTypeAppTypeID, + "linkPreviewTypeArticle": LinkPreviewTypeArticleTypeID, + "linkPreviewTypeAudio": LinkPreviewTypeAudioTypeID, + "linkPreviewTypeBackground": LinkPreviewTypeBackgroundTypeID, + "linkPreviewTypeChannelBoost": LinkPreviewTypeChannelBoostTypeID, + "linkPreviewTypeChat": LinkPreviewTypeChatTypeID, + "linkPreviewTypeDocument": LinkPreviewTypeDocumentTypeID, + "linkPreviewTypeEmbeddedAnimationPlayer": LinkPreviewTypeEmbeddedAnimationPlayerTypeID, + "linkPreviewTypeEmbeddedAudioPlayer": LinkPreviewTypeEmbeddedAudioPlayerTypeID, + "linkPreviewTypeEmbeddedVideoPlayer": LinkPreviewTypeEmbeddedVideoPlayerTypeID, + "linkPreviewTypeExternalAudio": LinkPreviewTypeExternalAudioTypeID, + "linkPreviewTypeExternalVideo": LinkPreviewTypeExternalVideoTypeID, + "linkPreviewTypeInvoice": LinkPreviewTypeInvoiceTypeID, + "linkPreviewTypeMessage": LinkPreviewTypeMessageTypeID, + "linkPreviewTypePhoto": LinkPreviewTypePhotoTypeID, + "linkPreviewTypePremiumGiftCode": LinkPreviewTypePremiumGiftCodeTypeID, + "linkPreviewTypeShareableChatFolder": LinkPreviewTypeShareableChatFolderTypeID, + "linkPreviewTypeSticker": LinkPreviewTypeStickerTypeID, + "linkPreviewTypeStickerSet": LinkPreviewTypeStickerSetTypeID, + "linkPreviewTypeStory": LinkPreviewTypeStoryTypeID, + "linkPreviewTypeSupergroupBoost": LinkPreviewTypeSupergroupBoostTypeID, + "linkPreviewTypeTheme": LinkPreviewTypeThemeTypeID, + "linkPreviewTypeUnsupported": LinkPreviewTypeUnsupportedTypeID, + "linkPreviewTypeUser": LinkPreviewTypeUserTypeID, + "linkPreviewTypeVideo": LinkPreviewTypeVideoTypeID, + "linkPreviewTypeVideoChat": LinkPreviewTypeVideoChatTypeID, + "linkPreviewTypeVideoNote": LinkPreviewTypeVideoNoteTypeID, + "linkPreviewTypeVoiceNote": LinkPreviewTypeVoiceNoteTypeID, + "linkPreviewTypeWebApp": LinkPreviewTypeWebAppTypeID, + "linkPreview": LinkPreviewTypeID, + "countryInfo": CountryInfoTypeID, + "countries": CountriesTypeID, + "phoneNumberInfo": PhoneNumberInfoTypeID, + "collectibleItemTypeUsername": CollectibleItemTypeUsernameTypeID, + "collectibleItemTypePhoneNumber": CollectibleItemTypePhoneNumberTypeID, + "collectibleItemInfo": CollectibleItemInfoTypeID, + "bankCardActionOpenUrl": BankCardActionOpenURLTypeID, + "bankCardInfo": BankCardInfoTypeID, + "address": AddressTypeID, + "locationAddress": LocationAddressTypeID, + "themeParameters": ThemeParametersTypeID, + "labeledPricePart": LabeledPricePartTypeID, + "invoice": InvoiceTypeID, + "orderInfo": OrderInfoTypeID, + "shippingOption": ShippingOptionTypeID, + "savedCredentials": SavedCredentialsTypeID, + "inputCredentialsSaved": InputCredentialsSavedTypeID, + "inputCredentialsNew": InputCredentialsNewTypeID, + "inputCredentialsApplePay": InputCredentialsApplePayTypeID, + "inputCredentialsGooglePay": InputCredentialsGooglePayTypeID, + "paymentProviderSmartGlocal": PaymentProviderSmartGlocalTypeID, + "paymentProviderStripe": PaymentProviderStripeTypeID, + "paymentProviderOther": PaymentProviderOtherTypeID, + "paymentOption": PaymentOptionTypeID, + "paymentFormTypeRegular": PaymentFormTypeRegularTypeID, + "paymentFormTypeStars": PaymentFormTypeStarsTypeID, + "paymentForm": PaymentFormTypeID, + "validatedOrderInfo": ValidatedOrderInfoTypeID, + "paymentResult": PaymentResultTypeID, + "paymentReceiptTypeRegular": PaymentReceiptTypeRegularTypeID, + "paymentReceiptTypeStars": PaymentReceiptTypeStarsTypeID, + "paymentReceipt": PaymentReceiptTypeID, + "inputInvoiceMessage": InputInvoiceMessageTypeID, + "inputInvoiceName": InputInvoiceNameTypeID, + "inputInvoiceTelegram": InputInvoiceTelegramTypeID, + "paidMediaPreview": PaidMediaPreviewTypeID, + "paidMediaPhoto": PaidMediaPhotoTypeID, + "paidMediaVideo": PaidMediaVideoTypeID, + "paidMediaUnsupported": PaidMediaUnsupportedTypeID, + "giveawayParameters": GiveawayParametersTypeID, + "datedFile": DatedFileTypeID, + "passportElementTypePersonalDetails": PassportElementTypePersonalDetailsTypeID, + "passportElementTypePassport": PassportElementTypePassportTypeID, + "passportElementTypeDriverLicense": PassportElementTypeDriverLicenseTypeID, + "passportElementTypeIdentityCard": PassportElementTypeIdentityCardTypeID, + "passportElementTypeInternalPassport": PassportElementTypeInternalPassportTypeID, + "passportElementTypeAddress": PassportElementTypeAddressTypeID, + "passportElementTypeUtilityBill": PassportElementTypeUtilityBillTypeID, + "passportElementTypeBankStatement": PassportElementTypeBankStatementTypeID, + "passportElementTypeRentalAgreement": PassportElementTypeRentalAgreementTypeID, + "passportElementTypePassportRegistration": PassportElementTypePassportRegistrationTypeID, + "passportElementTypeTemporaryRegistration": PassportElementTypeTemporaryRegistrationTypeID, + "passportElementTypePhoneNumber": PassportElementTypePhoneNumberTypeID, + "passportElementTypeEmailAddress": PassportElementTypeEmailAddressTypeID, + "date": DateTypeID, + "personalDetails": PersonalDetailsTypeID, + "identityDocument": IdentityDocumentTypeID, + "inputIdentityDocument": InputIdentityDocumentTypeID, + "personalDocument": PersonalDocumentTypeID, + "inputPersonalDocument": InputPersonalDocumentTypeID, + "passportElementPersonalDetails": PassportElementPersonalDetailsTypeID, + "passportElementPassport": PassportElementPassportTypeID, + "passportElementDriverLicense": PassportElementDriverLicenseTypeID, + "passportElementIdentityCard": PassportElementIdentityCardTypeID, + "passportElementInternalPassport": PassportElementInternalPassportTypeID, + "passportElementAddress": PassportElementAddressTypeID, + "passportElementUtilityBill": PassportElementUtilityBillTypeID, + "passportElementBankStatement": PassportElementBankStatementTypeID, + "passportElementRentalAgreement": PassportElementRentalAgreementTypeID, + "passportElementPassportRegistration": PassportElementPassportRegistrationTypeID, + "passportElementTemporaryRegistration": PassportElementTemporaryRegistrationTypeID, + "passportElementPhoneNumber": PassportElementPhoneNumberTypeID, + "passportElementEmailAddress": PassportElementEmailAddressTypeID, + "inputPassportElementPersonalDetails": InputPassportElementPersonalDetailsTypeID, + "inputPassportElementPassport": InputPassportElementPassportTypeID, + "inputPassportElementDriverLicense": InputPassportElementDriverLicenseTypeID, + "inputPassportElementIdentityCard": InputPassportElementIdentityCardTypeID, + "inputPassportElementInternalPassport": InputPassportElementInternalPassportTypeID, + "inputPassportElementAddress": InputPassportElementAddressTypeID, + "inputPassportElementUtilityBill": InputPassportElementUtilityBillTypeID, + "inputPassportElementBankStatement": InputPassportElementBankStatementTypeID, + "inputPassportElementRentalAgreement": InputPassportElementRentalAgreementTypeID, + "inputPassportElementPassportRegistration": InputPassportElementPassportRegistrationTypeID, + "inputPassportElementTemporaryRegistration": InputPassportElementTemporaryRegistrationTypeID, + "inputPassportElementPhoneNumber": InputPassportElementPhoneNumberTypeID, + "inputPassportElementEmailAddress": InputPassportElementEmailAddressTypeID, + "passportElements": PassportElementsTypeID, + "passportElementErrorSourceUnspecified": PassportElementErrorSourceUnspecifiedTypeID, + "passportElementErrorSourceDataField": PassportElementErrorSourceDataFieldTypeID, + "passportElementErrorSourceFrontSide": PassportElementErrorSourceFrontSideTypeID, + "passportElementErrorSourceReverseSide": PassportElementErrorSourceReverseSideTypeID, + "passportElementErrorSourceSelfie": PassportElementErrorSourceSelfieTypeID, + "passportElementErrorSourceTranslationFile": PassportElementErrorSourceTranslationFileTypeID, + "passportElementErrorSourceTranslationFiles": PassportElementErrorSourceTranslationFilesTypeID, + "passportElementErrorSourceFile": PassportElementErrorSourceFileTypeID, + "passportElementErrorSourceFiles": PassportElementErrorSourceFilesTypeID, + "passportElementError": PassportElementErrorTypeID, + "passportSuitableElement": PassportSuitableElementTypeID, + "passportRequiredElement": PassportRequiredElementTypeID, + "passportAuthorizationForm": PassportAuthorizationFormTypeID, + "passportElementsWithErrors": PassportElementsWithErrorsTypeID, + "encryptedCredentials": EncryptedCredentialsTypeID, + "encryptedPassportElement": EncryptedPassportElementTypeID, + "inputPassportElementErrorSourceUnspecified": InputPassportElementErrorSourceUnspecifiedTypeID, + "inputPassportElementErrorSourceDataField": InputPassportElementErrorSourceDataFieldTypeID, + "inputPassportElementErrorSourceFrontSide": InputPassportElementErrorSourceFrontSideTypeID, + "inputPassportElementErrorSourceReverseSide": InputPassportElementErrorSourceReverseSideTypeID, + "inputPassportElementErrorSourceSelfie": InputPassportElementErrorSourceSelfieTypeID, + "inputPassportElementErrorSourceTranslationFile": InputPassportElementErrorSourceTranslationFileTypeID, + "inputPassportElementErrorSourceTranslationFiles": InputPassportElementErrorSourceTranslationFilesTypeID, + "inputPassportElementErrorSourceFile": InputPassportElementErrorSourceFileTypeID, + "inputPassportElementErrorSourceFiles": InputPassportElementErrorSourceFilesTypeID, + "inputPassportElementError": InputPassportElementErrorTypeID, + "messageText": MessageTextTypeID, + "messageAnimation": MessageAnimationTypeID, + "messageAudio": MessageAudioTypeID, + "messageDocument": MessageDocumentTypeID, + "messagePaidMedia": MessagePaidMediaTypeID, + "messagePhoto": MessagePhotoTypeID, + "messageSticker": MessageStickerTypeID, + "messageVideo": MessageVideoTypeID, + "messageVideoNote": MessageVideoNoteTypeID, + "messageVoiceNote": MessageVoiceNoteTypeID, + "messageExpiredPhoto": MessageExpiredPhotoTypeID, + "messageExpiredVideo": MessageExpiredVideoTypeID, + "messageExpiredVideoNote": MessageExpiredVideoNoteTypeID, + "messageExpiredVoiceNote": MessageExpiredVoiceNoteTypeID, + "messageLocation": MessageLocationTypeID, + "messageVenue": MessageVenueTypeID, + "messageContact": MessageContactTypeID, + "messageAnimatedEmoji": MessageAnimatedEmojiTypeID, + "messageDice": MessageDiceTypeID, + "messageGame": MessageGameTypeID, + "messagePoll": MessagePollTypeID, + "messageStory": MessageStoryTypeID, + "messageInvoice": MessageInvoiceTypeID, + "messageCall": MessageCallTypeID, + "messageVideoChatScheduled": MessageVideoChatScheduledTypeID, + "messageVideoChatStarted": MessageVideoChatStartedTypeID, + "messageVideoChatEnded": MessageVideoChatEndedTypeID, + "messageInviteVideoChatParticipants": MessageInviteVideoChatParticipantsTypeID, + "messageBasicGroupChatCreate": MessageBasicGroupChatCreateTypeID, + "messageSupergroupChatCreate": MessageSupergroupChatCreateTypeID, + "messageChatChangeTitle": MessageChatChangeTitleTypeID, + "messageChatChangePhoto": MessageChatChangePhotoTypeID, + "messageChatDeletePhoto": MessageChatDeletePhotoTypeID, + "messageChatAddMembers": MessageChatAddMembersTypeID, + "messageChatJoinByLink": MessageChatJoinByLinkTypeID, + "messageChatJoinByRequest": MessageChatJoinByRequestTypeID, + "messageChatDeleteMember": MessageChatDeleteMemberTypeID, + "messageChatUpgradeTo": MessageChatUpgradeToTypeID, + "messageChatUpgradeFrom": MessageChatUpgradeFromTypeID, + "messagePinMessage": MessagePinMessageTypeID, + "messageScreenshotTaken": MessageScreenshotTakenTypeID, + "messageChatSetBackground": MessageChatSetBackgroundTypeID, + "messageChatSetTheme": MessageChatSetThemeTypeID, + "messageChatSetMessageAutoDeleteTime": MessageChatSetMessageAutoDeleteTimeTypeID, + "messageChatBoost": MessageChatBoostTypeID, + "messageForumTopicCreated": MessageForumTopicCreatedTypeID, + "messageForumTopicEdited": MessageForumTopicEditedTypeID, + "messageForumTopicIsClosedToggled": MessageForumTopicIsClosedToggledTypeID, + "messageForumTopicIsHiddenToggled": MessageForumTopicIsHiddenToggledTypeID, + "messageSuggestProfilePhoto": MessageSuggestProfilePhotoTypeID, + "messageCustomServiceAction": MessageCustomServiceActionTypeID, + "messageGameScore": MessageGameScoreTypeID, + "messagePaymentSuccessful": MessagePaymentSuccessfulTypeID, + "messagePaymentSuccessfulBot": MessagePaymentSuccessfulBotTypeID, + "messagePaymentRefunded": MessagePaymentRefundedTypeID, + "messageGiftedPremium": MessageGiftedPremiumTypeID, + "messagePremiumGiftCode": MessagePremiumGiftCodeTypeID, + "messageGiveawayCreated": MessageGiveawayCreatedTypeID, + "messageGiveaway": MessageGiveawayTypeID, + "messageGiveawayCompleted": MessageGiveawayCompletedTypeID, + "messageGiveawayWinners": MessageGiveawayWinnersTypeID, + "messageGiftedStars": MessageGiftedStarsTypeID, + "messageGiveawayPrizeStars": MessageGiveawayPrizeStarsTypeID, + "messageGift": MessageGiftTypeID, + "messageContactRegistered": MessageContactRegisteredTypeID, + "messageUsersShared": MessageUsersSharedTypeID, + "messageChatShared": MessageChatSharedTypeID, + "messageBotWriteAccessAllowed": MessageBotWriteAccessAllowedTypeID, + "messageWebAppDataSent": MessageWebAppDataSentTypeID, + "messageWebAppDataReceived": MessageWebAppDataReceivedTypeID, + "messagePassportDataSent": MessagePassportDataSentTypeID, + "messagePassportDataReceived": MessagePassportDataReceivedTypeID, + "messageProximityAlertTriggered": MessageProximityAlertTriggeredTypeID, + "messageUnsupported": MessageUnsupportedTypeID, + "textEntityTypeMention": TextEntityTypeMentionTypeID, + "textEntityTypeHashtag": TextEntityTypeHashtagTypeID, + "textEntityTypeCashtag": TextEntityTypeCashtagTypeID, + "textEntityTypeBotCommand": TextEntityTypeBotCommandTypeID, + "textEntityTypeUrl": TextEntityTypeURLTypeID, + "textEntityTypeEmailAddress": TextEntityTypeEmailAddressTypeID, + "textEntityTypePhoneNumber": TextEntityTypePhoneNumberTypeID, + "textEntityTypeBankCardNumber": TextEntityTypeBankCardNumberTypeID, + "textEntityTypeBold": TextEntityTypeBoldTypeID, + "textEntityTypeItalic": TextEntityTypeItalicTypeID, + "textEntityTypeUnderline": TextEntityTypeUnderlineTypeID, + "textEntityTypeStrikethrough": TextEntityTypeStrikethroughTypeID, + "textEntityTypeSpoiler": TextEntityTypeSpoilerTypeID, + "textEntityTypeCode": TextEntityTypeCodeTypeID, + "textEntityTypePre": TextEntityTypePreTypeID, + "textEntityTypePreCode": TextEntityTypePreCodeTypeID, + "textEntityTypeBlockQuote": TextEntityTypeBlockQuoteTypeID, + "textEntityTypeExpandableBlockQuote": TextEntityTypeExpandableBlockQuoteTypeID, + "textEntityTypeTextUrl": TextEntityTypeTextURLTypeID, + "textEntityTypeMentionName": TextEntityTypeMentionNameTypeID, + "textEntityTypeCustomEmoji": TextEntityTypeCustomEmojiTypeID, + "textEntityTypeMediaTimestamp": TextEntityTypeMediaTimestampTypeID, + "inputThumbnail": InputThumbnailTypeID, + "inputPaidMediaTypePhoto": InputPaidMediaTypePhotoTypeID, + "inputPaidMediaTypeVideo": InputPaidMediaTypeVideoTypeID, + "inputPaidMedia": InputPaidMediaTypeID, + "messageSchedulingStateSendAtDate": MessageSchedulingStateSendAtDateTypeID, + "messageSchedulingStateSendWhenOnline": MessageSchedulingStateSendWhenOnlineTypeID, + "messageSelfDestructTypeTimer": MessageSelfDestructTypeTimerTypeID, + "messageSelfDestructTypeImmediately": MessageSelfDestructTypeImmediatelyTypeID, + "messageSendOptions": MessageSendOptionsTypeID, + "messageCopyOptions": MessageCopyOptionsTypeID, + "inputMessageText": InputMessageTextTypeID, + "inputMessageAnimation": InputMessageAnimationTypeID, + "inputMessageAudio": InputMessageAudioTypeID, + "inputMessageDocument": InputMessageDocumentTypeID, + "inputMessagePaidMedia": InputMessagePaidMediaTypeID, + "inputMessagePhoto": InputMessagePhotoTypeID, + "inputMessageSticker": InputMessageStickerTypeID, + "inputMessageVideo": InputMessageVideoTypeID, + "inputMessageVideoNote": InputMessageVideoNoteTypeID, + "inputMessageVoiceNote": InputMessageVoiceNoteTypeID, + "inputMessageLocation": InputMessageLocationTypeID, + "inputMessageVenue": InputMessageVenueTypeID, + "inputMessageContact": InputMessageContactTypeID, + "inputMessageDice": InputMessageDiceTypeID, + "inputMessageGame": InputMessageGameTypeID, + "inputMessageInvoice": InputMessageInvoiceTypeID, + "inputMessagePoll": InputMessagePollTypeID, + "inputMessageStory": InputMessageStoryTypeID, + "inputMessageForwarded": InputMessageForwardedTypeID, + "messageProperties": MessagePropertiesTypeID, + "searchMessagesFilterEmpty": SearchMessagesFilterEmptyTypeID, + "searchMessagesFilterAnimation": SearchMessagesFilterAnimationTypeID, + "searchMessagesFilterAudio": SearchMessagesFilterAudioTypeID, + "searchMessagesFilterDocument": SearchMessagesFilterDocumentTypeID, + "searchMessagesFilterPhoto": SearchMessagesFilterPhotoTypeID, + "searchMessagesFilterVideo": SearchMessagesFilterVideoTypeID, + "searchMessagesFilterVoiceNote": SearchMessagesFilterVoiceNoteTypeID, + "searchMessagesFilterPhotoAndVideo": SearchMessagesFilterPhotoAndVideoTypeID, + "searchMessagesFilterUrl": SearchMessagesFilterURLTypeID, + "searchMessagesFilterChatPhoto": SearchMessagesFilterChatPhotoTypeID, + "searchMessagesFilterVideoNote": SearchMessagesFilterVideoNoteTypeID, + "searchMessagesFilterVoiceAndVideoNote": SearchMessagesFilterVoiceAndVideoNoteTypeID, + "searchMessagesFilterMention": SearchMessagesFilterMentionTypeID, + "searchMessagesFilterUnreadMention": SearchMessagesFilterUnreadMentionTypeID, + "searchMessagesFilterUnreadReaction": SearchMessagesFilterUnreadReactionTypeID, + "searchMessagesFilterFailedToSend": SearchMessagesFilterFailedToSendTypeID, + "searchMessagesFilterPinned": SearchMessagesFilterPinnedTypeID, + "chatActionTyping": ChatActionTypingTypeID, + "chatActionRecordingVideo": ChatActionRecordingVideoTypeID, + "chatActionUploadingVideo": ChatActionUploadingVideoTypeID, + "chatActionRecordingVoiceNote": ChatActionRecordingVoiceNoteTypeID, + "chatActionUploadingVoiceNote": ChatActionUploadingVoiceNoteTypeID, + "chatActionUploadingPhoto": ChatActionUploadingPhotoTypeID, + "chatActionUploadingDocument": ChatActionUploadingDocumentTypeID, + "chatActionChoosingSticker": ChatActionChoosingStickerTypeID, + "chatActionChoosingLocation": ChatActionChoosingLocationTypeID, + "chatActionChoosingContact": ChatActionChoosingContactTypeID, + "chatActionStartPlayingGame": ChatActionStartPlayingGameTypeID, + "chatActionRecordingVideoNote": ChatActionRecordingVideoNoteTypeID, + "chatActionUploadingVideoNote": ChatActionUploadingVideoNoteTypeID, + "chatActionWatchingAnimations": ChatActionWatchingAnimationsTypeID, + "chatActionCancel": ChatActionCancelTypeID, + "userStatusEmpty": UserStatusEmptyTypeID, + "userStatusOnline": UserStatusOnlineTypeID, + "userStatusOffline": UserStatusOfflineTypeID, + "userStatusRecently": UserStatusRecentlyTypeID, + "userStatusLastWeek": UserStatusLastWeekTypeID, + "userStatusLastMonth": UserStatusLastMonthTypeID, + "emojiKeyword": EmojiKeywordTypeID, + "emojiKeywords": EmojiKeywordsTypeID, + "stickers": StickersTypeID, + "emojis": EmojisTypeID, + "stickerSet": StickerSetTypeID, + "stickerSetInfo": StickerSetInfoTypeID, + "stickerSets": StickerSetsTypeID, + "trendingStickerSets": TrendingStickerSetsTypeID, + "emojiCategorySourceSearch": EmojiCategorySourceSearchTypeID, + "emojiCategorySourcePremium": EmojiCategorySourcePremiumTypeID, + "emojiCategory": EmojiCategoryTypeID, + "emojiCategories": EmojiCategoriesTypeID, + "emojiCategoryTypeDefault": EmojiCategoryTypeDefaultTypeID, + "emojiCategoryTypeRegularStickers": EmojiCategoryTypeRegularStickersTypeID, + "emojiCategoryTypeEmojiStatus": EmojiCategoryTypeEmojiStatusTypeID, + "emojiCategoryTypeChatPhoto": EmojiCategoryTypeChatPhotoTypeID, + "currentWeather": CurrentWeatherTypeID, + "storyAreaPosition": StoryAreaPositionTypeID, + "storyAreaTypeLocation": StoryAreaTypeLocationTypeID, + "storyAreaTypeVenue": StoryAreaTypeVenueTypeID, + "storyAreaTypeSuggestedReaction": StoryAreaTypeSuggestedReactionTypeID, + "storyAreaTypeMessage": StoryAreaTypeMessageTypeID, + "storyAreaTypeLink": StoryAreaTypeLinkTypeID, + "storyAreaTypeWeather": StoryAreaTypeWeatherTypeID, + "storyArea": StoryAreaTypeID, + "inputStoryAreaTypeLocation": InputStoryAreaTypeLocationTypeID, + "inputStoryAreaTypeFoundVenue": InputStoryAreaTypeFoundVenueTypeID, + "inputStoryAreaTypePreviousVenue": InputStoryAreaTypePreviousVenueTypeID, + "inputStoryAreaTypeSuggestedReaction": InputStoryAreaTypeSuggestedReactionTypeID, + "inputStoryAreaTypeMessage": InputStoryAreaTypeMessageTypeID, + "inputStoryAreaTypeLink": InputStoryAreaTypeLinkTypeID, + "inputStoryAreaTypeWeather": InputStoryAreaTypeWeatherTypeID, + "inputStoryArea": InputStoryAreaTypeID, + "inputStoryAreas": InputStoryAreasTypeID, + "storyVideo": StoryVideoTypeID, + "storyContentPhoto": StoryContentPhotoTypeID, + "storyContentVideo": StoryContentVideoTypeID, + "storyContentUnsupported": StoryContentUnsupportedTypeID, + "inputStoryContentPhoto": InputStoryContentPhotoTypeID, + "inputStoryContentVideo": InputStoryContentVideoTypeID, + "storyListMain": StoryListMainTypeID, + "storyListArchive": StoryListArchiveTypeID, + "storyOriginPublicStory": StoryOriginPublicStoryTypeID, + "storyOriginHiddenUser": StoryOriginHiddenUserTypeID, + "storyRepostInfo": StoryRepostInfoTypeID, + "storyInteractionInfo": StoryInteractionInfoTypeID, + "story": StoryTypeID, + "stories": StoriesTypeID, + "foundStories": FoundStoriesTypeID, + "storyFullId": StoryFullIDTypeID, + "storyInfo": StoryInfoTypeID, + "chatActiveStories": ChatActiveStoriesTypeID, + "storyInteractionTypeView": StoryInteractionTypeViewTypeID, + "storyInteractionTypeForward": StoryInteractionTypeForwardTypeID, + "storyInteractionTypeRepost": StoryInteractionTypeRepostTypeID, + "storyInteraction": StoryInteractionTypeID, + "storyInteractions": StoryInteractionsTypeID, + "quickReplyMessage": QuickReplyMessageTypeID, + "quickReplyMessages": QuickReplyMessagesTypeID, + "quickReplyShortcut": QuickReplyShortcutTypeID, + "publicForwardMessage": PublicForwardMessageTypeID, + "publicForwardStory": PublicForwardStoryTypeID, + "publicForwards": PublicForwardsTypeID, + "botMediaPreview": BotMediaPreviewTypeID, + "botMediaPreviews": BotMediaPreviewsTypeID, + "botMediaPreviewInfo": BotMediaPreviewInfoTypeID, + "chatBoostLevelFeatures": ChatBoostLevelFeaturesTypeID, + "chatBoostFeatures": ChatBoostFeaturesTypeID, + "chatBoostSourceGiftCode": ChatBoostSourceGiftCodeTypeID, + "chatBoostSourceGiveaway": ChatBoostSourceGiveawayTypeID, + "chatBoostSourcePremium": ChatBoostSourcePremiumTypeID, + "prepaidGiveaway": PrepaidGiveawayTypeID, + "chatBoostStatus": ChatBoostStatusTypeID, + "chatBoost": ChatBoostTypeID, + "foundChatBoosts": FoundChatBoostsTypeID, + "chatBoostSlot": ChatBoostSlotTypeID, + "chatBoostSlots": ChatBoostSlotsTypeID, + "resendCodeReasonUserRequest": ResendCodeReasonUserRequestTypeID, + "resendCodeReasonVerificationFailed": ResendCodeReasonVerificationFailedTypeID, + "callDiscardReasonEmpty": CallDiscardReasonEmptyTypeID, + "callDiscardReasonMissed": CallDiscardReasonMissedTypeID, + "callDiscardReasonDeclined": CallDiscardReasonDeclinedTypeID, + "callDiscardReasonDisconnected": CallDiscardReasonDisconnectedTypeID, + "callDiscardReasonHungUp": CallDiscardReasonHungUpTypeID, + "callProtocol": CallProtocolTypeID, + "callServerTypeTelegramReflector": CallServerTypeTelegramReflectorTypeID, + "callServerTypeWebrtc": CallServerTypeWebrtcTypeID, + "callServer": CallServerTypeID, + "callId": CallIDTypeID, + "groupCallId": GroupCallIDTypeID, + "callStatePending": CallStatePendingTypeID, + "callStateExchangingKeys": CallStateExchangingKeysTypeID, + "callStateReady": CallStateReadyTypeID, + "callStateHangingUp": CallStateHangingUpTypeID, + "callStateDiscarded": CallStateDiscardedTypeID, + "callStateError": CallStateErrorTypeID, + "groupCallVideoQualityThumbnail": GroupCallVideoQualityThumbnailTypeID, + "groupCallVideoQualityMedium": GroupCallVideoQualityMediumTypeID, + "groupCallVideoQualityFull": GroupCallVideoQualityFullTypeID, + "groupCallStream": GroupCallStreamTypeID, + "groupCallStreams": GroupCallStreamsTypeID, + "rtmpUrl": RtmpURLTypeID, + "groupCallRecentSpeaker": GroupCallRecentSpeakerTypeID, + "groupCall": GroupCallTypeID, + "groupCallVideoSourceGroup": GroupCallVideoSourceGroupTypeID, + "groupCallParticipantVideoInfo": GroupCallParticipantVideoInfoTypeID, + "groupCallParticipant": GroupCallParticipantTypeID, + "callProblemEcho": CallProblemEchoTypeID, + "callProblemNoise": CallProblemNoiseTypeID, + "callProblemInterruptions": CallProblemInterruptionsTypeID, + "callProblemDistortedSpeech": CallProblemDistortedSpeechTypeID, + "callProblemSilentLocal": CallProblemSilentLocalTypeID, + "callProblemSilentRemote": CallProblemSilentRemoteTypeID, + "callProblemDropped": CallProblemDroppedTypeID, + "callProblemDistortedVideo": CallProblemDistortedVideoTypeID, + "callProblemPixelatedVideo": CallProblemPixelatedVideoTypeID, + "call": CallTypeID, + "firebaseAuthenticationSettingsAndroid": FirebaseAuthenticationSettingsAndroidTypeID, + "firebaseAuthenticationSettingsIos": FirebaseAuthenticationSettingsIosTypeID, + "phoneNumberAuthenticationSettings": PhoneNumberAuthenticationSettingsTypeID, + "addedReaction": AddedReactionTypeID, + "addedReactions": AddedReactionsTypeID, + "availableReaction": AvailableReactionTypeID, + "availableReactions": AvailableReactionsTypeID, + "emojiReaction": EmojiReactionTypeID, + "reactionUnavailabilityReasonAnonymousAdministrator": ReactionUnavailabilityReasonAnonymousAdministratorTypeID, + "reactionUnavailabilityReasonGuest": ReactionUnavailabilityReasonGuestTypeID, + "animations": AnimationsTypeID, + "diceStickersRegular": DiceStickersRegularTypeID, + "diceStickersSlotMachine": DiceStickersSlotMachineTypeID, + "importedContacts": ImportedContactsTypeID, + "speechRecognitionResultPending": SpeechRecognitionResultPendingTypeID, + "speechRecognitionResultText": SpeechRecognitionResultTextTypeID, + "speechRecognitionResultError": SpeechRecognitionResultErrorTypeID, + "businessConnection": BusinessConnectionTypeID, + "attachmentMenuBotColor": AttachmentMenuBotColorTypeID, + "attachmentMenuBot": AttachmentMenuBotTypeID, + "sentWebAppMessage": SentWebAppMessageTypeID, + "botWriteAccessAllowReasonConnectedWebsite": BotWriteAccessAllowReasonConnectedWebsiteTypeID, + "botWriteAccessAllowReasonAddedToAttachmentMenu": BotWriteAccessAllowReasonAddedToAttachmentMenuTypeID, + "botWriteAccessAllowReasonLaunchedWebApp": BotWriteAccessAllowReasonLaunchedWebAppTypeID, + "botWriteAccessAllowReasonAcceptedRequest": BotWriteAccessAllowReasonAcceptedRequestTypeID, "httpUrl": HTTPURLTypeID, "userLink": UserLinkTypeID, "inputInlineQueryResultAnimation": InputInlineQueryResultAnimationTypeID, @@ -3617,6 +3651,7 @@ func NamesMap() map[string]uint32 { "pushMessageContentPoll": PushMessageContentPollTypeID, "pushMessageContentPremiumGiftCode": PushMessageContentPremiumGiftCodeTypeID, "pushMessageContentGiveaway": PushMessageContentGiveawayTypeID, + "pushMessageContentGift": PushMessageContentGiftTypeID, "pushMessageContentScreenshotTaken": PushMessageContentScreenshotTakenTypeID, "pushMessageContentSticker": PushMessageContentStickerTypeID, "pushMessageContentStory": PushMessageContentStoryTypeID, @@ -3724,6 +3759,13 @@ func NamesMap() map[string]uint32 { "reportReasonIllegalDrugs": ReportReasonIllegalDrugsTypeID, "reportReasonPersonalDetails": ReportReasonPersonalDetailsTypeID, "reportReasonCustom": ReportReasonCustomTypeID, + "reportChatResultOk": ReportChatResultOkTypeID, + "reportChatResultOptionRequired": ReportChatResultOptionRequiredTypeID, + "reportChatResultTextRequired": ReportChatResultTextRequiredTypeID, + "reportChatResultMessagesRequired": ReportChatResultMessagesRequiredTypeID, + "reportStoryResultOk": ReportStoryResultOkTypeID, + "reportStoryResultOptionRequired": ReportStoryResultOptionRequiredTypeID, + "reportStoryResultTextRequired": ReportStoryResultTextRequiredTypeID, "targetChatCurrent": TargetChatCurrentTypeID, "targetChatChosen": TargetChatChosenTypeID, "targetChatInternalLink": TargetChatInternalLinkTypeID, @@ -4694,6 +4736,11 @@ func NamesMap() map[string]uint32 { "getSavedOrderInfo": GetSavedOrderInfoRequestTypeID, "deleteSavedOrderInfo": DeleteSavedOrderInfoRequestTypeID, "deleteSavedCredentials": DeleteSavedCredentialsRequestTypeID, + "getAvailableGifts": GetAvailableGiftsRequestTypeID, + "sendGift": SendGiftRequestTypeID, + "sellGift": SellGiftRequestTypeID, + "toggleGiftIsSaved": ToggleGiftIsSavedRequestTypeID, + "getUserGifts": GetUserGiftsRequestTypeID, "createInvoiceLink": CreateInvoiceLinkRequestTypeID, "refundStarPayment": RefundStarPaymentRequestTypeID, "getSupportUser": GetSupportUserRequestTypeID, @@ -4793,6 +4840,7 @@ func NamesMap() map[string]uint32 { "getPremiumLimit": GetPremiumLimitRequestTypeID, "getPremiumFeatures": GetPremiumFeaturesRequestTypeID, "getPremiumStickerExamples": GetPremiumStickerExamplesRequestTypeID, + "getPremiumInfoSticker": GetPremiumInfoStickerRequestTypeID, "viewPremiumFeature": ViewPremiumFeatureRequestTypeID, "clickPremiumSubscriptionButton": ClickPremiumSubscriptionButtonRequestTypeID, "getPremiumState": GetPremiumStateRequestTypeID, @@ -4962,6 +5010,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { GameTypeID: func() bin.Object { return &Game{} }, WebAppTypeID: func() bin.Object { return &WebApp{} }, PollTypeID: func() bin.Object { return &Poll{} }, + AlternativeVideoTypeID: func() bin.Object { return &AlternativeVideo{} }, BackgroundTypeID: func() bin.Object { return &Background{} }, BackgroundsTypeID: func() bin.Object { return &Backgrounds{} }, ChatBackgroundTypeID: func() bin.Object { return &ChatBackground{} }, @@ -5020,6 +5069,10 @@ func TypesConstructorMap() map[uint32]func() bin.Object { StarGiveawayWinnerOptionTypeID: func() bin.Object { return &StarGiveawayWinnerOption{} }, StarGiveawayPaymentOptionTypeID: func() bin.Object { return &StarGiveawayPaymentOption{} }, StarGiveawayPaymentOptionsTypeID: func() bin.Object { return &StarGiveawayPaymentOptions{} }, + GiftTypeID: func() bin.Object { return &Gift{} }, + GiftsTypeID: func() bin.Object { return &Gifts{} }, + UserGiftTypeID: func() bin.Object { return &UserGift{} }, + UserGiftsTypeID: func() bin.Object { return &UserGifts{} }, StarTransactionDirectionIncomingTypeID: func() bin.Object { return &StarTransactionDirectionIncoming{} }, StarTransactionDirectionOutgoingTypeID: func() bin.Object { return &StarTransactionDirectionOutgoing{} }, BotTransactionPurposePaidMediaTypeID: func() bin.Object { return &BotTransactionPurposePaidMedia{} }, @@ -5028,6 +5081,9 @@ func TypesConstructorMap() map[uint32]func() bin.Object { ChatTransactionPurposeJoinTypeID: func() bin.Object { return &ChatTransactionPurposeJoin{} }, ChatTransactionPurposeReactionTypeID: func() bin.Object { return &ChatTransactionPurposeReaction{} }, ChatTransactionPurposeGiveawayTypeID: func() bin.Object { return &ChatTransactionPurposeGiveaway{} }, + UserTransactionPurposeGiftedStarsTypeID: func() bin.Object { return &UserTransactionPurposeGiftedStars{} }, + UserTransactionPurposeGiftSellTypeID: func() bin.Object { return &UserTransactionPurposeGiftSell{} }, + UserTransactionPurposeGiftSendTypeID: func() bin.Object { return &UserTransactionPurposeGiftSend{} }, StarTransactionPartnerTelegramTypeID: func() bin.Object { return &StarTransactionPartnerTelegram{} }, StarTransactionPartnerAppStoreTypeID: func() bin.Object { return &StarTransactionPartnerAppStore{} }, StarTransactionPartnerGooglePlayTypeID: func() bin.Object { return &StarTransactionPartnerGooglePlay{} }, @@ -5171,7 +5227,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { MessageSponsorTypeID: func() bin.Object { return &MessageSponsor{} }, SponsoredMessageTypeID: func() bin.Object { return &SponsoredMessage{} }, SponsoredMessagesTypeID: func() bin.Object { return &SponsoredMessages{} }, - ReportChatSponsoredMessageOptionTypeID: func() bin.Object { return &ReportChatSponsoredMessageOption{} }, + ReportOptionTypeID: func() bin.Object { return &ReportOption{} }, ReportChatSponsoredMessageResultOkTypeID: func() bin.Object { return &ReportChatSponsoredMessageResultOk{} }, ReportChatSponsoredMessageResultFailedTypeID: func() bin.Object { return &ReportChatSponsoredMessageResultFailed{} }, ReportChatSponsoredMessageResultOptionRequiredTypeID: func() bin.Object { return &ReportChatSponsoredMessageResultOptionRequired{} }, @@ -5249,6 +5305,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { InlineKeyboardButtonTypeSwitchInlineTypeID: func() bin.Object { return &InlineKeyboardButtonTypeSwitchInline{} }, InlineKeyboardButtonTypeBuyTypeID: func() bin.Object { return &InlineKeyboardButtonTypeBuy{} }, InlineKeyboardButtonTypeUserTypeID: func() bin.Object { return &InlineKeyboardButtonTypeUser{} }, + InlineKeyboardButtonTypeCopyTextTypeID: func() bin.Object { return &InlineKeyboardButtonTypeCopyText{} }, InlineKeyboardButtonTypeID: func() bin.Object { return &InlineKeyboardButton{} }, ReplyMarkupRemoveKeyboardTypeID: func() bin.Object { return &ReplyMarkupRemoveKeyboard{} }, ReplyMarkupForceReplyTypeID: func() bin.Object { return &ReplyMarkupForceReply{} }, @@ -5539,6 +5596,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { MessageGiveawayWinnersTypeID: func() bin.Object { return &MessageGiveawayWinners{} }, MessageGiftedStarsTypeID: func() bin.Object { return &MessageGiftedStars{} }, MessageGiveawayPrizeStarsTypeID: func() bin.Object { return &MessageGiveawayPrizeStars{} }, + MessageGiftTypeID: func() bin.Object { return &MessageGift{} }, MessageContactRegisteredTypeID: func() bin.Object { return &MessageContactRegistered{} }, MessageUsersSharedTypeID: func() bin.Object { return &MessageUsersShared{} }, MessageChatSharedTypeID: func() bin.Object { return &MessageChatShared{} }, @@ -6032,6 +6090,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { PushMessageContentPollTypeID: func() bin.Object { return &PushMessageContentPoll{} }, PushMessageContentPremiumGiftCodeTypeID: func() bin.Object { return &PushMessageContentPremiumGiftCode{} }, PushMessageContentGiveawayTypeID: func() bin.Object { return &PushMessageContentGiveaway{} }, + PushMessageContentGiftTypeID: func() bin.Object { return &PushMessageContentGift{} }, PushMessageContentScreenshotTakenTypeID: func() bin.Object { return &PushMessageContentScreenshotTaken{} }, PushMessageContentStickerTypeID: func() bin.Object { return &PushMessageContentSticker{} }, PushMessageContentStoryTypeID: func() bin.Object { return &PushMessageContentStory{} }, @@ -6139,6 +6198,13 @@ func TypesConstructorMap() map[uint32]func() bin.Object { ReportReasonIllegalDrugsTypeID: func() bin.Object { return &ReportReasonIllegalDrugs{} }, ReportReasonPersonalDetailsTypeID: func() bin.Object { return &ReportReasonPersonalDetails{} }, ReportReasonCustomTypeID: func() bin.Object { return &ReportReasonCustom{} }, + ReportChatResultOkTypeID: func() bin.Object { return &ReportChatResultOk{} }, + ReportChatResultOptionRequiredTypeID: func() bin.Object { return &ReportChatResultOptionRequired{} }, + ReportChatResultTextRequiredTypeID: func() bin.Object { return &ReportChatResultTextRequired{} }, + ReportChatResultMessagesRequiredTypeID: func() bin.Object { return &ReportChatResultMessagesRequired{} }, + ReportStoryResultOkTypeID: func() bin.Object { return &ReportStoryResultOk{} }, + ReportStoryResultOptionRequiredTypeID: func() bin.Object { return &ReportStoryResultOptionRequired{} }, + ReportStoryResultTextRequiredTypeID: func() bin.Object { return &ReportStoryResultTextRequired{} }, TargetChatCurrentTypeID: func() bin.Object { return &TargetChatCurrent{} }, TargetChatChosenTypeID: func() bin.Object { return &TargetChatChosen{} }, TargetChatInternalLinkTypeID: func() bin.Object { return &TargetChatInternalLink{} }, @@ -7109,6 +7175,11 @@ func TypesConstructorMap() map[uint32]func() bin.Object { GetSavedOrderInfoRequestTypeID: func() bin.Object { return &GetSavedOrderInfoRequest{} }, DeleteSavedOrderInfoRequestTypeID: func() bin.Object { return &DeleteSavedOrderInfoRequest{} }, DeleteSavedCredentialsRequestTypeID: func() bin.Object { return &DeleteSavedCredentialsRequest{} }, + GetAvailableGiftsRequestTypeID: func() bin.Object { return &GetAvailableGiftsRequest{} }, + SendGiftRequestTypeID: func() bin.Object { return &SendGiftRequest{} }, + SellGiftRequestTypeID: func() bin.Object { return &SellGiftRequest{} }, + ToggleGiftIsSavedRequestTypeID: func() bin.Object { return &ToggleGiftIsSavedRequest{} }, + GetUserGiftsRequestTypeID: func() bin.Object { return &GetUserGiftsRequest{} }, CreateInvoiceLinkRequestTypeID: func() bin.Object { return &CreateInvoiceLinkRequest{} }, RefundStarPaymentRequestTypeID: func() bin.Object { return &RefundStarPaymentRequest{} }, GetSupportUserRequestTypeID: func() bin.Object { return &GetSupportUserRequest{} }, @@ -7208,6 +7279,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { GetPremiumLimitRequestTypeID: func() bin.Object { return &GetPremiumLimitRequest{} }, GetPremiumFeaturesRequestTypeID: func() bin.Object { return &GetPremiumFeaturesRequest{} }, GetPremiumStickerExamplesRequestTypeID: func() bin.Object { return &GetPremiumStickerExamplesRequest{} }, + GetPremiumInfoStickerRequestTypeID: func() bin.Object { return &GetPremiumInfoStickerRequest{} }, ViewPremiumFeatureRequestTypeID: func() bin.Object { return &ViewPremiumFeatureRequest{} }, ClickPremiumSubscriptionButtonRequestTypeID: func() bin.Object { return &ClickPremiumSubscriptionButtonRequest{} }, GetPremiumStateRequestTypeID: func() bin.Object { return &GetPremiumStateRequest{} }, @@ -7684,6 +7756,7 @@ func ClassConstructorsMap() map[string][]uint32 { InlineKeyboardButtonTypeSwitchInlineTypeID, InlineKeyboardButtonTypeBuyTypeID, InlineKeyboardButtonTypeUserTypeID, + InlineKeyboardButtonTypeCopyTextTypeID, }, InlineQueryResultClassName: { InlineQueryResultArticleTypeID, @@ -8004,6 +8077,7 @@ func ClassConstructorsMap() map[string][]uint32 { MessageGiveawayWinnersTypeID, MessageGiftedStarsTypeID, MessageGiveawayPrizeStarsTypeID, + MessageGiftTypeID, MessageContactRegisteredTypeID, MessageUsersSharedTypeID, MessageChatSharedTypeID, @@ -8306,6 +8380,7 @@ func ClassConstructorsMap() map[string][]uint32 { PushMessageContentPollTypeID, PushMessageContentPremiumGiftCodeTypeID, PushMessageContentGiveawayTypeID, + PushMessageContentGiftTypeID, PushMessageContentScreenshotTakenTypeID, PushMessageContentStickerTypeID, PushMessageContentStoryTypeID, @@ -8347,6 +8422,12 @@ func ClassConstructorsMap() map[string][]uint32 { ReplyMarkupShowKeyboardTypeID, ReplyMarkupInlineKeyboardTypeID, }, + ReportChatResultClassName: { + ReportChatResultOkTypeID, + ReportChatResultOptionRequiredTypeID, + ReportChatResultTextRequiredTypeID, + ReportChatResultMessagesRequiredTypeID, + }, ReportChatSponsoredMessageResultClassName: { ReportChatSponsoredMessageResultOkTypeID, ReportChatSponsoredMessageResultFailedTypeID, @@ -8366,6 +8447,11 @@ func ClassConstructorsMap() map[string][]uint32 { ReportReasonPersonalDetailsTypeID, ReportReasonCustomTypeID, }, + ReportStoryResultClassName: { + ReportStoryResultOkTypeID, + ReportStoryResultOptionRequiredTypeID, + ReportStoryResultTextRequiredTypeID, + }, ResendCodeReasonClassName: { ResendCodeReasonUserRequestTypeID, ResendCodeReasonVerificationFailedTypeID, @@ -8805,6 +8891,11 @@ func ClassConstructorsMap() map[string][]uint32 { UserStatusLastWeekTypeID, UserStatusLastMonthTypeID, }, + UserTransactionPurposeClassName: { + UserTransactionPurposeGiftedStarsTypeID, + UserTransactionPurposeGiftSellTypeID, + UserTransactionPurposeGiftSendTypeID, + }, UserTypeClassName: { UserTypeRegularTypeID, UserTypeDeletedTypeID, diff --git a/tdapi/tl_reply_markup_gen.go b/tdapi/tl_reply_markup_gen.go index 1757f5bae8..2d5197c28c 100644 --- a/tdapi/tl_reply_markup_gen.go +++ b/tdapi/tl_reply_markup_gen.go @@ -405,7 +405,7 @@ func (r *ReplyMarkupForceReply) GetInputFieldPlaceholder() (value string) { type ReplyMarkupShowKeyboard struct { // A list of rows of bot keyboard buttons Rows [][]KeyboardButton - // True, if the keyboard is supposed to always be shown when the ordinary keyboard is + // True, if the keyboard is expected to always be shown when the ordinary keyboard is // hidden IsPersistent bool // True, if the application needs to resize the keyboard vertically diff --git a/tdapi/tl_report_chat_gen.go b/tdapi/tl_report_chat_gen.go index 6da0ab482d..8ad50e863b 100644 --- a/tdapi/tl_report_chat_gen.go +++ b/tdapi/tl_report_chat_gen.go @@ -31,21 +31,22 @@ var ( _ = tdjson.Encoder{} ) -// ReportChatRequest represents TL type `reportChat#d92c3a8a`. +// ReportChatRequest represents TL type `reportChat#54f7972f`. type ReportChatRequest struct { // Chat identifier ChatID int64 - // 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 + // Option identifier chosen by the user; leave empty for the initial request + OptionID []byte + // Identifiers of reported messages. Use messageProperties.can_report_chat to check + // whether the message can be reported MessageIDs []int64 - // The reason for reporting the chat - Reason ReportReasonClass - // Additional report details; 0-1024 characters + // Additional report details if asked by the server; 0-1024 characters; leave empty for + // the initial request Text string } // ReportChatRequestTypeID is TL type id of ReportChatRequest. -const ReportChatRequestTypeID = 0xd92c3a8a +const ReportChatRequestTypeID = 0x54f7972f // Ensuring interfaces in compile-time for ReportChatRequest. var ( @@ -62,10 +63,10 @@ func (r *ReportChatRequest) Zero() bool { if !(r.ChatID == 0) { return false } - if !(r.MessageIDs == nil) { + if !(r.OptionID == nil) { return false } - if !(r.Reason == nil) { + if !(r.MessageIDs == nil) { return false } if !(r.Text == "") { @@ -112,12 +113,12 @@ func (r *ReportChatRequest) TypeInfo() tdp.Type { SchemaName: "chat_id", }, { - Name: "MessageIDs", - SchemaName: "message_ids", + Name: "OptionID", + SchemaName: "option_id", }, { - Name: "Reason", - SchemaName: "reason", + Name: "MessageIDs", + SchemaName: "message_ids", }, { Name: "Text", @@ -130,7 +131,7 @@ func (r *ReportChatRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (r *ReportChatRequest) Encode(b *bin.Buffer) error { if r == nil { - return fmt.Errorf("can't encode reportChat#d92c3a8a as nil") + return fmt.Errorf("can't encode reportChat#54f7972f as nil") } b.PutID(ReportChatRequestTypeID) return r.EncodeBare(b) @@ -139,19 +140,14 @@ func (r *ReportChatRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (r *ReportChatRequest) EncodeBare(b *bin.Buffer) error { if r == nil { - return fmt.Errorf("can't encode reportChat#d92c3a8a as nil") + return fmt.Errorf("can't encode reportChat#54f7972f as nil") } b.PutInt53(r.ChatID) + b.PutBytes(r.OptionID) b.PutInt(len(r.MessageIDs)) for _, v := range r.MessageIDs { b.PutInt53(v) } - if r.Reason == nil { - return fmt.Errorf("unable to encode reportChat#d92c3a8a: field reason is nil") - } - if err := r.Reason.Encode(b); err != nil { - return fmt.Errorf("unable to encode reportChat#d92c3a8a: field reason: %w", err) - } b.PutString(r.Text) return nil } @@ -159,10 +155,10 @@ func (r *ReportChatRequest) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (r *ReportChatRequest) Decode(b *bin.Buffer) error { if r == nil { - return fmt.Errorf("can't decode reportChat#d92c3a8a to nil") + return fmt.Errorf("can't decode reportChat#54f7972f to nil") } if err := b.ConsumeID(ReportChatRequestTypeID); err != nil { - return fmt.Errorf("unable to decode reportChat#d92c3a8a: %w", err) + return fmt.Errorf("unable to decode reportChat#54f7972f: %w", err) } return r.DecodeBare(b) } @@ -170,19 +166,26 @@ func (r *ReportChatRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (r *ReportChatRequest) DecodeBare(b *bin.Buffer) error { if r == nil { - return fmt.Errorf("can't decode reportChat#d92c3a8a to nil") + return fmt.Errorf("can't decode reportChat#54f7972f to nil") } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode reportChat#d92c3a8a: field chat_id: %w", err) + return fmt.Errorf("unable to decode reportChat#54f7972f: field chat_id: %w", err) } r.ChatID = value } + { + value, err := b.Bytes() + if err != nil { + return fmt.Errorf("unable to decode reportChat#54f7972f: field option_id: %w", err) + } + r.OptionID = value + } { headerLen, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode reportChat#d92c3a8a: field message_ids: %w", err) + return fmt.Errorf("unable to decode reportChat#54f7972f: field message_ids: %w", err) } if headerLen > 0 { @@ -191,22 +194,15 @@ func (r *ReportChatRequest) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode reportChat#d92c3a8a: field message_ids: %w", err) + return fmt.Errorf("unable to decode reportChat#54f7972f: field message_ids: %w", err) } r.MessageIDs = append(r.MessageIDs, value) } } - { - value, err := DecodeReportReason(b) - if err != nil { - return fmt.Errorf("unable to decode reportChat#d92c3a8a: field reason: %w", err) - } - r.Reason = value - } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode reportChat#d92c3a8a: field text: %w", err) + return fmt.Errorf("unable to decode reportChat#54f7972f: field text: %w", err) } r.Text = value } @@ -216,7 +212,7 @@ func (r *ReportChatRequest) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (r *ReportChatRequest) EncodeTDLibJSON(b tdjson.Encoder) error { if r == nil { - return fmt.Errorf("can't encode reportChat#d92c3a8a as nil") + return fmt.Errorf("can't encode reportChat#54f7972f as nil") } b.ObjStart() b.PutID("reportChat") @@ -224,6 +220,9 @@ func (r *ReportChatRequest) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("chat_id") b.PutInt53(r.ChatID) b.Comma() + b.FieldStart("option_id") + b.PutBytes(r.OptionID) + b.Comma() b.FieldStart("message_ids") b.ArrStart() for _, v := range r.MessageIDs { @@ -233,14 +232,6 @@ func (r *ReportChatRequest) EncodeTDLibJSON(b tdjson.Encoder) error { b.StripComma() b.ArrEnd() b.Comma() - b.FieldStart("reason") - if r.Reason == nil { - return fmt.Errorf("unable to encode reportChat#d92c3a8a: field reason is nil") - } - if err := r.Reason.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode reportChat#d92c3a8a: field reason: %w", err) - } - b.Comma() b.FieldStart("text") b.PutString(r.Text) b.Comma() @@ -252,42 +243,42 @@ func (r *ReportChatRequest) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (r *ReportChatRequest) DecodeTDLibJSON(b tdjson.Decoder) error { if r == nil { - return fmt.Errorf("can't decode reportChat#d92c3a8a to nil") + return fmt.Errorf("can't decode reportChat#54f7972f to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("reportChat"); err != nil { - return fmt.Errorf("unable to decode reportChat#d92c3a8a: %w", err) + return fmt.Errorf("unable to decode reportChat#54f7972f: %w", err) } case "chat_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode reportChat#d92c3a8a: field chat_id: %w", err) + return fmt.Errorf("unable to decode reportChat#54f7972f: field chat_id: %w", err) } r.ChatID = value + case "option_id": + value, err := b.Bytes() + if err != nil { + return fmt.Errorf("unable to decode reportChat#54f7972f: field option_id: %w", err) + } + r.OptionID = value case "message_ids": if err := b.Arr(func(b tdjson.Decoder) error { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode reportChat#d92c3a8a: field message_ids: %w", err) + return fmt.Errorf("unable to decode reportChat#54f7972f: field message_ids: %w", err) } r.MessageIDs = append(r.MessageIDs, value) return nil }); err != nil { - return fmt.Errorf("unable to decode reportChat#d92c3a8a: field message_ids: %w", err) - } - case "reason": - value, err := DecodeTDLibJSONReportReason(b) - if err != nil { - return fmt.Errorf("unable to decode reportChat#d92c3a8a: field reason: %w", err) + return fmt.Errorf("unable to decode reportChat#54f7972f: field message_ids: %w", err) } - r.Reason = value case "text": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode reportChat#d92c3a8a: field text: %w", err) + return fmt.Errorf("unable to decode reportChat#54f7972f: field text: %w", err) } r.Text = value default: @@ -305,20 +296,20 @@ func (r *ReportChatRequest) GetChatID() (value int64) { return r.ChatID } -// GetMessageIDs returns value of MessageIDs field. -func (r *ReportChatRequest) GetMessageIDs() (value []int64) { +// GetOptionID returns value of OptionID field. +func (r *ReportChatRequest) GetOptionID() (value []byte) { if r == nil { return } - return r.MessageIDs + return r.OptionID } -// GetReason returns value of Reason field. -func (r *ReportChatRequest) GetReason() (value ReportReasonClass) { +// GetMessageIDs returns value of MessageIDs field. +func (r *ReportChatRequest) GetMessageIDs() (value []int64) { if r == nil { return } - return r.Reason + return r.MessageIDs } // GetText returns value of Text field. @@ -329,12 +320,12 @@ func (r *ReportChatRequest) GetText() (value string) { return r.Text } -// ReportChat invokes method reportChat#d92c3a8a returning error if any. -func (c *Client) ReportChat(ctx context.Context, request *ReportChatRequest) error { - var ok Ok +// ReportChat invokes method reportChat#54f7972f returning error if any. +func (c *Client) ReportChat(ctx context.Context, request *ReportChatRequest) (ReportChatResultClass, error) { + var result ReportChatResultBox - if err := c.rpc.Invoke(ctx, request, &ok); err != nil { - return err + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err } - return nil + return result.ReportChatResult, nil } diff --git a/tdapi/tl_report_chat_result_gen.go b/tdapi/tl_report_chat_result_gen.go new file mode 100644 index 0000000000..a6d5571b65 --- /dev/null +++ b/tdapi/tl_report_chat_result_gen.go @@ -0,0 +1,889 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tdapi + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// ReportChatResultOk represents TL type `reportChatResultOk#481a557d`. +type ReportChatResultOk struct { +} + +// ReportChatResultOkTypeID is TL type id of ReportChatResultOk. +const ReportChatResultOkTypeID = 0x481a557d + +// construct implements constructor of ReportChatResultClass. +func (r ReportChatResultOk) construct() ReportChatResultClass { return &r } + +// Ensuring interfaces in compile-time for ReportChatResultOk. +var ( + _ bin.Encoder = &ReportChatResultOk{} + _ bin.Decoder = &ReportChatResultOk{} + _ bin.BareEncoder = &ReportChatResultOk{} + _ bin.BareDecoder = &ReportChatResultOk{} + + _ ReportChatResultClass = &ReportChatResultOk{} +) + +func (r *ReportChatResultOk) Zero() bool { + if r == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (r *ReportChatResultOk) String() string { + if r == nil { + return "ReportChatResultOk(nil)" + } + type Alias ReportChatResultOk + return fmt.Sprintf("ReportChatResultOk%+v", Alias(*r)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*ReportChatResultOk) TypeID() uint32 { + return ReportChatResultOkTypeID +} + +// TypeName returns name of type in TL schema. +func (*ReportChatResultOk) TypeName() string { + return "reportChatResultOk" +} + +// TypeInfo returns info about TL type. +func (r *ReportChatResultOk) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "reportChatResultOk", + ID: ReportChatResultOkTypeID, + } + if r == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (r *ReportChatResultOk) Encode(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't encode reportChatResultOk#481a557d as nil") + } + b.PutID(ReportChatResultOkTypeID) + return r.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (r *ReportChatResultOk) EncodeBare(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't encode reportChatResultOk#481a557d as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (r *ReportChatResultOk) Decode(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't decode reportChatResultOk#481a557d to nil") + } + if err := b.ConsumeID(ReportChatResultOkTypeID); err != nil { + return fmt.Errorf("unable to decode reportChatResultOk#481a557d: %w", err) + } + return r.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (r *ReportChatResultOk) DecodeBare(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't decode reportChatResultOk#481a557d to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (r *ReportChatResultOk) EncodeTDLibJSON(b tdjson.Encoder) error { + if r == nil { + return fmt.Errorf("can't encode reportChatResultOk#481a557d as nil") + } + b.ObjStart() + b.PutID("reportChatResultOk") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (r *ReportChatResultOk) DecodeTDLibJSON(b tdjson.Decoder) error { + if r == nil { + return fmt.Errorf("can't decode reportChatResultOk#481a557d to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("reportChatResultOk"); err != nil { + return fmt.Errorf("unable to decode reportChatResultOk#481a557d: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// ReportChatResultOptionRequired represents TL type `reportChatResultOptionRequired#2d89acaa`. +type ReportChatResultOptionRequired struct { + // Title for the option choice + Title string + // List of available options + Options []ReportOption +} + +// ReportChatResultOptionRequiredTypeID is TL type id of ReportChatResultOptionRequired. +const ReportChatResultOptionRequiredTypeID = 0x2d89acaa + +// construct implements constructor of ReportChatResultClass. +func (r ReportChatResultOptionRequired) construct() ReportChatResultClass { return &r } + +// Ensuring interfaces in compile-time for ReportChatResultOptionRequired. +var ( + _ bin.Encoder = &ReportChatResultOptionRequired{} + _ bin.Decoder = &ReportChatResultOptionRequired{} + _ bin.BareEncoder = &ReportChatResultOptionRequired{} + _ bin.BareDecoder = &ReportChatResultOptionRequired{} + + _ ReportChatResultClass = &ReportChatResultOptionRequired{} +) + +func (r *ReportChatResultOptionRequired) Zero() bool { + if r == nil { + return true + } + if !(r.Title == "") { + return false + } + if !(r.Options == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (r *ReportChatResultOptionRequired) String() string { + if r == nil { + return "ReportChatResultOptionRequired(nil)" + } + type Alias ReportChatResultOptionRequired + return fmt.Sprintf("ReportChatResultOptionRequired%+v", Alias(*r)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*ReportChatResultOptionRequired) TypeID() uint32 { + return ReportChatResultOptionRequiredTypeID +} + +// TypeName returns name of type in TL schema. +func (*ReportChatResultOptionRequired) TypeName() string { + return "reportChatResultOptionRequired" +} + +// TypeInfo returns info about TL type. +func (r *ReportChatResultOptionRequired) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "reportChatResultOptionRequired", + ID: ReportChatResultOptionRequiredTypeID, + } + if r == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Title", + SchemaName: "title", + }, + { + Name: "Options", + SchemaName: "options", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (r *ReportChatResultOptionRequired) Encode(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't encode reportChatResultOptionRequired#2d89acaa as nil") + } + b.PutID(ReportChatResultOptionRequiredTypeID) + return r.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (r *ReportChatResultOptionRequired) EncodeBare(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't encode reportChatResultOptionRequired#2d89acaa as nil") + } + b.PutString(r.Title) + b.PutInt(len(r.Options)) + for idx, v := range r.Options { + if err := v.EncodeBare(b); err != nil { + return fmt.Errorf("unable to encode bare reportChatResultOptionRequired#2d89acaa: field options element with index %d: %w", idx, err) + } + } + return nil +} + +// Decode implements bin.Decoder. +func (r *ReportChatResultOptionRequired) Decode(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't decode reportChatResultOptionRequired#2d89acaa to nil") + } + if err := b.ConsumeID(ReportChatResultOptionRequiredTypeID); err != nil { + return fmt.Errorf("unable to decode reportChatResultOptionRequired#2d89acaa: %w", err) + } + return r.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (r *ReportChatResultOptionRequired) DecodeBare(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't decode reportChatResultOptionRequired#2d89acaa to nil") + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode reportChatResultOptionRequired#2d89acaa: field title: %w", err) + } + r.Title = value + } + { + headerLen, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode reportChatResultOptionRequired#2d89acaa: field options: %w", err) + } + + if headerLen > 0 { + r.Options = make([]ReportOption, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + var value ReportOption + if err := value.DecodeBare(b); err != nil { + return fmt.Errorf("unable to decode bare reportChatResultOptionRequired#2d89acaa: field options: %w", err) + } + r.Options = append(r.Options, value) + } + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (r *ReportChatResultOptionRequired) EncodeTDLibJSON(b tdjson.Encoder) error { + if r == nil { + return fmt.Errorf("can't encode reportChatResultOptionRequired#2d89acaa as nil") + } + b.ObjStart() + b.PutID("reportChatResultOptionRequired") + b.Comma() + b.FieldStart("title") + b.PutString(r.Title) + b.Comma() + b.FieldStart("options") + b.ArrStart() + for idx, v := range r.Options { + if err := v.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode reportChatResultOptionRequired#2d89acaa: field options element with index %d: %w", idx, err) + } + b.Comma() + } + b.StripComma() + b.ArrEnd() + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (r *ReportChatResultOptionRequired) DecodeTDLibJSON(b tdjson.Decoder) error { + if r == nil { + return fmt.Errorf("can't decode reportChatResultOptionRequired#2d89acaa to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("reportChatResultOptionRequired"); err != nil { + return fmt.Errorf("unable to decode reportChatResultOptionRequired#2d89acaa: %w", err) + } + case "title": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode reportChatResultOptionRequired#2d89acaa: field title: %w", err) + } + r.Title = value + case "options": + if err := b.Arr(func(b tdjson.Decoder) error { + var value ReportOption + if err := value.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode reportChatResultOptionRequired#2d89acaa: field options: %w", err) + } + r.Options = append(r.Options, value) + return nil + }); err != nil { + return fmt.Errorf("unable to decode reportChatResultOptionRequired#2d89acaa: field options: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetTitle returns value of Title field. +func (r *ReportChatResultOptionRequired) GetTitle() (value string) { + if r == nil { + return + } + return r.Title +} + +// GetOptions returns value of Options field. +func (r *ReportChatResultOptionRequired) GetOptions() (value []ReportOption) { + if r == nil { + return + } + return r.Options +} + +// ReportChatResultTextRequired represents TL type `reportChatResultTextRequired#8bcc30c1`. +type ReportChatResultTextRequired struct { + // Option identifier for the next reportChat request + OptionID []byte + // True, if the user can skip text adding + IsOptional bool +} + +// ReportChatResultTextRequiredTypeID is TL type id of ReportChatResultTextRequired. +const ReportChatResultTextRequiredTypeID = 0x8bcc30c1 + +// construct implements constructor of ReportChatResultClass. +func (r ReportChatResultTextRequired) construct() ReportChatResultClass { return &r } + +// Ensuring interfaces in compile-time for ReportChatResultTextRequired. +var ( + _ bin.Encoder = &ReportChatResultTextRequired{} + _ bin.Decoder = &ReportChatResultTextRequired{} + _ bin.BareEncoder = &ReportChatResultTextRequired{} + _ bin.BareDecoder = &ReportChatResultTextRequired{} + + _ ReportChatResultClass = &ReportChatResultTextRequired{} +) + +func (r *ReportChatResultTextRequired) Zero() bool { + if r == nil { + return true + } + if !(r.OptionID == nil) { + return false + } + if !(r.IsOptional == false) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (r *ReportChatResultTextRequired) String() string { + if r == nil { + return "ReportChatResultTextRequired(nil)" + } + type Alias ReportChatResultTextRequired + return fmt.Sprintf("ReportChatResultTextRequired%+v", Alias(*r)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*ReportChatResultTextRequired) TypeID() uint32 { + return ReportChatResultTextRequiredTypeID +} + +// TypeName returns name of type in TL schema. +func (*ReportChatResultTextRequired) TypeName() string { + return "reportChatResultTextRequired" +} + +// TypeInfo returns info about TL type. +func (r *ReportChatResultTextRequired) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "reportChatResultTextRequired", + ID: ReportChatResultTextRequiredTypeID, + } + if r == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "OptionID", + SchemaName: "option_id", + }, + { + Name: "IsOptional", + SchemaName: "is_optional", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (r *ReportChatResultTextRequired) Encode(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't encode reportChatResultTextRequired#8bcc30c1 as nil") + } + b.PutID(ReportChatResultTextRequiredTypeID) + return r.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (r *ReportChatResultTextRequired) EncodeBare(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't encode reportChatResultTextRequired#8bcc30c1 as nil") + } + b.PutBytes(r.OptionID) + b.PutBool(r.IsOptional) + return nil +} + +// Decode implements bin.Decoder. +func (r *ReportChatResultTextRequired) Decode(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't decode reportChatResultTextRequired#8bcc30c1 to nil") + } + if err := b.ConsumeID(ReportChatResultTextRequiredTypeID); err != nil { + return fmt.Errorf("unable to decode reportChatResultTextRequired#8bcc30c1: %w", err) + } + return r.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (r *ReportChatResultTextRequired) DecodeBare(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't decode reportChatResultTextRequired#8bcc30c1 to nil") + } + { + value, err := b.Bytes() + if err != nil { + return fmt.Errorf("unable to decode reportChatResultTextRequired#8bcc30c1: field option_id: %w", err) + } + r.OptionID = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode reportChatResultTextRequired#8bcc30c1: field is_optional: %w", err) + } + r.IsOptional = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (r *ReportChatResultTextRequired) EncodeTDLibJSON(b tdjson.Encoder) error { + if r == nil { + return fmt.Errorf("can't encode reportChatResultTextRequired#8bcc30c1 as nil") + } + b.ObjStart() + b.PutID("reportChatResultTextRequired") + b.Comma() + b.FieldStart("option_id") + b.PutBytes(r.OptionID) + b.Comma() + b.FieldStart("is_optional") + b.PutBool(r.IsOptional) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (r *ReportChatResultTextRequired) DecodeTDLibJSON(b tdjson.Decoder) error { + if r == nil { + return fmt.Errorf("can't decode reportChatResultTextRequired#8bcc30c1 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("reportChatResultTextRequired"); err != nil { + return fmt.Errorf("unable to decode reportChatResultTextRequired#8bcc30c1: %w", err) + } + case "option_id": + value, err := b.Bytes() + if err != nil { + return fmt.Errorf("unable to decode reportChatResultTextRequired#8bcc30c1: field option_id: %w", err) + } + r.OptionID = value + case "is_optional": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode reportChatResultTextRequired#8bcc30c1: field is_optional: %w", err) + } + r.IsOptional = value + default: + return b.Skip() + } + return nil + }) +} + +// GetOptionID returns value of OptionID field. +func (r *ReportChatResultTextRequired) GetOptionID() (value []byte) { + if r == nil { + return + } + return r.OptionID +} + +// GetIsOptional returns value of IsOptional field. +func (r *ReportChatResultTextRequired) GetIsOptional() (value bool) { + if r == nil { + return + } + return r.IsOptional +} + +// ReportChatResultMessagesRequired represents TL type `reportChatResultMessagesRequired#6521790`. +type ReportChatResultMessagesRequired struct { +} + +// ReportChatResultMessagesRequiredTypeID is TL type id of ReportChatResultMessagesRequired. +const ReportChatResultMessagesRequiredTypeID = 0x6521790 + +// construct implements constructor of ReportChatResultClass. +func (r ReportChatResultMessagesRequired) construct() ReportChatResultClass { return &r } + +// Ensuring interfaces in compile-time for ReportChatResultMessagesRequired. +var ( + _ bin.Encoder = &ReportChatResultMessagesRequired{} + _ bin.Decoder = &ReportChatResultMessagesRequired{} + _ bin.BareEncoder = &ReportChatResultMessagesRequired{} + _ bin.BareDecoder = &ReportChatResultMessagesRequired{} + + _ ReportChatResultClass = &ReportChatResultMessagesRequired{} +) + +func (r *ReportChatResultMessagesRequired) Zero() bool { + if r == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (r *ReportChatResultMessagesRequired) String() string { + if r == nil { + return "ReportChatResultMessagesRequired(nil)" + } + type Alias ReportChatResultMessagesRequired + return fmt.Sprintf("ReportChatResultMessagesRequired%+v", Alias(*r)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*ReportChatResultMessagesRequired) TypeID() uint32 { + return ReportChatResultMessagesRequiredTypeID +} + +// TypeName returns name of type in TL schema. +func (*ReportChatResultMessagesRequired) TypeName() string { + return "reportChatResultMessagesRequired" +} + +// TypeInfo returns info about TL type. +func (r *ReportChatResultMessagesRequired) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "reportChatResultMessagesRequired", + ID: ReportChatResultMessagesRequiredTypeID, + } + if r == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (r *ReportChatResultMessagesRequired) Encode(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't encode reportChatResultMessagesRequired#6521790 as nil") + } + b.PutID(ReportChatResultMessagesRequiredTypeID) + return r.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (r *ReportChatResultMessagesRequired) EncodeBare(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't encode reportChatResultMessagesRequired#6521790 as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (r *ReportChatResultMessagesRequired) Decode(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't decode reportChatResultMessagesRequired#6521790 to nil") + } + if err := b.ConsumeID(ReportChatResultMessagesRequiredTypeID); err != nil { + return fmt.Errorf("unable to decode reportChatResultMessagesRequired#6521790: %w", err) + } + return r.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (r *ReportChatResultMessagesRequired) DecodeBare(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't decode reportChatResultMessagesRequired#6521790 to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (r *ReportChatResultMessagesRequired) EncodeTDLibJSON(b tdjson.Encoder) error { + if r == nil { + return fmt.Errorf("can't encode reportChatResultMessagesRequired#6521790 as nil") + } + b.ObjStart() + b.PutID("reportChatResultMessagesRequired") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (r *ReportChatResultMessagesRequired) DecodeTDLibJSON(b tdjson.Decoder) error { + if r == nil { + return fmt.Errorf("can't decode reportChatResultMessagesRequired#6521790 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("reportChatResultMessagesRequired"); err != nil { + return fmt.Errorf("unable to decode reportChatResultMessagesRequired#6521790: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// ReportChatResultClassName is schema name of ReportChatResultClass. +const ReportChatResultClassName = "ReportChatResult" + +// ReportChatResultClass represents ReportChatResult generic type. +// +// Example: +// +// g, err := tdapi.DecodeReportChatResult(buf) +// if err != nil { +// panic(err) +// } +// switch v := g.(type) { +// case *tdapi.ReportChatResultOk: // reportChatResultOk#481a557d +// case *tdapi.ReportChatResultOptionRequired: // reportChatResultOptionRequired#2d89acaa +// case *tdapi.ReportChatResultTextRequired: // reportChatResultTextRequired#8bcc30c1 +// case *tdapi.ReportChatResultMessagesRequired: // reportChatResultMessagesRequired#6521790 +// default: panic(v) +// } +type ReportChatResultClass interface { + bin.Encoder + bin.Decoder + bin.BareEncoder + bin.BareDecoder + construct() ReportChatResultClass + + // TypeID returns type id in TL schema. + // + // See https://core.telegram.org/mtproto/TL-tl#remarks. + TypeID() uint32 + // TypeName returns name of type in TL schema. + TypeName() string + // String implements fmt.Stringer. + String() string + // Zero returns true if current object has a zero value. + Zero() bool + + EncodeTDLibJSON(b tdjson.Encoder) error + DecodeTDLibJSON(b tdjson.Decoder) error +} + +// DecodeReportChatResult implements binary de-serialization for ReportChatResultClass. +func DecodeReportChatResult(buf *bin.Buffer) (ReportChatResultClass, error) { + id, err := buf.PeekID() + if err != nil { + return nil, err + } + switch id { + case ReportChatResultOkTypeID: + // Decoding reportChatResultOk#481a557d. + v := ReportChatResultOk{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode ReportChatResultClass: %w", err) + } + return &v, nil + case ReportChatResultOptionRequiredTypeID: + // Decoding reportChatResultOptionRequired#2d89acaa. + v := ReportChatResultOptionRequired{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode ReportChatResultClass: %w", err) + } + return &v, nil + case ReportChatResultTextRequiredTypeID: + // Decoding reportChatResultTextRequired#8bcc30c1. + v := ReportChatResultTextRequired{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode ReportChatResultClass: %w", err) + } + return &v, nil + case ReportChatResultMessagesRequiredTypeID: + // Decoding reportChatResultMessagesRequired#6521790. + v := ReportChatResultMessagesRequired{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode ReportChatResultClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode ReportChatResultClass: %w", bin.NewUnexpectedID(id)) + } +} + +// DecodeTDLibJSONReportChatResult implements binary de-serialization for ReportChatResultClass. +func DecodeTDLibJSONReportChatResult(buf tdjson.Decoder) (ReportChatResultClass, error) { + id, err := buf.FindTypeID() + if err != nil { + return nil, err + } + switch id { + case "reportChatResultOk": + // Decoding reportChatResultOk#481a557d. + v := ReportChatResultOk{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode ReportChatResultClass: %w", err) + } + return &v, nil + case "reportChatResultOptionRequired": + // Decoding reportChatResultOptionRequired#2d89acaa. + v := ReportChatResultOptionRequired{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode ReportChatResultClass: %w", err) + } + return &v, nil + case "reportChatResultTextRequired": + // Decoding reportChatResultTextRequired#8bcc30c1. + v := ReportChatResultTextRequired{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode ReportChatResultClass: %w", err) + } + return &v, nil + case "reportChatResultMessagesRequired": + // Decoding reportChatResultMessagesRequired#6521790. + v := ReportChatResultMessagesRequired{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode ReportChatResultClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode ReportChatResultClass: %w", tdjson.NewUnexpectedID(id)) + } +} + +// ReportChatResult boxes the ReportChatResultClass providing a helper. +type ReportChatResultBox struct { + ReportChatResult ReportChatResultClass +} + +// Decode implements bin.Decoder for ReportChatResultBox. +func (b *ReportChatResultBox) Decode(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("unable to decode ReportChatResultBox to nil") + } + v, err := DecodeReportChatResult(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.ReportChatResult = v + return nil +} + +// Encode implements bin.Encode for ReportChatResultBox. +func (b *ReportChatResultBox) Encode(buf *bin.Buffer) error { + if b == nil || b.ReportChatResult == nil { + return fmt.Errorf("unable to encode ReportChatResultClass as nil") + } + return b.ReportChatResult.Encode(buf) +} + +// DecodeTDLibJSON implements bin.Decoder for ReportChatResultBox. +func (b *ReportChatResultBox) DecodeTDLibJSON(buf tdjson.Decoder) error { + if b == nil { + return fmt.Errorf("unable to decode ReportChatResultBox to nil") + } + v, err := DecodeTDLibJSONReportChatResult(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.ReportChatResult = v + return nil +} + +// EncodeTDLibJSON implements bin.Encode for ReportChatResultBox. +func (b *ReportChatResultBox) EncodeTDLibJSON(buf tdjson.Encoder) error { + if b == nil || b.ReportChatResult == nil { + return fmt.Errorf("unable to encode ReportChatResultClass as nil") + } + return b.ReportChatResult.EncodeTDLibJSON(buf) +} diff --git a/tdapi/tl_report_chat_sponsored_message_option_gen.go b/tdapi/tl_report_chat_sponsored_message_option_gen.go deleted file mode 100644 index 33f9ccd2b3..0000000000 --- a/tdapi/tl_report_chat_sponsored_message_option_gen.go +++ /dev/null @@ -1,227 +0,0 @@ -// Code generated by gotdgen, DO NOT EDIT. - -package tdapi - -import ( - "context" - "errors" - "fmt" - "sort" - "strings" - - "go.uber.org/multierr" - - "github.com/gotd/td/bin" - "github.com/gotd/td/tdjson" - "github.com/gotd/td/tdp" - "github.com/gotd/td/tgerr" -) - -// No-op definition for keeping imports. -var ( - _ = bin.Buffer{} - _ = context.Background() - _ = fmt.Stringer(nil) - _ = strings.Builder{} - _ = errors.Is - _ = multierr.AppendInto - _ = sort.Ints - _ = tdp.Format - _ = tgerr.Error{} - _ = tdjson.Encoder{} -) - -// ReportChatSponsoredMessageOption represents TL type `reportChatSponsoredMessageOption#aabd054a`. -type ReportChatSponsoredMessageOption struct { - // Unique identifier of the option - ID []byte - // Text of the option - Text string -} - -// ReportChatSponsoredMessageOptionTypeID is TL type id of ReportChatSponsoredMessageOption. -const ReportChatSponsoredMessageOptionTypeID = 0xaabd054a - -// Ensuring interfaces in compile-time for ReportChatSponsoredMessageOption. -var ( - _ bin.Encoder = &ReportChatSponsoredMessageOption{} - _ bin.Decoder = &ReportChatSponsoredMessageOption{} - _ bin.BareEncoder = &ReportChatSponsoredMessageOption{} - _ bin.BareDecoder = &ReportChatSponsoredMessageOption{} -) - -func (r *ReportChatSponsoredMessageOption) Zero() bool { - if r == nil { - return true - } - if !(r.ID == nil) { - return false - } - if !(r.Text == "") { - return false - } - - return true -} - -// String implements fmt.Stringer. -func (r *ReportChatSponsoredMessageOption) String() string { - if r == nil { - return "ReportChatSponsoredMessageOption(nil)" - } - type Alias ReportChatSponsoredMessageOption - return fmt.Sprintf("ReportChatSponsoredMessageOption%+v", Alias(*r)) -} - -// TypeID returns type id in TL schema. -// -// See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*ReportChatSponsoredMessageOption) TypeID() uint32 { - return ReportChatSponsoredMessageOptionTypeID -} - -// TypeName returns name of type in TL schema. -func (*ReportChatSponsoredMessageOption) TypeName() string { - return "reportChatSponsoredMessageOption" -} - -// TypeInfo returns info about TL type. -func (r *ReportChatSponsoredMessageOption) TypeInfo() tdp.Type { - typ := tdp.Type{ - Name: "reportChatSponsoredMessageOption", - ID: ReportChatSponsoredMessageOptionTypeID, - } - if r == nil { - typ.Null = true - return typ - } - typ.Fields = []tdp.Field{ - { - Name: "ID", - SchemaName: "id", - }, - { - Name: "Text", - SchemaName: "text", - }, - } - return typ -} - -// Encode implements bin.Encoder. -func (r *ReportChatSponsoredMessageOption) Encode(b *bin.Buffer) error { - if r == nil { - return fmt.Errorf("can't encode reportChatSponsoredMessageOption#aabd054a as nil") - } - b.PutID(ReportChatSponsoredMessageOptionTypeID) - return r.EncodeBare(b) -} - -// EncodeBare implements bin.BareEncoder. -func (r *ReportChatSponsoredMessageOption) EncodeBare(b *bin.Buffer) error { - if r == nil { - return fmt.Errorf("can't encode reportChatSponsoredMessageOption#aabd054a as nil") - } - b.PutBytes(r.ID) - b.PutString(r.Text) - return nil -} - -// Decode implements bin.Decoder. -func (r *ReportChatSponsoredMessageOption) Decode(b *bin.Buffer) error { - if r == nil { - return fmt.Errorf("can't decode reportChatSponsoredMessageOption#aabd054a to nil") - } - if err := b.ConsumeID(ReportChatSponsoredMessageOptionTypeID); err != nil { - return fmt.Errorf("unable to decode reportChatSponsoredMessageOption#aabd054a: %w", err) - } - return r.DecodeBare(b) -} - -// DecodeBare implements bin.BareDecoder. -func (r *ReportChatSponsoredMessageOption) DecodeBare(b *bin.Buffer) error { - if r == nil { - return fmt.Errorf("can't decode reportChatSponsoredMessageOption#aabd054a to nil") - } - { - value, err := b.Bytes() - if err != nil { - return fmt.Errorf("unable to decode reportChatSponsoredMessageOption#aabd054a: field id: %w", err) - } - r.ID = value - } - { - value, err := b.String() - if err != nil { - return fmt.Errorf("unable to decode reportChatSponsoredMessageOption#aabd054a: field text: %w", err) - } - r.Text = value - } - return nil -} - -// EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (r *ReportChatSponsoredMessageOption) EncodeTDLibJSON(b tdjson.Encoder) error { - if r == nil { - return fmt.Errorf("can't encode reportChatSponsoredMessageOption#aabd054a as nil") - } - b.ObjStart() - b.PutID("reportChatSponsoredMessageOption") - b.Comma() - b.FieldStart("id") - b.PutBytes(r.ID) - b.Comma() - b.FieldStart("text") - b.PutString(r.Text) - b.Comma() - b.StripComma() - b.ObjEnd() - return nil -} - -// DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (r *ReportChatSponsoredMessageOption) DecodeTDLibJSON(b tdjson.Decoder) error { - if r == nil { - return fmt.Errorf("can't decode reportChatSponsoredMessageOption#aabd054a to nil") - } - - return b.Obj(func(b tdjson.Decoder, key []byte) error { - switch string(key) { - case tdjson.TypeField: - if err := b.ConsumeID("reportChatSponsoredMessageOption"); err != nil { - return fmt.Errorf("unable to decode reportChatSponsoredMessageOption#aabd054a: %w", err) - } - case "id": - value, err := b.Bytes() - if err != nil { - return fmt.Errorf("unable to decode reportChatSponsoredMessageOption#aabd054a: field id: %w", err) - } - r.ID = value - case "text": - value, err := b.String() - if err != nil { - return fmt.Errorf("unable to decode reportChatSponsoredMessageOption#aabd054a: field text: %w", err) - } - r.Text = value - default: - return b.Skip() - } - return nil - }) -} - -// GetID returns value of ID field. -func (r *ReportChatSponsoredMessageOption) GetID() (value []byte) { - if r == nil { - return - } - return r.ID -} - -// GetText returns value of Text field. -func (r *ReportChatSponsoredMessageOption) GetText() (value string) { - if r == nil { - return - } - return r.Text -} diff --git a/tdapi/tl_report_chat_sponsored_message_result_gen.go b/tdapi/tl_report_chat_sponsored_message_result_gen.go index 1cd06ecee7..d26b849cb4 100644 --- a/tdapi/tl_report_chat_sponsored_message_result_gen.go +++ b/tdapi/tl_report_chat_sponsored_message_result_gen.go @@ -297,16 +297,16 @@ func (r *ReportChatSponsoredMessageResultFailed) DecodeTDLibJSON(b tdjson.Decode }) } -// ReportChatSponsoredMessageResultOptionRequired represents TL type `reportChatSponsoredMessageResultOptionRequired#314c2d73`. +// ReportChatSponsoredMessageResultOptionRequired represents TL type `reportChatSponsoredMessageResultOptionRequired#34fc24b2`. type ReportChatSponsoredMessageResultOptionRequired struct { // Title for the option choice Title string // List of available options - Options []ReportChatSponsoredMessageOption + Options []ReportOption } // ReportChatSponsoredMessageResultOptionRequiredTypeID is TL type id of ReportChatSponsoredMessageResultOptionRequired. -const ReportChatSponsoredMessageResultOptionRequiredTypeID = 0x314c2d73 +const ReportChatSponsoredMessageResultOptionRequiredTypeID = 0x34fc24b2 // construct implements constructor of ReportChatSponsoredMessageResultClass. func (r ReportChatSponsoredMessageResultOptionRequired) construct() ReportChatSponsoredMessageResultClass { @@ -384,7 +384,7 @@ func (r *ReportChatSponsoredMessageResultOptionRequired) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (r *ReportChatSponsoredMessageResultOptionRequired) Encode(b *bin.Buffer) error { if r == nil { - return fmt.Errorf("can't encode reportChatSponsoredMessageResultOptionRequired#314c2d73 as nil") + return fmt.Errorf("can't encode reportChatSponsoredMessageResultOptionRequired#34fc24b2 as nil") } b.PutID(ReportChatSponsoredMessageResultOptionRequiredTypeID) return r.EncodeBare(b) @@ -393,13 +393,13 @@ func (r *ReportChatSponsoredMessageResultOptionRequired) Encode(b *bin.Buffer) e // EncodeBare implements bin.BareEncoder. func (r *ReportChatSponsoredMessageResultOptionRequired) EncodeBare(b *bin.Buffer) error { if r == nil { - return fmt.Errorf("can't encode reportChatSponsoredMessageResultOptionRequired#314c2d73 as nil") + return fmt.Errorf("can't encode reportChatSponsoredMessageResultOptionRequired#34fc24b2 as nil") } b.PutString(r.Title) b.PutInt(len(r.Options)) for idx, v := range r.Options { if err := v.EncodeBare(b); err != nil { - return fmt.Errorf("unable to encode bare reportChatSponsoredMessageResultOptionRequired#314c2d73: field options element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode bare reportChatSponsoredMessageResultOptionRequired#34fc24b2: field options element with index %d: %w", idx, err) } } return nil @@ -408,10 +408,10 @@ func (r *ReportChatSponsoredMessageResultOptionRequired) EncodeBare(b *bin.Buffe // Decode implements bin.Decoder. func (r *ReportChatSponsoredMessageResultOptionRequired) Decode(b *bin.Buffer) error { if r == nil { - return fmt.Errorf("can't decode reportChatSponsoredMessageResultOptionRequired#314c2d73 to nil") + return fmt.Errorf("can't decode reportChatSponsoredMessageResultOptionRequired#34fc24b2 to nil") } if err := b.ConsumeID(ReportChatSponsoredMessageResultOptionRequiredTypeID); err != nil { - return fmt.Errorf("unable to decode reportChatSponsoredMessageResultOptionRequired#314c2d73: %w", err) + return fmt.Errorf("unable to decode reportChatSponsoredMessageResultOptionRequired#34fc24b2: %w", err) } return r.DecodeBare(b) } @@ -419,28 +419,28 @@ func (r *ReportChatSponsoredMessageResultOptionRequired) Decode(b *bin.Buffer) e // DecodeBare implements bin.BareDecoder. func (r *ReportChatSponsoredMessageResultOptionRequired) DecodeBare(b *bin.Buffer) error { if r == nil { - return fmt.Errorf("can't decode reportChatSponsoredMessageResultOptionRequired#314c2d73 to nil") + return fmt.Errorf("can't decode reportChatSponsoredMessageResultOptionRequired#34fc24b2 to nil") } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode reportChatSponsoredMessageResultOptionRequired#314c2d73: field title: %w", err) + return fmt.Errorf("unable to decode reportChatSponsoredMessageResultOptionRequired#34fc24b2: field title: %w", err) } r.Title = value } { headerLen, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode reportChatSponsoredMessageResultOptionRequired#314c2d73: field options: %w", err) + return fmt.Errorf("unable to decode reportChatSponsoredMessageResultOptionRequired#34fc24b2: field options: %w", err) } if headerLen > 0 { - r.Options = make([]ReportChatSponsoredMessageOption, 0, headerLen%bin.PreallocateLimit) + r.Options = make([]ReportOption, 0, headerLen%bin.PreallocateLimit) } for idx := 0; idx < headerLen; idx++ { - var value ReportChatSponsoredMessageOption + var value ReportOption if err := value.DecodeBare(b); err != nil { - return fmt.Errorf("unable to decode bare reportChatSponsoredMessageResultOptionRequired#314c2d73: field options: %w", err) + return fmt.Errorf("unable to decode bare reportChatSponsoredMessageResultOptionRequired#34fc24b2: field options: %w", err) } r.Options = append(r.Options, value) } @@ -451,7 +451,7 @@ func (r *ReportChatSponsoredMessageResultOptionRequired) DecodeBare(b *bin.Buffe // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (r *ReportChatSponsoredMessageResultOptionRequired) EncodeTDLibJSON(b tdjson.Encoder) error { if r == nil { - return fmt.Errorf("can't encode reportChatSponsoredMessageResultOptionRequired#314c2d73 as nil") + return fmt.Errorf("can't encode reportChatSponsoredMessageResultOptionRequired#34fc24b2 as nil") } b.ObjStart() b.PutID("reportChatSponsoredMessageResultOptionRequired") @@ -463,7 +463,7 @@ func (r *ReportChatSponsoredMessageResultOptionRequired) EncodeTDLibJSON(b tdjso b.ArrStart() for idx, v := range r.Options { if err := v.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode reportChatSponsoredMessageResultOptionRequired#314c2d73: field options element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode reportChatSponsoredMessageResultOptionRequired#34fc24b2: field options element with index %d: %w", idx, err) } b.Comma() } @@ -478,31 +478,31 @@ func (r *ReportChatSponsoredMessageResultOptionRequired) EncodeTDLibJSON(b tdjso // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (r *ReportChatSponsoredMessageResultOptionRequired) DecodeTDLibJSON(b tdjson.Decoder) error { if r == nil { - return fmt.Errorf("can't decode reportChatSponsoredMessageResultOptionRequired#314c2d73 to nil") + return fmt.Errorf("can't decode reportChatSponsoredMessageResultOptionRequired#34fc24b2 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("reportChatSponsoredMessageResultOptionRequired"); err != nil { - return fmt.Errorf("unable to decode reportChatSponsoredMessageResultOptionRequired#314c2d73: %w", err) + return fmt.Errorf("unable to decode reportChatSponsoredMessageResultOptionRequired#34fc24b2: %w", err) } case "title": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode reportChatSponsoredMessageResultOptionRequired#314c2d73: field title: %w", err) + return fmt.Errorf("unable to decode reportChatSponsoredMessageResultOptionRequired#34fc24b2: field title: %w", err) } r.Title = value case "options": if err := b.Arr(func(b tdjson.Decoder) error { - var value ReportChatSponsoredMessageOption + var value ReportOption if err := value.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode reportChatSponsoredMessageResultOptionRequired#314c2d73: field options: %w", err) + return fmt.Errorf("unable to decode reportChatSponsoredMessageResultOptionRequired#34fc24b2: field options: %w", err) } r.Options = append(r.Options, value) return nil }); err != nil { - return fmt.Errorf("unable to decode reportChatSponsoredMessageResultOptionRequired#314c2d73: field options: %w", err) + return fmt.Errorf("unable to decode reportChatSponsoredMessageResultOptionRequired#34fc24b2: field options: %w", err) } default: return b.Skip() @@ -520,7 +520,7 @@ func (r *ReportChatSponsoredMessageResultOptionRequired) GetTitle() (value strin } // GetOptions returns value of Options field. -func (r *ReportChatSponsoredMessageResultOptionRequired) GetOptions() (value []ReportChatSponsoredMessageOption) { +func (r *ReportChatSponsoredMessageResultOptionRequired) GetOptions() (value []ReportOption) { if r == nil { return } @@ -807,7 +807,7 @@ const ReportChatSponsoredMessageResultClassName = "ReportChatSponsoredMessageRes // switch v := g.(type) { // case *tdapi.ReportChatSponsoredMessageResultOk: // reportChatSponsoredMessageResultOk#754f721f // case *tdapi.ReportChatSponsoredMessageResultFailed: // reportChatSponsoredMessageResultFailed#7f1f9bc6 -// case *tdapi.ReportChatSponsoredMessageResultOptionRequired: // reportChatSponsoredMessageResultOptionRequired#314c2d73 +// case *tdapi.ReportChatSponsoredMessageResultOptionRequired: // reportChatSponsoredMessageResultOptionRequired#34fc24b2 // case *tdapi.ReportChatSponsoredMessageResultAdsHidden: // reportChatSponsoredMessageResultAdsHidden#e8eade1e // case *tdapi.ReportChatSponsoredMessageResultPremiumRequired: // reportChatSponsoredMessageResultPremiumRequired#770c2ed0 // default: panic(v) @@ -856,7 +856,7 @@ func DecodeReportChatSponsoredMessageResult(buf *bin.Buffer) (ReportChatSponsore } return &v, nil case ReportChatSponsoredMessageResultOptionRequiredTypeID: - // Decoding reportChatSponsoredMessageResultOptionRequired#314c2d73. + // Decoding reportChatSponsoredMessageResultOptionRequired#34fc24b2. v := ReportChatSponsoredMessageResultOptionRequired{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode ReportChatSponsoredMessageResultClass: %w", err) @@ -903,7 +903,7 @@ func DecodeTDLibJSONReportChatSponsoredMessageResult(buf tdjson.Decoder) (Report } return &v, nil case "reportChatSponsoredMessageResultOptionRequired": - // Decoding reportChatSponsoredMessageResultOptionRequired#314c2d73. + // Decoding reportChatSponsoredMessageResultOptionRequired#34fc24b2. v := ReportChatSponsoredMessageResultOptionRequired{} if err := v.DecodeTDLibJSON(buf); err != nil { return nil, fmt.Errorf("unable to decode ReportChatSponsoredMessageResultClass: %w", err) diff --git a/tdapi/tl_report_option_gen.go b/tdapi/tl_report_option_gen.go new file mode 100644 index 0000000000..231f91dfcd --- /dev/null +++ b/tdapi/tl_report_option_gen.go @@ -0,0 +1,227 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tdapi + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// ReportOption represents TL type `reportOption#41f22c20`. +type ReportOption struct { + // Unique identifier of the option + ID []byte + // Text of the option + Text string +} + +// ReportOptionTypeID is TL type id of ReportOption. +const ReportOptionTypeID = 0x41f22c20 + +// Ensuring interfaces in compile-time for ReportOption. +var ( + _ bin.Encoder = &ReportOption{} + _ bin.Decoder = &ReportOption{} + _ bin.BareEncoder = &ReportOption{} + _ bin.BareDecoder = &ReportOption{} +) + +func (r *ReportOption) Zero() bool { + if r == nil { + return true + } + if !(r.ID == nil) { + return false + } + if !(r.Text == "") { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (r *ReportOption) String() string { + if r == nil { + return "ReportOption(nil)" + } + type Alias ReportOption + return fmt.Sprintf("ReportOption%+v", Alias(*r)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*ReportOption) TypeID() uint32 { + return ReportOptionTypeID +} + +// TypeName returns name of type in TL schema. +func (*ReportOption) TypeName() string { + return "reportOption" +} + +// TypeInfo returns info about TL type. +func (r *ReportOption) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "reportOption", + ID: ReportOptionTypeID, + } + if r == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "ID", + SchemaName: "id", + }, + { + Name: "Text", + SchemaName: "text", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (r *ReportOption) Encode(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't encode reportOption#41f22c20 as nil") + } + b.PutID(ReportOptionTypeID) + return r.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (r *ReportOption) EncodeBare(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't encode reportOption#41f22c20 as nil") + } + b.PutBytes(r.ID) + b.PutString(r.Text) + return nil +} + +// Decode implements bin.Decoder. +func (r *ReportOption) Decode(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't decode reportOption#41f22c20 to nil") + } + if err := b.ConsumeID(ReportOptionTypeID); err != nil { + return fmt.Errorf("unable to decode reportOption#41f22c20: %w", err) + } + return r.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (r *ReportOption) DecodeBare(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't decode reportOption#41f22c20 to nil") + } + { + value, err := b.Bytes() + if err != nil { + return fmt.Errorf("unable to decode reportOption#41f22c20: field id: %w", err) + } + r.ID = value + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode reportOption#41f22c20: field text: %w", err) + } + r.Text = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (r *ReportOption) EncodeTDLibJSON(b tdjson.Encoder) error { + if r == nil { + return fmt.Errorf("can't encode reportOption#41f22c20 as nil") + } + b.ObjStart() + b.PutID("reportOption") + b.Comma() + b.FieldStart("id") + b.PutBytes(r.ID) + b.Comma() + b.FieldStart("text") + b.PutString(r.Text) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (r *ReportOption) DecodeTDLibJSON(b tdjson.Decoder) error { + if r == nil { + return fmt.Errorf("can't decode reportOption#41f22c20 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("reportOption"); err != nil { + return fmt.Errorf("unable to decode reportOption#41f22c20: %w", err) + } + case "id": + value, err := b.Bytes() + if err != nil { + return fmt.Errorf("unable to decode reportOption#41f22c20: field id: %w", err) + } + r.ID = value + case "text": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode reportOption#41f22c20: field text: %w", err) + } + r.Text = value + default: + return b.Skip() + } + return nil + }) +} + +// GetID returns value of ID field. +func (r *ReportOption) GetID() (value []byte) { + if r == nil { + return + } + return r.ID +} + +// GetText returns value of Text field. +func (r *ReportOption) GetText() (value string) { + if r == nil { + return + } + return r.Text +} diff --git a/tdapi/tl_report_story_gen.go b/tdapi/tl_report_story_gen.go index 7b4aec0976..80e127abe2 100644 --- a/tdapi/tl_report_story_gen.go +++ b/tdapi/tl_report_story_gen.go @@ -31,20 +31,20 @@ var ( _ = tdjson.Encoder{} ) -// ReportStoryRequest represents TL type `reportStory#9b5f709b`. +// ReportStoryRequest represents TL type `reportStory#78de7310`. type ReportStoryRequest struct { // The identifier of the sender of the story to report StorySenderChatID int64 // The identifier of the story to report StoryID int32 - // The reason for reporting the story - Reason ReportReasonClass - // Additional report details; 0-1024 characters + // Option identifier chosen by the user; leave empty for the initial request + OptionID []byte + // Additional report details; 0-1024 characters; leave empty for the initial request Text string } // ReportStoryRequestTypeID is TL type id of ReportStoryRequest. -const ReportStoryRequestTypeID = 0x9b5f709b +const ReportStoryRequestTypeID = 0x78de7310 // Ensuring interfaces in compile-time for ReportStoryRequest. var ( @@ -64,7 +64,7 @@ func (r *ReportStoryRequest) Zero() bool { if !(r.StoryID == 0) { return false } - if !(r.Reason == nil) { + if !(r.OptionID == nil) { return false } if !(r.Text == "") { @@ -115,8 +115,8 @@ func (r *ReportStoryRequest) TypeInfo() tdp.Type { SchemaName: "story_id", }, { - Name: "Reason", - SchemaName: "reason", + Name: "OptionID", + SchemaName: "option_id", }, { Name: "Text", @@ -129,7 +129,7 @@ func (r *ReportStoryRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (r *ReportStoryRequest) Encode(b *bin.Buffer) error { if r == nil { - return fmt.Errorf("can't encode reportStory#9b5f709b as nil") + return fmt.Errorf("can't encode reportStory#78de7310 as nil") } b.PutID(ReportStoryRequestTypeID) return r.EncodeBare(b) @@ -138,16 +138,11 @@ func (r *ReportStoryRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (r *ReportStoryRequest) EncodeBare(b *bin.Buffer) error { if r == nil { - return fmt.Errorf("can't encode reportStory#9b5f709b as nil") + return fmt.Errorf("can't encode reportStory#78de7310 as nil") } b.PutInt53(r.StorySenderChatID) b.PutInt32(r.StoryID) - if r.Reason == nil { - return fmt.Errorf("unable to encode reportStory#9b5f709b: field reason is nil") - } - if err := r.Reason.Encode(b); err != nil { - return fmt.Errorf("unable to encode reportStory#9b5f709b: field reason: %w", err) - } + b.PutBytes(r.OptionID) b.PutString(r.Text) return nil } @@ -155,10 +150,10 @@ func (r *ReportStoryRequest) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (r *ReportStoryRequest) Decode(b *bin.Buffer) error { if r == nil { - return fmt.Errorf("can't decode reportStory#9b5f709b to nil") + return fmt.Errorf("can't decode reportStory#78de7310 to nil") } if err := b.ConsumeID(ReportStoryRequestTypeID); err != nil { - return fmt.Errorf("unable to decode reportStory#9b5f709b: %w", err) + return fmt.Errorf("unable to decode reportStory#78de7310: %w", err) } return r.DecodeBare(b) } @@ -166,33 +161,33 @@ func (r *ReportStoryRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (r *ReportStoryRequest) DecodeBare(b *bin.Buffer) error { if r == nil { - return fmt.Errorf("can't decode reportStory#9b5f709b to nil") + return fmt.Errorf("can't decode reportStory#78de7310 to nil") } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode reportStory#9b5f709b: field story_sender_chat_id: %w", err) + return fmt.Errorf("unable to decode reportStory#78de7310: field story_sender_chat_id: %w", err) } r.StorySenderChatID = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode reportStory#9b5f709b: field story_id: %w", err) + return fmt.Errorf("unable to decode reportStory#78de7310: field story_id: %w", err) } r.StoryID = value } { - value, err := DecodeReportReason(b) + value, err := b.Bytes() if err != nil { - return fmt.Errorf("unable to decode reportStory#9b5f709b: field reason: %w", err) + return fmt.Errorf("unable to decode reportStory#78de7310: field option_id: %w", err) } - r.Reason = value + r.OptionID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode reportStory#9b5f709b: field text: %w", err) + return fmt.Errorf("unable to decode reportStory#78de7310: field text: %w", err) } r.Text = value } @@ -202,7 +197,7 @@ func (r *ReportStoryRequest) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (r *ReportStoryRequest) EncodeTDLibJSON(b tdjson.Encoder) error { if r == nil { - return fmt.Errorf("can't encode reportStory#9b5f709b as nil") + return fmt.Errorf("can't encode reportStory#78de7310 as nil") } b.ObjStart() b.PutID("reportStory") @@ -213,13 +208,8 @@ func (r *ReportStoryRequest) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("story_id") b.PutInt32(r.StoryID) b.Comma() - b.FieldStart("reason") - if r.Reason == nil { - return fmt.Errorf("unable to encode reportStory#9b5f709b: field reason is nil") - } - if err := r.Reason.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode reportStory#9b5f709b: field reason: %w", err) - } + b.FieldStart("option_id") + b.PutBytes(r.OptionID) b.Comma() b.FieldStart("text") b.PutString(r.Text) @@ -232,37 +222,37 @@ func (r *ReportStoryRequest) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (r *ReportStoryRequest) DecodeTDLibJSON(b tdjson.Decoder) error { if r == nil { - return fmt.Errorf("can't decode reportStory#9b5f709b to nil") + return fmt.Errorf("can't decode reportStory#78de7310 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("reportStory"); err != nil { - return fmt.Errorf("unable to decode reportStory#9b5f709b: %w", err) + return fmt.Errorf("unable to decode reportStory#78de7310: %w", err) } case "story_sender_chat_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode reportStory#9b5f709b: field story_sender_chat_id: %w", err) + return fmt.Errorf("unable to decode reportStory#78de7310: field story_sender_chat_id: %w", err) } r.StorySenderChatID = value case "story_id": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode reportStory#9b5f709b: field story_id: %w", err) + return fmt.Errorf("unable to decode reportStory#78de7310: field story_id: %w", err) } r.StoryID = value - case "reason": - value, err := DecodeTDLibJSONReportReason(b) + case "option_id": + value, err := b.Bytes() if err != nil { - return fmt.Errorf("unable to decode reportStory#9b5f709b: field reason: %w", err) + return fmt.Errorf("unable to decode reportStory#78de7310: field option_id: %w", err) } - r.Reason = value + r.OptionID = value case "text": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode reportStory#9b5f709b: field text: %w", err) + return fmt.Errorf("unable to decode reportStory#78de7310: field text: %w", err) } r.Text = value default: @@ -288,12 +278,12 @@ func (r *ReportStoryRequest) GetStoryID() (value int32) { return r.StoryID } -// GetReason returns value of Reason field. -func (r *ReportStoryRequest) GetReason() (value ReportReasonClass) { +// GetOptionID returns value of OptionID field. +func (r *ReportStoryRequest) GetOptionID() (value []byte) { if r == nil { return } - return r.Reason + return r.OptionID } // GetText returns value of Text field. @@ -304,12 +294,12 @@ func (r *ReportStoryRequest) GetText() (value string) { return r.Text } -// ReportStory invokes method reportStory#9b5f709b returning error if any. -func (c *Client) ReportStory(ctx context.Context, request *ReportStoryRequest) error { - var ok Ok +// ReportStory invokes method reportStory#78de7310 returning error if any. +func (c *Client) ReportStory(ctx context.Context, request *ReportStoryRequest) (ReportStoryResultClass, error) { + var result ReportStoryResultBox - if err := c.rpc.Invoke(ctx, request, &ok); err != nil { - return err + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err } - return nil + return result.ReportStoryResult, nil } diff --git a/tdapi/tl_report_story_result_gen.go b/tdapi/tl_report_story_result_gen.go new file mode 100644 index 0000000000..1192e1301e --- /dev/null +++ b/tdapi/tl_report_story_result_gen.go @@ -0,0 +1,743 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tdapi + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// ReportStoryResultOk represents TL type `reportStoryResultOk#ac3c63b3`. +type ReportStoryResultOk struct { +} + +// ReportStoryResultOkTypeID is TL type id of ReportStoryResultOk. +const ReportStoryResultOkTypeID = 0xac3c63b3 + +// construct implements constructor of ReportStoryResultClass. +func (r ReportStoryResultOk) construct() ReportStoryResultClass { return &r } + +// Ensuring interfaces in compile-time for ReportStoryResultOk. +var ( + _ bin.Encoder = &ReportStoryResultOk{} + _ bin.Decoder = &ReportStoryResultOk{} + _ bin.BareEncoder = &ReportStoryResultOk{} + _ bin.BareDecoder = &ReportStoryResultOk{} + + _ ReportStoryResultClass = &ReportStoryResultOk{} +) + +func (r *ReportStoryResultOk) Zero() bool { + if r == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (r *ReportStoryResultOk) String() string { + if r == nil { + return "ReportStoryResultOk(nil)" + } + type Alias ReportStoryResultOk + return fmt.Sprintf("ReportStoryResultOk%+v", Alias(*r)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*ReportStoryResultOk) TypeID() uint32 { + return ReportStoryResultOkTypeID +} + +// TypeName returns name of type in TL schema. +func (*ReportStoryResultOk) TypeName() string { + return "reportStoryResultOk" +} + +// TypeInfo returns info about TL type. +func (r *ReportStoryResultOk) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "reportStoryResultOk", + ID: ReportStoryResultOkTypeID, + } + if r == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (r *ReportStoryResultOk) Encode(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't encode reportStoryResultOk#ac3c63b3 as nil") + } + b.PutID(ReportStoryResultOkTypeID) + return r.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (r *ReportStoryResultOk) EncodeBare(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't encode reportStoryResultOk#ac3c63b3 as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (r *ReportStoryResultOk) Decode(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't decode reportStoryResultOk#ac3c63b3 to nil") + } + if err := b.ConsumeID(ReportStoryResultOkTypeID); err != nil { + return fmt.Errorf("unable to decode reportStoryResultOk#ac3c63b3: %w", err) + } + return r.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (r *ReportStoryResultOk) DecodeBare(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't decode reportStoryResultOk#ac3c63b3 to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (r *ReportStoryResultOk) EncodeTDLibJSON(b tdjson.Encoder) error { + if r == nil { + return fmt.Errorf("can't encode reportStoryResultOk#ac3c63b3 as nil") + } + b.ObjStart() + b.PutID("reportStoryResultOk") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (r *ReportStoryResultOk) DecodeTDLibJSON(b tdjson.Decoder) error { + if r == nil { + return fmt.Errorf("can't decode reportStoryResultOk#ac3c63b3 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("reportStoryResultOk"); err != nil { + return fmt.Errorf("unable to decode reportStoryResultOk#ac3c63b3: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// ReportStoryResultOptionRequired represents TL type `reportStoryResultOptionRequired#bf79aa9b`. +type ReportStoryResultOptionRequired struct { + // Title for the option choice + Title string + // List of available options + Options []ReportOption +} + +// ReportStoryResultOptionRequiredTypeID is TL type id of ReportStoryResultOptionRequired. +const ReportStoryResultOptionRequiredTypeID = 0xbf79aa9b + +// construct implements constructor of ReportStoryResultClass. +func (r ReportStoryResultOptionRequired) construct() ReportStoryResultClass { return &r } + +// Ensuring interfaces in compile-time for ReportStoryResultOptionRequired. +var ( + _ bin.Encoder = &ReportStoryResultOptionRequired{} + _ bin.Decoder = &ReportStoryResultOptionRequired{} + _ bin.BareEncoder = &ReportStoryResultOptionRequired{} + _ bin.BareDecoder = &ReportStoryResultOptionRequired{} + + _ ReportStoryResultClass = &ReportStoryResultOptionRequired{} +) + +func (r *ReportStoryResultOptionRequired) Zero() bool { + if r == nil { + return true + } + if !(r.Title == "") { + return false + } + if !(r.Options == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (r *ReportStoryResultOptionRequired) String() string { + if r == nil { + return "ReportStoryResultOptionRequired(nil)" + } + type Alias ReportStoryResultOptionRequired + return fmt.Sprintf("ReportStoryResultOptionRequired%+v", Alias(*r)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*ReportStoryResultOptionRequired) TypeID() uint32 { + return ReportStoryResultOptionRequiredTypeID +} + +// TypeName returns name of type in TL schema. +func (*ReportStoryResultOptionRequired) TypeName() string { + return "reportStoryResultOptionRequired" +} + +// TypeInfo returns info about TL type. +func (r *ReportStoryResultOptionRequired) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "reportStoryResultOptionRequired", + ID: ReportStoryResultOptionRequiredTypeID, + } + if r == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Title", + SchemaName: "title", + }, + { + Name: "Options", + SchemaName: "options", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (r *ReportStoryResultOptionRequired) Encode(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't encode reportStoryResultOptionRequired#bf79aa9b as nil") + } + b.PutID(ReportStoryResultOptionRequiredTypeID) + return r.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (r *ReportStoryResultOptionRequired) EncodeBare(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't encode reportStoryResultOptionRequired#bf79aa9b as nil") + } + b.PutString(r.Title) + b.PutInt(len(r.Options)) + for idx, v := range r.Options { + if err := v.EncodeBare(b); err != nil { + return fmt.Errorf("unable to encode bare reportStoryResultOptionRequired#bf79aa9b: field options element with index %d: %w", idx, err) + } + } + return nil +} + +// Decode implements bin.Decoder. +func (r *ReportStoryResultOptionRequired) Decode(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't decode reportStoryResultOptionRequired#bf79aa9b to nil") + } + if err := b.ConsumeID(ReportStoryResultOptionRequiredTypeID); err != nil { + return fmt.Errorf("unable to decode reportStoryResultOptionRequired#bf79aa9b: %w", err) + } + return r.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (r *ReportStoryResultOptionRequired) DecodeBare(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't decode reportStoryResultOptionRequired#bf79aa9b to nil") + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode reportStoryResultOptionRequired#bf79aa9b: field title: %w", err) + } + r.Title = value + } + { + headerLen, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode reportStoryResultOptionRequired#bf79aa9b: field options: %w", err) + } + + if headerLen > 0 { + r.Options = make([]ReportOption, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + var value ReportOption + if err := value.DecodeBare(b); err != nil { + return fmt.Errorf("unable to decode bare reportStoryResultOptionRequired#bf79aa9b: field options: %w", err) + } + r.Options = append(r.Options, value) + } + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (r *ReportStoryResultOptionRequired) EncodeTDLibJSON(b tdjson.Encoder) error { + if r == nil { + return fmt.Errorf("can't encode reportStoryResultOptionRequired#bf79aa9b as nil") + } + b.ObjStart() + b.PutID("reportStoryResultOptionRequired") + b.Comma() + b.FieldStart("title") + b.PutString(r.Title) + b.Comma() + b.FieldStart("options") + b.ArrStart() + for idx, v := range r.Options { + if err := v.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode reportStoryResultOptionRequired#bf79aa9b: field options element with index %d: %w", idx, err) + } + b.Comma() + } + b.StripComma() + b.ArrEnd() + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (r *ReportStoryResultOptionRequired) DecodeTDLibJSON(b tdjson.Decoder) error { + if r == nil { + return fmt.Errorf("can't decode reportStoryResultOptionRequired#bf79aa9b to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("reportStoryResultOptionRequired"); err != nil { + return fmt.Errorf("unable to decode reportStoryResultOptionRequired#bf79aa9b: %w", err) + } + case "title": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode reportStoryResultOptionRequired#bf79aa9b: field title: %w", err) + } + r.Title = value + case "options": + if err := b.Arr(func(b tdjson.Decoder) error { + var value ReportOption + if err := value.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode reportStoryResultOptionRequired#bf79aa9b: field options: %w", err) + } + r.Options = append(r.Options, value) + return nil + }); err != nil { + return fmt.Errorf("unable to decode reportStoryResultOptionRequired#bf79aa9b: field options: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetTitle returns value of Title field. +func (r *ReportStoryResultOptionRequired) GetTitle() (value string) { + if r == nil { + return + } + return r.Title +} + +// GetOptions returns value of Options field. +func (r *ReportStoryResultOptionRequired) GetOptions() (value []ReportOption) { + if r == nil { + return + } + return r.Options +} + +// ReportStoryResultTextRequired represents TL type `reportStoryResultTextRequired#13ed9d91`. +type ReportStoryResultTextRequired struct { + // Option identifier for the next reportStory request + OptionID []byte + // True, if the user can skip text adding + IsOptional bool +} + +// ReportStoryResultTextRequiredTypeID is TL type id of ReportStoryResultTextRequired. +const ReportStoryResultTextRequiredTypeID = 0x13ed9d91 + +// construct implements constructor of ReportStoryResultClass. +func (r ReportStoryResultTextRequired) construct() ReportStoryResultClass { return &r } + +// Ensuring interfaces in compile-time for ReportStoryResultTextRequired. +var ( + _ bin.Encoder = &ReportStoryResultTextRequired{} + _ bin.Decoder = &ReportStoryResultTextRequired{} + _ bin.BareEncoder = &ReportStoryResultTextRequired{} + _ bin.BareDecoder = &ReportStoryResultTextRequired{} + + _ ReportStoryResultClass = &ReportStoryResultTextRequired{} +) + +func (r *ReportStoryResultTextRequired) Zero() bool { + if r == nil { + return true + } + if !(r.OptionID == nil) { + return false + } + if !(r.IsOptional == false) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (r *ReportStoryResultTextRequired) String() string { + if r == nil { + return "ReportStoryResultTextRequired(nil)" + } + type Alias ReportStoryResultTextRequired + return fmt.Sprintf("ReportStoryResultTextRequired%+v", Alias(*r)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*ReportStoryResultTextRequired) TypeID() uint32 { + return ReportStoryResultTextRequiredTypeID +} + +// TypeName returns name of type in TL schema. +func (*ReportStoryResultTextRequired) TypeName() string { + return "reportStoryResultTextRequired" +} + +// TypeInfo returns info about TL type. +func (r *ReportStoryResultTextRequired) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "reportStoryResultTextRequired", + ID: ReportStoryResultTextRequiredTypeID, + } + if r == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "OptionID", + SchemaName: "option_id", + }, + { + Name: "IsOptional", + SchemaName: "is_optional", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (r *ReportStoryResultTextRequired) Encode(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't encode reportStoryResultTextRequired#13ed9d91 as nil") + } + b.PutID(ReportStoryResultTextRequiredTypeID) + return r.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (r *ReportStoryResultTextRequired) EncodeBare(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't encode reportStoryResultTextRequired#13ed9d91 as nil") + } + b.PutBytes(r.OptionID) + b.PutBool(r.IsOptional) + return nil +} + +// Decode implements bin.Decoder. +func (r *ReportStoryResultTextRequired) Decode(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't decode reportStoryResultTextRequired#13ed9d91 to nil") + } + if err := b.ConsumeID(ReportStoryResultTextRequiredTypeID); err != nil { + return fmt.Errorf("unable to decode reportStoryResultTextRequired#13ed9d91: %w", err) + } + return r.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (r *ReportStoryResultTextRequired) DecodeBare(b *bin.Buffer) error { + if r == nil { + return fmt.Errorf("can't decode reportStoryResultTextRequired#13ed9d91 to nil") + } + { + value, err := b.Bytes() + if err != nil { + return fmt.Errorf("unable to decode reportStoryResultTextRequired#13ed9d91: field option_id: %w", err) + } + r.OptionID = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode reportStoryResultTextRequired#13ed9d91: field is_optional: %w", err) + } + r.IsOptional = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (r *ReportStoryResultTextRequired) EncodeTDLibJSON(b tdjson.Encoder) error { + if r == nil { + return fmt.Errorf("can't encode reportStoryResultTextRequired#13ed9d91 as nil") + } + b.ObjStart() + b.PutID("reportStoryResultTextRequired") + b.Comma() + b.FieldStart("option_id") + b.PutBytes(r.OptionID) + b.Comma() + b.FieldStart("is_optional") + b.PutBool(r.IsOptional) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (r *ReportStoryResultTextRequired) DecodeTDLibJSON(b tdjson.Decoder) error { + if r == nil { + return fmt.Errorf("can't decode reportStoryResultTextRequired#13ed9d91 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("reportStoryResultTextRequired"); err != nil { + return fmt.Errorf("unable to decode reportStoryResultTextRequired#13ed9d91: %w", err) + } + case "option_id": + value, err := b.Bytes() + if err != nil { + return fmt.Errorf("unable to decode reportStoryResultTextRequired#13ed9d91: field option_id: %w", err) + } + r.OptionID = value + case "is_optional": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode reportStoryResultTextRequired#13ed9d91: field is_optional: %w", err) + } + r.IsOptional = value + default: + return b.Skip() + } + return nil + }) +} + +// GetOptionID returns value of OptionID field. +func (r *ReportStoryResultTextRequired) GetOptionID() (value []byte) { + if r == nil { + return + } + return r.OptionID +} + +// GetIsOptional returns value of IsOptional field. +func (r *ReportStoryResultTextRequired) GetIsOptional() (value bool) { + if r == nil { + return + } + return r.IsOptional +} + +// ReportStoryResultClassName is schema name of ReportStoryResultClass. +const ReportStoryResultClassName = "ReportStoryResult" + +// ReportStoryResultClass represents ReportStoryResult generic type. +// +// Example: +// +// g, err := tdapi.DecodeReportStoryResult(buf) +// if err != nil { +// panic(err) +// } +// switch v := g.(type) { +// case *tdapi.ReportStoryResultOk: // reportStoryResultOk#ac3c63b3 +// case *tdapi.ReportStoryResultOptionRequired: // reportStoryResultOptionRequired#bf79aa9b +// case *tdapi.ReportStoryResultTextRequired: // reportStoryResultTextRequired#13ed9d91 +// default: panic(v) +// } +type ReportStoryResultClass interface { + bin.Encoder + bin.Decoder + bin.BareEncoder + bin.BareDecoder + construct() ReportStoryResultClass + + // TypeID returns type id in TL schema. + // + // See https://core.telegram.org/mtproto/TL-tl#remarks. + TypeID() uint32 + // TypeName returns name of type in TL schema. + TypeName() string + // String implements fmt.Stringer. + String() string + // Zero returns true if current object has a zero value. + Zero() bool + + EncodeTDLibJSON(b tdjson.Encoder) error + DecodeTDLibJSON(b tdjson.Decoder) error +} + +// DecodeReportStoryResult implements binary de-serialization for ReportStoryResultClass. +func DecodeReportStoryResult(buf *bin.Buffer) (ReportStoryResultClass, error) { + id, err := buf.PeekID() + if err != nil { + return nil, err + } + switch id { + case ReportStoryResultOkTypeID: + // Decoding reportStoryResultOk#ac3c63b3. + v := ReportStoryResultOk{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode ReportStoryResultClass: %w", err) + } + return &v, nil + case ReportStoryResultOptionRequiredTypeID: + // Decoding reportStoryResultOptionRequired#bf79aa9b. + v := ReportStoryResultOptionRequired{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode ReportStoryResultClass: %w", err) + } + return &v, nil + case ReportStoryResultTextRequiredTypeID: + // Decoding reportStoryResultTextRequired#13ed9d91. + v := ReportStoryResultTextRequired{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode ReportStoryResultClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode ReportStoryResultClass: %w", bin.NewUnexpectedID(id)) + } +} + +// DecodeTDLibJSONReportStoryResult implements binary de-serialization for ReportStoryResultClass. +func DecodeTDLibJSONReportStoryResult(buf tdjson.Decoder) (ReportStoryResultClass, error) { + id, err := buf.FindTypeID() + if err != nil { + return nil, err + } + switch id { + case "reportStoryResultOk": + // Decoding reportStoryResultOk#ac3c63b3. + v := ReportStoryResultOk{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode ReportStoryResultClass: %w", err) + } + return &v, nil + case "reportStoryResultOptionRequired": + // Decoding reportStoryResultOptionRequired#bf79aa9b. + v := ReportStoryResultOptionRequired{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode ReportStoryResultClass: %w", err) + } + return &v, nil + case "reportStoryResultTextRequired": + // Decoding reportStoryResultTextRequired#13ed9d91. + v := ReportStoryResultTextRequired{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode ReportStoryResultClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode ReportStoryResultClass: %w", tdjson.NewUnexpectedID(id)) + } +} + +// ReportStoryResult boxes the ReportStoryResultClass providing a helper. +type ReportStoryResultBox struct { + ReportStoryResult ReportStoryResultClass +} + +// Decode implements bin.Decoder for ReportStoryResultBox. +func (b *ReportStoryResultBox) Decode(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("unable to decode ReportStoryResultBox to nil") + } + v, err := DecodeReportStoryResult(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.ReportStoryResult = v + return nil +} + +// Encode implements bin.Encode for ReportStoryResultBox. +func (b *ReportStoryResultBox) Encode(buf *bin.Buffer) error { + if b == nil || b.ReportStoryResult == nil { + return fmt.Errorf("unable to encode ReportStoryResultClass as nil") + } + return b.ReportStoryResult.Encode(buf) +} + +// DecodeTDLibJSON implements bin.Decoder for ReportStoryResultBox. +func (b *ReportStoryResultBox) DecodeTDLibJSON(buf tdjson.Decoder) error { + if b == nil { + return fmt.Errorf("unable to decode ReportStoryResultBox to nil") + } + v, err := DecodeTDLibJSONReportStoryResult(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.ReportStoryResult = v + return nil +} + +// EncodeTDLibJSON implements bin.Encode for ReportStoryResultBox. +func (b *ReportStoryResultBox) EncodeTDLibJSON(buf tdjson.Encoder) error { + if b == nil || b.ReportStoryResult == nil { + return fmt.Errorf("unable to encode ReportStoryResultClass as nil") + } + return b.ReportStoryResult.EncodeTDLibJSON(buf) +} diff --git a/tdapi/tl_report_supergroup_spam_gen.go b/tdapi/tl_report_supergroup_spam_gen.go index a619aebc54..36a6f8a163 100644 --- a/tdapi/tl_report_supergroup_spam_gen.go +++ b/tdapi/tl_report_supergroup_spam_gen.go @@ -35,8 +35,8 @@ var ( type ReportSupergroupSpamRequest struct { // Supergroup identifier SupergroupID int64 - // Identifiers of messages to report. Use messageProperties.can_be_reported to check - // whether the message can be reported + // Identifiers of messages to report. Use messageProperties.can_report_supergroup_spam to + // check whether the message can be reported MessageIDs []int64 } diff --git a/tdapi/tl_sell_gift_gen.go b/tdapi/tl_sell_gift_gen.go new file mode 100644 index 0000000000..aff2beee9a --- /dev/null +++ b/tdapi/tl_sell_gift_gen.go @@ -0,0 +1,237 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tdapi + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// SellGiftRequest represents TL type `sellGift#671b88b4`. +type SellGiftRequest struct { + // Identifier of the user that sent the gift + SenderUserID int64 + // Identifier of the message with the gift in the chat with the user + MessageID int64 +} + +// SellGiftRequestTypeID is TL type id of SellGiftRequest. +const SellGiftRequestTypeID = 0x671b88b4 + +// Ensuring interfaces in compile-time for SellGiftRequest. +var ( + _ bin.Encoder = &SellGiftRequest{} + _ bin.Decoder = &SellGiftRequest{} + _ bin.BareEncoder = &SellGiftRequest{} + _ bin.BareDecoder = &SellGiftRequest{} +) + +func (s *SellGiftRequest) Zero() bool { + if s == nil { + return true + } + if !(s.SenderUserID == 0) { + return false + } + if !(s.MessageID == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *SellGiftRequest) String() string { + if s == nil { + return "SellGiftRequest(nil)" + } + type Alias SellGiftRequest + return fmt.Sprintf("SellGiftRequest%+v", Alias(*s)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*SellGiftRequest) TypeID() uint32 { + return SellGiftRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*SellGiftRequest) TypeName() string { + return "sellGift" +} + +// TypeInfo returns info about TL type. +func (s *SellGiftRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "sellGift", + ID: SellGiftRequestTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "SenderUserID", + SchemaName: "sender_user_id", + }, + { + Name: "MessageID", + SchemaName: "message_id", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (s *SellGiftRequest) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode sellGift#671b88b4 as nil") + } + b.PutID(SellGiftRequestTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *SellGiftRequest) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode sellGift#671b88b4 as nil") + } + b.PutInt53(s.SenderUserID) + b.PutInt53(s.MessageID) + return nil +} + +// Decode implements bin.Decoder. +func (s *SellGiftRequest) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode sellGift#671b88b4 to nil") + } + if err := b.ConsumeID(SellGiftRequestTypeID); err != nil { + return fmt.Errorf("unable to decode sellGift#671b88b4: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *SellGiftRequest) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode sellGift#671b88b4 to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode sellGift#671b88b4: field sender_user_id: %w", err) + } + s.SenderUserID = value + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode sellGift#671b88b4: field message_id: %w", err) + } + s.MessageID = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (s *SellGiftRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if s == nil { + return fmt.Errorf("can't encode sellGift#671b88b4 as nil") + } + b.ObjStart() + b.PutID("sellGift") + b.Comma() + b.FieldStart("sender_user_id") + b.PutInt53(s.SenderUserID) + b.Comma() + b.FieldStart("message_id") + b.PutInt53(s.MessageID) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (s *SellGiftRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if s == nil { + return fmt.Errorf("can't decode sellGift#671b88b4 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("sellGift"); err != nil { + return fmt.Errorf("unable to decode sellGift#671b88b4: %w", err) + } + case "sender_user_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode sellGift#671b88b4: field sender_user_id: %w", err) + } + s.SenderUserID = value + case "message_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode sellGift#671b88b4: field message_id: %w", err) + } + s.MessageID = value + default: + return b.Skip() + } + return nil + }) +} + +// GetSenderUserID returns value of SenderUserID field. +func (s *SellGiftRequest) GetSenderUserID() (value int64) { + if s == nil { + return + } + return s.SenderUserID +} + +// GetMessageID returns value of MessageID field. +func (s *SellGiftRequest) GetMessageID() (value int64) { + if s == nil { + return + } + return s.MessageID +} + +// SellGift invokes method sellGift#671b88b4 returning error if any. +func (c *Client) SellGift(ctx context.Context, request *SellGiftRequest) error { + var ok Ok + + if err := c.rpc.Invoke(ctx, request, &ok); err != nil { + return err + } + return nil +} diff --git a/tdapi/tl_send_gift_gen.go b/tdapi/tl_send_gift_gen.go new file mode 100644 index 0000000000..bd9cb88ee8 --- /dev/null +++ b/tdapi/tl_send_gift_gen.go @@ -0,0 +1,307 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tdapi + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// SendGiftRequest represents TL type `sendGift#32c9796d`. +type SendGiftRequest struct { + // Identifier of the gift to send + GiftID int64 + // Identifier of the user that will receive the gift + UserID int64 + // 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 + Text FormattedText + // 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 + IsPrivate bool +} + +// SendGiftRequestTypeID is TL type id of SendGiftRequest. +const SendGiftRequestTypeID = 0x32c9796d + +// Ensuring interfaces in compile-time for SendGiftRequest. +var ( + _ bin.Encoder = &SendGiftRequest{} + _ bin.Decoder = &SendGiftRequest{} + _ bin.BareEncoder = &SendGiftRequest{} + _ bin.BareDecoder = &SendGiftRequest{} +) + +func (s *SendGiftRequest) Zero() bool { + if s == nil { + return true + } + if !(s.GiftID == 0) { + return false + } + if !(s.UserID == 0) { + return false + } + if !(s.Text.Zero()) { + return false + } + if !(s.IsPrivate == false) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *SendGiftRequest) String() string { + if s == nil { + return "SendGiftRequest(nil)" + } + type Alias SendGiftRequest + return fmt.Sprintf("SendGiftRequest%+v", Alias(*s)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*SendGiftRequest) TypeID() uint32 { + return SendGiftRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*SendGiftRequest) TypeName() string { + return "sendGift" +} + +// TypeInfo returns info about TL type. +func (s *SendGiftRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "sendGift", + ID: SendGiftRequestTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "GiftID", + SchemaName: "gift_id", + }, + { + Name: "UserID", + SchemaName: "user_id", + }, + { + Name: "Text", + SchemaName: "text", + }, + { + Name: "IsPrivate", + SchemaName: "is_private", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (s *SendGiftRequest) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode sendGift#32c9796d as nil") + } + b.PutID(SendGiftRequestTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *SendGiftRequest) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode sendGift#32c9796d as nil") + } + b.PutLong(s.GiftID) + b.PutInt53(s.UserID) + if err := s.Text.Encode(b); err != nil { + return fmt.Errorf("unable to encode sendGift#32c9796d: field text: %w", err) + } + b.PutBool(s.IsPrivate) + return nil +} + +// Decode implements bin.Decoder. +func (s *SendGiftRequest) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode sendGift#32c9796d to nil") + } + if err := b.ConsumeID(SendGiftRequestTypeID); err != nil { + return fmt.Errorf("unable to decode sendGift#32c9796d: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *SendGiftRequest) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode sendGift#32c9796d to nil") + } + { + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode sendGift#32c9796d: field gift_id: %w", err) + } + s.GiftID = value + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode sendGift#32c9796d: field user_id: %w", err) + } + s.UserID = value + } + { + if err := s.Text.Decode(b); err != nil { + return fmt.Errorf("unable to decode sendGift#32c9796d: field text: %w", err) + } + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode sendGift#32c9796d: field is_private: %w", err) + } + s.IsPrivate = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (s *SendGiftRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if s == nil { + return fmt.Errorf("can't encode sendGift#32c9796d as nil") + } + b.ObjStart() + b.PutID("sendGift") + b.Comma() + b.FieldStart("gift_id") + b.PutLong(s.GiftID) + b.Comma() + b.FieldStart("user_id") + b.PutInt53(s.UserID) + b.Comma() + b.FieldStart("text") + if err := s.Text.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode sendGift#32c9796d: field text: %w", err) + } + b.Comma() + b.FieldStart("is_private") + b.PutBool(s.IsPrivate) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (s *SendGiftRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if s == nil { + return fmt.Errorf("can't decode sendGift#32c9796d to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("sendGift"); err != nil { + return fmt.Errorf("unable to decode sendGift#32c9796d: %w", err) + } + case "gift_id": + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode sendGift#32c9796d: field gift_id: %w", err) + } + s.GiftID = value + case "user_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode sendGift#32c9796d: field user_id: %w", err) + } + s.UserID = value + case "text": + if err := s.Text.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode sendGift#32c9796d: field text: %w", err) + } + case "is_private": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode sendGift#32c9796d: field is_private: %w", err) + } + s.IsPrivate = value + default: + return b.Skip() + } + return nil + }) +} + +// GetGiftID returns value of GiftID field. +func (s *SendGiftRequest) GetGiftID() (value int64) { + if s == nil { + return + } + return s.GiftID +} + +// GetUserID returns value of UserID field. +func (s *SendGiftRequest) GetUserID() (value int64) { + if s == nil { + return + } + return s.UserID +} + +// GetText returns value of Text field. +func (s *SendGiftRequest) GetText() (value FormattedText) { + if s == nil { + return + } + return s.Text +} + +// GetIsPrivate returns value of IsPrivate field. +func (s *SendGiftRequest) GetIsPrivate() (value bool) { + if s == nil { + return + } + return s.IsPrivate +} + +// SendGift invokes method sendGift#32c9796d returning error if any. +func (c *Client) SendGift(ctx context.Context, request *SendGiftRequest) error { + var ok Ok + + if err := c.rpc.Invoke(ctx, request, &ok); err != nil { + return err + } + return nil +} diff --git a/tdapi/tl_sponsored_message_gen.go b/tdapi/tl_sponsored_message_gen.go index 0a931e5fcf..695d3b2f91 100644 --- a/tdapi/tl_sponsored_message_gen.go +++ b/tdapi/tl_sponsored_message_gen.go @@ -42,7 +42,8 @@ type SponsoredMessage struct { // reportChatSponsoredMessage CanBeReported bool // Content of the message. Currently, can be only of the types messageText, - // messageAnimation, messagePhoto, or messageVideo + // messageAnimation, messagePhoto, or messageVideo. Video messages can be viewed + // fullscreen Content MessageContentClass // Information about the sponsor of the message Sponsor MessageSponsor diff --git a/tdapi/tl_star_transaction_partner_gen.go b/tdapi/tl_star_transaction_partner_gen.go index 1fbfc0b1ba..04a5c9072d 100644 --- a/tdapi/tl_star_transaction_partner_gen.go +++ b/tdapi/tl_star_transaction_partner_gen.go @@ -1385,16 +1385,16 @@ func (s *StarTransactionPartnerChat) GetPurpose() (value ChatTransactionPurposeC return s.Purpose } -// StarTransactionPartnerUser represents TL type `starTransactionPartnerUser#2cf89d66`. +// StarTransactionPartnerUser represents TL type `starTransactionPartnerUser#6f4d43d1`. type StarTransactionPartnerUser struct { - // Identifier of the user; 0 if the gift was anonymous + // Identifier of the user; 0 if the user was anonymous UserID int64 - // A sticker to be shown in the transaction information; may be null if unknown - Sticker Sticker + // Purpose of the transaction + Purpose UserTransactionPurposeClass } // StarTransactionPartnerUserTypeID is TL type id of StarTransactionPartnerUser. -const StarTransactionPartnerUserTypeID = 0x2cf89d66 +const StarTransactionPartnerUserTypeID = 0x6f4d43d1 // construct implements constructor of StarTransactionPartnerClass. func (s StarTransactionPartnerUser) construct() StarTransactionPartnerClass { return &s } @@ -1416,7 +1416,7 @@ func (s *StarTransactionPartnerUser) Zero() bool { if !(s.UserID == 0) { return false } - if !(s.Sticker.Zero()) { + if !(s.Purpose == nil) { return false } @@ -1460,8 +1460,8 @@ func (s *StarTransactionPartnerUser) TypeInfo() tdp.Type { SchemaName: "user_id", }, { - Name: "Sticker", - SchemaName: "sticker", + Name: "Purpose", + SchemaName: "purpose", }, } return typ @@ -1470,7 +1470,7 @@ func (s *StarTransactionPartnerUser) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (s *StarTransactionPartnerUser) Encode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode starTransactionPartnerUser#2cf89d66 as nil") + return fmt.Errorf("can't encode starTransactionPartnerUser#6f4d43d1 as nil") } b.PutID(StarTransactionPartnerUserTypeID) return s.EncodeBare(b) @@ -1479,11 +1479,14 @@ func (s *StarTransactionPartnerUser) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (s *StarTransactionPartnerUser) EncodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode starTransactionPartnerUser#2cf89d66 as nil") + return fmt.Errorf("can't encode starTransactionPartnerUser#6f4d43d1 as nil") } b.PutInt53(s.UserID) - if err := s.Sticker.Encode(b); err != nil { - return fmt.Errorf("unable to encode starTransactionPartnerUser#2cf89d66: field sticker: %w", err) + if s.Purpose == nil { + return fmt.Errorf("unable to encode starTransactionPartnerUser#6f4d43d1: field purpose is nil") + } + if err := s.Purpose.Encode(b); err != nil { + return fmt.Errorf("unable to encode starTransactionPartnerUser#6f4d43d1: field purpose: %w", err) } return nil } @@ -1491,10 +1494,10 @@ func (s *StarTransactionPartnerUser) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (s *StarTransactionPartnerUser) Decode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode starTransactionPartnerUser#2cf89d66 to nil") + return fmt.Errorf("can't decode starTransactionPartnerUser#6f4d43d1 to nil") } if err := b.ConsumeID(StarTransactionPartnerUserTypeID); err != nil { - return fmt.Errorf("unable to decode starTransactionPartnerUser#2cf89d66: %w", err) + return fmt.Errorf("unable to decode starTransactionPartnerUser#6f4d43d1: %w", err) } return s.DecodeBare(b) } @@ -1502,19 +1505,21 @@ func (s *StarTransactionPartnerUser) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (s *StarTransactionPartnerUser) DecodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode starTransactionPartnerUser#2cf89d66 to nil") + return fmt.Errorf("can't decode starTransactionPartnerUser#6f4d43d1 to nil") } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode starTransactionPartnerUser#2cf89d66: field user_id: %w", err) + return fmt.Errorf("unable to decode starTransactionPartnerUser#6f4d43d1: field user_id: %w", err) } s.UserID = value } { - if err := s.Sticker.Decode(b); err != nil { - return fmt.Errorf("unable to decode starTransactionPartnerUser#2cf89d66: field sticker: %w", err) + value, err := DecodeUserTransactionPurpose(b) + if err != nil { + return fmt.Errorf("unable to decode starTransactionPartnerUser#6f4d43d1: field purpose: %w", err) } + s.Purpose = value } return nil } @@ -1522,7 +1527,7 @@ func (s *StarTransactionPartnerUser) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (s *StarTransactionPartnerUser) EncodeTDLibJSON(b tdjson.Encoder) error { if s == nil { - return fmt.Errorf("can't encode starTransactionPartnerUser#2cf89d66 as nil") + return fmt.Errorf("can't encode starTransactionPartnerUser#6f4d43d1 as nil") } b.ObjStart() b.PutID("starTransactionPartnerUser") @@ -1530,9 +1535,12 @@ func (s *StarTransactionPartnerUser) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("user_id") b.PutInt53(s.UserID) b.Comma() - b.FieldStart("sticker") - if err := s.Sticker.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode starTransactionPartnerUser#2cf89d66: field sticker: %w", err) + b.FieldStart("purpose") + if s.Purpose == nil { + return fmt.Errorf("unable to encode starTransactionPartnerUser#6f4d43d1: field purpose is nil") + } + if err := s.Purpose.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode starTransactionPartnerUser#6f4d43d1: field purpose: %w", err) } b.Comma() b.StripComma() @@ -1543,25 +1551,27 @@ func (s *StarTransactionPartnerUser) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (s *StarTransactionPartnerUser) DecodeTDLibJSON(b tdjson.Decoder) error { if s == nil { - return fmt.Errorf("can't decode starTransactionPartnerUser#2cf89d66 to nil") + return fmt.Errorf("can't decode starTransactionPartnerUser#6f4d43d1 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("starTransactionPartnerUser"); err != nil { - return fmt.Errorf("unable to decode starTransactionPartnerUser#2cf89d66: %w", err) + return fmt.Errorf("unable to decode starTransactionPartnerUser#6f4d43d1: %w", err) } case "user_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode starTransactionPartnerUser#2cf89d66: field user_id: %w", err) + return fmt.Errorf("unable to decode starTransactionPartnerUser#6f4d43d1: field user_id: %w", err) } s.UserID = value - case "sticker": - if err := s.Sticker.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode starTransactionPartnerUser#2cf89d66: field sticker: %w", err) + case "purpose": + value, err := DecodeTDLibJSONUserTransactionPurpose(b) + if err != nil { + return fmt.Errorf("unable to decode starTransactionPartnerUser#6f4d43d1: field purpose: %w", err) } + s.Purpose = value default: return b.Skip() } @@ -1577,12 +1587,12 @@ func (s *StarTransactionPartnerUser) GetUserID() (value int64) { return s.UserID } -// GetSticker returns value of Sticker field. -func (s *StarTransactionPartnerUser) GetSticker() (value Sticker) { +// GetPurpose returns value of Purpose field. +func (s *StarTransactionPartnerUser) GetPurpose() (value UserTransactionPurposeClass) { if s == nil { return } - return s.Sticker + return s.Purpose } // StarTransactionPartnerUnsupported represents TL type `starTransactionPartnerUnsupported#c4b20d73`. @@ -1736,7 +1746,7 @@ const StarTransactionPartnerClassName = "StarTransactionPartner" // case *tdapi.StarTransactionPartnerBot: // starTransactionPartnerBot#4ece3a40 // case *tdapi.StarTransactionPartnerBusiness: // starTransactionPartnerBusiness#7af9fb52 // case *tdapi.StarTransactionPartnerChat: // starTransactionPartnerChat#71db4d40 -// case *tdapi.StarTransactionPartnerUser: // starTransactionPartnerUser#2cf89d66 +// case *tdapi.StarTransactionPartnerUser: // starTransactionPartnerUser#6f4d43d1 // case *tdapi.StarTransactionPartnerUnsupported: // starTransactionPartnerUnsupported#c4b20d73 // default: panic(v) // } @@ -1826,7 +1836,7 @@ func DecodeStarTransactionPartner(buf *bin.Buffer) (StarTransactionPartnerClass, } return &v, nil case StarTransactionPartnerUserTypeID: - // Decoding starTransactionPartnerUser#2cf89d66. + // Decoding starTransactionPartnerUser#6f4d43d1. v := StarTransactionPartnerUser{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode StarTransactionPartnerClass: %w", err) @@ -1908,7 +1918,7 @@ func DecodeTDLibJSONStarTransactionPartner(buf tdjson.Decoder) (StarTransactionP } return &v, nil case "starTransactionPartnerUser": - // Decoding starTransactionPartnerUser#2cf89d66. + // Decoding starTransactionPartnerUser#6f4d43d1. v := StarTransactionPartnerUser{} if err := v.DecodeTDLibJSON(buf); err != nil { return nil, fmt.Errorf("unable to decode StarTransactionPartnerClass: %w", err) diff --git a/tdapi/tl_story_content_gen.go b/tdapi/tl_story_content_gen.go index 916663e478..cc6900b915 100644 --- a/tdapi/tl_story_content_gen.go +++ b/tdapi/tl_story_content_gen.go @@ -201,7 +201,8 @@ func (s *StoryContentPhoto) GetPhoto() (value Photo) { type StoryContentVideo struct { // The video in MPEG4 format Video StoryVideo - // Alternative version of the video in MPEG4 format, encoded by x264 codec; may be null + // Alternative version of the video in MPEG4 format, encoded with H.264 codec; may be + // null AlternativeVideo StoryVideo } diff --git a/tdapi/tl_story_video_gen.go b/tdapi/tl_story_video_gen.go index 68176be903..14ef9163cd 100644 --- a/tdapi/tl_story_video_gen.go +++ b/tdapi/tl_story_video_gen.go @@ -48,7 +48,7 @@ type StoryVideo struct { Minithumbnail Minithumbnail // Video thumbnail in JPEG or MPEG4 format; may be null Thumbnail Thumbnail - // Size of file prefix, which is supposed to be preloaded, in bytes + // Size of file prefix, which is expected to be preloaded, in bytes PreloadPrefixSize int32 // Timestamp of the frame used as video thumbnail CoverFrameTimestamp float64 diff --git a/tdapi/tl_toggle_gift_is_saved_gen.go b/tdapi/tl_toggle_gift_is_saved_gen.go new file mode 100644 index 0000000000..cd0baf24f7 --- /dev/null +++ b/tdapi/tl_toggle_gift_is_saved_gen.go @@ -0,0 +1,272 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tdapi + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// ToggleGiftIsSavedRequest represents TL type `toggleGiftIsSaved#91c2f183`. +type ToggleGiftIsSavedRequest struct { + // Identifier of the user that sent the gift + SenderUserID int64 + // Identifier of the message with the gift in the chat with the user + MessageID int64 + // Pass true to display the gift on the user's profile page; pass false to remove it from + // the profile page + IsSaved bool +} + +// ToggleGiftIsSavedRequestTypeID is TL type id of ToggleGiftIsSavedRequest. +const ToggleGiftIsSavedRequestTypeID = 0x91c2f183 + +// Ensuring interfaces in compile-time for ToggleGiftIsSavedRequest. +var ( + _ bin.Encoder = &ToggleGiftIsSavedRequest{} + _ bin.Decoder = &ToggleGiftIsSavedRequest{} + _ bin.BareEncoder = &ToggleGiftIsSavedRequest{} + _ bin.BareDecoder = &ToggleGiftIsSavedRequest{} +) + +func (t *ToggleGiftIsSavedRequest) Zero() bool { + if t == nil { + return true + } + if !(t.SenderUserID == 0) { + return false + } + if !(t.MessageID == 0) { + return false + } + if !(t.IsSaved == false) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (t *ToggleGiftIsSavedRequest) String() string { + if t == nil { + return "ToggleGiftIsSavedRequest(nil)" + } + type Alias ToggleGiftIsSavedRequest + return fmt.Sprintf("ToggleGiftIsSavedRequest%+v", Alias(*t)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*ToggleGiftIsSavedRequest) TypeID() uint32 { + return ToggleGiftIsSavedRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*ToggleGiftIsSavedRequest) TypeName() string { + return "toggleGiftIsSaved" +} + +// TypeInfo returns info about TL type. +func (t *ToggleGiftIsSavedRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "toggleGiftIsSaved", + ID: ToggleGiftIsSavedRequestTypeID, + } + if t == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "SenderUserID", + SchemaName: "sender_user_id", + }, + { + Name: "MessageID", + SchemaName: "message_id", + }, + { + Name: "IsSaved", + SchemaName: "is_saved", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (t *ToggleGiftIsSavedRequest) Encode(b *bin.Buffer) error { + if t == nil { + return fmt.Errorf("can't encode toggleGiftIsSaved#91c2f183 as nil") + } + b.PutID(ToggleGiftIsSavedRequestTypeID) + return t.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (t *ToggleGiftIsSavedRequest) EncodeBare(b *bin.Buffer) error { + if t == nil { + return fmt.Errorf("can't encode toggleGiftIsSaved#91c2f183 as nil") + } + b.PutInt53(t.SenderUserID) + b.PutInt53(t.MessageID) + b.PutBool(t.IsSaved) + return nil +} + +// Decode implements bin.Decoder. +func (t *ToggleGiftIsSavedRequest) Decode(b *bin.Buffer) error { + if t == nil { + return fmt.Errorf("can't decode toggleGiftIsSaved#91c2f183 to nil") + } + if err := b.ConsumeID(ToggleGiftIsSavedRequestTypeID); err != nil { + return fmt.Errorf("unable to decode toggleGiftIsSaved#91c2f183: %w", err) + } + return t.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (t *ToggleGiftIsSavedRequest) DecodeBare(b *bin.Buffer) error { + if t == nil { + return fmt.Errorf("can't decode toggleGiftIsSaved#91c2f183 to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode toggleGiftIsSaved#91c2f183: field sender_user_id: %w", err) + } + t.SenderUserID = value + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode toggleGiftIsSaved#91c2f183: field message_id: %w", err) + } + t.MessageID = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode toggleGiftIsSaved#91c2f183: field is_saved: %w", err) + } + t.IsSaved = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (t *ToggleGiftIsSavedRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if t == nil { + return fmt.Errorf("can't encode toggleGiftIsSaved#91c2f183 as nil") + } + b.ObjStart() + b.PutID("toggleGiftIsSaved") + b.Comma() + b.FieldStart("sender_user_id") + b.PutInt53(t.SenderUserID) + b.Comma() + b.FieldStart("message_id") + b.PutInt53(t.MessageID) + b.Comma() + b.FieldStart("is_saved") + b.PutBool(t.IsSaved) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (t *ToggleGiftIsSavedRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if t == nil { + return fmt.Errorf("can't decode toggleGiftIsSaved#91c2f183 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("toggleGiftIsSaved"); err != nil { + return fmt.Errorf("unable to decode toggleGiftIsSaved#91c2f183: %w", err) + } + case "sender_user_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode toggleGiftIsSaved#91c2f183: field sender_user_id: %w", err) + } + t.SenderUserID = value + case "message_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode toggleGiftIsSaved#91c2f183: field message_id: %w", err) + } + t.MessageID = value + case "is_saved": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode toggleGiftIsSaved#91c2f183: field is_saved: %w", err) + } + t.IsSaved = value + default: + return b.Skip() + } + return nil + }) +} + +// GetSenderUserID returns value of SenderUserID field. +func (t *ToggleGiftIsSavedRequest) GetSenderUserID() (value int64) { + if t == nil { + return + } + return t.SenderUserID +} + +// GetMessageID returns value of MessageID field. +func (t *ToggleGiftIsSavedRequest) GetMessageID() (value int64) { + if t == nil { + return + } + return t.MessageID +} + +// GetIsSaved returns value of IsSaved field. +func (t *ToggleGiftIsSavedRequest) GetIsSaved() (value bool) { + if t == nil { + return + } + return t.IsSaved +} + +// ToggleGiftIsSaved invokes method toggleGiftIsSaved#91c2f183 returning error if any. +func (c *Client) ToggleGiftIsSaved(ctx context.Context, request *ToggleGiftIsSavedRequest) error { + var ok Ok + + if err := c.rpc.Invoke(ctx, request, &ok); err != nil { + return err + } + return nil +} diff --git a/tdapi/tl_update_gen.go b/tdapi/tl_update_gen.go index 62e2a24537..8c8e76acf2 100644 --- a/tdapi/tl_update_gen.go +++ b/tdapi/tl_update_gen.go @@ -15674,13 +15674,13 @@ func (u *UpdateFile) GetFile() (value File) { type UpdateFileGenerationStart struct { // Unique identifier for the generation process GenerationID int64 - // The path to a file from which a new file is generated; may be empty + // The original path specified by the application in inputFileGenerated OriginalPath string - // The path to a file that must be created and where the new file is generated + // The path to a file that must be created and where the new file must be generated by + // the application. DestinationPath string - // 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 + // If the conversion is "#url#" than original_path contains an HTTP/HTTPS URL of a file + // that must be downloaded by the application. Conversion string } diff --git a/tdapi/tl_user_full_info_gen.go b/tdapi/tl_user_full_info_gen.go index be8a1bd85f..b41ce4a231 100644 --- a/tdapi/tl_user_full_info_gen.go +++ b/tdapi/tl_user_full_info_gen.go @@ -31,7 +31,7 @@ var ( _ = tdjson.Encoder{} ) -// UserFullInfo represents TL type `userFullInfo#b61c9c5`. +// UserFullInfo represents TL type `userFullInfo#8388276a`. type UserFullInfo struct { // User profile photo set by the current user for the contact; may be null. If null and // user.profile_photo is null, then the photo is empty; otherwise, it is unknown. @@ -72,6 +72,8 @@ type UserFullInfo struct { PersonalChatID int64 // The list of available options for gifting Telegram Premium to the user PremiumGiftOptions []PremiumPaymentOption + // Number of gifts saved to profile by the user + GiftCount int32 // Number of group chats where both the other user and the current user are a member; 0 // for the current user GroupInCommonCount int32 @@ -83,7 +85,7 @@ type UserFullInfo struct { } // UserFullInfoTypeID is TL type id of UserFullInfo. -const UserFullInfoTypeID = 0xb61c9c5 +const UserFullInfoTypeID = 0x8388276a // Ensuring interfaces in compile-time for UserFullInfo. var ( @@ -148,6 +150,9 @@ func (u *UserFullInfo) Zero() bool { if !(u.PremiumGiftOptions == nil) { return false } + if !(u.GiftCount == 0) { + return false + } if !(u.GroupInCommonCount == 0) { return false } @@ -261,6 +266,10 @@ func (u *UserFullInfo) TypeInfo() tdp.Type { Name: "PremiumGiftOptions", SchemaName: "premium_gift_options", }, + { + Name: "GiftCount", + SchemaName: "gift_count", + }, { Name: "GroupInCommonCount", SchemaName: "group_in_common_count", @@ -280,7 +289,7 @@ func (u *UserFullInfo) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UserFullInfo) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode userFullInfo#b61c9c5 as nil") + return fmt.Errorf("can't encode userFullInfo#8388276a as nil") } b.PutID(UserFullInfoTypeID) return u.EncodeBare(b) @@ -289,22 +298,22 @@ func (u *UserFullInfo) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UserFullInfo) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode userFullInfo#b61c9c5 as nil") + return fmt.Errorf("can't encode userFullInfo#8388276a as nil") } if err := u.PersonalPhoto.Encode(b); err != nil { - return fmt.Errorf("unable to encode userFullInfo#b61c9c5: field personal_photo: %w", err) + return fmt.Errorf("unable to encode userFullInfo#8388276a: field personal_photo: %w", err) } if err := u.Photo.Encode(b); err != nil { - return fmt.Errorf("unable to encode userFullInfo#b61c9c5: field photo: %w", err) + return fmt.Errorf("unable to encode userFullInfo#8388276a: field photo: %w", err) } if err := u.PublicPhoto.Encode(b); err != nil { - return fmt.Errorf("unable to encode userFullInfo#b61c9c5: field public_photo: %w", err) + return fmt.Errorf("unable to encode userFullInfo#8388276a: field public_photo: %w", err) } if u.BlockList == nil { - return fmt.Errorf("unable to encode userFullInfo#b61c9c5: field block_list is nil") + return fmt.Errorf("unable to encode userFullInfo#8388276a: field block_list is nil") } if err := u.BlockList.Encode(b); err != nil { - return fmt.Errorf("unable to encode userFullInfo#b61c9c5: field block_list: %w", err) + return fmt.Errorf("unable to encode userFullInfo#8388276a: field block_list: %w", err) } b.PutBool(u.CanBeCalled) b.PutBool(u.SupportsVideoCalls) @@ -316,24 +325,25 @@ func (u *UserFullInfo) EncodeBare(b *bin.Buffer) error { b.PutBool(u.NeedPhoneNumberPrivacyException) b.PutBool(u.SetChatBackground) if err := u.Bio.Encode(b); err != nil { - return fmt.Errorf("unable to encode userFullInfo#b61c9c5: field bio: %w", err) + return fmt.Errorf("unable to encode userFullInfo#8388276a: field bio: %w", err) } if err := u.Birthdate.Encode(b); err != nil { - return fmt.Errorf("unable to encode userFullInfo#b61c9c5: field birthdate: %w", err) + return fmt.Errorf("unable to encode userFullInfo#8388276a: field birthdate: %w", err) } b.PutInt53(u.PersonalChatID) b.PutInt(len(u.PremiumGiftOptions)) for idx, v := range u.PremiumGiftOptions { if err := v.EncodeBare(b); err != nil { - return fmt.Errorf("unable to encode bare userFullInfo#b61c9c5: field premium_gift_options element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode bare userFullInfo#8388276a: field premium_gift_options element with index %d: %w", idx, err) } } + b.PutInt32(u.GiftCount) b.PutInt32(u.GroupInCommonCount) if err := u.BusinessInfo.Encode(b); err != nil { - return fmt.Errorf("unable to encode userFullInfo#b61c9c5: field business_info: %w", err) + return fmt.Errorf("unable to encode userFullInfo#8388276a: field business_info: %w", err) } if err := u.BotInfo.Encode(b); err != nil { - return fmt.Errorf("unable to encode userFullInfo#b61c9c5: field bot_info: %w", err) + return fmt.Errorf("unable to encode userFullInfo#8388276a: field bot_info: %w", err) } return nil } @@ -341,10 +351,10 @@ func (u *UserFullInfo) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (u *UserFullInfo) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode userFullInfo#b61c9c5 to nil") + return fmt.Errorf("can't decode userFullInfo#8388276a to nil") } if err := b.ConsumeID(UserFullInfoTypeID); err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: %w", err) } return u.DecodeBare(b) } @@ -352,114 +362,114 @@ func (u *UserFullInfo) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UserFullInfo) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode userFullInfo#b61c9c5 to nil") + return fmt.Errorf("can't decode userFullInfo#8388276a to nil") } { if err := u.PersonalPhoto.Decode(b); err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field personal_photo: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field personal_photo: %w", err) } } { if err := u.Photo.Decode(b); err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field photo: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field photo: %w", err) } } { if err := u.PublicPhoto.Decode(b); err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field public_photo: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field public_photo: %w", err) } } { value, err := DecodeBlockList(b) if err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field block_list: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field block_list: %w", err) } u.BlockList = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field can_be_called: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field can_be_called: %w", err) } u.CanBeCalled = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field supports_video_calls: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field supports_video_calls: %w", err) } u.SupportsVideoCalls = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field has_private_calls: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field has_private_calls: %w", err) } u.HasPrivateCalls = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field has_private_forwards: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field has_private_forwards: %w", err) } u.HasPrivateForwards = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field has_restricted_voice_and_video_note_messages: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field has_restricted_voice_and_video_note_messages: %w", err) } u.HasRestrictedVoiceAndVideoNoteMessages = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field has_posted_to_profile_stories: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field has_posted_to_profile_stories: %w", err) } u.HasPostedToProfileStories = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field has_sponsored_messages_enabled: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field has_sponsored_messages_enabled: %w", err) } u.HasSponsoredMessagesEnabled = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field need_phone_number_privacy_exception: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field need_phone_number_privacy_exception: %w", err) } u.NeedPhoneNumberPrivacyException = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field set_chat_background: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field set_chat_background: %w", err) } u.SetChatBackground = value } { if err := u.Bio.Decode(b); err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field bio: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field bio: %w", err) } } { if err := u.Birthdate.Decode(b); err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field birthdate: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field birthdate: %w", err) } } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field personal_chat_id: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field personal_chat_id: %w", err) } u.PersonalChatID = value } { headerLen, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field premium_gift_options: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field premium_gift_options: %w", err) } if headerLen > 0 { @@ -468,7 +478,7 @@ func (u *UserFullInfo) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { var value PremiumPaymentOption if err := value.DecodeBare(b); err != nil { - return fmt.Errorf("unable to decode bare userFullInfo#b61c9c5: field premium_gift_options: %w", err) + return fmt.Errorf("unable to decode bare userFullInfo#8388276a: field premium_gift_options: %w", err) } u.PremiumGiftOptions = append(u.PremiumGiftOptions, value) } @@ -476,18 +486,25 @@ func (u *UserFullInfo) DecodeBare(b *bin.Buffer) error { { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field group_in_common_count: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field gift_count: %w", err) + } + u.GiftCount = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode userFullInfo#8388276a: field group_in_common_count: %w", err) } u.GroupInCommonCount = value } { if err := u.BusinessInfo.Decode(b); err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field business_info: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field business_info: %w", err) } } { if err := u.BotInfo.Decode(b); err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field bot_info: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field bot_info: %w", err) } } return nil @@ -496,32 +513,32 @@ func (u *UserFullInfo) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (u *UserFullInfo) EncodeTDLibJSON(b tdjson.Encoder) error { if u == nil { - return fmt.Errorf("can't encode userFullInfo#b61c9c5 as nil") + return fmt.Errorf("can't encode userFullInfo#8388276a as nil") } b.ObjStart() b.PutID("userFullInfo") b.Comma() b.FieldStart("personal_photo") if err := u.PersonalPhoto.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode userFullInfo#b61c9c5: field personal_photo: %w", err) + return fmt.Errorf("unable to encode userFullInfo#8388276a: field personal_photo: %w", err) } b.Comma() b.FieldStart("photo") if err := u.Photo.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode userFullInfo#b61c9c5: field photo: %w", err) + return fmt.Errorf("unable to encode userFullInfo#8388276a: field photo: %w", err) } b.Comma() b.FieldStart("public_photo") if err := u.PublicPhoto.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode userFullInfo#b61c9c5: field public_photo: %w", err) + return fmt.Errorf("unable to encode userFullInfo#8388276a: field public_photo: %w", err) } b.Comma() b.FieldStart("block_list") if u.BlockList == nil { - return fmt.Errorf("unable to encode userFullInfo#b61c9c5: field block_list is nil") + return fmt.Errorf("unable to encode userFullInfo#8388276a: field block_list is nil") } if err := u.BlockList.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode userFullInfo#b61c9c5: field block_list: %w", err) + return fmt.Errorf("unable to encode userFullInfo#8388276a: field block_list: %w", err) } b.Comma() b.FieldStart("can_be_called") @@ -553,12 +570,12 @@ func (u *UserFullInfo) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("bio") if err := u.Bio.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode userFullInfo#b61c9c5: field bio: %w", err) + return fmt.Errorf("unable to encode userFullInfo#8388276a: field bio: %w", err) } b.Comma() b.FieldStart("birthdate") if err := u.Birthdate.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode userFullInfo#b61c9c5: field birthdate: %w", err) + return fmt.Errorf("unable to encode userFullInfo#8388276a: field birthdate: %w", err) } b.Comma() b.FieldStart("personal_chat_id") @@ -568,24 +585,27 @@ func (u *UserFullInfo) EncodeTDLibJSON(b tdjson.Encoder) error { b.ArrStart() for idx, v := range u.PremiumGiftOptions { if err := v.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode userFullInfo#b61c9c5: field premium_gift_options element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode userFullInfo#8388276a: field premium_gift_options element with index %d: %w", idx, err) } b.Comma() } b.StripComma() b.ArrEnd() b.Comma() + b.FieldStart("gift_count") + b.PutInt32(u.GiftCount) + b.Comma() b.FieldStart("group_in_common_count") b.PutInt32(u.GroupInCommonCount) b.Comma() b.FieldStart("business_info") if err := u.BusinessInfo.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode userFullInfo#b61c9c5: field business_info: %w", err) + return fmt.Errorf("unable to encode userFullInfo#8388276a: field business_info: %w", err) } b.Comma() b.FieldStart("bot_info") if err := u.BotInfo.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode userFullInfo#b61c9c5: field bot_info: %w", err) + return fmt.Errorf("unable to encode userFullInfo#8388276a: field bot_info: %w", err) } b.Comma() b.StripComma() @@ -596,125 +616,131 @@ func (u *UserFullInfo) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (u *UserFullInfo) DecodeTDLibJSON(b tdjson.Decoder) error { if u == nil { - return fmt.Errorf("can't decode userFullInfo#b61c9c5 to nil") + return fmt.Errorf("can't decode userFullInfo#8388276a to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("userFullInfo"); err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: %w", err) } case "personal_photo": if err := u.PersonalPhoto.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field personal_photo: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field personal_photo: %w", err) } case "photo": if err := u.Photo.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field photo: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field photo: %w", err) } case "public_photo": if err := u.PublicPhoto.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field public_photo: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field public_photo: %w", err) } case "block_list": value, err := DecodeTDLibJSONBlockList(b) if err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field block_list: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field block_list: %w", err) } u.BlockList = value case "can_be_called": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field can_be_called: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field can_be_called: %w", err) } u.CanBeCalled = value case "supports_video_calls": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field supports_video_calls: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field supports_video_calls: %w", err) } u.SupportsVideoCalls = value case "has_private_calls": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field has_private_calls: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field has_private_calls: %w", err) } u.HasPrivateCalls = value case "has_private_forwards": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field has_private_forwards: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field has_private_forwards: %w", err) } u.HasPrivateForwards = value case "has_restricted_voice_and_video_note_messages": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field has_restricted_voice_and_video_note_messages: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field has_restricted_voice_and_video_note_messages: %w", err) } u.HasRestrictedVoiceAndVideoNoteMessages = value case "has_posted_to_profile_stories": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field has_posted_to_profile_stories: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field has_posted_to_profile_stories: %w", err) } u.HasPostedToProfileStories = value case "has_sponsored_messages_enabled": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field has_sponsored_messages_enabled: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field has_sponsored_messages_enabled: %w", err) } u.HasSponsoredMessagesEnabled = value case "need_phone_number_privacy_exception": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field need_phone_number_privacy_exception: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field need_phone_number_privacy_exception: %w", err) } u.NeedPhoneNumberPrivacyException = value case "set_chat_background": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field set_chat_background: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field set_chat_background: %w", err) } u.SetChatBackground = value case "bio": if err := u.Bio.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field bio: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field bio: %w", err) } case "birthdate": if err := u.Birthdate.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field birthdate: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field birthdate: %w", err) } case "personal_chat_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field personal_chat_id: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field personal_chat_id: %w", err) } u.PersonalChatID = value case "premium_gift_options": if err := b.Arr(func(b tdjson.Decoder) error { var value PremiumPaymentOption if err := value.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field premium_gift_options: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field premium_gift_options: %w", err) } u.PremiumGiftOptions = append(u.PremiumGiftOptions, value) return nil }); err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field premium_gift_options: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field premium_gift_options: %w", err) } + case "gift_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode userFullInfo#8388276a: field gift_count: %w", err) + } + u.GiftCount = value case "group_in_common_count": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field group_in_common_count: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field group_in_common_count: %w", err) } u.GroupInCommonCount = value case "business_info": if err := u.BusinessInfo.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field business_info: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field business_info: %w", err) } case "bot_info": if err := u.BotInfo.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode userFullInfo#b61c9c5: field bot_info: %w", err) + return fmt.Errorf("unable to decode userFullInfo#8388276a: field bot_info: %w", err) } default: return b.Skip() @@ -859,6 +885,14 @@ func (u *UserFullInfo) GetPremiumGiftOptions() (value []PremiumPaymentOption) { return u.PremiumGiftOptions } +// GetGiftCount returns value of GiftCount field. +func (u *UserFullInfo) GetGiftCount() (value int32) { + if u == nil { + return + } + return u.GiftCount +} + // GetGroupInCommonCount returns value of GroupInCommonCount field. func (u *UserFullInfo) GetGroupInCommonCount() (value int32) { if u == nil { diff --git a/tdapi/tl_user_gift_gen.go b/tdapi/tl_user_gift_gen.go new file mode 100644 index 0000000000..d8c89d4bb2 --- /dev/null +++ b/tdapi/tl_user_gift_gen.go @@ -0,0 +1,435 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tdapi + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// UserGift represents TL type `userGift#494eb721`. +type UserGift struct { + // Identifier of the user that sent the gift; 0 if unknown + SenderUserID int64 + // Message added to the gift + Text FormattedText + // True, if the sender and gift text are shown only to the gift receiver; otherwise, + // everyone are able to see them + IsPrivate bool + // True, if the gift is displayed on the user's profile page; may be false only for the + // receiver of the gift + IsSaved bool + // Point in time (Unix timestamp) when the gift was sent + Date int32 + // The gift + Gift Gift + // 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 + MessageID int64 + // Number of Telegram Stars that can be claimed by the receiver instead of the gift; only + // for the gift receiver + SellStarCount int64 +} + +// UserGiftTypeID is TL type id of UserGift. +const UserGiftTypeID = 0x494eb721 + +// Ensuring interfaces in compile-time for UserGift. +var ( + _ bin.Encoder = &UserGift{} + _ bin.Decoder = &UserGift{} + _ bin.BareEncoder = &UserGift{} + _ bin.BareDecoder = &UserGift{} +) + +func (u *UserGift) Zero() bool { + if u == nil { + return true + } + if !(u.SenderUserID == 0) { + return false + } + if !(u.Text.Zero()) { + return false + } + if !(u.IsPrivate == false) { + return false + } + if !(u.IsSaved == false) { + return false + } + if !(u.Date == 0) { + return false + } + if !(u.Gift.Zero()) { + return false + } + if !(u.MessageID == 0) { + return false + } + if !(u.SellStarCount == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (u *UserGift) String() string { + if u == nil { + return "UserGift(nil)" + } + type Alias UserGift + return fmt.Sprintf("UserGift%+v", Alias(*u)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*UserGift) TypeID() uint32 { + return UserGiftTypeID +} + +// TypeName returns name of type in TL schema. +func (*UserGift) TypeName() string { + return "userGift" +} + +// TypeInfo returns info about TL type. +func (u *UserGift) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "userGift", + ID: UserGiftTypeID, + } + if u == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "SenderUserID", + SchemaName: "sender_user_id", + }, + { + Name: "Text", + SchemaName: "text", + }, + { + Name: "IsPrivate", + SchemaName: "is_private", + }, + { + Name: "IsSaved", + SchemaName: "is_saved", + }, + { + Name: "Date", + SchemaName: "date", + }, + { + Name: "Gift", + SchemaName: "gift", + }, + { + Name: "MessageID", + SchemaName: "message_id", + }, + { + Name: "SellStarCount", + SchemaName: "sell_star_count", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (u *UserGift) Encode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode userGift#494eb721 as nil") + } + b.PutID(UserGiftTypeID) + return u.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (u *UserGift) EncodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode userGift#494eb721 as nil") + } + b.PutInt53(u.SenderUserID) + if err := u.Text.Encode(b); err != nil { + return fmt.Errorf("unable to encode userGift#494eb721: field text: %w", err) + } + b.PutBool(u.IsPrivate) + b.PutBool(u.IsSaved) + b.PutInt32(u.Date) + if err := u.Gift.Encode(b); err != nil { + return fmt.Errorf("unable to encode userGift#494eb721: field gift: %w", err) + } + b.PutInt53(u.MessageID) + b.PutInt53(u.SellStarCount) + return nil +} + +// Decode implements bin.Decoder. +func (u *UserGift) Decode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode userGift#494eb721 to nil") + } + if err := b.ConsumeID(UserGiftTypeID); err != nil { + return fmt.Errorf("unable to decode userGift#494eb721: %w", err) + } + return u.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (u *UserGift) DecodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode userGift#494eb721 to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode userGift#494eb721: field sender_user_id: %w", err) + } + u.SenderUserID = value + } + { + if err := u.Text.Decode(b); err != nil { + return fmt.Errorf("unable to decode userGift#494eb721: field text: %w", err) + } + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode userGift#494eb721: field is_private: %w", err) + } + u.IsPrivate = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode userGift#494eb721: field is_saved: %w", err) + } + u.IsSaved = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode userGift#494eb721: field date: %w", err) + } + u.Date = value + } + { + if err := u.Gift.Decode(b); err != nil { + return fmt.Errorf("unable to decode userGift#494eb721: field gift: %w", err) + } + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode userGift#494eb721: field message_id: %w", err) + } + u.MessageID = value + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode userGift#494eb721: field sell_star_count: %w", err) + } + u.SellStarCount = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (u *UserGift) EncodeTDLibJSON(b tdjson.Encoder) error { + if u == nil { + return fmt.Errorf("can't encode userGift#494eb721 as nil") + } + b.ObjStart() + b.PutID("userGift") + b.Comma() + b.FieldStart("sender_user_id") + b.PutInt53(u.SenderUserID) + b.Comma() + b.FieldStart("text") + if err := u.Text.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode userGift#494eb721: field text: %w", err) + } + b.Comma() + b.FieldStart("is_private") + b.PutBool(u.IsPrivate) + b.Comma() + b.FieldStart("is_saved") + b.PutBool(u.IsSaved) + b.Comma() + b.FieldStart("date") + b.PutInt32(u.Date) + b.Comma() + b.FieldStart("gift") + if err := u.Gift.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode userGift#494eb721: field gift: %w", err) + } + b.Comma() + b.FieldStart("message_id") + b.PutInt53(u.MessageID) + b.Comma() + b.FieldStart("sell_star_count") + b.PutInt53(u.SellStarCount) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (u *UserGift) DecodeTDLibJSON(b tdjson.Decoder) error { + if u == nil { + return fmt.Errorf("can't decode userGift#494eb721 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("userGift"); err != nil { + return fmt.Errorf("unable to decode userGift#494eb721: %w", err) + } + case "sender_user_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode userGift#494eb721: field sender_user_id: %w", err) + } + u.SenderUserID = value + case "text": + if err := u.Text.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode userGift#494eb721: field text: %w", err) + } + case "is_private": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode userGift#494eb721: field is_private: %w", err) + } + u.IsPrivate = value + case "is_saved": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode userGift#494eb721: field is_saved: %w", err) + } + u.IsSaved = value + case "date": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode userGift#494eb721: field date: %w", err) + } + u.Date = value + case "gift": + if err := u.Gift.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode userGift#494eb721: field gift: %w", err) + } + case "message_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode userGift#494eb721: field message_id: %w", err) + } + u.MessageID = value + case "sell_star_count": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode userGift#494eb721: field sell_star_count: %w", err) + } + u.SellStarCount = value + default: + return b.Skip() + } + return nil + }) +} + +// GetSenderUserID returns value of SenderUserID field. +func (u *UserGift) GetSenderUserID() (value int64) { + if u == nil { + return + } + return u.SenderUserID +} + +// GetText returns value of Text field. +func (u *UserGift) GetText() (value FormattedText) { + if u == nil { + return + } + return u.Text +} + +// GetIsPrivate returns value of IsPrivate field. +func (u *UserGift) GetIsPrivate() (value bool) { + if u == nil { + return + } + return u.IsPrivate +} + +// GetIsSaved returns value of IsSaved field. +func (u *UserGift) GetIsSaved() (value bool) { + if u == nil { + return + } + return u.IsSaved +} + +// GetDate returns value of Date field. +func (u *UserGift) GetDate() (value int32) { + if u == nil { + return + } + return u.Date +} + +// GetGift returns value of Gift field. +func (u *UserGift) GetGift() (value Gift) { + if u == nil { + return + } + return u.Gift +} + +// GetMessageID returns value of MessageID field. +func (u *UserGift) GetMessageID() (value int64) { + if u == nil { + return + } + return u.MessageID +} + +// GetSellStarCount returns value of SellStarCount field. +func (u *UserGift) GetSellStarCount() (value int64) { + if u == nil { + return + } + return u.SellStarCount +} diff --git a/tdapi/tl_user_gifts_gen.go b/tdapi/tl_user_gifts_gen.go new file mode 100644 index 0000000000..3853ba9f7b --- /dev/null +++ b/tdapi/tl_user_gifts_gen.go @@ -0,0 +1,289 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tdapi + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// UserGifts represents TL type `userGifts#e274219f`. +type UserGifts struct { + // The total number of received gifts + TotalCount int32 + // The list of gifts + Gifts []UserGift + // The offset for the next request. If empty, then there are no more results + NextOffset string +} + +// UserGiftsTypeID is TL type id of UserGifts. +const UserGiftsTypeID = 0xe274219f + +// Ensuring interfaces in compile-time for UserGifts. +var ( + _ bin.Encoder = &UserGifts{} + _ bin.Decoder = &UserGifts{} + _ bin.BareEncoder = &UserGifts{} + _ bin.BareDecoder = &UserGifts{} +) + +func (u *UserGifts) Zero() bool { + if u == nil { + return true + } + if !(u.TotalCount == 0) { + return false + } + if !(u.Gifts == nil) { + return false + } + if !(u.NextOffset == "") { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (u *UserGifts) String() string { + if u == nil { + return "UserGifts(nil)" + } + type Alias UserGifts + return fmt.Sprintf("UserGifts%+v", Alias(*u)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*UserGifts) TypeID() uint32 { + return UserGiftsTypeID +} + +// TypeName returns name of type in TL schema. +func (*UserGifts) TypeName() string { + return "userGifts" +} + +// TypeInfo returns info about TL type. +func (u *UserGifts) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "userGifts", + ID: UserGiftsTypeID, + } + if u == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "TotalCount", + SchemaName: "total_count", + }, + { + Name: "Gifts", + SchemaName: "gifts", + }, + { + Name: "NextOffset", + SchemaName: "next_offset", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (u *UserGifts) Encode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode userGifts#e274219f as nil") + } + b.PutID(UserGiftsTypeID) + return u.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (u *UserGifts) EncodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode userGifts#e274219f as nil") + } + b.PutInt32(u.TotalCount) + b.PutInt(len(u.Gifts)) + for idx, v := range u.Gifts { + if err := v.EncodeBare(b); err != nil { + return fmt.Errorf("unable to encode bare userGifts#e274219f: field gifts element with index %d: %w", idx, err) + } + } + b.PutString(u.NextOffset) + return nil +} + +// Decode implements bin.Decoder. +func (u *UserGifts) Decode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode userGifts#e274219f to nil") + } + if err := b.ConsumeID(UserGiftsTypeID); err != nil { + return fmt.Errorf("unable to decode userGifts#e274219f: %w", err) + } + return u.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (u *UserGifts) DecodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode userGifts#e274219f to nil") + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode userGifts#e274219f: field total_count: %w", err) + } + u.TotalCount = value + } + { + headerLen, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode userGifts#e274219f: field gifts: %w", err) + } + + if headerLen > 0 { + u.Gifts = make([]UserGift, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + var value UserGift + if err := value.DecodeBare(b); err != nil { + return fmt.Errorf("unable to decode bare userGifts#e274219f: field gifts: %w", err) + } + u.Gifts = append(u.Gifts, value) + } + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode userGifts#e274219f: field next_offset: %w", err) + } + u.NextOffset = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (u *UserGifts) EncodeTDLibJSON(b tdjson.Encoder) error { + if u == nil { + return fmt.Errorf("can't encode userGifts#e274219f as nil") + } + b.ObjStart() + b.PutID("userGifts") + b.Comma() + b.FieldStart("total_count") + b.PutInt32(u.TotalCount) + b.Comma() + b.FieldStart("gifts") + b.ArrStart() + for idx, v := range u.Gifts { + if err := v.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode userGifts#e274219f: field gifts element with index %d: %w", idx, err) + } + b.Comma() + } + b.StripComma() + b.ArrEnd() + b.Comma() + b.FieldStart("next_offset") + b.PutString(u.NextOffset) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (u *UserGifts) DecodeTDLibJSON(b tdjson.Decoder) error { + if u == nil { + return fmt.Errorf("can't decode userGifts#e274219f to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("userGifts"); err != nil { + return fmt.Errorf("unable to decode userGifts#e274219f: %w", err) + } + case "total_count": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode userGifts#e274219f: field total_count: %w", err) + } + u.TotalCount = value + case "gifts": + if err := b.Arr(func(b tdjson.Decoder) error { + var value UserGift + if err := value.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode userGifts#e274219f: field gifts: %w", err) + } + u.Gifts = append(u.Gifts, value) + return nil + }); err != nil { + return fmt.Errorf("unable to decode userGifts#e274219f: field gifts: %w", err) + } + case "next_offset": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode userGifts#e274219f: field next_offset: %w", err) + } + u.NextOffset = value + default: + return b.Skip() + } + return nil + }) +} + +// GetTotalCount returns value of TotalCount field. +func (u *UserGifts) GetTotalCount() (value int32) { + if u == nil { + return + } + return u.TotalCount +} + +// GetGifts returns value of Gifts field. +func (u *UserGifts) GetGifts() (value []UserGift) { + if u == nil { + return + } + return u.Gifts +} + +// GetNextOffset returns value of NextOffset field. +func (u *UserGifts) GetNextOffset() (value string) { + if u == nil { + return + } + return u.NextOffset +} diff --git a/tdapi/tl_user_transaction_purpose_gen.go b/tdapi/tl_user_transaction_purpose_gen.go new file mode 100644 index 0000000000..15b9ad4bd2 --- /dev/null +++ b/tdapi/tl_user_transaction_purpose_gen.go @@ -0,0 +1,682 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tdapi + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// UserTransactionPurposeGiftedStars represents TL type `userTransactionPurposeGiftedStars#1fb3401`. +type UserTransactionPurposeGiftedStars struct { + // A sticker to be shown in the transaction information; may be null if unknown + Sticker Sticker +} + +// UserTransactionPurposeGiftedStarsTypeID is TL type id of UserTransactionPurposeGiftedStars. +const UserTransactionPurposeGiftedStarsTypeID = 0x1fb3401 + +// construct implements constructor of UserTransactionPurposeClass. +func (u UserTransactionPurposeGiftedStars) construct() UserTransactionPurposeClass { return &u } + +// Ensuring interfaces in compile-time for UserTransactionPurposeGiftedStars. +var ( + _ bin.Encoder = &UserTransactionPurposeGiftedStars{} + _ bin.Decoder = &UserTransactionPurposeGiftedStars{} + _ bin.BareEncoder = &UserTransactionPurposeGiftedStars{} + _ bin.BareDecoder = &UserTransactionPurposeGiftedStars{} + + _ UserTransactionPurposeClass = &UserTransactionPurposeGiftedStars{} +) + +func (u *UserTransactionPurposeGiftedStars) Zero() bool { + if u == nil { + return true + } + if !(u.Sticker.Zero()) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (u *UserTransactionPurposeGiftedStars) String() string { + if u == nil { + return "UserTransactionPurposeGiftedStars(nil)" + } + type Alias UserTransactionPurposeGiftedStars + return fmt.Sprintf("UserTransactionPurposeGiftedStars%+v", Alias(*u)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*UserTransactionPurposeGiftedStars) TypeID() uint32 { + return UserTransactionPurposeGiftedStarsTypeID +} + +// TypeName returns name of type in TL schema. +func (*UserTransactionPurposeGiftedStars) TypeName() string { + return "userTransactionPurposeGiftedStars" +} + +// TypeInfo returns info about TL type. +func (u *UserTransactionPurposeGiftedStars) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "userTransactionPurposeGiftedStars", + ID: UserTransactionPurposeGiftedStarsTypeID, + } + if u == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Sticker", + SchemaName: "sticker", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (u *UserTransactionPurposeGiftedStars) Encode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode userTransactionPurposeGiftedStars#1fb3401 as nil") + } + b.PutID(UserTransactionPurposeGiftedStarsTypeID) + return u.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (u *UserTransactionPurposeGiftedStars) EncodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode userTransactionPurposeGiftedStars#1fb3401 as nil") + } + if err := u.Sticker.Encode(b); err != nil { + return fmt.Errorf("unable to encode userTransactionPurposeGiftedStars#1fb3401: field sticker: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (u *UserTransactionPurposeGiftedStars) Decode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode userTransactionPurposeGiftedStars#1fb3401 to nil") + } + if err := b.ConsumeID(UserTransactionPurposeGiftedStarsTypeID); err != nil { + return fmt.Errorf("unable to decode userTransactionPurposeGiftedStars#1fb3401: %w", err) + } + return u.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (u *UserTransactionPurposeGiftedStars) DecodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode userTransactionPurposeGiftedStars#1fb3401 to nil") + } + { + if err := u.Sticker.Decode(b); err != nil { + return fmt.Errorf("unable to decode userTransactionPurposeGiftedStars#1fb3401: field sticker: %w", err) + } + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (u *UserTransactionPurposeGiftedStars) EncodeTDLibJSON(b tdjson.Encoder) error { + if u == nil { + return fmt.Errorf("can't encode userTransactionPurposeGiftedStars#1fb3401 as nil") + } + b.ObjStart() + b.PutID("userTransactionPurposeGiftedStars") + b.Comma() + b.FieldStart("sticker") + if err := u.Sticker.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode userTransactionPurposeGiftedStars#1fb3401: field sticker: %w", err) + } + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (u *UserTransactionPurposeGiftedStars) DecodeTDLibJSON(b tdjson.Decoder) error { + if u == nil { + return fmt.Errorf("can't decode userTransactionPurposeGiftedStars#1fb3401 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("userTransactionPurposeGiftedStars"); err != nil { + return fmt.Errorf("unable to decode userTransactionPurposeGiftedStars#1fb3401: %w", err) + } + case "sticker": + if err := u.Sticker.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode userTransactionPurposeGiftedStars#1fb3401: field sticker: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetSticker returns value of Sticker field. +func (u *UserTransactionPurposeGiftedStars) GetSticker() (value Sticker) { + if u == nil { + return + } + return u.Sticker +} + +// UserTransactionPurposeGiftSell represents TL type `userTransactionPurposeGiftSell#195fcd8e`. +type UserTransactionPurposeGiftSell struct { + // The gift + Gift Gift +} + +// UserTransactionPurposeGiftSellTypeID is TL type id of UserTransactionPurposeGiftSell. +const UserTransactionPurposeGiftSellTypeID = 0x195fcd8e + +// construct implements constructor of UserTransactionPurposeClass. +func (u UserTransactionPurposeGiftSell) construct() UserTransactionPurposeClass { return &u } + +// Ensuring interfaces in compile-time for UserTransactionPurposeGiftSell. +var ( + _ bin.Encoder = &UserTransactionPurposeGiftSell{} + _ bin.Decoder = &UserTransactionPurposeGiftSell{} + _ bin.BareEncoder = &UserTransactionPurposeGiftSell{} + _ bin.BareDecoder = &UserTransactionPurposeGiftSell{} + + _ UserTransactionPurposeClass = &UserTransactionPurposeGiftSell{} +) + +func (u *UserTransactionPurposeGiftSell) Zero() bool { + if u == nil { + return true + } + if !(u.Gift.Zero()) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (u *UserTransactionPurposeGiftSell) String() string { + if u == nil { + return "UserTransactionPurposeGiftSell(nil)" + } + type Alias UserTransactionPurposeGiftSell + return fmt.Sprintf("UserTransactionPurposeGiftSell%+v", Alias(*u)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*UserTransactionPurposeGiftSell) TypeID() uint32 { + return UserTransactionPurposeGiftSellTypeID +} + +// TypeName returns name of type in TL schema. +func (*UserTransactionPurposeGiftSell) TypeName() string { + return "userTransactionPurposeGiftSell" +} + +// TypeInfo returns info about TL type. +func (u *UserTransactionPurposeGiftSell) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "userTransactionPurposeGiftSell", + ID: UserTransactionPurposeGiftSellTypeID, + } + if u == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Gift", + SchemaName: "gift", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (u *UserTransactionPurposeGiftSell) Encode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode userTransactionPurposeGiftSell#195fcd8e as nil") + } + b.PutID(UserTransactionPurposeGiftSellTypeID) + return u.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (u *UserTransactionPurposeGiftSell) EncodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode userTransactionPurposeGiftSell#195fcd8e as nil") + } + if err := u.Gift.Encode(b); err != nil { + return fmt.Errorf("unable to encode userTransactionPurposeGiftSell#195fcd8e: field gift: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (u *UserTransactionPurposeGiftSell) Decode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode userTransactionPurposeGiftSell#195fcd8e to nil") + } + if err := b.ConsumeID(UserTransactionPurposeGiftSellTypeID); err != nil { + return fmt.Errorf("unable to decode userTransactionPurposeGiftSell#195fcd8e: %w", err) + } + return u.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (u *UserTransactionPurposeGiftSell) DecodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode userTransactionPurposeGiftSell#195fcd8e to nil") + } + { + if err := u.Gift.Decode(b); err != nil { + return fmt.Errorf("unable to decode userTransactionPurposeGiftSell#195fcd8e: field gift: %w", err) + } + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (u *UserTransactionPurposeGiftSell) EncodeTDLibJSON(b tdjson.Encoder) error { + if u == nil { + return fmt.Errorf("can't encode userTransactionPurposeGiftSell#195fcd8e as nil") + } + b.ObjStart() + b.PutID("userTransactionPurposeGiftSell") + b.Comma() + b.FieldStart("gift") + if err := u.Gift.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode userTransactionPurposeGiftSell#195fcd8e: field gift: %w", err) + } + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (u *UserTransactionPurposeGiftSell) DecodeTDLibJSON(b tdjson.Decoder) error { + if u == nil { + return fmt.Errorf("can't decode userTransactionPurposeGiftSell#195fcd8e to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("userTransactionPurposeGiftSell"); err != nil { + return fmt.Errorf("unable to decode userTransactionPurposeGiftSell#195fcd8e: %w", err) + } + case "gift": + if err := u.Gift.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode userTransactionPurposeGiftSell#195fcd8e: field gift: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetGift returns value of Gift field. +func (u *UserTransactionPurposeGiftSell) GetGift() (value Gift) { + if u == nil { + return + } + return u.Gift +} + +// UserTransactionPurposeGiftSend represents TL type `userTransactionPurposeGiftSend#b36e54df`. +type UserTransactionPurposeGiftSend struct { + // The gift + Gift Gift +} + +// UserTransactionPurposeGiftSendTypeID is TL type id of UserTransactionPurposeGiftSend. +const UserTransactionPurposeGiftSendTypeID = 0xb36e54df + +// construct implements constructor of UserTransactionPurposeClass. +func (u UserTransactionPurposeGiftSend) construct() UserTransactionPurposeClass { return &u } + +// Ensuring interfaces in compile-time for UserTransactionPurposeGiftSend. +var ( + _ bin.Encoder = &UserTransactionPurposeGiftSend{} + _ bin.Decoder = &UserTransactionPurposeGiftSend{} + _ bin.BareEncoder = &UserTransactionPurposeGiftSend{} + _ bin.BareDecoder = &UserTransactionPurposeGiftSend{} + + _ UserTransactionPurposeClass = &UserTransactionPurposeGiftSend{} +) + +func (u *UserTransactionPurposeGiftSend) Zero() bool { + if u == nil { + return true + } + if !(u.Gift.Zero()) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (u *UserTransactionPurposeGiftSend) String() string { + if u == nil { + return "UserTransactionPurposeGiftSend(nil)" + } + type Alias UserTransactionPurposeGiftSend + return fmt.Sprintf("UserTransactionPurposeGiftSend%+v", Alias(*u)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*UserTransactionPurposeGiftSend) TypeID() uint32 { + return UserTransactionPurposeGiftSendTypeID +} + +// TypeName returns name of type in TL schema. +func (*UserTransactionPurposeGiftSend) TypeName() string { + return "userTransactionPurposeGiftSend" +} + +// TypeInfo returns info about TL type. +func (u *UserTransactionPurposeGiftSend) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "userTransactionPurposeGiftSend", + ID: UserTransactionPurposeGiftSendTypeID, + } + if u == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Gift", + SchemaName: "gift", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (u *UserTransactionPurposeGiftSend) Encode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode userTransactionPurposeGiftSend#b36e54df as nil") + } + b.PutID(UserTransactionPurposeGiftSendTypeID) + return u.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (u *UserTransactionPurposeGiftSend) EncodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode userTransactionPurposeGiftSend#b36e54df as nil") + } + if err := u.Gift.Encode(b); err != nil { + return fmt.Errorf("unable to encode userTransactionPurposeGiftSend#b36e54df: field gift: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (u *UserTransactionPurposeGiftSend) Decode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode userTransactionPurposeGiftSend#b36e54df to nil") + } + if err := b.ConsumeID(UserTransactionPurposeGiftSendTypeID); err != nil { + return fmt.Errorf("unable to decode userTransactionPurposeGiftSend#b36e54df: %w", err) + } + return u.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (u *UserTransactionPurposeGiftSend) DecodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode userTransactionPurposeGiftSend#b36e54df to nil") + } + { + if err := u.Gift.Decode(b); err != nil { + return fmt.Errorf("unable to decode userTransactionPurposeGiftSend#b36e54df: field gift: %w", err) + } + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (u *UserTransactionPurposeGiftSend) EncodeTDLibJSON(b tdjson.Encoder) error { + if u == nil { + return fmt.Errorf("can't encode userTransactionPurposeGiftSend#b36e54df as nil") + } + b.ObjStart() + b.PutID("userTransactionPurposeGiftSend") + b.Comma() + b.FieldStart("gift") + if err := u.Gift.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode userTransactionPurposeGiftSend#b36e54df: field gift: %w", err) + } + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (u *UserTransactionPurposeGiftSend) DecodeTDLibJSON(b tdjson.Decoder) error { + if u == nil { + return fmt.Errorf("can't decode userTransactionPurposeGiftSend#b36e54df to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("userTransactionPurposeGiftSend"); err != nil { + return fmt.Errorf("unable to decode userTransactionPurposeGiftSend#b36e54df: %w", err) + } + case "gift": + if err := u.Gift.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode userTransactionPurposeGiftSend#b36e54df: field gift: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetGift returns value of Gift field. +func (u *UserTransactionPurposeGiftSend) GetGift() (value Gift) { + if u == nil { + return + } + return u.Gift +} + +// UserTransactionPurposeClassName is schema name of UserTransactionPurposeClass. +const UserTransactionPurposeClassName = "UserTransactionPurpose" + +// UserTransactionPurposeClass represents UserTransactionPurpose generic type. +// +// Example: +// +// g, err := tdapi.DecodeUserTransactionPurpose(buf) +// if err != nil { +// panic(err) +// } +// switch v := g.(type) { +// case *tdapi.UserTransactionPurposeGiftedStars: // userTransactionPurposeGiftedStars#1fb3401 +// case *tdapi.UserTransactionPurposeGiftSell: // userTransactionPurposeGiftSell#195fcd8e +// case *tdapi.UserTransactionPurposeGiftSend: // userTransactionPurposeGiftSend#b36e54df +// default: panic(v) +// } +type UserTransactionPurposeClass interface { + bin.Encoder + bin.Decoder + bin.BareEncoder + bin.BareDecoder + construct() UserTransactionPurposeClass + + // TypeID returns type id in TL schema. + // + // See https://core.telegram.org/mtproto/TL-tl#remarks. + TypeID() uint32 + // TypeName returns name of type in TL schema. + TypeName() string + // String implements fmt.Stringer. + String() string + // Zero returns true if current object has a zero value. + Zero() bool + + EncodeTDLibJSON(b tdjson.Encoder) error + DecodeTDLibJSON(b tdjson.Decoder) error +} + +// DecodeUserTransactionPurpose implements binary de-serialization for UserTransactionPurposeClass. +func DecodeUserTransactionPurpose(buf *bin.Buffer) (UserTransactionPurposeClass, error) { + id, err := buf.PeekID() + if err != nil { + return nil, err + } + switch id { + case UserTransactionPurposeGiftedStarsTypeID: + // Decoding userTransactionPurposeGiftedStars#1fb3401. + v := UserTransactionPurposeGiftedStars{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode UserTransactionPurposeClass: %w", err) + } + return &v, nil + case UserTransactionPurposeGiftSellTypeID: + // Decoding userTransactionPurposeGiftSell#195fcd8e. + v := UserTransactionPurposeGiftSell{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode UserTransactionPurposeClass: %w", err) + } + return &v, nil + case UserTransactionPurposeGiftSendTypeID: + // Decoding userTransactionPurposeGiftSend#b36e54df. + v := UserTransactionPurposeGiftSend{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode UserTransactionPurposeClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode UserTransactionPurposeClass: %w", bin.NewUnexpectedID(id)) + } +} + +// DecodeTDLibJSONUserTransactionPurpose implements binary de-serialization for UserTransactionPurposeClass. +func DecodeTDLibJSONUserTransactionPurpose(buf tdjson.Decoder) (UserTransactionPurposeClass, error) { + id, err := buf.FindTypeID() + if err != nil { + return nil, err + } + switch id { + case "userTransactionPurposeGiftedStars": + // Decoding userTransactionPurposeGiftedStars#1fb3401. + v := UserTransactionPurposeGiftedStars{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode UserTransactionPurposeClass: %w", err) + } + return &v, nil + case "userTransactionPurposeGiftSell": + // Decoding userTransactionPurposeGiftSell#195fcd8e. + v := UserTransactionPurposeGiftSell{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode UserTransactionPurposeClass: %w", err) + } + return &v, nil + case "userTransactionPurposeGiftSend": + // Decoding userTransactionPurposeGiftSend#b36e54df. + v := UserTransactionPurposeGiftSend{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode UserTransactionPurposeClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode UserTransactionPurposeClass: %w", tdjson.NewUnexpectedID(id)) + } +} + +// UserTransactionPurpose boxes the UserTransactionPurposeClass providing a helper. +type UserTransactionPurposeBox struct { + UserTransactionPurpose UserTransactionPurposeClass +} + +// Decode implements bin.Decoder for UserTransactionPurposeBox. +func (b *UserTransactionPurposeBox) Decode(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("unable to decode UserTransactionPurposeBox to nil") + } + v, err := DecodeUserTransactionPurpose(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.UserTransactionPurpose = v + return nil +} + +// Encode implements bin.Encode for UserTransactionPurposeBox. +func (b *UserTransactionPurposeBox) Encode(buf *bin.Buffer) error { + if b == nil || b.UserTransactionPurpose == nil { + return fmt.Errorf("unable to encode UserTransactionPurposeClass as nil") + } + return b.UserTransactionPurpose.Encode(buf) +} + +// DecodeTDLibJSON implements bin.Decoder for UserTransactionPurposeBox. +func (b *UserTransactionPurposeBox) DecodeTDLibJSON(buf tdjson.Decoder) error { + if b == nil { + return fmt.Errorf("unable to decode UserTransactionPurposeBox to nil") + } + v, err := DecodeTDLibJSONUserTransactionPurpose(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.UserTransactionPurpose = v + return nil +} + +// EncodeTDLibJSON implements bin.Encode for UserTransactionPurposeBox. +func (b *UserTransactionPurposeBox) EncodeTDLibJSON(buf tdjson.Encoder) error { + if b == nil || b.UserTransactionPurpose == nil { + return fmt.Errorf("unable to encode UserTransactionPurposeClass as nil") + } + return b.UserTransactionPurpose.EncodeTDLibJSON(buf) +} diff --git a/tdapi/tl_video_gen.go b/tdapi/tl_video_gen.go index 9a88dcc6a6..e8d8e8993f 100644 --- a/tdapi/tl_video_gen.go +++ b/tdapi/tl_video_gen.go @@ -46,7 +46,7 @@ type Video struct { // True, if stickers were added to the video. The list of corresponding sticker sets can // be received using getAttachedStickerSets HasStickers bool - // True, if the video is supposed to be streamed + // True, if the video is expected to be streamed SupportsStreaming bool // Video minithumbnail; may be null Minithumbnail Minithumbnail