From 8a3baa2e48664cb07d4a90a31d63c22e2c2b5d0b Mon Sep 17 00:00:00 2001 From: GitHub Date: Wed, 3 Jul 2024 07:44:50 +0000 Subject: [PATCH] feat(schema): update TDLib to the latest layer --- _schema/tdapi.tl | 168 +- tdapi/tl_authentication_code_type_gen.go | 111 +- tdapi/tl_background_type_gen.go | 2 +- tdapi/tl_bot_menu_button_gen.go | 4 +- tdapi/tl_edit_business_message_caption_gen.go | 4 +- tdapi/tl_edit_inline_message_caption_gen.go | 4 +- tdapi/tl_edit_message_caption_gen.go | 4 +- ...base_device_verification_parameters_gen.go | 539 +++++ tdapi/tl_get_star_ad_account_url_gen.go | 217 ++ tdapi/tl_get_star_revenue_statistics_gen.go | 3 +- tdapi/tl_get_star_withdrawal_url_gen.go | 3 +- tdapi/tl_inline_keyboard_button_type_gen.go | 3 +- tdapi/tl_input_message_content_gen.go | 478 ++++- tdapi/tl_input_paid_media_gen.go | 407 ++++ tdapi/tl_input_paid_media_type_gen.go | 500 +++++ tdapi/tl_internal_link_type_gen.go | 140 +- tdapi/tl_message_content_gen.go | 470 ++++- tdapi/tl_message_extended_media_gen.go | 1070 ---------- tdapi/tl_paid_media_gen.go | 930 +++++++++ tdapi/tl_premium_feature_gen.go | 146 ++ tdapi/tl_push_message_content_gen.go | 215 ++ tdapi/tl_read_date_privacy_settings_gen.go | 2 +- tdapi/tl_registry_gen.go | 1786 +++++++++-------- tdapi/tl_resend_code_reason_gen.go | 2 +- tdapi/tl_star_transaction_partner_gen.go | 453 ++++- tdapi/tl_supergroup_full_info_gen.go | 194 +- tdapi/tl_theme_parameters_gen.go | 106 +- tdapi/tl_update_gen.go | 72 +- 28 files changed, 5573 insertions(+), 2460 deletions(-) create mode 100644 tdapi/tl_firebase_device_verification_parameters_gen.go create mode 100644 tdapi/tl_get_star_ad_account_url_gen.go create mode 100644 tdapi/tl_input_paid_media_gen.go create mode 100644 tdapi/tl_input_paid_media_type_gen.go delete mode 100644 tdapi/tl_message_extended_media_gen.go create mode 100644 tdapi/tl_paid_media_gen.go diff --git a/_schema/tdapi.tl b/_schema/tdapi.tl index b2f5663fba..850b8ef5df 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: 038ccb6ad3847fb84c06803118cd6460d2a00d7096a27d1b85278f4d7dae4d61 +// SHA256: 94693614587a368347b47c0aa49eb024cf7e874403e3e55bf6f746d8f9c5b93c double#2210c154 ? = Double; @@ -64,10 +64,9 @@ authenticationCodeTypeMissedCall#29bb0a87 phone_number_prefix:string length:int3 authenticationCodeTypeFragment#810f74cd url:string length:int32 = AuthenticationCodeType; //@description A digit-only authentication code is delivered via Firebase Authentication to the official Android application -//@use_play_integrity True, if Play Integrity API must be used for device verification. Otherwise, SafetyNet Attestation API must be used -//@nonce Nonce to pass to the Play Integrity API or the SafetyNet Attestation API +//@device_verification_parameters Parameters to be used for device verification //@length Length of the code -authenticationCodeTypeFirebaseAndroid#e5a1fe7d use_play_integrity:Bool nonce:bytes length:int32 = AuthenticationCodeType; +authenticationCodeTypeFirebaseAndroid#6f9bb51e device_verification_parameters:FirebaseDeviceVerificationParameters length:int32 = AuthenticationCodeType; //@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 @@ -183,6 +182,17 @@ authorizationStateClosing#1a93364f = AuthorizationState; //@description TDLib client is in its final state. All databases are closed and all resources are released. No other updates will be received after this. All queries will be responded to authorizationStateClosed#5af5a360 = AuthorizationState; +//@class FirebaseDeviceVerificationParameters @description Describes parameters to be used for device verification + +//@description Device verification must be performed with the SafetyNet Attestation API +//@nonce Nonce to pass to the SafetyNet Attestation API +firebaseDeviceVerificationParametersSafetyNet#2b96b2f1 nonce:bytes = FirebaseDeviceVerificationParameters; + +//@description Device verification must be performed with the classic Play Integrity verification (https://developer.android.com/google/play/integrity/classic) +//@nonce Base64url-encoded nonce to pass to the Play Integrity API +//@cloud_project_number Cloud project number to pass to the Play Integrity API +firebaseDeviceVerificationParametersPlayIntegrity#caf4a58a nonce:string cloud_project_number:int64 = FirebaseDeviceVerificationParameters; + //@description Represents the current state of 2-step verification //@has_password True, if a 2-step verification password is set //@password_hint Hint for the password; may be empty @@ -587,7 +597,7 @@ botCommands#4f9aa2c5 bot_user_id:int53 commands:vector = BotCommands //@description Describes a button to be shown instead of bot commands menu button //@text Text of the button -//@url URL to be passed to openWebApp +//@url URL of a Web App to open when the button is pressed. If the link is of the type internalLinkTypeWebApp, then it must be processed accordingly. Otherwise, the link must be passed to openWebApp botMenuButton#c7b57ce6 text:string url:string = BotMenuButton; //@description Represents a location to which a chat is connected @@ -820,7 +830,7 @@ premiumPaymentOption#8c0c5fb2 currency:string amount:int53 discount_percentage:i //@last_transaction_id Identifier of the last in-store transaction for the currently used option premiumStatePaymentOption#7d06b579 payment_option:premiumPaymentOption is_current:Bool is_upgrade:Bool last_transaction_id:string = PremiumStatePaymentOption; -//@description Describes an option for creating Telegram Premium gift codes +//@description Describes an option for creating Telegram Premium gift codes. Use telegramPaymentPurposePremiumGiftCodes for out-of-store payments //@currency ISO 4217 currency code for Telegram Premium gift code payment //@amount The amount to pay, in the smallest units of the currency //@user_count Number of users which will be able to activate the gift codes @@ -843,7 +853,7 @@ premiumGiftCodePaymentOptions#97a8cf2e options:vector = StarTransactionPartner; //@description The transaction is a transaction with unknown partner starTransactionPartnerUnsupported#c4b20d73 = StarTransactionPartner; @@ -1310,6 +1326,7 @@ supergroup#39a14289 id:int53 usernames:usernames date:int32 status:ChatMemberSta //@is_all_history_available True, if new chat members will have access to old messages. In public, discussion, of forum groups and all channels, old messages are always available, //@can_have_sponsored_messages True, if the chat can have sponsored messages. The value of this field is only available to the owner of the chat //@has_aggressive_anti_spam_enabled True, if aggressive anti-spam checks are enabled in the supergroup. The value of this field is only available to chat administrators +//@has_paid_media_allowed True, if paid media can be sent and forwarded to the channel chat; for channels only //@has_pinned_stories True, if the supergroup or channel has pinned stories //@my_boost_count Number of times the current user boosted the supergroup or channel //@unrestrict_boost_count Number of times the supergroup must be boosted by a user to ignore slow mode and chat permission restrictions; 0 if unspecified @@ -1320,7 +1337,7 @@ supergroup#39a14289 id:int53 usernames:usernames date:int32 status:ChatMemberSta //@bot_commands List of commands of bots in the group //@upgraded_from_basic_group_id Identifier of the basic group from which supergroup was upgraded; 0 if none //@upgraded_from_max_message_id Identifier of the last message in the basic group from which supergroup was upgraded; 0 if none -supergroupFullInfo#d262590a photo:chatPhoto description:string member_count:int32 administrator_count:int32 restricted_count:int32 banned_count:int32 linked_chat_id:int53 slow_mode_delay:int32 slow_mode_delay_expires_in:double can_get_members:Bool has_hidden_members:Bool can_hide_members:Bool can_set_sticker_set:Bool can_set_location:Bool can_get_statistics:Bool can_get_revenue_statistics:Bool can_toggle_aggressive_anti_spam:Bool is_all_history_available:Bool can_have_sponsored_messages:Bool has_aggressive_anti_spam_enabled:Bool has_pinned_stories:Bool my_boost_count:int32 unrestrict_boost_count:int32 sticker_set_id:int64 custom_emoji_sticker_set_id:int64 location:chatLocation invite_link:chatInviteLink bot_commands:vector upgraded_from_basic_group_id:int53 upgraded_from_max_message_id:int53 = SupergroupFullInfo; +supergroupFullInfo#c02dd0a6 photo:chatPhoto description:string member_count:int32 administrator_count:int32 restricted_count:int32 banned_count:int32 linked_chat_id:int53 slow_mode_delay:int32 slow_mode_delay_expires_in:double can_get_members:Bool has_hidden_members:Bool can_hide_members:Bool can_set_sticker_set:Bool can_set_location:Bool can_get_statistics:Bool can_get_revenue_statistics:Bool can_toggle_aggressive_anti_spam:Bool is_all_history_available:Bool can_have_sponsored_messages:Bool has_aggressive_anti_spam_enabled:Bool has_paid_media_allowed:Bool has_pinned_stories:Bool my_boost_count:int32 unrestrict_boost_count:int32 sticker_set_id:int64 custom_emoji_sticker_set_id:int64 location:chatLocation invite_link:chatInviteLink bot_commands:vector upgraded_from_basic_group_id:int53 upgraded_from_max_message_id:int53 = SupergroupFullInfo; //@class SecretChatState @description Describes the current secret chat state @@ -2143,7 +2160,7 @@ keyboardButton#84a0ce74 text:string type:KeyboardButtonType = KeyboardButton; //@class InlineKeyboardButtonType @description Describes the type of inline keyboard button //@description A button that opens a specified URL -//@url HTTP or tg:// URL to open +//@url HTTP or tg:// URL to open. If the link is of the type internalLinkTypeWebApp, then the button must be marked as a Web App button inlineKeyboardButtonTypeUrl#4365beac url:string = InlineKeyboardButtonType; //@description A button that opens a specified URL and automatically authorize the current user by calling getLoginUrlInfo @@ -2720,6 +2737,7 @@ locationAddress#a3dad322 country_code:string state:string city:string street:str //@secondary_background_color A secondary color for the background in the RGB24 format //@header_background_color A color of the header background in the RGB24 format //@section_background_color A color of the section background in the RGB24 format +//@section_separator_color A color of the section separator in the RGB24 format //@text_color A color of text in the RGB24 format //@accent_text_color An accent color of the text in the RGB24 format //@section_header_text_color A color of text on the section headers in the RGB24 format @@ -2729,7 +2747,7 @@ locationAddress#a3dad322 country_code:string state:string city:string street:str //@link_color A color of links in the RGB24 format //@button_color A color of the buttons in the RGB24 format //@button_text_color A color of text on the buttons in the RGB24 format -themeParameters#af3f42fc background_color:int32 secondary_background_color:int32 header_background_color:int32 section_background_color:int32 text_color:int32 accent_text_color:int32 section_header_text_color:int32 subtitle_text_color:int32 destructive_text_color:int32 hint_color:int32 link_color:int32 button_color:int32 button_text_color:int32 = ThemeParameters; +themeParameters#b47510c1 background_color:int32 secondary_background_color:int32 header_background_color:int32 section_background_color:int32 section_separator_color:int32 text_color:int32 accent_text_color:int32 section_header_text_color:int32 subtitle_text_color:int32 destructive_text_color:int32 hint_color:int32 link_color:int32 button_color:int32 button_text_color:int32 = ThemeParameters; //@description Portion of the price of a product (e.g., "delivery cost", "tax amount") //@label Label for this portion of the product price @@ -2872,7 +2890,7 @@ paymentReceipt#2d313392 product_info:productInfo date:int32 seller_bot_user_id:i //@class InputInvoice @description Describes an invoice to process -//@description An invoice from a message of the type messageInvoice +//@description An invoice from a message of the type messageInvoice or paid media purchase from messagePaidMedia //@chat_id Chat identifier of the message //@message_id Message identifier inputInvoiceMessage#58dcea10 chat_id:int53 message_id:int53 = InputInvoice; @@ -2885,29 +2903,25 @@ inputInvoiceName#b1ca16f3 name:string = InputInvoice; //@purpose Transaction purpose inputInvoiceTelegram#96ecfeed purpose:TelegramPaymentPurpose = InputInvoice; -//@class MessageExtendedMedia @description Describes a media, which is attached to an invoice +//@class PaidMedia @description Describes a paid media //@description The media is hidden until the invoice is paid //@width Media width; 0 if unknown //@height Media height; 0 if unknown //@duration Media duration, in seconds; 0 if unknown //@minithumbnail Media minithumbnail; may be null -//@caption Media caption -messageExtendedMediaPreview#7703a347 width:int32 height:int32 duration:int32 minithumbnail:minithumbnail caption:formattedText = MessageExtendedMedia; +paidMediaPreview#bcc1c474 width:int32 height:int32 duration:int32 minithumbnail:minithumbnail = PaidMedia; //@description The media is a photo //@photo The photo -//@caption Photo caption -messageExtendedMediaPhoto#c68b4530 photo:photo caption:formattedText = MessageExtendedMedia; +paidMediaPhoto#ba82551a photo:photo = PaidMedia; //@description The media is a video //@video The video -//@caption Photo caption -messageExtendedMediaVideo#11acbf3b video:video caption:formattedText = MessageExtendedMedia; +paidMediaVideo#1bb52e09 video:video = PaidMedia; //@description The media is unsupported -//@caption Media caption -messageExtendedMediaUnsupported#141f5020 caption:formattedText = MessageExtendedMedia; +paidMediaUnsupported#6bc3e26 = PaidMedia; //@description Describes parameters of a Telegram Premium giveaway //@boosted_chat_id Identifier of the supergroup or channel chat, which will be automatically boosted by the winners of the giveaway for duration of the Premium subscription. @@ -3258,7 +3272,7 @@ messageText#c13562aa text:formattedText web_page:webPage link_preview_options:li //@description An animation message (GIF-style). //@animation The animation description //@caption Animation caption -//@show_caption_above_media True, if caption must be shown above the animation; otherwise, caption must be shown below the animation +//@show_caption_above_media True, if the caption must be shown above the animation; otherwise, the caption must be shown below the animation //@has_spoiler True, if the animation preview must be covered by a spoiler animation //@is_secret True, if the animation thumbnail must be blurred and the animation must be shown only while tapped messageAnimation#8ecb1128 animation:animation caption:formattedText show_caption_above_media:Bool has_spoiler:Bool is_secret:Bool = MessageContent; @@ -3273,10 +3287,17 @@ messageAudio#107e741c audio:audio caption:formattedText = MessageContent; //@caption Document caption messageDocument#2394ab77 document:document caption:formattedText = MessageContent; +//@description A message with paid media +//@star_count Number of stars needed to buy access to the media in the message +//@media Information about the media +//@caption Media caption +//@show_caption_above_media True, if the caption must be shown above the media; otherwise, the caption must be shown below the media +messagePaidMedia#3e5fd7c2 star_count:int53 media:vector caption:formattedText show_caption_above_media:Bool = MessageContent; + //@description A photo message //@photo The photo //@caption Photo caption -//@show_caption_above_media True, if caption must be shown above the photo; otherwise, caption must be shown below the photo +//@show_caption_above_media True, if the caption must be shown above the photo; otherwise, the caption must be shown below the photo //@has_spoiler True, if the photo preview must be covered by a spoiler animation //@is_secret True, if the photo must be blurred and must be shown only while tapped messagePhoto#754c7e1f photo:photo caption:formattedText show_caption_above_media:Bool has_spoiler:Bool is_secret:Bool = MessageContent; @@ -3289,7 +3310,7 @@ messageSticker#e5f0dcca sticker:sticker is_premium:Bool = MessageContent; //@description A video message //@video The video description //@caption Video caption -//@show_caption_above_media True, if caption must be shown above the video; otherwise, caption must be shown below the video +//@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; @@ -3369,8 +3390,9 @@ messageStory#3329f2d4 story_sender_chat_id:int53 story_id:int32 via_mention:Bool //@is_test True, if the invoice is a test invoice //@need_shipping_address True, if the shipping address must be specified //@receipt_message_id The identifier of the message with the receipt, after the product has been purchased -//@extended_media Extended media attached to the invoice; may be null -messageInvoice#d8201a53 product_info:productInfo currency:string total_amount:int53 start_parameter:string is_test:Bool need_shipping_address:Bool receipt_message_id:int53 extended_media:MessageExtendedMedia = MessageContent; +//@paid_media Extended media attached to the invoice; may be null if none +//@paid_media_caption Extended media caption; may be null if none +messageInvoice#fadfd46 product_info:productInfo currency:string total_amount:int53 start_parameter:string is_test:Bool need_shipping_address:Bool receipt_message_id:int53 paid_media:PaidMedia paid_media_caption:formattedText = MessageContent; //@description A message with information about an ended call //@is_video True, if the call was a video call @@ -3543,7 +3565,7 @@ messageGiftedPremium#78d1d0a gifter_user_id:int53 currency:string amount:int53 c //@code The gift code messagePremiumGiftCode#26bd1bf3 creator_id:MessageSender is_from_giveaway:Bool is_unclaimed:Bool currency:string amount:int53 cryptocurrency:string cryptocurrency_amount:int64 month_count:int32 sticker:sticker code:string = MessageContent; -//@description A Telegram Premium giveaway was created for the chat +//@description A Telegram Premium giveaway was created for the chat. Use telegramPaymentPurposePremiumGiveaway or storePaymentPurposePremiumGiveaway to create a giveaway messagePremiumGiveawayCreated#270f2c44 = MessageContent; //@description A Telegram Premium giveaway @@ -3696,6 +3718,25 @@ textEntityTypeMediaTimestamp#9236da10 media_timestamp:int32 = TextEntityType; //@height Thumbnail height, usually shouldn't exceed 320. Use 0 if unknown inputThumbnail#5e515024 thumbnail:InputFile width:int32 height:int32 = InputThumbnail; +//@class InputPaidMediaType @description Describes type of paid media to sent + +//@description The media is a photo. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20 +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 +inputPaidMediaTypeVideo#b053f9fc duration:int32 supports_streaming:Bool = InputPaidMediaType; + +//@description Describes a paid media to be sent +//@type Type of the media +//@media Photo or video to be sent +//@thumbnail Media thumbnail; pass null to skip thumbnail uploading +//@added_sticker_file_ids File identifiers of the stickers added to the media, if applicable +//@width Media width +//@height Media height +inputPaidMedia#19f0fc79 type:InputPaidMediaType media:InputFile thumbnail:inputThumbnail added_sticker_file_ids:vector width:int32 height:int32 = InputPaidMedia; + //@class MessageSchedulingState @description Contains information about the time when a scheduled message will be sent //@description The message will be sent at the specified date @@ -3725,7 +3766,7 @@ messageSelfDestructTypeImmediately#c23c9005 = MessageSelfDestructType; //@only_preview Pass true to get a fake message instead of actually sending them messageSendOptions#828489ae disable_notification:Bool from_background:Bool protect_content:Bool update_order_of_installed_sticker_sets:Bool scheduling_state:MessageSchedulingState effect_id:int64 sending_id:int32 only_preview:Bool = MessageSendOptions; -//@description Options to be used when a message content is copied without reference to the original sender. Service messages, messages with messageInvoice, messagePremiumGiveaway, or messagePremiumGiveawayWinners content can't be copied +//@description Options to be used when a message content is copied without reference to the original sender. Service messages, messages with messageInvoice, messagePaidMedia, messagePremiumGiveaway, or messagePremiumGiveawayWinners content can't be copied //@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 @@ -3748,7 +3789,7 @@ inputMessageText#f350d894 text:formattedText link_preview_options:linkPreviewOpt //@width Width of the animation; may be replaced by the server //@height Height of the animation; may be replaced by the server //@caption Animation caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters -//@show_caption_above_media True, if caption must be shown above the animation; otherwise, caption must be shown below the animation; not supported in secret chats +//@show_caption_above_media True, if the caption must be shown above the animation; otherwise, the caption must be shown below the animation; not supported in secret chats //@has_spoiler True, if the animation preview must be covered by a spoiler animation; not supported in secret chats inputMessageAnimation#19fe563 animation:InputFile thumbnail:inputThumbnail added_sticker_file_ids:vector duration:int32 width:int32 height:int32 caption:formattedText show_caption_above_media:Bool has_spoiler:Bool = InputMessageContent; @@ -3768,6 +3809,13 @@ inputMessageAudio#daa400b2 audio:InputFile album_cover_thumbnail:inputThumbnail //@caption Document caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters inputMessageDocument#615b72b9 document:InputFile thumbnail:inputThumbnail disable_content_type_detection:Bool caption:formattedText = InputMessageContent; +//@description A message with paid media; can be used only in channel chats with supergroupFullInfo.has_paid_media_allowed +//@star_count The number of 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 +inputMessagePaidMedia#36f9c23c star_count:int53 paid_media:vector caption:formattedText show_caption_above_media:Bool = InputMessageContent; + //@description A photo message //@photo Photo to send. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20 //@thumbnail Photo thumbnail to be sent; pass null to skip thumbnail uploading. The thumbnail is sent to the other party only in secret chats @@ -3775,7 +3823,7 @@ inputMessageDocument#615b72b9 document:InputFile thumbnail:inputThumbnail disabl //@width Photo width //@height Photo height //@caption Photo caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters -//@show_caption_above_media True, if caption must be shown above the photo; otherwise, caption must be shown below the photo; not supported in secret chats +//@show_caption_above_media True, if the caption must be shown above the photo; otherwise, the caption must be shown below the photo; not supported in secret chats //@self_destruct_type Photo self-destruct type; pass null if none; private chats only //@has_spoiler True, if the photo preview must be covered by a spoiler animation; not supported in secret chats inputMessagePhoto#bc78dbcc photo:InputFile thumbnail:inputThumbnail added_sticker_file_ids:vector width:int32 height:int32 caption:formattedText show_caption_above_media:Bool self_destruct_type:MessageSelfDestructType has_spoiler:Bool = InputMessageContent; @@ -3797,7 +3845,7 @@ inputMessageSticker#3ff1b6f9 sticker:InputFile thumbnail:inputThumbnail width:in //@height Video height //@supports_streaming True, if the video is supposed 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 caption must be shown above the video; otherwise, 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 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 //@has_spoiler True, if the video preview must be covered by a spoiler animation; not supported in secret chats inputMessageVideo#1a64cc26 video:InputFile thumbnail:inputThumbnail added_sticker_file_ids:vector duration:int32 width:int32 height:int32 supports_streaming:Bool caption:formattedText show_caption_above_media:Bool self_destruct_type:MessageSelfDestructType has_spoiler:Bool = InputMessageContent; @@ -3855,8 +3903,9 @@ inputMessageGame#4aae6ae2 bot_user_id:int53 game_short_name:string = InputMessag //@provider_token Payment provider token; may be empty for payments in Telegram Stars //@provider_data JSON-encoded data about the invoice, which will be shared with the payment provider //@start_parameter Unique invoice bot deep link parameter for the generation of this invoice. If empty, it would be possible to pay directly from forwards of the invoice message -//@extended_media_content The content of extended media attached to the invoice. The content of the message to be sent. Must be one of the following types: inputMessagePhoto, inputMessageVideo -inputMessageInvoice#34cd1d60 invoice:invoice title:string description:string photo_url:string photo_size:int32 photo_width:int32 photo_height:int32 payload:bytes provider_token:string provider_data:string start_parameter:string extended_media_content:InputMessageContent = InputMessageContent; +//@paid_media The content of paid media attached to the invoice; pass null if none +//@paid_media_caption Paid media caption; pass null to use an empty caption; 0-getOption("message_caption_length_max") characters +inputMessageInvoice#babc8f71 invoice:invoice title:string description:string photo_url:string photo_size:int32 photo_width:int32 photo_height:int32 payload:bytes provider_token:string provider_data:string start_parameter:string paid_media:inputPaidMedia paid_media_caption:formattedText = InputMessageContent; //@description A message with a poll. Polls can't be sent to secret chats. Polls can be sent only to a private chat with a bot //@question Poll question; 1-255 characters (up to 300 characters for bots). Only custom emoji entities are allowed to be added and only by Premium users @@ -4486,7 +4535,7 @@ chatBoostSlots#6859c79 slots:vector = ChatBoostSlots; resendCodeReasonUserRequest#e5a8c880 = ResendCodeReason; //@description The code is re-sent, because device verification has failed -//@error_message Cause of the verification failure, for example, PLAY_SERVICES_NOT_AVAILABLE, APNS_RECEIVE_TIMEOUT, APNS_INIT_FAILED, etc. +//@error_message Cause of the verification failure, for example, PLAY_SERVICES_NOT_AVAILABLE, APNS_RECEIVE_TIMEOUT, or APNS_INIT_FAILED resendCodeReasonVerificationFailed#1f952dc1 error_message:string = ResendCodeReason; //@class CallDiscardReason @description Describes the reason why a call was discarded @@ -5581,6 +5630,9 @@ premiumFeatureLastSeenTimes#d2914a8f = PremiumFeature; //@description The ability to use Business features premiumFeatureBusiness#a6609704 = PremiumFeature; +//@description The ability to use all available message effects +premiumFeatureMessageEffects#d4e35061 = PremiumFeature; + //@class BusinessFeature @description Describes a feature available to Business user accounts //@description The ability to set location @@ -5839,7 +5891,7 @@ backgroundTypeWallpaper#758c4c7b is_blurred:Bool is_moving:Bool = BackgroundType //@description A PNG or TGV (gzipped subset of SVG with MIME type "application/x-tgwallpattern") pattern to be combined with the background fill chosen by the user //@fill Fill of the background -//@intensity Intensity of the pattern when it is shown above the filled background; 0-100. +//@intensity Intensity of the pattern when it is shown above the filled background; 0-100 //@is_inverted True, if the background fill must be applied only to the pattern itself. All other pixels are black in this case. For dark themes only //@is_moving True, if the background needs to be slightly moved when device is tilted backgroundTypePattern#4ce716fd fill:BackgroundFill intensity:int32 is_inverted:Bool is_moving:Bool = BackgroundType; @@ -6040,6 +6092,11 @@ pushMessageContentInvoice#98c88bbc price:string is_pinned:Bool = PushMessageCont //@is_pinned True, if the message is a pinned message with the specified content pushMessageContentLocation#b33a97b3 is_live:Bool is_pinned:Bool = PushMessageContent; +//@description A message with paid media +//@star_count Number of stars needed to buy access to the media in the message; 0 for pinned message +//@is_pinned True, if the message is a pinned message with the specified content +pushMessageContentPaidMedia#b556e74a star_count:int53 is_pinned:Bool = PushMessageContent; + //@description A photo message //@photo Message content; may be null //@caption Photo caption @@ -6354,7 +6411,7 @@ userPrivacySettingAllowFindingByPhoneNumber#91ee6d51 = UserPrivacySetting; userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages#14272e3c = UserPrivacySetting; //@description Contains privacy settings for message read date in private chats. Read dates are always shown to the users that can see online status of the current user regardless of this setting -//@show_read_date True, if message read date is shown to other users in private chats. If false and the current user isn't a Telegram Premium user, then they will not be able to see other's message read date. +//@show_read_date True, if message read date is shown to other users in private chats. If false and the current user isn't a Telegram Premium user, then they will not be able to see other's message read date readDatePrivacySettings#62a2e628 show_read_date:Bool = ReadDatePrivacySettings; //@description Contains privacy settings for new chats with non-contacts @@ -6675,7 +6732,8 @@ internalLinkTypeSettings#177545b4 = InternalLinkType; //@description The link is a link to a bot, which can be installed to the side menu. Call searchPublicChat with the given bot username, check that the user is a bot and can be added to attachment menu. //@bot_username Username of the bot //@url URL to be passed to getWebAppUrl -internalLinkTypeSideMenuBot#a260e77d bot_username:string url:string = InternalLinkType; +//@is_compact True, if the Web App must be opened in a compact mode instead of a full-size mode +internalLinkTypeSideMenuBot#c45f0c16 bot_username:string url:string is_compact:Bool = InternalLinkType; //@description The link is a link to a sticker set. Call searchStickerSet with the given sticker set name to process the link and show the sticker set. //@sticker_set_name Name of the sticker set @@ -6720,7 +6778,8 @@ internalLinkTypeVideoChat#8796f8b4 chat_username:string invite_hash:string is_li //@bot_username Username of the bot that owns the Web App //@web_app_short_name Short name of the Web App //@start_parameter Start parameter to be passed to getWebAppLinkUrl -internalLinkTypeWebApp#fc98d04f bot_username:string web_app_short_name:string start_parameter:string = InternalLinkType; +//@is_compact True, if the Web App must be opened in a compact mode instead of a full-size mode +internalLinkTypeWebApp#4c68bb0d bot_username:string web_app_short_name:string start_parameter:string is_compact:Bool = InternalLinkType; //@description Contains an HTTPS link to a message in a supergroup or channel, or a forum topic //@link The link @@ -7785,8 +7844,9 @@ updateFileRemovedFromDownloads#6e7c14e8 file_id:int32 counts:downloadedFileCount //@description A request can't be completed unless application verification is performed; for official mobile applications only. //@verification_id Unique identifier for the verification process -//@nonce Unique nonce for the classic Play Integrity verification (https://developer.android.com/google/play/integrity/classic) for Android, -updateApplicationVerificationRequired#32079e05 verification_id:int53 nonce:string = Update; +//@nonce Unique base64url-encoded nonce for the classic Play Integrity verification (https://developer.android.com/google/play/integrity/classic) for Android, +//@cloud_project_number Cloud project number to pass to the Play Integrity API on Android +updateApplicationVerificationRequired#c59c61d7 verification_id:int53 nonce:string cloud_project_number:int64 = Update; //@description New call was created or information about a call was updated //@call New data about a call @@ -8972,7 +9032,7 @@ editMessageMedia#bb4b8713 chat_id:int53 message_id:int53 reply_markup:ReplyMarku //@message_id Identifier of the message //@reply_markup The new message reply markup; pass null if none; for bots only //@caption New message content caption; 0-getOption("message_caption_length_max") characters; pass null to remove caption -//@show_caption_above_media Pass true to show the caption above the media; otherwise, caption will be shown below the media. Can be true only for animation, photo, and video messages +//@show_caption_above_media Pass true to show the caption above the media; otherwise, the caption will be shown below the media. Can be true only for animation, photo, and video messages editMessageCaption#87977241 chat_id:int53 message_id:int53 reply_markup:ReplyMarkup caption:formattedText show_caption_above_media:Bool = Message; //@description Edits the message reply markup; for bots only. Returns the edited message after the edit is completed on the server side. @@ -9006,7 +9066,7 @@ editInlineMessageMedia#1676781 inline_message_id:string reply_markup:ReplyMarkup //@inline_message_id Inline message identifier //@reply_markup The new message reply markup; pass null if none //@caption New message content caption; pass null to remove caption; 0-getOption("message_caption_length_max") characters -//@show_caption_above_media Pass true to show the caption above the media; otherwise, caption will be shown below the media. Can be true only for animation, photo, and video messages +//@show_caption_above_media Pass true to show the caption above the media; otherwise, the caption will be shown below the media. Can be true only for animation, photo, and video messages editInlineMessageCaption#540744f8 inline_message_id:string reply_markup:ReplyMarkup caption:formattedText show_caption_above_media:Bool = Ok; //@description Edits the reply markup of an inline message sent via a bot; for bots only @@ -9080,7 +9140,7 @@ editBusinessMessageMedia#fc614778 business_connection_id:string chat_id:int53 me //@message_id Identifier of the message //@reply_markup The new message reply markup; pass null if none //@caption New message content caption; pass null to remove caption; 0-getOption("message_caption_length_max") characters -//@show_caption_above_media Pass true to show the caption above the media; otherwise, caption will be shown below the media. Can be true only for animation, photo, and video messages +//@show_caption_above_media Pass true to show the caption above the media; otherwise, the caption will be shown below the media. Can be true only for animation, photo, and video messages editBusinessMessageCaption#c02142c3 business_connection_id:string chat_id:int53 message_id:int53 reply_markup:ReplyMarkup caption:formattedText show_caption_above_media:Bool = BusinessMessage; //@description Edits the reply markup of a message sent on behalf of a business account; for bots only @@ -11265,7 +11325,7 @@ getChatEventLog#f47b0a9b chat_id:int53 query:string from_event_id:int64 limit:in //@description Returns the list of supported time zones getTimeZones#4fe2e058 = TimeZones; -//@description Returns an invoice payment form. This method must be called when the user presses inline button of the type inlineKeyboardButtonTypeBuy +//@description Returns an invoice payment form. This method must be called when the user presses inline button of the type inlineKeyboardButtonTypeBuy, or wants to buy access to media in a messagePaidMedia message //@input_invoice The invoice //@theme Preferred payment form theme; pass null to use the default theme getPaymentForm#8d4f76d4 input_invoice:InputInvoice theme:themeParameters = PaymentForm; @@ -11482,7 +11542,7 @@ reportMessageReactions#36c88827 chat_id:int53 message_id:int53 sender_id:Message //@is_dark Pass true if a dark theme is used by the application getChatRevenueStatistics#29d79b3c chat_id:int53 is_dark:Bool = ChatRevenueStatistics; -//@description Returns URL for chat revenue withdrawal; requires owner privileges in the chat. Currently, this method can be used only for channels if supergroupFullInfo.can_get_revenue_statistics == true and getOption("can_withdraw_chat_revenue") +//@description Returns a URL for chat revenue withdrawal; requires owner privileges in the chat. Currently, this method can be used only for channels if supergroupFullInfo.can_get_revenue_statistics == true and getOption("can_withdraw_chat_revenue") //@chat_id Chat identifier //@password The 2-step verification password of the current user getChatRevenueWithdrawalUrl#1e320720 chat_id:int53 password:string = HttpUrl; @@ -11494,16 +11554,20 @@ getChatRevenueWithdrawalUrl#1e320720 chat_id:int53 password:string = HttpUrl; getChatRevenueTransactions#472f0715 chat_id:int53 offset:int32 limit:int32 = ChatRevenueTransactions; //@description Returns detailed Telegram star revenue statistics -//@owner_id Identifier of the owner of the Telegram stars; can be identifier of an owned bot, or identifier of a channel chat with supergroupFullInfo.can_get_revenue_statistics == true +//@owner_id Identifier of the owner of the Telegram stars; can be identifier of an owned bot, or identifier of an owned channel chat //@is_dark Pass true if a dark theme is used by the application getStarRevenueStatistics#f07b4517 owner_id:MessageSender is_dark:Bool = StarRevenueStatistics; -//@description Returns URL for Telegram star withdrawal -//@owner_id Identifier of the owner of the Telegram stars; can be identifier of an owned bot, or identifier of a channel chat with supergroupFullInfo.can_get_revenue_statistics == true +//@description Returns a URL for Telegram star withdrawal +//@owner_id Identifier of the owner of the Telegram stars; can be identifier of an owned bot, or identifier of an owned channel chat //@star_count The number of Telegram stars to withdraw. Must be at least getOption("star_withdrawal_count_min") //@password The 2-step verification password of the current user getStarWithdrawalUrl#a9d23712 owner_id:MessageSender star_count:int53 password:string = HttpUrl; +//@description Returns a URL for a Telegram Ad platform account that can be used to set up advertisements for the chat paid in the owned Telegram stars +//@owner_id Identifier of the owner of the Telegram stars; can be identifier of an owned bot, or identifier of an owned channel chat +getStarAdAccountUrl#73a9455d owner_id:MessageSender = HttpUrl; + //@description Returns detailed statistics about a chat. Currently, this method can be used only for supergroups and channels. Can be used only if supergroupFullInfo.can_get_statistics == true //@chat_id Chat identifier //@is_dark Pass true if a dark theme is used by the application diff --git a/tdapi/tl_authentication_code_type_gen.go b/tdapi/tl_authentication_code_type_gen.go index 9437ac421e..aeeb4152a7 100644 --- a/tdapi/tl_authentication_code_type_gen.go +++ b/tdapi/tl_authentication_code_type_gen.go @@ -1427,19 +1427,16 @@ func (a *AuthenticationCodeTypeFragment) GetLength() (value int32) { return a.Length } -// AuthenticationCodeTypeFirebaseAndroid represents TL type `authenticationCodeTypeFirebaseAndroid#e5a1fe7d`. +// AuthenticationCodeTypeFirebaseAndroid represents TL type `authenticationCodeTypeFirebaseAndroid#6f9bb51e`. type AuthenticationCodeTypeFirebaseAndroid struct { - // True, if Play Integrity API must be used for device verification. Otherwise, SafetyNet - // Attestation API must be used - UsePlayIntegrity bool - // Nonce to pass to the Play Integrity API or the SafetyNet Attestation API - Nonce []byte + // Parameters to be used for device verification + DeviceVerificationParameters FirebaseDeviceVerificationParametersClass // Length of the code Length int32 } // AuthenticationCodeTypeFirebaseAndroidTypeID is TL type id of AuthenticationCodeTypeFirebaseAndroid. -const AuthenticationCodeTypeFirebaseAndroidTypeID = 0xe5a1fe7d +const AuthenticationCodeTypeFirebaseAndroidTypeID = 0x6f9bb51e // construct implements constructor of AuthenticationCodeTypeClass. func (a AuthenticationCodeTypeFirebaseAndroid) construct() AuthenticationCodeTypeClass { return &a } @@ -1458,10 +1455,7 @@ func (a *AuthenticationCodeTypeFirebaseAndroid) Zero() bool { if a == nil { return true } - if !(a.UsePlayIntegrity == false) { - return false - } - if !(a.Nonce == nil) { + if !(a.DeviceVerificationParameters == nil) { return false } if !(a.Length == 0) { @@ -1504,12 +1498,8 @@ func (a *AuthenticationCodeTypeFirebaseAndroid) TypeInfo() tdp.Type { } typ.Fields = []tdp.Field{ { - Name: "UsePlayIntegrity", - SchemaName: "use_play_integrity", - }, - { - Name: "Nonce", - SchemaName: "nonce", + Name: "DeviceVerificationParameters", + SchemaName: "device_verification_parameters", }, { Name: "Length", @@ -1522,7 +1512,7 @@ func (a *AuthenticationCodeTypeFirebaseAndroid) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (a *AuthenticationCodeTypeFirebaseAndroid) Encode(b *bin.Buffer) error { if a == nil { - return fmt.Errorf("can't encode authenticationCodeTypeFirebaseAndroid#e5a1fe7d as nil") + return fmt.Errorf("can't encode authenticationCodeTypeFirebaseAndroid#6f9bb51e as nil") } b.PutID(AuthenticationCodeTypeFirebaseAndroidTypeID) return a.EncodeBare(b) @@ -1531,10 +1521,14 @@ func (a *AuthenticationCodeTypeFirebaseAndroid) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (a *AuthenticationCodeTypeFirebaseAndroid) EncodeBare(b *bin.Buffer) error { if a == nil { - return fmt.Errorf("can't encode authenticationCodeTypeFirebaseAndroid#e5a1fe7d as nil") + return fmt.Errorf("can't encode authenticationCodeTypeFirebaseAndroid#6f9bb51e as nil") + } + if a.DeviceVerificationParameters == nil { + return fmt.Errorf("unable to encode authenticationCodeTypeFirebaseAndroid#6f9bb51e: field device_verification_parameters is nil") + } + if err := a.DeviceVerificationParameters.Encode(b); err != nil { + return fmt.Errorf("unable to encode authenticationCodeTypeFirebaseAndroid#6f9bb51e: field device_verification_parameters: %w", err) } - b.PutBool(a.UsePlayIntegrity) - b.PutBytes(a.Nonce) b.PutInt32(a.Length) return nil } @@ -1542,10 +1536,10 @@ func (a *AuthenticationCodeTypeFirebaseAndroid) EncodeBare(b *bin.Buffer) error // Decode implements bin.Decoder. func (a *AuthenticationCodeTypeFirebaseAndroid) Decode(b *bin.Buffer) error { if a == nil { - return fmt.Errorf("can't decode authenticationCodeTypeFirebaseAndroid#e5a1fe7d to nil") + return fmt.Errorf("can't decode authenticationCodeTypeFirebaseAndroid#6f9bb51e to nil") } if err := b.ConsumeID(AuthenticationCodeTypeFirebaseAndroidTypeID); err != nil { - return fmt.Errorf("unable to decode authenticationCodeTypeFirebaseAndroid#e5a1fe7d: %w", err) + return fmt.Errorf("unable to decode authenticationCodeTypeFirebaseAndroid#6f9bb51e: %w", err) } return a.DecodeBare(b) } @@ -1553,26 +1547,19 @@ func (a *AuthenticationCodeTypeFirebaseAndroid) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (a *AuthenticationCodeTypeFirebaseAndroid) DecodeBare(b *bin.Buffer) error { if a == nil { - return fmt.Errorf("can't decode authenticationCodeTypeFirebaseAndroid#e5a1fe7d to nil") - } - { - value, err := b.Bool() - if err != nil { - return fmt.Errorf("unable to decode authenticationCodeTypeFirebaseAndroid#e5a1fe7d: field use_play_integrity: %w", err) - } - a.UsePlayIntegrity = value + return fmt.Errorf("can't decode authenticationCodeTypeFirebaseAndroid#6f9bb51e to nil") } { - value, err := b.Bytes() + value, err := DecodeFirebaseDeviceVerificationParameters(b) if err != nil { - return fmt.Errorf("unable to decode authenticationCodeTypeFirebaseAndroid#e5a1fe7d: field nonce: %w", err) + return fmt.Errorf("unable to decode authenticationCodeTypeFirebaseAndroid#6f9bb51e: field device_verification_parameters: %w", err) } - a.Nonce = value + a.DeviceVerificationParameters = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode authenticationCodeTypeFirebaseAndroid#e5a1fe7d: field length: %w", err) + return fmt.Errorf("unable to decode authenticationCodeTypeFirebaseAndroid#6f9bb51e: field length: %w", err) } a.Length = value } @@ -1582,16 +1569,18 @@ func (a *AuthenticationCodeTypeFirebaseAndroid) DecodeBare(b *bin.Buffer) error // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (a *AuthenticationCodeTypeFirebaseAndroid) EncodeTDLibJSON(b tdjson.Encoder) error { if a == nil { - return fmt.Errorf("can't encode authenticationCodeTypeFirebaseAndroid#e5a1fe7d as nil") + return fmt.Errorf("can't encode authenticationCodeTypeFirebaseAndroid#6f9bb51e as nil") } b.ObjStart() b.PutID("authenticationCodeTypeFirebaseAndroid") b.Comma() - b.FieldStart("use_play_integrity") - b.PutBool(a.UsePlayIntegrity) - b.Comma() - b.FieldStart("nonce") - b.PutBytes(a.Nonce) + b.FieldStart("device_verification_parameters") + if a.DeviceVerificationParameters == nil { + return fmt.Errorf("unable to encode authenticationCodeTypeFirebaseAndroid#6f9bb51e: field device_verification_parameters is nil") + } + if err := a.DeviceVerificationParameters.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode authenticationCodeTypeFirebaseAndroid#6f9bb51e: field device_verification_parameters: %w", err) + } b.Comma() b.FieldStart("length") b.PutInt32(a.Length) @@ -1604,31 +1593,25 @@ func (a *AuthenticationCodeTypeFirebaseAndroid) EncodeTDLibJSON(b tdjson.Encoder // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (a *AuthenticationCodeTypeFirebaseAndroid) DecodeTDLibJSON(b tdjson.Decoder) error { if a == nil { - return fmt.Errorf("can't decode authenticationCodeTypeFirebaseAndroid#e5a1fe7d to nil") + return fmt.Errorf("can't decode authenticationCodeTypeFirebaseAndroid#6f9bb51e to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("authenticationCodeTypeFirebaseAndroid"); err != nil { - return fmt.Errorf("unable to decode authenticationCodeTypeFirebaseAndroid#e5a1fe7d: %w", err) - } - case "use_play_integrity": - value, err := b.Bool() - if err != nil { - return fmt.Errorf("unable to decode authenticationCodeTypeFirebaseAndroid#e5a1fe7d: field use_play_integrity: %w", err) + return fmt.Errorf("unable to decode authenticationCodeTypeFirebaseAndroid#6f9bb51e: %w", err) } - a.UsePlayIntegrity = value - case "nonce": - value, err := b.Bytes() + case "device_verification_parameters": + value, err := DecodeTDLibJSONFirebaseDeviceVerificationParameters(b) if err != nil { - return fmt.Errorf("unable to decode authenticationCodeTypeFirebaseAndroid#e5a1fe7d: field nonce: %w", err) + return fmt.Errorf("unable to decode authenticationCodeTypeFirebaseAndroid#6f9bb51e: field device_verification_parameters: %w", err) } - a.Nonce = value + a.DeviceVerificationParameters = value case "length": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode authenticationCodeTypeFirebaseAndroid#e5a1fe7d: field length: %w", err) + return fmt.Errorf("unable to decode authenticationCodeTypeFirebaseAndroid#6f9bb51e: field length: %w", err) } a.Length = value default: @@ -1638,20 +1621,12 @@ func (a *AuthenticationCodeTypeFirebaseAndroid) DecodeTDLibJSON(b tdjson.Decoder }) } -// GetUsePlayIntegrity returns value of UsePlayIntegrity field. -func (a *AuthenticationCodeTypeFirebaseAndroid) GetUsePlayIntegrity() (value bool) { - if a == nil { - return - } - return a.UsePlayIntegrity -} - -// GetNonce returns value of Nonce field. -func (a *AuthenticationCodeTypeFirebaseAndroid) GetNonce() (value []byte) { +// GetDeviceVerificationParameters returns value of DeviceVerificationParameters field. +func (a *AuthenticationCodeTypeFirebaseAndroid) GetDeviceVerificationParameters() (value FirebaseDeviceVerificationParametersClass) { if a == nil { return } - return a.Nonce + return a.DeviceVerificationParameters } // GetLength returns value of Length field. @@ -1918,7 +1893,7 @@ const AuthenticationCodeTypeClassName = "AuthenticationCodeType" // case *tdapi.AuthenticationCodeTypeFlashCall: // authenticationCodeTypeFlashCall#533379a2 // case *tdapi.AuthenticationCodeTypeMissedCall: // authenticationCodeTypeMissedCall#29bb0a87 // case *tdapi.AuthenticationCodeTypeFragment: // authenticationCodeTypeFragment#810f74cd -// case *tdapi.AuthenticationCodeTypeFirebaseAndroid: // authenticationCodeTypeFirebaseAndroid#e5a1fe7d +// case *tdapi.AuthenticationCodeTypeFirebaseAndroid: // authenticationCodeTypeFirebaseAndroid#6f9bb51e // case *tdapi.AuthenticationCodeTypeFirebaseIos: // authenticationCodeTypeFirebaseIos#ff55aa93 // default: panic(v) // } @@ -2008,7 +1983,7 @@ func DecodeAuthenticationCodeType(buf *bin.Buffer) (AuthenticationCodeTypeClass, } return &v, nil case AuthenticationCodeTypeFirebaseAndroidTypeID: - // Decoding authenticationCodeTypeFirebaseAndroid#e5a1fe7d. + // Decoding authenticationCodeTypeFirebaseAndroid#6f9bb51e. v := AuthenticationCodeTypeFirebaseAndroid{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode AuthenticationCodeTypeClass: %w", err) @@ -2090,7 +2065,7 @@ func DecodeTDLibJSONAuthenticationCodeType(buf tdjson.Decoder) (AuthenticationCo } return &v, nil case "authenticationCodeTypeFirebaseAndroid": - // Decoding authenticationCodeTypeFirebaseAndroid#e5a1fe7d. + // Decoding authenticationCodeTypeFirebaseAndroid#6f9bb51e. v := AuthenticationCodeTypeFirebaseAndroid{} if err := v.DecodeTDLibJSON(buf); err != nil { return nil, fmt.Errorf("unable to decode AuthenticationCodeTypeClass: %w", err) diff --git a/tdapi/tl_background_type_gen.go b/tdapi/tl_background_type_gen.go index 57fac9aef6..971d602e1c 100644 --- a/tdapi/tl_background_type_gen.go +++ b/tdapi/tl_background_type_gen.go @@ -236,7 +236,7 @@ func (b *BackgroundTypeWallpaper) GetIsMoving() (value bool) { type BackgroundTypePattern struct { // Fill of the background Fill BackgroundFillClass - // Intensity of the pattern when it is shown above the filled background; 0-100. + // Intensity of the pattern when it is shown above the filled background; 0-100 Intensity int32 // True, if the background fill must be applied only to the pattern itself. All other // pixels are black in this case. For dark themes only diff --git a/tdapi/tl_bot_menu_button_gen.go b/tdapi/tl_bot_menu_button_gen.go index 4c98cfbf68..29fb3d1ea7 100644 --- a/tdapi/tl_bot_menu_button_gen.go +++ b/tdapi/tl_bot_menu_button_gen.go @@ -35,7 +35,9 @@ var ( type BotMenuButton struct { // Text of the button Text string - // URL to be passed to openWebApp + // URL of a Web App to open when the button is pressed. If the link is of the type + // internalLinkTypeWebApp, then it must be processed accordingly. Otherwise, the link + // must be passed to openWebApp URL string } diff --git a/tdapi/tl_edit_business_message_caption_gen.go b/tdapi/tl_edit_business_message_caption_gen.go index ea44477e3b..3d485ea881 100644 --- a/tdapi/tl_edit_business_message_caption_gen.go +++ b/tdapi/tl_edit_business_message_caption_gen.go @@ -44,8 +44,8 @@ type EditBusinessMessageCaptionRequest struct { // New message content caption; pass null to remove caption; // 0-getOption("message_caption_length_max") characters Caption FormattedText - // Pass true to show the caption above the media; otherwise, caption will be shown below - // the media. Can be true only for animation, photo, and video messages + // 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 ShowCaptionAboveMedia bool } diff --git a/tdapi/tl_edit_inline_message_caption_gen.go b/tdapi/tl_edit_inline_message_caption_gen.go index 2bb2089a07..7abbf85e8f 100644 --- a/tdapi/tl_edit_inline_message_caption_gen.go +++ b/tdapi/tl_edit_inline_message_caption_gen.go @@ -40,8 +40,8 @@ type EditInlineMessageCaptionRequest struct { // New message content caption; pass null to remove caption; // 0-getOption("message_caption_length_max") characters Caption FormattedText - // Pass true to show the caption above the media; otherwise, caption will be shown below - // the media. Can be true only for animation, photo, and video messages + // 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 ShowCaptionAboveMedia bool } diff --git a/tdapi/tl_edit_message_caption_gen.go b/tdapi/tl_edit_message_caption_gen.go index a924bedbab..b658bb70d2 100644 --- a/tdapi/tl_edit_message_caption_gen.go +++ b/tdapi/tl_edit_message_caption_gen.go @@ -42,8 +42,8 @@ type EditMessageCaptionRequest struct { // New message content caption; 0-getOption("message_caption_length_max") characters; // pass null to remove caption Caption FormattedText - // Pass true to show the caption above the media; otherwise, caption will be shown below - // the media. Can be true only for animation, photo, and video messages + // 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 ShowCaptionAboveMedia bool } diff --git a/tdapi/tl_firebase_device_verification_parameters_gen.go b/tdapi/tl_firebase_device_verification_parameters_gen.go new file mode 100644 index 0000000000..a95d070b9b --- /dev/null +++ b/tdapi/tl_firebase_device_verification_parameters_gen.go @@ -0,0 +1,539 @@ +// 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{} +) + +// FirebaseDeviceVerificationParametersSafetyNet represents TL type `firebaseDeviceVerificationParametersSafetyNet#2b96b2f1`. +type FirebaseDeviceVerificationParametersSafetyNet struct { + // Nonce to pass to the SafetyNet Attestation API + Nonce []byte +} + +// FirebaseDeviceVerificationParametersSafetyNetTypeID is TL type id of FirebaseDeviceVerificationParametersSafetyNet. +const FirebaseDeviceVerificationParametersSafetyNetTypeID = 0x2b96b2f1 + +// construct implements constructor of FirebaseDeviceVerificationParametersClass. +func (f FirebaseDeviceVerificationParametersSafetyNet) construct() FirebaseDeviceVerificationParametersClass { + return &f +} + +// Ensuring interfaces in compile-time for FirebaseDeviceVerificationParametersSafetyNet. +var ( + _ bin.Encoder = &FirebaseDeviceVerificationParametersSafetyNet{} + _ bin.Decoder = &FirebaseDeviceVerificationParametersSafetyNet{} + _ bin.BareEncoder = &FirebaseDeviceVerificationParametersSafetyNet{} + _ bin.BareDecoder = &FirebaseDeviceVerificationParametersSafetyNet{} + + _ FirebaseDeviceVerificationParametersClass = &FirebaseDeviceVerificationParametersSafetyNet{} +) + +func (f *FirebaseDeviceVerificationParametersSafetyNet) Zero() bool { + if f == nil { + return true + } + if !(f.Nonce == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (f *FirebaseDeviceVerificationParametersSafetyNet) String() string { + if f == nil { + return "FirebaseDeviceVerificationParametersSafetyNet(nil)" + } + type Alias FirebaseDeviceVerificationParametersSafetyNet + return fmt.Sprintf("FirebaseDeviceVerificationParametersSafetyNet%+v", Alias(*f)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*FirebaseDeviceVerificationParametersSafetyNet) TypeID() uint32 { + return FirebaseDeviceVerificationParametersSafetyNetTypeID +} + +// TypeName returns name of type in TL schema. +func (*FirebaseDeviceVerificationParametersSafetyNet) TypeName() string { + return "firebaseDeviceVerificationParametersSafetyNet" +} + +// TypeInfo returns info about TL type. +func (f *FirebaseDeviceVerificationParametersSafetyNet) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "firebaseDeviceVerificationParametersSafetyNet", + ID: FirebaseDeviceVerificationParametersSafetyNetTypeID, + } + if f == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Nonce", + SchemaName: "nonce", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (f *FirebaseDeviceVerificationParametersSafetyNet) Encode(b *bin.Buffer) error { + if f == nil { + return fmt.Errorf("can't encode firebaseDeviceVerificationParametersSafetyNet#2b96b2f1 as nil") + } + b.PutID(FirebaseDeviceVerificationParametersSafetyNetTypeID) + return f.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (f *FirebaseDeviceVerificationParametersSafetyNet) EncodeBare(b *bin.Buffer) error { + if f == nil { + return fmt.Errorf("can't encode firebaseDeviceVerificationParametersSafetyNet#2b96b2f1 as nil") + } + b.PutBytes(f.Nonce) + return nil +} + +// Decode implements bin.Decoder. +func (f *FirebaseDeviceVerificationParametersSafetyNet) Decode(b *bin.Buffer) error { + if f == nil { + return fmt.Errorf("can't decode firebaseDeviceVerificationParametersSafetyNet#2b96b2f1 to nil") + } + if err := b.ConsumeID(FirebaseDeviceVerificationParametersSafetyNetTypeID); err != nil { + return fmt.Errorf("unable to decode firebaseDeviceVerificationParametersSafetyNet#2b96b2f1: %w", err) + } + return f.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (f *FirebaseDeviceVerificationParametersSafetyNet) DecodeBare(b *bin.Buffer) error { + if f == nil { + return fmt.Errorf("can't decode firebaseDeviceVerificationParametersSafetyNet#2b96b2f1 to nil") + } + { + value, err := b.Bytes() + if err != nil { + return fmt.Errorf("unable to decode firebaseDeviceVerificationParametersSafetyNet#2b96b2f1: field nonce: %w", err) + } + f.Nonce = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (f *FirebaseDeviceVerificationParametersSafetyNet) EncodeTDLibJSON(b tdjson.Encoder) error { + if f == nil { + return fmt.Errorf("can't encode firebaseDeviceVerificationParametersSafetyNet#2b96b2f1 as nil") + } + b.ObjStart() + b.PutID("firebaseDeviceVerificationParametersSafetyNet") + b.Comma() + b.FieldStart("nonce") + b.PutBytes(f.Nonce) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (f *FirebaseDeviceVerificationParametersSafetyNet) DecodeTDLibJSON(b tdjson.Decoder) error { + if f == nil { + return fmt.Errorf("can't decode firebaseDeviceVerificationParametersSafetyNet#2b96b2f1 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("firebaseDeviceVerificationParametersSafetyNet"); err != nil { + return fmt.Errorf("unable to decode firebaseDeviceVerificationParametersSafetyNet#2b96b2f1: %w", err) + } + case "nonce": + value, err := b.Bytes() + if err != nil { + return fmt.Errorf("unable to decode firebaseDeviceVerificationParametersSafetyNet#2b96b2f1: field nonce: %w", err) + } + f.Nonce = value + default: + return b.Skip() + } + return nil + }) +} + +// GetNonce returns value of Nonce field. +func (f *FirebaseDeviceVerificationParametersSafetyNet) GetNonce() (value []byte) { + if f == nil { + return + } + return f.Nonce +} + +// FirebaseDeviceVerificationParametersPlayIntegrity represents TL type `firebaseDeviceVerificationParametersPlayIntegrity#caf4a58a`. +type FirebaseDeviceVerificationParametersPlayIntegrity struct { + // Base64url-encoded nonce to pass to the Play Integrity API + Nonce string + // Cloud project number to pass to the Play Integrity API + CloudProjectNumber int64 +} + +// FirebaseDeviceVerificationParametersPlayIntegrityTypeID is TL type id of FirebaseDeviceVerificationParametersPlayIntegrity. +const FirebaseDeviceVerificationParametersPlayIntegrityTypeID = 0xcaf4a58a + +// construct implements constructor of FirebaseDeviceVerificationParametersClass. +func (f FirebaseDeviceVerificationParametersPlayIntegrity) construct() FirebaseDeviceVerificationParametersClass { + return &f +} + +// Ensuring interfaces in compile-time for FirebaseDeviceVerificationParametersPlayIntegrity. +var ( + _ bin.Encoder = &FirebaseDeviceVerificationParametersPlayIntegrity{} + _ bin.Decoder = &FirebaseDeviceVerificationParametersPlayIntegrity{} + _ bin.BareEncoder = &FirebaseDeviceVerificationParametersPlayIntegrity{} + _ bin.BareDecoder = &FirebaseDeviceVerificationParametersPlayIntegrity{} + + _ FirebaseDeviceVerificationParametersClass = &FirebaseDeviceVerificationParametersPlayIntegrity{} +) + +func (f *FirebaseDeviceVerificationParametersPlayIntegrity) Zero() bool { + if f == nil { + return true + } + if !(f.Nonce == "") { + return false + } + if !(f.CloudProjectNumber == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (f *FirebaseDeviceVerificationParametersPlayIntegrity) String() string { + if f == nil { + return "FirebaseDeviceVerificationParametersPlayIntegrity(nil)" + } + type Alias FirebaseDeviceVerificationParametersPlayIntegrity + return fmt.Sprintf("FirebaseDeviceVerificationParametersPlayIntegrity%+v", Alias(*f)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*FirebaseDeviceVerificationParametersPlayIntegrity) TypeID() uint32 { + return FirebaseDeviceVerificationParametersPlayIntegrityTypeID +} + +// TypeName returns name of type in TL schema. +func (*FirebaseDeviceVerificationParametersPlayIntegrity) TypeName() string { + return "firebaseDeviceVerificationParametersPlayIntegrity" +} + +// TypeInfo returns info about TL type. +func (f *FirebaseDeviceVerificationParametersPlayIntegrity) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "firebaseDeviceVerificationParametersPlayIntegrity", + ID: FirebaseDeviceVerificationParametersPlayIntegrityTypeID, + } + if f == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Nonce", + SchemaName: "nonce", + }, + { + Name: "CloudProjectNumber", + SchemaName: "cloud_project_number", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (f *FirebaseDeviceVerificationParametersPlayIntegrity) Encode(b *bin.Buffer) error { + if f == nil { + return fmt.Errorf("can't encode firebaseDeviceVerificationParametersPlayIntegrity#caf4a58a as nil") + } + b.PutID(FirebaseDeviceVerificationParametersPlayIntegrityTypeID) + return f.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (f *FirebaseDeviceVerificationParametersPlayIntegrity) EncodeBare(b *bin.Buffer) error { + if f == nil { + return fmt.Errorf("can't encode firebaseDeviceVerificationParametersPlayIntegrity#caf4a58a as nil") + } + b.PutString(f.Nonce) + b.PutLong(f.CloudProjectNumber) + return nil +} + +// Decode implements bin.Decoder. +func (f *FirebaseDeviceVerificationParametersPlayIntegrity) Decode(b *bin.Buffer) error { + if f == nil { + return fmt.Errorf("can't decode firebaseDeviceVerificationParametersPlayIntegrity#caf4a58a to nil") + } + if err := b.ConsumeID(FirebaseDeviceVerificationParametersPlayIntegrityTypeID); err != nil { + return fmt.Errorf("unable to decode firebaseDeviceVerificationParametersPlayIntegrity#caf4a58a: %w", err) + } + return f.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (f *FirebaseDeviceVerificationParametersPlayIntegrity) DecodeBare(b *bin.Buffer) error { + if f == nil { + return fmt.Errorf("can't decode firebaseDeviceVerificationParametersPlayIntegrity#caf4a58a to nil") + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode firebaseDeviceVerificationParametersPlayIntegrity#caf4a58a: field nonce: %w", err) + } + f.Nonce = value + } + { + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode firebaseDeviceVerificationParametersPlayIntegrity#caf4a58a: field cloud_project_number: %w", err) + } + f.CloudProjectNumber = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (f *FirebaseDeviceVerificationParametersPlayIntegrity) EncodeTDLibJSON(b tdjson.Encoder) error { + if f == nil { + return fmt.Errorf("can't encode firebaseDeviceVerificationParametersPlayIntegrity#caf4a58a as nil") + } + b.ObjStart() + b.PutID("firebaseDeviceVerificationParametersPlayIntegrity") + b.Comma() + b.FieldStart("nonce") + b.PutString(f.Nonce) + b.Comma() + b.FieldStart("cloud_project_number") + b.PutLong(f.CloudProjectNumber) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (f *FirebaseDeviceVerificationParametersPlayIntegrity) DecodeTDLibJSON(b tdjson.Decoder) error { + if f == nil { + return fmt.Errorf("can't decode firebaseDeviceVerificationParametersPlayIntegrity#caf4a58a to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("firebaseDeviceVerificationParametersPlayIntegrity"); err != nil { + return fmt.Errorf("unable to decode firebaseDeviceVerificationParametersPlayIntegrity#caf4a58a: %w", err) + } + case "nonce": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode firebaseDeviceVerificationParametersPlayIntegrity#caf4a58a: field nonce: %w", err) + } + f.Nonce = value + case "cloud_project_number": + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode firebaseDeviceVerificationParametersPlayIntegrity#caf4a58a: field cloud_project_number: %w", err) + } + f.CloudProjectNumber = value + default: + return b.Skip() + } + return nil + }) +} + +// GetNonce returns value of Nonce field. +func (f *FirebaseDeviceVerificationParametersPlayIntegrity) GetNonce() (value string) { + if f == nil { + return + } + return f.Nonce +} + +// GetCloudProjectNumber returns value of CloudProjectNumber field. +func (f *FirebaseDeviceVerificationParametersPlayIntegrity) GetCloudProjectNumber() (value int64) { + if f == nil { + return + } + return f.CloudProjectNumber +} + +// FirebaseDeviceVerificationParametersClassName is schema name of FirebaseDeviceVerificationParametersClass. +const FirebaseDeviceVerificationParametersClassName = "FirebaseDeviceVerificationParameters" + +// FirebaseDeviceVerificationParametersClass represents FirebaseDeviceVerificationParameters generic type. +// +// Example: +// +// g, err := tdapi.DecodeFirebaseDeviceVerificationParameters(buf) +// if err != nil { +// panic(err) +// } +// switch v := g.(type) { +// case *tdapi.FirebaseDeviceVerificationParametersSafetyNet: // firebaseDeviceVerificationParametersSafetyNet#2b96b2f1 +// case *tdapi.FirebaseDeviceVerificationParametersPlayIntegrity: // firebaseDeviceVerificationParametersPlayIntegrity#caf4a58a +// default: panic(v) +// } +type FirebaseDeviceVerificationParametersClass interface { + bin.Encoder + bin.Decoder + bin.BareEncoder + bin.BareDecoder + construct() FirebaseDeviceVerificationParametersClass + + // 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 +} + +// DecodeFirebaseDeviceVerificationParameters implements binary de-serialization for FirebaseDeviceVerificationParametersClass. +func DecodeFirebaseDeviceVerificationParameters(buf *bin.Buffer) (FirebaseDeviceVerificationParametersClass, error) { + id, err := buf.PeekID() + if err != nil { + return nil, err + } + switch id { + case FirebaseDeviceVerificationParametersSafetyNetTypeID: + // Decoding firebaseDeviceVerificationParametersSafetyNet#2b96b2f1. + v := FirebaseDeviceVerificationParametersSafetyNet{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode FirebaseDeviceVerificationParametersClass: %w", err) + } + return &v, nil + case FirebaseDeviceVerificationParametersPlayIntegrityTypeID: + // Decoding firebaseDeviceVerificationParametersPlayIntegrity#caf4a58a. + v := FirebaseDeviceVerificationParametersPlayIntegrity{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode FirebaseDeviceVerificationParametersClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode FirebaseDeviceVerificationParametersClass: %w", bin.NewUnexpectedID(id)) + } +} + +// DecodeTDLibJSONFirebaseDeviceVerificationParameters implements binary de-serialization for FirebaseDeviceVerificationParametersClass. +func DecodeTDLibJSONFirebaseDeviceVerificationParameters(buf tdjson.Decoder) (FirebaseDeviceVerificationParametersClass, error) { + id, err := buf.FindTypeID() + if err != nil { + return nil, err + } + switch id { + case "firebaseDeviceVerificationParametersSafetyNet": + // Decoding firebaseDeviceVerificationParametersSafetyNet#2b96b2f1. + v := FirebaseDeviceVerificationParametersSafetyNet{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode FirebaseDeviceVerificationParametersClass: %w", err) + } + return &v, nil + case "firebaseDeviceVerificationParametersPlayIntegrity": + // Decoding firebaseDeviceVerificationParametersPlayIntegrity#caf4a58a. + v := FirebaseDeviceVerificationParametersPlayIntegrity{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode FirebaseDeviceVerificationParametersClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode FirebaseDeviceVerificationParametersClass: %w", tdjson.NewUnexpectedID(id)) + } +} + +// FirebaseDeviceVerificationParameters boxes the FirebaseDeviceVerificationParametersClass providing a helper. +type FirebaseDeviceVerificationParametersBox struct { + FirebaseDeviceVerificationParameters FirebaseDeviceVerificationParametersClass +} + +// Decode implements bin.Decoder for FirebaseDeviceVerificationParametersBox. +func (b *FirebaseDeviceVerificationParametersBox) Decode(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("unable to decode FirebaseDeviceVerificationParametersBox to nil") + } + v, err := DecodeFirebaseDeviceVerificationParameters(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.FirebaseDeviceVerificationParameters = v + return nil +} + +// Encode implements bin.Encode for FirebaseDeviceVerificationParametersBox. +func (b *FirebaseDeviceVerificationParametersBox) Encode(buf *bin.Buffer) error { + if b == nil || b.FirebaseDeviceVerificationParameters == nil { + return fmt.Errorf("unable to encode FirebaseDeviceVerificationParametersClass as nil") + } + return b.FirebaseDeviceVerificationParameters.Encode(buf) +} + +// DecodeTDLibJSON implements bin.Decoder for FirebaseDeviceVerificationParametersBox. +func (b *FirebaseDeviceVerificationParametersBox) DecodeTDLibJSON(buf tdjson.Decoder) error { + if b == nil { + return fmt.Errorf("unable to decode FirebaseDeviceVerificationParametersBox to nil") + } + v, err := DecodeTDLibJSONFirebaseDeviceVerificationParameters(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.FirebaseDeviceVerificationParameters = v + return nil +} + +// EncodeTDLibJSON implements bin.Encode for FirebaseDeviceVerificationParametersBox. +func (b *FirebaseDeviceVerificationParametersBox) EncodeTDLibJSON(buf tdjson.Encoder) error { + if b == nil || b.FirebaseDeviceVerificationParameters == nil { + return fmt.Errorf("unable to encode FirebaseDeviceVerificationParametersClass as nil") + } + return b.FirebaseDeviceVerificationParameters.EncodeTDLibJSON(buf) +} diff --git a/tdapi/tl_get_star_ad_account_url_gen.go b/tdapi/tl_get_star_ad_account_url_gen.go new file mode 100644 index 0000000000..79b2b9ebac --- /dev/null +++ b/tdapi/tl_get_star_ad_account_url_gen.go @@ -0,0 +1,217 @@ +// 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{} +) + +// GetStarAdAccountURLRequest represents TL type `getStarAdAccountUrl#73a9455d`. +type GetStarAdAccountURLRequest struct { + // Identifier of the owner of the Telegram stars; can be identifier of an owned bot, or + // identifier of an owned channel chat + OwnerID MessageSenderClass +} + +// GetStarAdAccountURLRequestTypeID is TL type id of GetStarAdAccountURLRequest. +const GetStarAdAccountURLRequestTypeID = 0x73a9455d + +// Ensuring interfaces in compile-time for GetStarAdAccountURLRequest. +var ( + _ bin.Encoder = &GetStarAdAccountURLRequest{} + _ bin.Decoder = &GetStarAdAccountURLRequest{} + _ bin.BareEncoder = &GetStarAdAccountURLRequest{} + _ bin.BareDecoder = &GetStarAdAccountURLRequest{} +) + +func (g *GetStarAdAccountURLRequest) Zero() bool { + if g == nil { + return true + } + if !(g.OwnerID == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (g *GetStarAdAccountURLRequest) String() string { + if g == nil { + return "GetStarAdAccountURLRequest(nil)" + } + type Alias GetStarAdAccountURLRequest + return fmt.Sprintf("GetStarAdAccountURLRequest%+v", Alias(*g)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*GetStarAdAccountURLRequest) TypeID() uint32 { + return GetStarAdAccountURLRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*GetStarAdAccountURLRequest) TypeName() string { + return "getStarAdAccountUrl" +} + +// TypeInfo returns info about TL type. +func (g *GetStarAdAccountURLRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "getStarAdAccountUrl", + ID: GetStarAdAccountURLRequestTypeID, + } + if g == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "OwnerID", + SchemaName: "owner_id", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (g *GetStarAdAccountURLRequest) Encode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getStarAdAccountUrl#73a9455d as nil") + } + b.PutID(GetStarAdAccountURLRequestTypeID) + return g.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (g *GetStarAdAccountURLRequest) EncodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getStarAdAccountUrl#73a9455d as nil") + } + if g.OwnerID == nil { + return fmt.Errorf("unable to encode getStarAdAccountUrl#73a9455d: field owner_id is nil") + } + if err := g.OwnerID.Encode(b); err != nil { + return fmt.Errorf("unable to encode getStarAdAccountUrl#73a9455d: field owner_id: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (g *GetStarAdAccountURLRequest) Decode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getStarAdAccountUrl#73a9455d to nil") + } + if err := b.ConsumeID(GetStarAdAccountURLRequestTypeID); err != nil { + return fmt.Errorf("unable to decode getStarAdAccountUrl#73a9455d: %w", err) + } + return g.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (g *GetStarAdAccountURLRequest) DecodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getStarAdAccountUrl#73a9455d to nil") + } + { + value, err := DecodeMessageSender(b) + if err != nil { + return fmt.Errorf("unable to decode getStarAdAccountUrl#73a9455d: field owner_id: %w", err) + } + g.OwnerID = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (g *GetStarAdAccountURLRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if g == nil { + return fmt.Errorf("can't encode getStarAdAccountUrl#73a9455d as nil") + } + b.ObjStart() + b.PutID("getStarAdAccountUrl") + b.Comma() + b.FieldStart("owner_id") + if g.OwnerID == nil { + return fmt.Errorf("unable to encode getStarAdAccountUrl#73a9455d: field owner_id is nil") + } + if err := g.OwnerID.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode getStarAdAccountUrl#73a9455d: field owner_id: %w", err) + } + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (g *GetStarAdAccountURLRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if g == nil { + return fmt.Errorf("can't decode getStarAdAccountUrl#73a9455d to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("getStarAdAccountUrl"); err != nil { + return fmt.Errorf("unable to decode getStarAdAccountUrl#73a9455d: %w", err) + } + case "owner_id": + value, err := DecodeTDLibJSONMessageSender(b) + if err != nil { + return fmt.Errorf("unable to decode getStarAdAccountUrl#73a9455d: field owner_id: %w", err) + } + g.OwnerID = value + default: + return b.Skip() + } + return nil + }) +} + +// GetOwnerID returns value of OwnerID field. +func (g *GetStarAdAccountURLRequest) GetOwnerID() (value MessageSenderClass) { + if g == nil { + return + } + return g.OwnerID +} + +// GetStarAdAccountURL invokes method getStarAdAccountUrl#73a9455d returning error if any. +func (c *Client) GetStarAdAccountURL(ctx context.Context, ownerid MessageSenderClass) (*HTTPURL, error) { + var result HTTPURL + + request := &GetStarAdAccountURLRequest{ + OwnerID: ownerid, + } + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return &result, nil +} diff --git a/tdapi/tl_get_star_revenue_statistics_gen.go b/tdapi/tl_get_star_revenue_statistics_gen.go index fcb7694421..b5a4a47a8e 100644 --- a/tdapi/tl_get_star_revenue_statistics_gen.go +++ b/tdapi/tl_get_star_revenue_statistics_gen.go @@ -34,8 +34,7 @@ var ( // GetStarRevenueStatisticsRequest represents TL type `getStarRevenueStatistics#f07b4517`. type GetStarRevenueStatisticsRequest struct { // Identifier of the owner of the Telegram stars; can be identifier of an owned bot, or - // identifier of a channel chat with supergroupFullInfo.can_get_revenue_statistics == - // true + // identifier of an owned channel chat OwnerID MessageSenderClass // Pass true if a dark theme is used by the application IsDark bool diff --git a/tdapi/tl_get_star_withdrawal_url_gen.go b/tdapi/tl_get_star_withdrawal_url_gen.go index 1f6b48eeed..8ba253f0d0 100644 --- a/tdapi/tl_get_star_withdrawal_url_gen.go +++ b/tdapi/tl_get_star_withdrawal_url_gen.go @@ -34,8 +34,7 @@ var ( // GetStarWithdrawalURLRequest represents TL type `getStarWithdrawalUrl#a9d23712`. type GetStarWithdrawalURLRequest struct { // Identifier of the owner of the Telegram stars; can be identifier of an owned bot, or - // identifier of a channel chat with supergroupFullInfo.can_get_revenue_statistics == - // true + // identifier of an owned channel chat OwnerID MessageSenderClass // The number of Telegram stars to withdraw. Must be at least // getOption("star_withdrawal_count_min") diff --git a/tdapi/tl_inline_keyboard_button_type_gen.go b/tdapi/tl_inline_keyboard_button_type_gen.go index 0d0ff4ad24..9a666c691b 100644 --- a/tdapi/tl_inline_keyboard_button_type_gen.go +++ b/tdapi/tl_inline_keyboard_button_type_gen.go @@ -33,7 +33,8 @@ var ( // InlineKeyboardButtonTypeURL represents TL type `inlineKeyboardButtonTypeUrl#4365beac`. type InlineKeyboardButtonTypeURL struct { - // HTTP or tg:// URL to open + // HTTP or tg:// URL to open. If the link is of the type internalLinkTypeWebApp, then the + // button must be marked as a Web App button URL string } diff --git a/tdapi/tl_input_message_content_gen.go b/tdapi/tl_input_message_content_gen.go index 6d6c3f160e..dbe654151f 100644 --- a/tdapi/tl_input_message_content_gen.go +++ b/tdapi/tl_input_message_content_gen.go @@ -285,8 +285,8 @@ type InputMessageAnimation struct { // Animation caption; pass null to use an empty caption; // 0-getOption("message_caption_length_max") characters Caption FormattedText - // True, if caption must be shown above the animation; otherwise, caption must be shown - // below the animation; not supported in secret chats + // True, if the caption must be shown above the animation; otherwise, the caption must be + // shown below the animation; not supported in secret chats ShowCaptionAboveMedia bool // True, if the animation preview must be covered by a spoiler animation; not supported // in secret chats @@ -1370,6 +1370,305 @@ func (i *InputMessageDocument) GetCaption() (value FormattedText) { return i.Caption } +// InputMessagePaidMedia represents TL type `inputMessagePaidMedia#36f9c23c`. +type InputMessagePaidMedia struct { + // The number of stars that must be paid to see the media; + // 1-getOption("paid_media_message_star_count_max") + StarCount int64 + // The content of the paid media + PaidMedia []InputPaidMedia + // 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 + ShowCaptionAboveMedia bool +} + +// InputMessagePaidMediaTypeID is TL type id of InputMessagePaidMedia. +const InputMessagePaidMediaTypeID = 0x36f9c23c + +// construct implements constructor of InputMessageContentClass. +func (i InputMessagePaidMedia) construct() InputMessageContentClass { return &i } + +// Ensuring interfaces in compile-time for InputMessagePaidMedia. +var ( + _ bin.Encoder = &InputMessagePaidMedia{} + _ bin.Decoder = &InputMessagePaidMedia{} + _ bin.BareEncoder = &InputMessagePaidMedia{} + _ bin.BareDecoder = &InputMessagePaidMedia{} + + _ InputMessageContentClass = &InputMessagePaidMedia{} +) + +func (i *InputMessagePaidMedia) Zero() bool { + if i == nil { + return true + } + if !(i.StarCount == 0) { + return false + } + if !(i.PaidMedia == nil) { + return false + } + if !(i.Caption.Zero()) { + return false + } + if !(i.ShowCaptionAboveMedia == false) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (i *InputMessagePaidMedia) String() string { + if i == nil { + return "InputMessagePaidMedia(nil)" + } + type Alias InputMessagePaidMedia + return fmt.Sprintf("InputMessagePaidMedia%+v", Alias(*i)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*InputMessagePaidMedia) TypeID() uint32 { + return InputMessagePaidMediaTypeID +} + +// TypeName returns name of type in TL schema. +func (*InputMessagePaidMedia) TypeName() string { + return "inputMessagePaidMedia" +} + +// TypeInfo returns info about TL type. +func (i *InputMessagePaidMedia) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "inputMessagePaidMedia", + ID: InputMessagePaidMediaTypeID, + } + if i == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "StarCount", + SchemaName: "star_count", + }, + { + Name: "PaidMedia", + SchemaName: "paid_media", + }, + { + Name: "Caption", + SchemaName: "caption", + }, + { + Name: "ShowCaptionAboveMedia", + SchemaName: "show_caption_above_media", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (i *InputMessagePaidMedia) Encode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode inputMessagePaidMedia#36f9c23c as nil") + } + b.PutID(InputMessagePaidMediaTypeID) + return i.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (i *InputMessagePaidMedia) EncodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode inputMessagePaidMedia#36f9c23c as nil") + } + b.PutInt53(i.StarCount) + b.PutInt(len(i.PaidMedia)) + for idx, v := range i.PaidMedia { + if err := v.EncodeBare(b); err != nil { + return fmt.Errorf("unable to encode bare inputMessagePaidMedia#36f9c23c: field paid_media element with index %d: %w", idx, err) + } + } + if err := i.Caption.Encode(b); err != nil { + return fmt.Errorf("unable to encode inputMessagePaidMedia#36f9c23c: field caption: %w", err) + } + b.PutBool(i.ShowCaptionAboveMedia) + return nil +} + +// Decode implements bin.Decoder. +func (i *InputMessagePaidMedia) Decode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode inputMessagePaidMedia#36f9c23c to nil") + } + if err := b.ConsumeID(InputMessagePaidMediaTypeID); err != nil { + return fmt.Errorf("unable to decode inputMessagePaidMedia#36f9c23c: %w", err) + } + return i.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (i *InputMessagePaidMedia) DecodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode inputMessagePaidMedia#36f9c23c to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode inputMessagePaidMedia#36f9c23c: field star_count: %w", err) + } + i.StarCount = value + } + { + headerLen, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode inputMessagePaidMedia#36f9c23c: field paid_media: %w", err) + } + + if headerLen > 0 { + i.PaidMedia = make([]InputPaidMedia, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + var value InputPaidMedia + if err := value.DecodeBare(b); err != nil { + return fmt.Errorf("unable to decode bare inputMessagePaidMedia#36f9c23c: field paid_media: %w", err) + } + i.PaidMedia = append(i.PaidMedia, value) + } + } + { + if err := i.Caption.Decode(b); err != nil { + return fmt.Errorf("unable to decode inputMessagePaidMedia#36f9c23c: field caption: %w", err) + } + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode inputMessagePaidMedia#36f9c23c: field show_caption_above_media: %w", err) + } + i.ShowCaptionAboveMedia = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (i *InputMessagePaidMedia) EncodeTDLibJSON(b tdjson.Encoder) error { + if i == nil { + return fmt.Errorf("can't encode inputMessagePaidMedia#36f9c23c as nil") + } + b.ObjStart() + b.PutID("inputMessagePaidMedia") + b.Comma() + b.FieldStart("star_count") + b.PutInt53(i.StarCount) + b.Comma() + b.FieldStart("paid_media") + b.ArrStart() + for idx, v := range i.PaidMedia { + if err := v.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode inputMessagePaidMedia#36f9c23c: field paid_media element with index %d: %w", idx, err) + } + b.Comma() + } + b.StripComma() + b.ArrEnd() + b.Comma() + b.FieldStart("caption") + if err := i.Caption.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode inputMessagePaidMedia#36f9c23c: field caption: %w", err) + } + b.Comma() + b.FieldStart("show_caption_above_media") + b.PutBool(i.ShowCaptionAboveMedia) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (i *InputMessagePaidMedia) DecodeTDLibJSON(b tdjson.Decoder) error { + if i == nil { + return fmt.Errorf("can't decode inputMessagePaidMedia#36f9c23c to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("inputMessagePaidMedia"); err != nil { + return fmt.Errorf("unable to decode inputMessagePaidMedia#36f9c23c: %w", err) + } + case "star_count": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode inputMessagePaidMedia#36f9c23c: field star_count: %w", err) + } + i.StarCount = value + case "paid_media": + if err := b.Arr(func(b tdjson.Decoder) error { + var value InputPaidMedia + if err := value.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode inputMessagePaidMedia#36f9c23c: field paid_media: %w", err) + } + i.PaidMedia = append(i.PaidMedia, value) + return nil + }); err != nil { + return fmt.Errorf("unable to decode inputMessagePaidMedia#36f9c23c: field paid_media: %w", err) + } + case "caption": + if err := i.Caption.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode inputMessagePaidMedia#36f9c23c: field caption: %w", err) + } + case "show_caption_above_media": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode inputMessagePaidMedia#36f9c23c: field show_caption_above_media: %w", err) + } + i.ShowCaptionAboveMedia = value + default: + return b.Skip() + } + return nil + }) +} + +// GetStarCount returns value of StarCount field. +func (i *InputMessagePaidMedia) GetStarCount() (value int64) { + if i == nil { + return + } + return i.StarCount +} + +// GetPaidMedia returns value of PaidMedia field. +func (i *InputMessagePaidMedia) GetPaidMedia() (value []InputPaidMedia) { + if i == nil { + return + } + return i.PaidMedia +} + +// GetCaption returns value of Caption field. +func (i *InputMessagePaidMedia) GetCaption() (value FormattedText) { + if i == nil { + return + } + return i.Caption +} + +// GetShowCaptionAboveMedia returns value of ShowCaptionAboveMedia field. +func (i *InputMessagePaidMedia) GetShowCaptionAboveMedia() (value bool) { + if i == nil { + return + } + return i.ShowCaptionAboveMedia +} + // InputMessagePhoto represents TL type `inputMessagePhoto#bc78dbcc`. type InputMessagePhoto struct { // Photo to send. The photo must be at most 10 MB in size. The photo's width and height @@ -1387,8 +1686,8 @@ type InputMessagePhoto struct { // Photo caption; pass null to use an empty caption; // 0-getOption("message_caption_length_max") characters Caption FormattedText - // True, if caption must be shown above the photo; otherwise, caption must be shown below - // the photo; not supported in secret chats + // True, if the caption must be shown above the photo; otherwise, the caption must be + // shown below the photo; not supported in secret chats ShowCaptionAboveMedia bool // Photo self-destruct type; pass null if none; private chats only SelfDestructType MessageSelfDestructTypeClass @@ -2188,8 +2487,8 @@ type InputMessageVideo struct { // Video caption; pass null to use an empty caption; // 0-getOption("message_caption_length_max") characters Caption FormattedText - // True, if caption must be shown above the video; otherwise, caption must be shown below - // the video; not supported in secret chats + // True, if the caption must be shown above the video; otherwise, the caption must be + // shown below the video; not supported in secret chats ShowCaptionAboveMedia bool // Video self-destruct type; pass null if none; private chats only SelfDestructType MessageSelfDestructTypeClass @@ -4375,7 +4674,7 @@ func (i *InputMessageGame) GetGameShortName() (value string) { return i.GameShortName } -// InputMessageInvoice represents TL type `inputMessageInvoice#34cd1d60`. +// InputMessageInvoice represents TL type `inputMessageInvoice#babc8f71`. type InputMessageInvoice struct { // Invoice Invoice Invoice @@ -4400,13 +4699,15 @@ type InputMessageInvoice struct { // Unique invoice bot deep link parameter for the generation of this invoice. If empty, // it would be possible to pay directly from forwards of the invoice message StartParameter string - // The content of extended media attached to the invoice. The content of the message to - // be sent. Must be one of the following types: inputMessagePhoto, inputMessageVideo - ExtendedMediaContent InputMessageContentClass + // The content of paid media attached to the invoice; pass null if none + PaidMedia InputPaidMedia + // Paid media caption; pass null to use an empty caption; + // 0-getOption("message_caption_length_max") characters + PaidMediaCaption FormattedText } // InputMessageInvoiceTypeID is TL type id of InputMessageInvoice. -const InputMessageInvoiceTypeID = 0x34cd1d60 +const InputMessageInvoiceTypeID = 0xbabc8f71 // construct implements constructor of InputMessageContentClass. func (i InputMessageInvoice) construct() InputMessageContentClass { return &i } @@ -4458,7 +4759,10 @@ func (i *InputMessageInvoice) Zero() bool { if !(i.StartParameter == "") { return false } - if !(i.ExtendedMediaContent == nil) { + if !(i.PaidMedia.Zero()) { + return false + } + if !(i.PaidMediaCaption.Zero()) { return false } @@ -4542,8 +4846,12 @@ func (i *InputMessageInvoice) TypeInfo() tdp.Type { SchemaName: "start_parameter", }, { - Name: "ExtendedMediaContent", - SchemaName: "extended_media_content", + Name: "PaidMedia", + SchemaName: "paid_media", + }, + { + Name: "PaidMediaCaption", + SchemaName: "paid_media_caption", }, } return typ @@ -4552,7 +4860,7 @@ func (i *InputMessageInvoice) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (i *InputMessageInvoice) Encode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode inputMessageInvoice#34cd1d60 as nil") + return fmt.Errorf("can't encode inputMessageInvoice#babc8f71 as nil") } b.PutID(InputMessageInvoiceTypeID) return i.EncodeBare(b) @@ -4561,10 +4869,10 @@ func (i *InputMessageInvoice) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (i *InputMessageInvoice) EncodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode inputMessageInvoice#34cd1d60 as nil") + return fmt.Errorf("can't encode inputMessageInvoice#babc8f71 as nil") } if err := i.Invoice.Encode(b); err != nil { - return fmt.Errorf("unable to encode inputMessageInvoice#34cd1d60: field invoice: %w", err) + return fmt.Errorf("unable to encode inputMessageInvoice#babc8f71: field invoice: %w", err) } b.PutString(i.Title) b.PutString(i.Description) @@ -4576,11 +4884,11 @@ func (i *InputMessageInvoice) EncodeBare(b *bin.Buffer) error { b.PutString(i.ProviderToken) b.PutString(i.ProviderData) b.PutString(i.StartParameter) - if i.ExtendedMediaContent == nil { - return fmt.Errorf("unable to encode inputMessageInvoice#34cd1d60: field extended_media_content is nil") + if err := i.PaidMedia.Encode(b); err != nil { + return fmt.Errorf("unable to encode inputMessageInvoice#babc8f71: field paid_media: %w", err) } - if err := i.ExtendedMediaContent.Encode(b); err != nil { - return fmt.Errorf("unable to encode inputMessageInvoice#34cd1d60: field extended_media_content: %w", err) + if err := i.PaidMediaCaption.Encode(b); err != nil { + return fmt.Errorf("unable to encode inputMessageInvoice#babc8f71: field paid_media_caption: %w", err) } return nil } @@ -4588,10 +4896,10 @@ func (i *InputMessageInvoice) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (i *InputMessageInvoice) Decode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode inputMessageInvoice#34cd1d60 to nil") + return fmt.Errorf("can't decode inputMessageInvoice#babc8f71 to nil") } if err := b.ConsumeID(InputMessageInvoiceTypeID); err != nil { - return fmt.Errorf("unable to decode inputMessageInvoice#34cd1d60: %w", err) + return fmt.Errorf("unable to decode inputMessageInvoice#babc8f71: %w", err) } return i.DecodeBare(b) } @@ -4599,89 +4907,92 @@ func (i *InputMessageInvoice) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (i *InputMessageInvoice) DecodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode inputMessageInvoice#34cd1d60 to nil") + return fmt.Errorf("can't decode inputMessageInvoice#babc8f71 to nil") } { if err := i.Invoice.Decode(b); err != nil { - return fmt.Errorf("unable to decode inputMessageInvoice#34cd1d60: field invoice: %w", err) + return fmt.Errorf("unable to decode inputMessageInvoice#babc8f71: field invoice: %w", err) } } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode inputMessageInvoice#34cd1d60: field title: %w", err) + return fmt.Errorf("unable to decode inputMessageInvoice#babc8f71: field title: %w", err) } i.Title = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode inputMessageInvoice#34cd1d60: field description: %w", err) + return fmt.Errorf("unable to decode inputMessageInvoice#babc8f71: field description: %w", err) } i.Description = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode inputMessageInvoice#34cd1d60: field photo_url: %w", err) + return fmt.Errorf("unable to decode inputMessageInvoice#babc8f71: field photo_url: %w", err) } i.PhotoURL = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode inputMessageInvoice#34cd1d60: field photo_size: %w", err) + return fmt.Errorf("unable to decode inputMessageInvoice#babc8f71: field photo_size: %w", err) } i.PhotoSize = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode inputMessageInvoice#34cd1d60: field photo_width: %w", err) + return fmt.Errorf("unable to decode inputMessageInvoice#babc8f71: field photo_width: %w", err) } i.PhotoWidth = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode inputMessageInvoice#34cd1d60: field photo_height: %w", err) + return fmt.Errorf("unable to decode inputMessageInvoice#babc8f71: field photo_height: %w", err) } i.PhotoHeight = value } { value, err := b.Bytes() if err != nil { - return fmt.Errorf("unable to decode inputMessageInvoice#34cd1d60: field payload: %w", err) + return fmt.Errorf("unable to decode inputMessageInvoice#babc8f71: field payload: %w", err) } i.Payload = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode inputMessageInvoice#34cd1d60: field provider_token: %w", err) + return fmt.Errorf("unable to decode inputMessageInvoice#babc8f71: field provider_token: %w", err) } i.ProviderToken = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode inputMessageInvoice#34cd1d60: field provider_data: %w", err) + return fmt.Errorf("unable to decode inputMessageInvoice#babc8f71: field provider_data: %w", err) } i.ProviderData = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode inputMessageInvoice#34cd1d60: field start_parameter: %w", err) + return fmt.Errorf("unable to decode inputMessageInvoice#babc8f71: field start_parameter: %w", err) } i.StartParameter = value } { - value, err := DecodeInputMessageContent(b) - if err != nil { - return fmt.Errorf("unable to decode inputMessageInvoice#34cd1d60: field extended_media_content: %w", err) + if err := i.PaidMedia.Decode(b); err != nil { + return fmt.Errorf("unable to decode inputMessageInvoice#babc8f71: field paid_media: %w", err) + } + } + { + if err := i.PaidMediaCaption.Decode(b); err != nil { + return fmt.Errorf("unable to decode inputMessageInvoice#babc8f71: field paid_media_caption: %w", err) } - i.ExtendedMediaContent = value } return nil } @@ -4689,14 +5000,14 @@ func (i *InputMessageInvoice) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (i *InputMessageInvoice) EncodeTDLibJSON(b tdjson.Encoder) error { if i == nil { - return fmt.Errorf("can't encode inputMessageInvoice#34cd1d60 as nil") + return fmt.Errorf("can't encode inputMessageInvoice#babc8f71 as nil") } b.ObjStart() b.PutID("inputMessageInvoice") b.Comma() b.FieldStart("invoice") if err := i.Invoice.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode inputMessageInvoice#34cd1d60: field invoice: %w", err) + return fmt.Errorf("unable to encode inputMessageInvoice#babc8f71: field invoice: %w", err) } b.Comma() b.FieldStart("title") @@ -4729,12 +5040,14 @@ func (i *InputMessageInvoice) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("start_parameter") b.PutString(i.StartParameter) b.Comma() - b.FieldStart("extended_media_content") - if i.ExtendedMediaContent == nil { - return fmt.Errorf("unable to encode inputMessageInvoice#34cd1d60: field extended_media_content is nil") + b.FieldStart("paid_media") + if err := i.PaidMedia.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode inputMessageInvoice#babc8f71: field paid_media: %w", err) } - if err := i.ExtendedMediaContent.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode inputMessageInvoice#34cd1d60: field extended_media_content: %w", err) + b.Comma() + b.FieldStart("paid_media_caption") + if err := i.PaidMediaCaption.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode inputMessageInvoice#babc8f71: field paid_media_caption: %w", err) } b.Comma() b.StripComma() @@ -4745,85 +5058,87 @@ func (i *InputMessageInvoice) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (i *InputMessageInvoice) DecodeTDLibJSON(b tdjson.Decoder) error { if i == nil { - return fmt.Errorf("can't decode inputMessageInvoice#34cd1d60 to nil") + return fmt.Errorf("can't decode inputMessageInvoice#babc8f71 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("inputMessageInvoice"); err != nil { - return fmt.Errorf("unable to decode inputMessageInvoice#34cd1d60: %w", err) + return fmt.Errorf("unable to decode inputMessageInvoice#babc8f71: %w", err) } case "invoice": if err := i.Invoice.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode inputMessageInvoice#34cd1d60: field invoice: %w", err) + return fmt.Errorf("unable to decode inputMessageInvoice#babc8f71: field invoice: %w", err) } case "title": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode inputMessageInvoice#34cd1d60: field title: %w", err) + return fmt.Errorf("unable to decode inputMessageInvoice#babc8f71: field title: %w", err) } i.Title = value case "description": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode inputMessageInvoice#34cd1d60: field description: %w", err) + return fmt.Errorf("unable to decode inputMessageInvoice#babc8f71: field description: %w", err) } i.Description = value case "photo_url": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode inputMessageInvoice#34cd1d60: field photo_url: %w", err) + return fmt.Errorf("unable to decode inputMessageInvoice#babc8f71: field photo_url: %w", err) } i.PhotoURL = value case "photo_size": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode inputMessageInvoice#34cd1d60: field photo_size: %w", err) + return fmt.Errorf("unable to decode inputMessageInvoice#babc8f71: field photo_size: %w", err) } i.PhotoSize = value case "photo_width": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode inputMessageInvoice#34cd1d60: field photo_width: %w", err) + return fmt.Errorf("unable to decode inputMessageInvoice#babc8f71: field photo_width: %w", err) } i.PhotoWidth = value case "photo_height": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode inputMessageInvoice#34cd1d60: field photo_height: %w", err) + return fmt.Errorf("unable to decode inputMessageInvoice#babc8f71: field photo_height: %w", err) } i.PhotoHeight = value case "payload": value, err := b.Bytes() if err != nil { - return fmt.Errorf("unable to decode inputMessageInvoice#34cd1d60: field payload: %w", err) + return fmt.Errorf("unable to decode inputMessageInvoice#babc8f71: field payload: %w", err) } i.Payload = value case "provider_token": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode inputMessageInvoice#34cd1d60: field provider_token: %w", err) + return fmt.Errorf("unable to decode inputMessageInvoice#babc8f71: field provider_token: %w", err) } i.ProviderToken = value case "provider_data": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode inputMessageInvoice#34cd1d60: field provider_data: %w", err) + return fmt.Errorf("unable to decode inputMessageInvoice#babc8f71: field provider_data: %w", err) } i.ProviderData = value case "start_parameter": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode inputMessageInvoice#34cd1d60: field start_parameter: %w", err) + return fmt.Errorf("unable to decode inputMessageInvoice#babc8f71: field start_parameter: %w", err) } i.StartParameter = value - case "extended_media_content": - value, err := DecodeTDLibJSONInputMessageContent(b) - if err != nil { - return fmt.Errorf("unable to decode inputMessageInvoice#34cd1d60: field extended_media_content: %w", err) + case "paid_media": + if err := i.PaidMedia.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode inputMessageInvoice#babc8f71: field paid_media: %w", err) + } + case "paid_media_caption": + if err := i.PaidMediaCaption.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode inputMessageInvoice#babc8f71: field paid_media_caption: %w", err) } - i.ExtendedMediaContent = value default: return b.Skip() } @@ -4919,12 +5234,20 @@ func (i *InputMessageInvoice) GetStartParameter() (value string) { return i.StartParameter } -// GetExtendedMediaContent returns value of ExtendedMediaContent field. -func (i *InputMessageInvoice) GetExtendedMediaContent() (value InputMessageContentClass) { +// GetPaidMedia returns value of PaidMedia field. +func (i *InputMessageInvoice) GetPaidMedia() (value InputPaidMedia) { if i == nil { return } - return i.ExtendedMediaContent + return i.PaidMedia +} + +// GetPaidMediaCaption returns value of PaidMediaCaption field. +func (i *InputMessageInvoice) GetPaidMediaCaption() (value FormattedText) { + if i == nil { + return + } + return i.PaidMediaCaption } // InputMessagePoll represents TL type `inputMessagePoll#9046c716`. @@ -5826,6 +6149,7 @@ const InputMessageContentClassName = "InputMessageContent" // case *tdapi.InputMessageAnimation: // inputMessageAnimation#19fe563 // case *tdapi.InputMessageAudio: // inputMessageAudio#daa400b2 // case *tdapi.InputMessageDocument: // inputMessageDocument#615b72b9 +// case *tdapi.InputMessagePaidMedia: // inputMessagePaidMedia#36f9c23c // case *tdapi.InputMessagePhoto: // inputMessagePhoto#bc78dbcc // case *tdapi.InputMessageSticker: // inputMessageSticker#3ff1b6f9 // case *tdapi.InputMessageVideo: // inputMessageVideo#1a64cc26 @@ -5836,7 +6160,7 @@ const InputMessageContentClassName = "InputMessageContent" // case *tdapi.InputMessageContact: // inputMessageContact#c5710cff // case *tdapi.InputMessageDice: // inputMessageDice#322967a9 // case *tdapi.InputMessageGame: // inputMessageGame#4aae6ae2 -// case *tdapi.InputMessageInvoice: // inputMessageInvoice#34cd1d60 +// case *tdapi.InputMessageInvoice: // inputMessageInvoice#babc8f71 // case *tdapi.InputMessagePoll: // inputMessagePoll#9046c716 // case *tdapi.InputMessageStory: // inputMessageStory#21099d63 // case *tdapi.InputMessageForwarded: // inputMessageForwarded#651a73f8 @@ -5899,6 +6223,13 @@ func DecodeInputMessageContent(buf *bin.Buffer) (InputMessageContentClass, error return nil, fmt.Errorf("unable to decode InputMessageContentClass: %w", err) } return &v, nil + case InputMessagePaidMediaTypeID: + // Decoding inputMessagePaidMedia#36f9c23c. + v := InputMessagePaidMedia{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode InputMessageContentClass: %w", err) + } + return &v, nil case InputMessagePhotoTypeID: // Decoding inputMessagePhoto#bc78dbcc. v := InputMessagePhoto{} @@ -5970,7 +6301,7 @@ func DecodeInputMessageContent(buf *bin.Buffer) (InputMessageContentClass, error } return &v, nil case InputMessageInvoiceTypeID: - // Decoding inputMessageInvoice#34cd1d60. + // Decoding inputMessageInvoice#babc8f71. v := InputMessageInvoice{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode InputMessageContentClass: %w", err) @@ -6037,6 +6368,13 @@ func DecodeTDLibJSONInputMessageContent(buf tdjson.Decoder) (InputMessageContent return nil, fmt.Errorf("unable to decode InputMessageContentClass: %w", err) } return &v, nil + case "inputMessagePaidMedia": + // Decoding inputMessagePaidMedia#36f9c23c. + v := InputMessagePaidMedia{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode InputMessageContentClass: %w", err) + } + return &v, nil case "inputMessagePhoto": // Decoding inputMessagePhoto#bc78dbcc. v := InputMessagePhoto{} @@ -6108,7 +6446,7 @@ func DecodeTDLibJSONInputMessageContent(buf tdjson.Decoder) (InputMessageContent } return &v, nil case "inputMessageInvoice": - // Decoding inputMessageInvoice#34cd1d60. + // Decoding inputMessageInvoice#babc8f71. v := InputMessageInvoice{} if err := v.DecodeTDLibJSON(buf); err != nil { return nil, fmt.Errorf("unable to decode InputMessageContentClass: %w", err) diff --git a/tdapi/tl_input_paid_media_gen.go b/tdapi/tl_input_paid_media_gen.go new file mode 100644 index 0000000000..b09b40c476 --- /dev/null +++ b/tdapi/tl_input_paid_media_gen.go @@ -0,0 +1,407 @@ +// 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{} +) + +// InputPaidMedia represents TL type `inputPaidMedia#19f0fc79`. +type InputPaidMedia struct { + // Type of the media + Type InputPaidMediaTypeClass + // Photo or video to be sent + Media InputFileClass + // Media thumbnail; pass null to skip thumbnail uploading + Thumbnail InputThumbnail + // File identifiers of the stickers added to the media, if applicable + AddedStickerFileIDs []int32 + // Media width + Width int32 + // Media height + Height int32 +} + +// InputPaidMediaTypeID is TL type id of InputPaidMedia. +const InputPaidMediaTypeID = 0x19f0fc79 + +// Ensuring interfaces in compile-time for InputPaidMedia. +var ( + _ bin.Encoder = &InputPaidMedia{} + _ bin.Decoder = &InputPaidMedia{} + _ bin.BareEncoder = &InputPaidMedia{} + _ bin.BareDecoder = &InputPaidMedia{} +) + +func (i *InputPaidMedia) Zero() bool { + if i == nil { + return true + } + if !(i.Type == nil) { + return false + } + if !(i.Media == nil) { + return false + } + if !(i.Thumbnail.Zero()) { + return false + } + if !(i.AddedStickerFileIDs == nil) { + return false + } + if !(i.Width == 0) { + return false + } + if !(i.Height == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (i *InputPaidMedia) String() string { + if i == nil { + return "InputPaidMedia(nil)" + } + type Alias InputPaidMedia + return fmt.Sprintf("InputPaidMedia%+v", Alias(*i)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*InputPaidMedia) TypeID() uint32 { + return InputPaidMediaTypeID +} + +// TypeName returns name of type in TL schema. +func (*InputPaidMedia) TypeName() string { + return "inputPaidMedia" +} + +// TypeInfo returns info about TL type. +func (i *InputPaidMedia) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "inputPaidMedia", + ID: InputPaidMediaTypeID, + } + if i == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Type", + SchemaName: "type", + }, + { + Name: "Media", + SchemaName: "media", + }, + { + Name: "Thumbnail", + SchemaName: "thumbnail", + }, + { + Name: "AddedStickerFileIDs", + SchemaName: "added_sticker_file_ids", + }, + { + Name: "Width", + SchemaName: "width", + }, + { + Name: "Height", + SchemaName: "height", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (i *InputPaidMedia) Encode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode inputPaidMedia#19f0fc79 as nil") + } + b.PutID(InputPaidMediaTypeID) + return i.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (i *InputPaidMedia) EncodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode inputPaidMedia#19f0fc79 as nil") + } + if i.Type == nil { + return fmt.Errorf("unable to encode inputPaidMedia#19f0fc79: field type is nil") + } + if err := i.Type.Encode(b); err != nil { + return fmt.Errorf("unable to encode inputPaidMedia#19f0fc79: field type: %w", err) + } + if i.Media == nil { + return fmt.Errorf("unable to encode inputPaidMedia#19f0fc79: field media is nil") + } + if err := i.Media.Encode(b); err != nil { + return fmt.Errorf("unable to encode inputPaidMedia#19f0fc79: field media: %w", err) + } + if err := i.Thumbnail.Encode(b); err != nil { + return fmt.Errorf("unable to encode inputPaidMedia#19f0fc79: field thumbnail: %w", err) + } + b.PutInt(len(i.AddedStickerFileIDs)) + for _, v := range i.AddedStickerFileIDs { + b.PutInt32(v) + } + b.PutInt32(i.Width) + b.PutInt32(i.Height) + return nil +} + +// Decode implements bin.Decoder. +func (i *InputPaidMedia) Decode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode inputPaidMedia#19f0fc79 to nil") + } + if err := b.ConsumeID(InputPaidMediaTypeID); err != nil { + return fmt.Errorf("unable to decode inputPaidMedia#19f0fc79: %w", err) + } + return i.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (i *InputPaidMedia) DecodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode inputPaidMedia#19f0fc79 to nil") + } + { + value, err := DecodeInputPaidMediaType(b) + if err != nil { + return fmt.Errorf("unable to decode inputPaidMedia#19f0fc79: field type: %w", err) + } + i.Type = value + } + { + value, err := DecodeInputFile(b) + if err != nil { + return fmt.Errorf("unable to decode inputPaidMedia#19f0fc79: field media: %w", err) + } + i.Media = value + } + { + if err := i.Thumbnail.Decode(b); err != nil { + return fmt.Errorf("unable to decode inputPaidMedia#19f0fc79: field thumbnail: %w", err) + } + } + { + headerLen, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode inputPaidMedia#19f0fc79: field added_sticker_file_ids: %w", err) + } + + if headerLen > 0 { + i.AddedStickerFileIDs = make([]int32, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode inputPaidMedia#19f0fc79: field added_sticker_file_ids: %w", err) + } + i.AddedStickerFileIDs = append(i.AddedStickerFileIDs, value) + } + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode inputPaidMedia#19f0fc79: field width: %w", err) + } + i.Width = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode inputPaidMedia#19f0fc79: field height: %w", err) + } + i.Height = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (i *InputPaidMedia) EncodeTDLibJSON(b tdjson.Encoder) error { + if i == nil { + return fmt.Errorf("can't encode inputPaidMedia#19f0fc79 as nil") + } + b.ObjStart() + b.PutID("inputPaidMedia") + b.Comma() + b.FieldStart("type") + if i.Type == nil { + return fmt.Errorf("unable to encode inputPaidMedia#19f0fc79: field type is nil") + } + if err := i.Type.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode inputPaidMedia#19f0fc79: field type: %w", err) + } + b.Comma() + b.FieldStart("media") + if i.Media == nil { + return fmt.Errorf("unable to encode inputPaidMedia#19f0fc79: field media is nil") + } + if err := i.Media.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode inputPaidMedia#19f0fc79: field media: %w", err) + } + b.Comma() + b.FieldStart("thumbnail") + if err := i.Thumbnail.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode inputPaidMedia#19f0fc79: field thumbnail: %w", err) + } + b.Comma() + b.FieldStart("added_sticker_file_ids") + b.ArrStart() + for _, v := range i.AddedStickerFileIDs { + b.PutInt32(v) + b.Comma() + } + b.StripComma() + b.ArrEnd() + b.Comma() + b.FieldStart("width") + b.PutInt32(i.Width) + b.Comma() + b.FieldStart("height") + b.PutInt32(i.Height) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (i *InputPaidMedia) DecodeTDLibJSON(b tdjson.Decoder) error { + if i == nil { + return fmt.Errorf("can't decode inputPaidMedia#19f0fc79 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("inputPaidMedia"); err != nil { + return fmt.Errorf("unable to decode inputPaidMedia#19f0fc79: %w", err) + } + case "type": + value, err := DecodeTDLibJSONInputPaidMediaType(b) + if err != nil { + return fmt.Errorf("unable to decode inputPaidMedia#19f0fc79: field type: %w", err) + } + i.Type = value + case "media": + value, err := DecodeTDLibJSONInputFile(b) + if err != nil { + return fmt.Errorf("unable to decode inputPaidMedia#19f0fc79: field media: %w", err) + } + i.Media = value + case "thumbnail": + if err := i.Thumbnail.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode inputPaidMedia#19f0fc79: field thumbnail: %w", err) + } + case "added_sticker_file_ids": + if err := b.Arr(func(b tdjson.Decoder) error { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode inputPaidMedia#19f0fc79: field added_sticker_file_ids: %w", err) + } + i.AddedStickerFileIDs = append(i.AddedStickerFileIDs, value) + return nil + }); err != nil { + return fmt.Errorf("unable to decode inputPaidMedia#19f0fc79: field added_sticker_file_ids: %w", err) + } + case "width": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode inputPaidMedia#19f0fc79: field width: %w", err) + } + i.Width = value + case "height": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode inputPaidMedia#19f0fc79: field height: %w", err) + } + i.Height = value + default: + return b.Skip() + } + return nil + }) +} + +// GetType returns value of Type field. +func (i *InputPaidMedia) GetType() (value InputPaidMediaTypeClass) { + if i == nil { + return + } + return i.Type +} + +// GetMedia returns value of Media field. +func (i *InputPaidMedia) GetMedia() (value InputFileClass) { + if i == nil { + return + } + return i.Media +} + +// GetThumbnail returns value of Thumbnail field. +func (i *InputPaidMedia) GetThumbnail() (value InputThumbnail) { + if i == nil { + return + } + return i.Thumbnail +} + +// GetAddedStickerFileIDs returns value of AddedStickerFileIDs field. +func (i *InputPaidMedia) GetAddedStickerFileIDs() (value []int32) { + if i == nil { + return + } + return i.AddedStickerFileIDs +} + +// GetWidth returns value of Width field. +func (i *InputPaidMedia) GetWidth() (value int32) { + if i == nil { + return + } + return i.Width +} + +// GetHeight returns value of Height field. +func (i *InputPaidMedia) GetHeight() (value int32) { + if i == nil { + return + } + return i.Height +} diff --git a/tdapi/tl_input_paid_media_type_gen.go b/tdapi/tl_input_paid_media_type_gen.go new file mode 100644 index 0000000000..c9bd8b7935 --- /dev/null +++ b/tdapi/tl_input_paid_media_type_gen.go @@ -0,0 +1,500 @@ +// 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{} +) + +// InputPaidMediaTypePhoto represents TL type `inputPaidMediaTypePhoto#d299fd1a`. +type InputPaidMediaTypePhoto struct { +} + +// InputPaidMediaTypePhotoTypeID is TL type id of InputPaidMediaTypePhoto. +const InputPaidMediaTypePhotoTypeID = 0xd299fd1a + +// construct implements constructor of InputPaidMediaTypeClass. +func (i InputPaidMediaTypePhoto) construct() InputPaidMediaTypeClass { return &i } + +// Ensuring interfaces in compile-time for InputPaidMediaTypePhoto. +var ( + _ bin.Encoder = &InputPaidMediaTypePhoto{} + _ bin.Decoder = &InputPaidMediaTypePhoto{} + _ bin.BareEncoder = &InputPaidMediaTypePhoto{} + _ bin.BareDecoder = &InputPaidMediaTypePhoto{} + + _ InputPaidMediaTypeClass = &InputPaidMediaTypePhoto{} +) + +func (i *InputPaidMediaTypePhoto) Zero() bool { + if i == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (i *InputPaidMediaTypePhoto) String() string { + if i == nil { + return "InputPaidMediaTypePhoto(nil)" + } + type Alias InputPaidMediaTypePhoto + return fmt.Sprintf("InputPaidMediaTypePhoto%+v", Alias(*i)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*InputPaidMediaTypePhoto) TypeID() uint32 { + return InputPaidMediaTypePhotoTypeID +} + +// TypeName returns name of type in TL schema. +func (*InputPaidMediaTypePhoto) TypeName() string { + return "inputPaidMediaTypePhoto" +} + +// TypeInfo returns info about TL type. +func (i *InputPaidMediaTypePhoto) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "inputPaidMediaTypePhoto", + ID: InputPaidMediaTypePhotoTypeID, + } + if i == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (i *InputPaidMediaTypePhoto) Encode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode inputPaidMediaTypePhoto#d299fd1a as nil") + } + b.PutID(InputPaidMediaTypePhotoTypeID) + return i.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (i *InputPaidMediaTypePhoto) EncodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode inputPaidMediaTypePhoto#d299fd1a as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (i *InputPaidMediaTypePhoto) Decode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode inputPaidMediaTypePhoto#d299fd1a to nil") + } + if err := b.ConsumeID(InputPaidMediaTypePhotoTypeID); err != nil { + return fmt.Errorf("unable to decode inputPaidMediaTypePhoto#d299fd1a: %w", err) + } + return i.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (i *InputPaidMediaTypePhoto) DecodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode inputPaidMediaTypePhoto#d299fd1a to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (i *InputPaidMediaTypePhoto) EncodeTDLibJSON(b tdjson.Encoder) error { + if i == nil { + return fmt.Errorf("can't encode inputPaidMediaTypePhoto#d299fd1a as nil") + } + b.ObjStart() + b.PutID("inputPaidMediaTypePhoto") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (i *InputPaidMediaTypePhoto) DecodeTDLibJSON(b tdjson.Decoder) error { + if i == nil { + return fmt.Errorf("can't decode inputPaidMediaTypePhoto#d299fd1a to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("inputPaidMediaTypePhoto"); err != nil { + return fmt.Errorf("unable to decode inputPaidMediaTypePhoto#d299fd1a: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// InputPaidMediaTypeVideo represents TL type `inputPaidMediaTypeVideo#b053f9fc`. +type InputPaidMediaTypeVideo struct { + // Duration of the video, in seconds + Duration int32 + // True, if the video is supposed to be streamed + SupportsStreaming bool +} + +// InputPaidMediaTypeVideoTypeID is TL type id of InputPaidMediaTypeVideo. +const InputPaidMediaTypeVideoTypeID = 0xb053f9fc + +// construct implements constructor of InputPaidMediaTypeClass. +func (i InputPaidMediaTypeVideo) construct() InputPaidMediaTypeClass { return &i } + +// Ensuring interfaces in compile-time for InputPaidMediaTypeVideo. +var ( + _ bin.Encoder = &InputPaidMediaTypeVideo{} + _ bin.Decoder = &InputPaidMediaTypeVideo{} + _ bin.BareEncoder = &InputPaidMediaTypeVideo{} + _ bin.BareDecoder = &InputPaidMediaTypeVideo{} + + _ InputPaidMediaTypeClass = &InputPaidMediaTypeVideo{} +) + +func (i *InputPaidMediaTypeVideo) Zero() bool { + if i == nil { + return true + } + if !(i.Duration == 0) { + return false + } + if !(i.SupportsStreaming == false) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (i *InputPaidMediaTypeVideo) String() string { + if i == nil { + return "InputPaidMediaTypeVideo(nil)" + } + type Alias InputPaidMediaTypeVideo + return fmt.Sprintf("InputPaidMediaTypeVideo%+v", Alias(*i)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*InputPaidMediaTypeVideo) TypeID() uint32 { + return InputPaidMediaTypeVideoTypeID +} + +// TypeName returns name of type in TL schema. +func (*InputPaidMediaTypeVideo) TypeName() string { + return "inputPaidMediaTypeVideo" +} + +// TypeInfo returns info about TL type. +func (i *InputPaidMediaTypeVideo) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "inputPaidMediaTypeVideo", + ID: InputPaidMediaTypeVideoTypeID, + } + if i == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Duration", + SchemaName: "duration", + }, + { + Name: "SupportsStreaming", + SchemaName: "supports_streaming", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (i *InputPaidMediaTypeVideo) Encode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode inputPaidMediaTypeVideo#b053f9fc as nil") + } + b.PutID(InputPaidMediaTypeVideoTypeID) + return i.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (i *InputPaidMediaTypeVideo) EncodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't encode inputPaidMediaTypeVideo#b053f9fc as nil") + } + b.PutInt32(i.Duration) + b.PutBool(i.SupportsStreaming) + return nil +} + +// Decode implements bin.Decoder. +func (i *InputPaidMediaTypeVideo) Decode(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode inputPaidMediaTypeVideo#b053f9fc to nil") + } + if err := b.ConsumeID(InputPaidMediaTypeVideoTypeID); err != nil { + return fmt.Errorf("unable to decode inputPaidMediaTypeVideo#b053f9fc: %w", err) + } + return i.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (i *InputPaidMediaTypeVideo) DecodeBare(b *bin.Buffer) error { + if i == nil { + return fmt.Errorf("can't decode inputPaidMediaTypeVideo#b053f9fc to nil") + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode inputPaidMediaTypeVideo#b053f9fc: field duration: %w", err) + } + i.Duration = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode inputPaidMediaTypeVideo#b053f9fc: field supports_streaming: %w", err) + } + i.SupportsStreaming = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (i *InputPaidMediaTypeVideo) EncodeTDLibJSON(b tdjson.Encoder) error { + if i == nil { + return fmt.Errorf("can't encode inputPaidMediaTypeVideo#b053f9fc as nil") + } + b.ObjStart() + b.PutID("inputPaidMediaTypeVideo") + b.Comma() + b.FieldStart("duration") + b.PutInt32(i.Duration) + b.Comma() + b.FieldStart("supports_streaming") + b.PutBool(i.SupportsStreaming) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (i *InputPaidMediaTypeVideo) DecodeTDLibJSON(b tdjson.Decoder) error { + if i == nil { + return fmt.Errorf("can't decode inputPaidMediaTypeVideo#b053f9fc to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("inputPaidMediaTypeVideo"); err != nil { + return fmt.Errorf("unable to decode inputPaidMediaTypeVideo#b053f9fc: %w", err) + } + case "duration": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode inputPaidMediaTypeVideo#b053f9fc: field duration: %w", err) + } + i.Duration = value + case "supports_streaming": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode inputPaidMediaTypeVideo#b053f9fc: field supports_streaming: %w", err) + } + i.SupportsStreaming = value + default: + return b.Skip() + } + return nil + }) +} + +// GetDuration returns value of Duration field. +func (i *InputPaidMediaTypeVideo) GetDuration() (value int32) { + if i == nil { + return + } + return i.Duration +} + +// GetSupportsStreaming returns value of SupportsStreaming field. +func (i *InputPaidMediaTypeVideo) GetSupportsStreaming() (value bool) { + if i == nil { + return + } + return i.SupportsStreaming +} + +// InputPaidMediaTypeClassName is schema name of InputPaidMediaTypeClass. +const InputPaidMediaTypeClassName = "InputPaidMediaType" + +// InputPaidMediaTypeClass represents InputPaidMediaType generic type. +// +// Example: +// +// g, err := tdapi.DecodeInputPaidMediaType(buf) +// if err != nil { +// panic(err) +// } +// switch v := g.(type) { +// case *tdapi.InputPaidMediaTypePhoto: // inputPaidMediaTypePhoto#d299fd1a +// case *tdapi.InputPaidMediaTypeVideo: // inputPaidMediaTypeVideo#b053f9fc +// default: panic(v) +// } +type InputPaidMediaTypeClass interface { + bin.Encoder + bin.Decoder + bin.BareEncoder + bin.BareDecoder + construct() InputPaidMediaTypeClass + + // 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 +} + +// DecodeInputPaidMediaType implements binary de-serialization for InputPaidMediaTypeClass. +func DecodeInputPaidMediaType(buf *bin.Buffer) (InputPaidMediaTypeClass, error) { + id, err := buf.PeekID() + if err != nil { + return nil, err + } + switch id { + case InputPaidMediaTypePhotoTypeID: + // Decoding inputPaidMediaTypePhoto#d299fd1a. + v := InputPaidMediaTypePhoto{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode InputPaidMediaTypeClass: %w", err) + } + return &v, nil + case InputPaidMediaTypeVideoTypeID: + // Decoding inputPaidMediaTypeVideo#b053f9fc. + v := InputPaidMediaTypeVideo{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode InputPaidMediaTypeClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode InputPaidMediaTypeClass: %w", bin.NewUnexpectedID(id)) + } +} + +// DecodeTDLibJSONInputPaidMediaType implements binary de-serialization for InputPaidMediaTypeClass. +func DecodeTDLibJSONInputPaidMediaType(buf tdjson.Decoder) (InputPaidMediaTypeClass, error) { + id, err := buf.FindTypeID() + if err != nil { + return nil, err + } + switch id { + case "inputPaidMediaTypePhoto": + // Decoding inputPaidMediaTypePhoto#d299fd1a. + v := InputPaidMediaTypePhoto{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode InputPaidMediaTypeClass: %w", err) + } + return &v, nil + case "inputPaidMediaTypeVideo": + // Decoding inputPaidMediaTypeVideo#b053f9fc. + v := InputPaidMediaTypeVideo{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode InputPaidMediaTypeClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode InputPaidMediaTypeClass: %w", tdjson.NewUnexpectedID(id)) + } +} + +// InputPaidMediaType boxes the InputPaidMediaTypeClass providing a helper. +type InputPaidMediaTypeBox struct { + InputPaidMediaType InputPaidMediaTypeClass +} + +// Decode implements bin.Decoder for InputPaidMediaTypeBox. +func (b *InputPaidMediaTypeBox) Decode(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("unable to decode InputPaidMediaTypeBox to nil") + } + v, err := DecodeInputPaidMediaType(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.InputPaidMediaType = v + return nil +} + +// Encode implements bin.Encode for InputPaidMediaTypeBox. +func (b *InputPaidMediaTypeBox) Encode(buf *bin.Buffer) error { + if b == nil || b.InputPaidMediaType == nil { + return fmt.Errorf("unable to encode InputPaidMediaTypeClass as nil") + } + return b.InputPaidMediaType.Encode(buf) +} + +// DecodeTDLibJSON implements bin.Decoder for InputPaidMediaTypeBox. +func (b *InputPaidMediaTypeBox) DecodeTDLibJSON(buf tdjson.Decoder) error { + if b == nil { + return fmt.Errorf("unable to decode InputPaidMediaTypeBox to nil") + } + v, err := DecodeTDLibJSONInputPaidMediaType(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.InputPaidMediaType = v + return nil +} + +// EncodeTDLibJSON implements bin.Encode for InputPaidMediaTypeBox. +func (b *InputPaidMediaTypeBox) EncodeTDLibJSON(buf tdjson.Encoder) error { + if b == nil || b.InputPaidMediaType == nil { + return fmt.Errorf("unable to encode InputPaidMediaTypeClass as nil") + } + return b.InputPaidMediaType.EncodeTDLibJSON(buf) +} diff --git a/tdapi/tl_internal_link_type_gen.go b/tdapi/tl_internal_link_type_gen.go index e58cfb8502..687138e5f3 100644 --- a/tdapi/tl_internal_link_type_gen.go +++ b/tdapi/tl_internal_link_type_gen.go @@ -5797,16 +5797,18 @@ func (i *InternalLinkTypeSettings) DecodeTDLibJSON(b tdjson.Decoder) error { }) } -// InternalLinkTypeSideMenuBot represents TL type `internalLinkTypeSideMenuBot#a260e77d`. +// InternalLinkTypeSideMenuBot represents TL type `internalLinkTypeSideMenuBot#c45f0c16`. type InternalLinkTypeSideMenuBot struct { // Username of the bot BotUsername string // URL to be passed to getWebAppUrl URL string + // True, if the Web App must be opened in a compact mode instead of a full-size mode + IsCompact bool } // InternalLinkTypeSideMenuBotTypeID is TL type id of InternalLinkTypeSideMenuBot. -const InternalLinkTypeSideMenuBotTypeID = 0xa260e77d +const InternalLinkTypeSideMenuBotTypeID = 0xc45f0c16 // construct implements constructor of InternalLinkTypeClass. func (i InternalLinkTypeSideMenuBot) construct() InternalLinkTypeClass { return &i } @@ -5831,6 +5833,9 @@ func (i *InternalLinkTypeSideMenuBot) Zero() bool { if !(i.URL == "") { return false } + if !(i.IsCompact == false) { + return false + } return true } @@ -5875,6 +5880,10 @@ func (i *InternalLinkTypeSideMenuBot) TypeInfo() tdp.Type { Name: "URL", SchemaName: "url", }, + { + Name: "IsCompact", + SchemaName: "is_compact", + }, } return typ } @@ -5882,7 +5891,7 @@ func (i *InternalLinkTypeSideMenuBot) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (i *InternalLinkTypeSideMenuBot) Encode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode internalLinkTypeSideMenuBot#a260e77d as nil") + return fmt.Errorf("can't encode internalLinkTypeSideMenuBot#c45f0c16 as nil") } b.PutID(InternalLinkTypeSideMenuBotTypeID) return i.EncodeBare(b) @@ -5891,20 +5900,21 @@ func (i *InternalLinkTypeSideMenuBot) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (i *InternalLinkTypeSideMenuBot) EncodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode internalLinkTypeSideMenuBot#a260e77d as nil") + return fmt.Errorf("can't encode internalLinkTypeSideMenuBot#c45f0c16 as nil") } b.PutString(i.BotUsername) b.PutString(i.URL) + b.PutBool(i.IsCompact) return nil } // Decode implements bin.Decoder. func (i *InternalLinkTypeSideMenuBot) Decode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode internalLinkTypeSideMenuBot#a260e77d to nil") + return fmt.Errorf("can't decode internalLinkTypeSideMenuBot#c45f0c16 to nil") } if err := b.ConsumeID(InternalLinkTypeSideMenuBotTypeID); err != nil { - return fmt.Errorf("unable to decode internalLinkTypeSideMenuBot#a260e77d: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeSideMenuBot#c45f0c16: %w", err) } return i.DecodeBare(b) } @@ -5912,29 +5922,36 @@ func (i *InternalLinkTypeSideMenuBot) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (i *InternalLinkTypeSideMenuBot) DecodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode internalLinkTypeSideMenuBot#a260e77d to nil") + return fmt.Errorf("can't decode internalLinkTypeSideMenuBot#c45f0c16 to nil") } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode internalLinkTypeSideMenuBot#a260e77d: field bot_username: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeSideMenuBot#c45f0c16: field bot_username: %w", err) } i.BotUsername = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode internalLinkTypeSideMenuBot#a260e77d: field url: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeSideMenuBot#c45f0c16: field url: %w", err) } i.URL = value } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode internalLinkTypeSideMenuBot#c45f0c16: field is_compact: %w", err) + } + i.IsCompact = value + } return nil } // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (i *InternalLinkTypeSideMenuBot) EncodeTDLibJSON(b tdjson.Encoder) error { if i == nil { - return fmt.Errorf("can't encode internalLinkTypeSideMenuBot#a260e77d as nil") + return fmt.Errorf("can't encode internalLinkTypeSideMenuBot#c45f0c16 as nil") } b.ObjStart() b.PutID("internalLinkTypeSideMenuBot") @@ -5945,6 +5962,9 @@ func (i *InternalLinkTypeSideMenuBot) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("url") b.PutString(i.URL) b.Comma() + b.FieldStart("is_compact") + b.PutBool(i.IsCompact) + b.Comma() b.StripComma() b.ObjEnd() return nil @@ -5953,27 +5973,33 @@ func (i *InternalLinkTypeSideMenuBot) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (i *InternalLinkTypeSideMenuBot) DecodeTDLibJSON(b tdjson.Decoder) error { if i == nil { - return fmt.Errorf("can't decode internalLinkTypeSideMenuBot#a260e77d to nil") + return fmt.Errorf("can't decode internalLinkTypeSideMenuBot#c45f0c16 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("internalLinkTypeSideMenuBot"); err != nil { - return fmt.Errorf("unable to decode internalLinkTypeSideMenuBot#a260e77d: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeSideMenuBot#c45f0c16: %w", err) } case "bot_username": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode internalLinkTypeSideMenuBot#a260e77d: field bot_username: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeSideMenuBot#c45f0c16: field bot_username: %w", err) } i.BotUsername = value case "url": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode internalLinkTypeSideMenuBot#a260e77d: field url: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeSideMenuBot#c45f0c16: field url: %w", err) } i.URL = value + case "is_compact": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode internalLinkTypeSideMenuBot#c45f0c16: field is_compact: %w", err) + } + i.IsCompact = value default: return b.Skip() } @@ -5997,6 +6023,14 @@ func (i *InternalLinkTypeSideMenuBot) GetURL() (value string) { return i.URL } +// GetIsCompact returns value of IsCompact field. +func (i *InternalLinkTypeSideMenuBot) GetIsCompact() (value bool) { + if i == nil { + return + } + return i.IsCompact +} + // InternalLinkTypeStickerSet represents TL type `internalLinkTypeStickerSet#a1464fa2`. type InternalLinkTypeStickerSet struct { // Name of the sticker set @@ -7593,7 +7627,7 @@ func (i *InternalLinkTypeVideoChat) GetIsLiveStream() (value bool) { return i.IsLiveStream } -// InternalLinkTypeWebApp represents TL type `internalLinkTypeWebApp#fc98d04f`. +// InternalLinkTypeWebApp represents TL type `internalLinkTypeWebApp#4c68bb0d`. type InternalLinkTypeWebApp struct { // Username of the bot that owns the Web App BotUsername string @@ -7601,10 +7635,12 @@ type InternalLinkTypeWebApp struct { WebAppShortName string // Start parameter to be passed to getWebAppLinkUrl StartParameter string + // True, if the Web App must be opened in a compact mode instead of a full-size mode + IsCompact bool } // InternalLinkTypeWebAppTypeID is TL type id of InternalLinkTypeWebApp. -const InternalLinkTypeWebAppTypeID = 0xfc98d04f +const InternalLinkTypeWebAppTypeID = 0x4c68bb0d // construct implements constructor of InternalLinkTypeClass. func (i InternalLinkTypeWebApp) construct() InternalLinkTypeClass { return &i } @@ -7632,6 +7668,9 @@ func (i *InternalLinkTypeWebApp) Zero() bool { if !(i.StartParameter == "") { return false } + if !(i.IsCompact == false) { + return false + } return true } @@ -7680,6 +7719,10 @@ func (i *InternalLinkTypeWebApp) TypeInfo() tdp.Type { Name: "StartParameter", SchemaName: "start_parameter", }, + { + Name: "IsCompact", + SchemaName: "is_compact", + }, } return typ } @@ -7687,7 +7730,7 @@ func (i *InternalLinkTypeWebApp) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (i *InternalLinkTypeWebApp) Encode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode internalLinkTypeWebApp#fc98d04f as nil") + return fmt.Errorf("can't encode internalLinkTypeWebApp#4c68bb0d as nil") } b.PutID(InternalLinkTypeWebAppTypeID) return i.EncodeBare(b) @@ -7696,21 +7739,22 @@ func (i *InternalLinkTypeWebApp) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (i *InternalLinkTypeWebApp) EncodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode internalLinkTypeWebApp#fc98d04f as nil") + return fmt.Errorf("can't encode internalLinkTypeWebApp#4c68bb0d as nil") } b.PutString(i.BotUsername) b.PutString(i.WebAppShortName) b.PutString(i.StartParameter) + b.PutBool(i.IsCompact) return nil } // Decode implements bin.Decoder. func (i *InternalLinkTypeWebApp) Decode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode internalLinkTypeWebApp#fc98d04f to nil") + return fmt.Errorf("can't decode internalLinkTypeWebApp#4c68bb0d to nil") } if err := b.ConsumeID(InternalLinkTypeWebAppTypeID); err != nil { - return fmt.Errorf("unable to decode internalLinkTypeWebApp#fc98d04f: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeWebApp#4c68bb0d: %w", err) } return i.DecodeBare(b) } @@ -7718,36 +7762,43 @@ func (i *InternalLinkTypeWebApp) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (i *InternalLinkTypeWebApp) DecodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode internalLinkTypeWebApp#fc98d04f to nil") + return fmt.Errorf("can't decode internalLinkTypeWebApp#4c68bb0d to nil") } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode internalLinkTypeWebApp#fc98d04f: field bot_username: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeWebApp#4c68bb0d: field bot_username: %w", err) } i.BotUsername = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode internalLinkTypeWebApp#fc98d04f: field web_app_short_name: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeWebApp#4c68bb0d: field web_app_short_name: %w", err) } i.WebAppShortName = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode internalLinkTypeWebApp#fc98d04f: field start_parameter: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeWebApp#4c68bb0d: field start_parameter: %w", err) } i.StartParameter = value } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode internalLinkTypeWebApp#4c68bb0d: field is_compact: %w", err) + } + i.IsCompact = value + } return nil } // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (i *InternalLinkTypeWebApp) EncodeTDLibJSON(b tdjson.Encoder) error { if i == nil { - return fmt.Errorf("can't encode internalLinkTypeWebApp#fc98d04f as nil") + return fmt.Errorf("can't encode internalLinkTypeWebApp#4c68bb0d as nil") } b.ObjStart() b.PutID("internalLinkTypeWebApp") @@ -7761,6 +7812,9 @@ func (i *InternalLinkTypeWebApp) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("start_parameter") b.PutString(i.StartParameter) b.Comma() + b.FieldStart("is_compact") + b.PutBool(i.IsCompact) + b.Comma() b.StripComma() b.ObjEnd() return nil @@ -7769,33 +7823,39 @@ func (i *InternalLinkTypeWebApp) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (i *InternalLinkTypeWebApp) DecodeTDLibJSON(b tdjson.Decoder) error { if i == nil { - return fmt.Errorf("can't decode internalLinkTypeWebApp#fc98d04f to nil") + return fmt.Errorf("can't decode internalLinkTypeWebApp#4c68bb0d to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("internalLinkTypeWebApp"); err != nil { - return fmt.Errorf("unable to decode internalLinkTypeWebApp#fc98d04f: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeWebApp#4c68bb0d: %w", err) } case "bot_username": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode internalLinkTypeWebApp#fc98d04f: field bot_username: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeWebApp#4c68bb0d: field bot_username: %w", err) } i.BotUsername = value case "web_app_short_name": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode internalLinkTypeWebApp#fc98d04f: field web_app_short_name: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeWebApp#4c68bb0d: field web_app_short_name: %w", err) } i.WebAppShortName = value case "start_parameter": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode internalLinkTypeWebApp#fc98d04f: field start_parameter: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeWebApp#4c68bb0d: field start_parameter: %w", err) } i.StartParameter = value + case "is_compact": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode internalLinkTypeWebApp#4c68bb0d: field is_compact: %w", err) + } + i.IsCompact = value default: return b.Skip() } @@ -7827,6 +7887,14 @@ func (i *InternalLinkTypeWebApp) GetStartParameter() (value string) { return i.StartParameter } +// GetIsCompact returns value of IsCompact field. +func (i *InternalLinkTypeWebApp) GetIsCompact() (value bool) { + if i == nil { + return + } + return i.IsCompact +} + // InternalLinkTypeClassName is schema name of InternalLinkTypeClass. const InternalLinkTypeClassName = "InternalLinkType" @@ -7872,7 +7940,7 @@ const InternalLinkTypeClassName = "InternalLinkType" // case *tdapi.InternalLinkTypeQrCodeAuthentication: // internalLinkTypeQrCodeAuthentication#bf121924 // case *tdapi.InternalLinkTypeRestorePurchases: // internalLinkTypeRestorePurchases#24203483 // case *tdapi.InternalLinkTypeSettings: // internalLinkTypeSettings#177545b4 -// case *tdapi.InternalLinkTypeSideMenuBot: // internalLinkTypeSideMenuBot#a260e77d +// case *tdapi.InternalLinkTypeSideMenuBot: // internalLinkTypeSideMenuBot#c45f0c16 // case *tdapi.InternalLinkTypeStickerSet: // internalLinkTypeStickerSet#a1464fa2 // case *tdapi.InternalLinkTypeStory: // internalLinkTypeStory#57bce647 // case *tdapi.InternalLinkTypeTheme: // internalLinkTypeTheme#f405f807 @@ -7882,7 +7950,7 @@ const InternalLinkTypeClassName = "InternalLinkType" // case *tdapi.InternalLinkTypeUserPhoneNumber: // internalLinkTypeUserPhoneNumber#77c08091 // case *tdapi.InternalLinkTypeUserToken: // internalLinkTypeUserToken#a8d7db59 // case *tdapi.InternalLinkTypeVideoChat: // internalLinkTypeVideoChat#8796f8b4 -// case *tdapi.InternalLinkTypeWebApp: // internalLinkTypeWebApp#fc98d04f +// case *tdapi.InternalLinkTypeWebApp: // internalLinkTypeWebApp#4c68bb0d // default: panic(v) // } type InternalLinkTypeClass interface { @@ -8146,7 +8214,7 @@ func DecodeInternalLinkType(buf *bin.Buffer) (InternalLinkTypeClass, error) { } return &v, nil case InternalLinkTypeSideMenuBotTypeID: - // Decoding internalLinkTypeSideMenuBot#a260e77d. + // Decoding internalLinkTypeSideMenuBot#c45f0c16. v := InternalLinkTypeSideMenuBot{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode InternalLinkTypeClass: %w", err) @@ -8216,7 +8284,7 @@ func DecodeInternalLinkType(buf *bin.Buffer) (InternalLinkTypeClass, error) { } return &v, nil case InternalLinkTypeWebAppTypeID: - // Decoding internalLinkTypeWebApp#fc98d04f. + // Decoding internalLinkTypeWebApp#4c68bb0d. v := InternalLinkTypeWebApp{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode InternalLinkTypeClass: %w", err) @@ -8466,7 +8534,7 @@ func DecodeTDLibJSONInternalLinkType(buf tdjson.Decoder) (InternalLinkTypeClass, } return &v, nil case "internalLinkTypeSideMenuBot": - // Decoding internalLinkTypeSideMenuBot#a260e77d. + // Decoding internalLinkTypeSideMenuBot#c45f0c16. v := InternalLinkTypeSideMenuBot{} if err := v.DecodeTDLibJSON(buf); err != nil { return nil, fmt.Errorf("unable to decode InternalLinkTypeClass: %w", err) @@ -8536,7 +8604,7 @@ func DecodeTDLibJSONInternalLinkType(buf tdjson.Decoder) (InternalLinkTypeClass, } return &v, nil case "internalLinkTypeWebApp": - // Decoding internalLinkTypeWebApp#fc98d04f. + // Decoding internalLinkTypeWebApp#4c68bb0d. v := InternalLinkTypeWebApp{} if err := v.DecodeTDLibJSON(buf); err != nil { return nil, fmt.Errorf("unable to decode InternalLinkTypeClass: %w", err) diff --git a/tdapi/tl_message_content_gen.go b/tdapi/tl_message_content_gen.go index 0793ec27f3..cdf52999c1 100644 --- a/tdapi/tl_message_content_gen.go +++ b/tdapi/tl_message_content_gen.go @@ -272,8 +272,8 @@ type MessageAnimation struct { Animation Animation // Animation caption Caption FormattedText - // True, if caption must be shown above the animation; otherwise, caption must be shown - // below the animation + // True, if the caption must be shown above the animation; otherwise, the caption must be + // shown below the animation ShowCaptionAboveMedia bool // True, if the animation preview must be covered by a spoiler animation HasSpoiler bool @@ -970,14 +970,317 @@ func (m *MessageDocument) GetCaption() (value FormattedText) { return m.Caption } +// MessagePaidMedia represents TL type `messagePaidMedia#3e5fd7c2`. +type MessagePaidMedia struct { + // Number of stars needed to buy access to the media in the message + StarCount int64 + // Information about the media + Media []PaidMediaClass + // Media caption + Caption FormattedText + // True, if the caption must be shown above the media; otherwise, the caption must be + // shown below the media + ShowCaptionAboveMedia bool +} + +// MessagePaidMediaTypeID is TL type id of MessagePaidMedia. +const MessagePaidMediaTypeID = 0x3e5fd7c2 + +// construct implements constructor of MessageContentClass. +func (m MessagePaidMedia) construct() MessageContentClass { return &m } + +// Ensuring interfaces in compile-time for MessagePaidMedia. +var ( + _ bin.Encoder = &MessagePaidMedia{} + _ bin.Decoder = &MessagePaidMedia{} + _ bin.BareEncoder = &MessagePaidMedia{} + _ bin.BareDecoder = &MessagePaidMedia{} + + _ MessageContentClass = &MessagePaidMedia{} +) + +func (m *MessagePaidMedia) Zero() bool { + if m == nil { + return true + } + if !(m.StarCount == 0) { + return false + } + if !(m.Media == nil) { + return false + } + if !(m.Caption.Zero()) { + return false + } + if !(m.ShowCaptionAboveMedia == false) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (m *MessagePaidMedia) String() string { + if m == nil { + return "MessagePaidMedia(nil)" + } + type Alias MessagePaidMedia + return fmt.Sprintf("MessagePaidMedia%+v", Alias(*m)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*MessagePaidMedia) TypeID() uint32 { + return MessagePaidMediaTypeID +} + +// TypeName returns name of type in TL schema. +func (*MessagePaidMedia) TypeName() string { + return "messagePaidMedia" +} + +// TypeInfo returns info about TL type. +func (m *MessagePaidMedia) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "messagePaidMedia", + ID: MessagePaidMediaTypeID, + } + if m == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "StarCount", + SchemaName: "star_count", + }, + { + Name: "Media", + SchemaName: "media", + }, + { + Name: "Caption", + SchemaName: "caption", + }, + { + Name: "ShowCaptionAboveMedia", + SchemaName: "show_caption_above_media", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (m *MessagePaidMedia) Encode(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't encode messagePaidMedia#3e5fd7c2 as nil") + } + b.PutID(MessagePaidMediaTypeID) + return m.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (m *MessagePaidMedia) EncodeBare(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't encode messagePaidMedia#3e5fd7c2 as nil") + } + b.PutInt53(m.StarCount) + b.PutInt(len(m.Media)) + for idx, v := range m.Media { + if v == nil { + return fmt.Errorf("unable to encode messagePaidMedia#3e5fd7c2: field media element with index %d is nil", idx) + } + if err := v.EncodeBare(b); err != nil { + return fmt.Errorf("unable to encode bare messagePaidMedia#3e5fd7c2: field media element with index %d: %w", idx, err) + } + } + if err := m.Caption.Encode(b); err != nil { + return fmt.Errorf("unable to encode messagePaidMedia#3e5fd7c2: field caption: %w", err) + } + b.PutBool(m.ShowCaptionAboveMedia) + return nil +} + +// Decode implements bin.Decoder. +func (m *MessagePaidMedia) Decode(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't decode messagePaidMedia#3e5fd7c2 to nil") + } + if err := b.ConsumeID(MessagePaidMediaTypeID); err != nil { + return fmt.Errorf("unable to decode messagePaidMedia#3e5fd7c2: %w", err) + } + return m.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (m *MessagePaidMedia) DecodeBare(b *bin.Buffer) error { + if m == nil { + return fmt.Errorf("can't decode messagePaidMedia#3e5fd7c2 to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode messagePaidMedia#3e5fd7c2: field star_count: %w", err) + } + m.StarCount = value + } + { + headerLen, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode messagePaidMedia#3e5fd7c2: field media: %w", err) + } + + if headerLen > 0 { + m.Media = make([]PaidMediaClass, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + value, err := DecodePaidMedia(b) + if err != nil { + return fmt.Errorf("unable to decode messagePaidMedia#3e5fd7c2: field media: %w", err) + } + m.Media = append(m.Media, value) + } + } + { + if err := m.Caption.Decode(b); err != nil { + return fmt.Errorf("unable to decode messagePaidMedia#3e5fd7c2: field caption: %w", err) + } + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode messagePaidMedia#3e5fd7c2: field show_caption_above_media: %w", err) + } + m.ShowCaptionAboveMedia = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (m *MessagePaidMedia) EncodeTDLibJSON(b tdjson.Encoder) error { + if m == nil { + return fmt.Errorf("can't encode messagePaidMedia#3e5fd7c2 as nil") + } + b.ObjStart() + b.PutID("messagePaidMedia") + b.Comma() + b.FieldStart("star_count") + b.PutInt53(m.StarCount) + b.Comma() + b.FieldStart("media") + b.ArrStart() + for idx, v := range m.Media { + if v == nil { + return fmt.Errorf("unable to encode messagePaidMedia#3e5fd7c2: field media element with index %d is nil", idx) + } + if err := v.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode messagePaidMedia#3e5fd7c2: field media 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 messagePaidMedia#3e5fd7c2: field caption: %w", err) + } + b.Comma() + b.FieldStart("show_caption_above_media") + b.PutBool(m.ShowCaptionAboveMedia) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (m *MessagePaidMedia) DecodeTDLibJSON(b tdjson.Decoder) error { + if m == nil { + return fmt.Errorf("can't decode messagePaidMedia#3e5fd7c2 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("messagePaidMedia"); err != nil { + return fmt.Errorf("unable to decode messagePaidMedia#3e5fd7c2: %w", err) + } + case "star_count": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode messagePaidMedia#3e5fd7c2: field star_count: %w", err) + } + m.StarCount = value + case "media": + if err := b.Arr(func(b tdjson.Decoder) error { + value, err := DecodeTDLibJSONPaidMedia(b) + if err != nil { + return fmt.Errorf("unable to decode messagePaidMedia#3e5fd7c2: field media: %w", err) + } + m.Media = append(m.Media, value) + return nil + }); err != nil { + return fmt.Errorf("unable to decode messagePaidMedia#3e5fd7c2: field media: %w", err) + } + case "caption": + if err := m.Caption.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode messagePaidMedia#3e5fd7c2: field caption: %w", err) + } + case "show_caption_above_media": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode messagePaidMedia#3e5fd7c2: field show_caption_above_media: %w", err) + } + m.ShowCaptionAboveMedia = value + default: + return b.Skip() + } + return nil + }) +} + +// GetStarCount returns value of StarCount field. +func (m *MessagePaidMedia) GetStarCount() (value int64) { + if m == nil { + return + } + return m.StarCount +} + +// GetMedia returns value of Media field. +func (m *MessagePaidMedia) GetMedia() (value []PaidMediaClass) { + if m == nil { + return + } + return m.Media +} + +// GetCaption returns value of Caption field. +func (m *MessagePaidMedia) GetCaption() (value FormattedText) { + if m == nil { + return + } + return m.Caption +} + +// GetShowCaptionAboveMedia returns value of ShowCaptionAboveMedia field. +func (m *MessagePaidMedia) GetShowCaptionAboveMedia() (value bool) { + if m == nil { + return + } + return m.ShowCaptionAboveMedia +} + // MessagePhoto represents TL type `messagePhoto#754c7e1f`. type MessagePhoto struct { // The photo Photo Photo // Photo caption Caption FormattedText - // True, if caption must be shown above the photo; otherwise, caption must be shown below - // the photo + // True, if the caption must be shown above the photo; otherwise, the caption must be + // shown below the photo ShowCaptionAboveMedia bool // True, if the photo preview must be covered by a spoiler animation HasSpoiler bool @@ -1479,8 +1782,8 @@ type MessageVideo struct { Video Video // Video caption Caption FormattedText - // True, if caption must be shown above the video; otherwise, caption must be shown below - // the video + // True, if the caption must be shown above the video; otherwise, the caption must be + // shown below the video ShowCaptionAboveMedia bool // True, if the video preview must be covered by a spoiler animation HasSpoiler bool @@ -4501,7 +4804,7 @@ func (m *MessageStory) GetViaMention() (value bool) { return m.ViaMention } -// MessageInvoice represents TL type `messageInvoice#d8201a53`. +// MessageInvoice represents TL type `messageInvoice#fadfd46`. type MessageInvoice struct { // Information about the product ProductInfo ProductInfo @@ -4517,12 +4820,14 @@ type MessageInvoice struct { NeedShippingAddress bool // The identifier of the message with the receipt, after the product has been purchased ReceiptMessageID int64 - // Extended media attached to the invoice; may be null - ExtendedMedia MessageExtendedMediaClass + // Extended media attached to the invoice; may be null if none + PaidMedia PaidMediaClass + // Extended media caption; may be null if none + PaidMediaCaption FormattedText } // MessageInvoiceTypeID is TL type id of MessageInvoice. -const MessageInvoiceTypeID = 0xd8201a53 +const MessageInvoiceTypeID = 0xfadfd46 // construct implements constructor of MessageContentClass. func (m MessageInvoice) construct() MessageContentClass { return &m } @@ -4562,7 +4867,10 @@ func (m *MessageInvoice) Zero() bool { if !(m.ReceiptMessageID == 0) { return false } - if !(m.ExtendedMedia == nil) { + if !(m.PaidMedia == nil) { + return false + } + if !(m.PaidMediaCaption.Zero()) { return false } @@ -4630,8 +4938,12 @@ func (m *MessageInvoice) TypeInfo() tdp.Type { SchemaName: "receipt_message_id", }, { - Name: "ExtendedMedia", - SchemaName: "extended_media", + Name: "PaidMedia", + SchemaName: "paid_media", + }, + { + Name: "PaidMediaCaption", + SchemaName: "paid_media_caption", }, } return typ @@ -4640,7 +4952,7 @@ func (m *MessageInvoice) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (m *MessageInvoice) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageInvoice#d8201a53 as nil") + return fmt.Errorf("can't encode messageInvoice#fadfd46 as nil") } b.PutID(MessageInvoiceTypeID) return m.EncodeBare(b) @@ -4649,10 +4961,10 @@ func (m *MessageInvoice) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (m *MessageInvoice) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messageInvoice#d8201a53 as nil") + return fmt.Errorf("can't encode messageInvoice#fadfd46 as nil") } if err := m.ProductInfo.Encode(b); err != nil { - return fmt.Errorf("unable to encode messageInvoice#d8201a53: field product_info: %w", err) + return fmt.Errorf("unable to encode messageInvoice#fadfd46: field product_info: %w", err) } b.PutString(m.Currency) b.PutInt53(m.TotalAmount) @@ -4660,11 +4972,14 @@ func (m *MessageInvoice) EncodeBare(b *bin.Buffer) error { b.PutBool(m.IsTest) b.PutBool(m.NeedShippingAddress) b.PutInt53(m.ReceiptMessageID) - if m.ExtendedMedia == nil { - return fmt.Errorf("unable to encode messageInvoice#d8201a53: field extended_media is nil") + if m.PaidMedia == nil { + return fmt.Errorf("unable to encode messageInvoice#fadfd46: field paid_media is nil") + } + if err := m.PaidMedia.Encode(b); err != nil { + return fmt.Errorf("unable to encode messageInvoice#fadfd46: field paid_media: %w", err) } - if err := m.ExtendedMedia.Encode(b); err != nil { - return fmt.Errorf("unable to encode messageInvoice#d8201a53: field extended_media: %w", err) + if err := m.PaidMediaCaption.Encode(b); err != nil { + return fmt.Errorf("unable to encode messageInvoice#fadfd46: field paid_media_caption: %w", err) } return nil } @@ -4672,10 +4987,10 @@ func (m *MessageInvoice) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (m *MessageInvoice) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageInvoice#d8201a53 to nil") + return fmt.Errorf("can't decode messageInvoice#fadfd46 to nil") } if err := b.ConsumeID(MessageInvoiceTypeID); err != nil { - return fmt.Errorf("unable to decode messageInvoice#d8201a53: %w", err) + return fmt.Errorf("unable to decode messageInvoice#fadfd46: %w", err) } return m.DecodeBare(b) } @@ -4683,61 +4998,66 @@ func (m *MessageInvoice) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (m *MessageInvoice) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messageInvoice#d8201a53 to nil") + return fmt.Errorf("can't decode messageInvoice#fadfd46 to nil") } { if err := m.ProductInfo.Decode(b); err != nil { - return fmt.Errorf("unable to decode messageInvoice#d8201a53: field product_info: %w", err) + return fmt.Errorf("unable to decode messageInvoice#fadfd46: field product_info: %w", err) } } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode messageInvoice#d8201a53: field currency: %w", err) + return fmt.Errorf("unable to decode messageInvoice#fadfd46: field currency: %w", err) } m.Currency = value } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode messageInvoice#d8201a53: field total_amount: %w", err) + return fmt.Errorf("unable to decode messageInvoice#fadfd46: field total_amount: %w", err) } m.TotalAmount = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode messageInvoice#d8201a53: field start_parameter: %w", err) + return fmt.Errorf("unable to decode messageInvoice#fadfd46: field start_parameter: %w", err) } m.StartParameter = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode messageInvoice#d8201a53: field is_test: %w", err) + return fmt.Errorf("unable to decode messageInvoice#fadfd46: field is_test: %w", err) } m.IsTest = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode messageInvoice#d8201a53: field need_shipping_address: %w", err) + return fmt.Errorf("unable to decode messageInvoice#fadfd46: field need_shipping_address: %w", err) } m.NeedShippingAddress = value } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode messageInvoice#d8201a53: field receipt_message_id: %w", err) + return fmt.Errorf("unable to decode messageInvoice#fadfd46: field receipt_message_id: %w", err) } m.ReceiptMessageID = value } { - value, err := DecodeMessageExtendedMedia(b) + value, err := DecodePaidMedia(b) if err != nil { - return fmt.Errorf("unable to decode messageInvoice#d8201a53: field extended_media: %w", err) + return fmt.Errorf("unable to decode messageInvoice#fadfd46: field paid_media: %w", err) + } + m.PaidMedia = value + } + { + if err := m.PaidMediaCaption.Decode(b); err != nil { + return fmt.Errorf("unable to decode messageInvoice#fadfd46: field paid_media_caption: %w", err) } - m.ExtendedMedia = value } return nil } @@ -4745,14 +5065,14 @@ func (m *MessageInvoice) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (m *MessageInvoice) EncodeTDLibJSON(b tdjson.Encoder) error { if m == nil { - return fmt.Errorf("can't encode messageInvoice#d8201a53 as nil") + return fmt.Errorf("can't encode messageInvoice#fadfd46 as nil") } b.ObjStart() b.PutID("messageInvoice") b.Comma() b.FieldStart("product_info") if err := m.ProductInfo.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode messageInvoice#d8201a53: field product_info: %w", err) + return fmt.Errorf("unable to encode messageInvoice#fadfd46: field product_info: %w", err) } b.Comma() b.FieldStart("currency") @@ -4773,12 +5093,17 @@ func (m *MessageInvoice) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("receipt_message_id") b.PutInt53(m.ReceiptMessageID) b.Comma() - b.FieldStart("extended_media") - if m.ExtendedMedia == nil { - return fmt.Errorf("unable to encode messageInvoice#d8201a53: field extended_media is nil") + b.FieldStart("paid_media") + if m.PaidMedia == nil { + return fmt.Errorf("unable to encode messageInvoice#fadfd46: field paid_media is nil") + } + if err := m.PaidMedia.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode messageInvoice#fadfd46: field paid_media: %w", err) } - if err := m.ExtendedMedia.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode messageInvoice#d8201a53: field extended_media: %w", err) + b.Comma() + b.FieldStart("paid_media_caption") + if err := m.PaidMediaCaption.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode messageInvoice#fadfd46: field paid_media_caption: %w", err) } b.Comma() b.StripComma() @@ -4789,61 +5114,65 @@ func (m *MessageInvoice) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (m *MessageInvoice) DecodeTDLibJSON(b tdjson.Decoder) error { if m == nil { - return fmt.Errorf("can't decode messageInvoice#d8201a53 to nil") + return fmt.Errorf("can't decode messageInvoice#fadfd46 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("messageInvoice"); err != nil { - return fmt.Errorf("unable to decode messageInvoice#d8201a53: %w", err) + return fmt.Errorf("unable to decode messageInvoice#fadfd46: %w", err) } case "product_info": if err := m.ProductInfo.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode messageInvoice#d8201a53: field product_info: %w", err) + return fmt.Errorf("unable to decode messageInvoice#fadfd46: field product_info: %w", err) } case "currency": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode messageInvoice#d8201a53: field currency: %w", err) + return fmt.Errorf("unable to decode messageInvoice#fadfd46: field currency: %w", err) } m.Currency = value case "total_amount": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode messageInvoice#d8201a53: field total_amount: %w", err) + return fmt.Errorf("unable to decode messageInvoice#fadfd46: field total_amount: %w", err) } m.TotalAmount = value case "start_parameter": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode messageInvoice#d8201a53: field start_parameter: %w", err) + return fmt.Errorf("unable to decode messageInvoice#fadfd46: field start_parameter: %w", err) } m.StartParameter = value case "is_test": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode messageInvoice#d8201a53: field is_test: %w", err) + return fmt.Errorf("unable to decode messageInvoice#fadfd46: field is_test: %w", err) } m.IsTest = value case "need_shipping_address": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode messageInvoice#d8201a53: field need_shipping_address: %w", err) + return fmt.Errorf("unable to decode messageInvoice#fadfd46: field need_shipping_address: %w", err) } m.NeedShippingAddress = value case "receipt_message_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode messageInvoice#d8201a53: field receipt_message_id: %w", err) + return fmt.Errorf("unable to decode messageInvoice#fadfd46: field receipt_message_id: %w", err) } m.ReceiptMessageID = value - case "extended_media": - value, err := DecodeTDLibJSONMessageExtendedMedia(b) + case "paid_media": + value, err := DecodeTDLibJSONPaidMedia(b) if err != nil { - return fmt.Errorf("unable to decode messageInvoice#d8201a53: field extended_media: %w", err) + return fmt.Errorf("unable to decode messageInvoice#fadfd46: field paid_media: %w", err) + } + m.PaidMedia = value + case "paid_media_caption": + if err := m.PaidMediaCaption.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode messageInvoice#fadfd46: field paid_media_caption: %w", err) } - m.ExtendedMedia = value default: return b.Skip() } @@ -4907,12 +5236,20 @@ func (m *MessageInvoice) GetReceiptMessageID() (value int64) { return m.ReceiptMessageID } -// GetExtendedMedia returns value of ExtendedMedia field. -func (m *MessageInvoice) GetExtendedMedia() (value MessageExtendedMediaClass) { +// GetPaidMedia returns value of PaidMedia field. +func (m *MessageInvoice) GetPaidMedia() (value PaidMediaClass) { if m == nil { return } - return m.ExtendedMedia + return m.PaidMedia +} + +// GetPaidMediaCaption returns value of PaidMediaCaption field. +func (m *MessageInvoice) GetPaidMediaCaption() (value FormattedText) { + if m == nil { + return + } + return m.PaidMediaCaption } // MessageCall represents TL type `messageCall#201ede00`. @@ -14915,6 +15252,7 @@ const MessageContentClassName = "MessageContent" // case *tdapi.MessageAnimation: // messageAnimation#8ecb1128 // case *tdapi.MessageAudio: // messageAudio#107e741c // case *tdapi.MessageDocument: // messageDocument#2394ab77 +// case *tdapi.MessagePaidMedia: // messagePaidMedia#3e5fd7c2 // case *tdapi.MessagePhoto: // messagePhoto#754c7e1f // case *tdapi.MessageSticker: // messageSticker#e5f0dcca // case *tdapi.MessageVideo: // messageVideo#adc2be09 @@ -14932,7 +15270,7 @@ const MessageContentClassName = "MessageContent" // case *tdapi.MessageGame: // messageGame#fbdc6976 // case *tdapi.MessagePoll: // messagePoll#d888b24d // case *tdapi.MessageStory: // messageStory#3329f2d4 -// case *tdapi.MessageInvoice: // messageInvoice#d8201a53 +// case *tdapi.MessageInvoice: // messageInvoice#fadfd46 // case *tdapi.MessageCall: // messageCall#201ede00 // case *tdapi.MessageVideoChatScheduled: // messageVideoChatScheduled#916c1db7 // case *tdapi.MessageVideoChatStarted: // messageVideoChatStarted#1f114559 @@ -15039,6 +15377,13 @@ func DecodeMessageContent(buf *bin.Buffer) (MessageContentClass, error) { return nil, fmt.Errorf("unable to decode MessageContentClass: %w", err) } return &v, nil + case MessagePaidMediaTypeID: + // Decoding messagePaidMedia#3e5fd7c2. + v := MessagePaidMedia{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode MessageContentClass: %w", err) + } + return &v, nil case MessagePhotoTypeID: // Decoding messagePhoto#754c7e1f. v := MessagePhoto{} @@ -15159,7 +15504,7 @@ func DecodeMessageContent(buf *bin.Buffer) (MessageContentClass, error) { } return &v, nil case MessageInvoiceTypeID: - // Decoding messageInvoice#d8201a53. + // Decoding messageInvoice#fadfd46. v := MessageInvoice{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode MessageContentClass: %w", err) @@ -15534,6 +15879,13 @@ func DecodeTDLibJSONMessageContent(buf tdjson.Decoder) (MessageContentClass, err return nil, fmt.Errorf("unable to decode MessageContentClass: %w", err) } return &v, nil + case "messagePaidMedia": + // Decoding messagePaidMedia#3e5fd7c2. + v := MessagePaidMedia{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode MessageContentClass: %w", err) + } + return &v, nil case "messagePhoto": // Decoding messagePhoto#754c7e1f. v := MessagePhoto{} @@ -15654,7 +16006,7 @@ func DecodeTDLibJSONMessageContent(buf tdjson.Decoder) (MessageContentClass, err } return &v, nil case "messageInvoice": - // Decoding messageInvoice#d8201a53. + // Decoding messageInvoice#fadfd46. v := MessageInvoice{} if err := v.DecodeTDLibJSON(buf); err != nil { return nil, fmt.Errorf("unable to decode MessageContentClass: %w", err) diff --git a/tdapi/tl_message_extended_media_gen.go b/tdapi/tl_message_extended_media_gen.go deleted file mode 100644 index c66ab02e6e..0000000000 --- a/tdapi/tl_message_extended_media_gen.go +++ /dev/null @@ -1,1070 +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{} -) - -// MessageExtendedMediaPreview represents TL type `messageExtendedMediaPreview#7703a347`. -type MessageExtendedMediaPreview struct { - // Media width; 0 if unknown - Width int32 - // Media height; 0 if unknown - Height int32 - // Media duration, in seconds; 0 if unknown - Duration int32 - // Media minithumbnail; may be null - Minithumbnail Minithumbnail - // Media caption - Caption FormattedText -} - -// MessageExtendedMediaPreviewTypeID is TL type id of MessageExtendedMediaPreview. -const MessageExtendedMediaPreviewTypeID = 0x7703a347 - -// construct implements constructor of MessageExtendedMediaClass. -func (m MessageExtendedMediaPreview) construct() MessageExtendedMediaClass { return &m } - -// Ensuring interfaces in compile-time for MessageExtendedMediaPreview. -var ( - _ bin.Encoder = &MessageExtendedMediaPreview{} - _ bin.Decoder = &MessageExtendedMediaPreview{} - _ bin.BareEncoder = &MessageExtendedMediaPreview{} - _ bin.BareDecoder = &MessageExtendedMediaPreview{} - - _ MessageExtendedMediaClass = &MessageExtendedMediaPreview{} -) - -func (m *MessageExtendedMediaPreview) Zero() bool { - if m == nil { - return true - } - if !(m.Width == 0) { - return false - } - if !(m.Height == 0) { - return false - } - if !(m.Duration == 0) { - return false - } - if !(m.Minithumbnail.Zero()) { - return false - } - if !(m.Caption.Zero()) { - return false - } - - return true -} - -// String implements fmt.Stringer. -func (m *MessageExtendedMediaPreview) String() string { - if m == nil { - return "MessageExtendedMediaPreview(nil)" - } - type Alias MessageExtendedMediaPreview - return fmt.Sprintf("MessageExtendedMediaPreview%+v", Alias(*m)) -} - -// TypeID returns type id in TL schema. -// -// See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*MessageExtendedMediaPreview) TypeID() uint32 { - return MessageExtendedMediaPreviewTypeID -} - -// TypeName returns name of type in TL schema. -func (*MessageExtendedMediaPreview) TypeName() string { - return "messageExtendedMediaPreview" -} - -// TypeInfo returns info about TL type. -func (m *MessageExtendedMediaPreview) TypeInfo() tdp.Type { - typ := tdp.Type{ - Name: "messageExtendedMediaPreview", - ID: MessageExtendedMediaPreviewTypeID, - } - if m == nil { - typ.Null = true - return typ - } - typ.Fields = []tdp.Field{ - { - Name: "Width", - SchemaName: "width", - }, - { - Name: "Height", - SchemaName: "height", - }, - { - Name: "Duration", - SchemaName: "duration", - }, - { - Name: "Minithumbnail", - SchemaName: "minithumbnail", - }, - { - Name: "Caption", - SchemaName: "caption", - }, - } - return typ -} - -// Encode implements bin.Encoder. -func (m *MessageExtendedMediaPreview) Encode(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't encode messageExtendedMediaPreview#7703a347 as nil") - } - b.PutID(MessageExtendedMediaPreviewTypeID) - return m.EncodeBare(b) -} - -// EncodeBare implements bin.BareEncoder. -func (m *MessageExtendedMediaPreview) EncodeBare(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't encode messageExtendedMediaPreview#7703a347 as nil") - } - b.PutInt32(m.Width) - b.PutInt32(m.Height) - b.PutInt32(m.Duration) - if err := m.Minithumbnail.Encode(b); err != nil { - return fmt.Errorf("unable to encode messageExtendedMediaPreview#7703a347: field minithumbnail: %w", err) - } - if err := m.Caption.Encode(b); err != nil { - return fmt.Errorf("unable to encode messageExtendedMediaPreview#7703a347: field caption: %w", err) - } - return nil -} - -// Decode implements bin.Decoder. -func (m *MessageExtendedMediaPreview) Decode(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't decode messageExtendedMediaPreview#7703a347 to nil") - } - if err := b.ConsumeID(MessageExtendedMediaPreviewTypeID); err != nil { - return fmt.Errorf("unable to decode messageExtendedMediaPreview#7703a347: %w", err) - } - return m.DecodeBare(b) -} - -// DecodeBare implements bin.BareDecoder. -func (m *MessageExtendedMediaPreview) DecodeBare(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't decode messageExtendedMediaPreview#7703a347 to nil") - } - { - value, err := b.Int32() - if err != nil { - return fmt.Errorf("unable to decode messageExtendedMediaPreview#7703a347: field width: %w", err) - } - m.Width = value - } - { - value, err := b.Int32() - if err != nil { - return fmt.Errorf("unable to decode messageExtendedMediaPreview#7703a347: field height: %w", err) - } - m.Height = value - } - { - value, err := b.Int32() - if err != nil { - return fmt.Errorf("unable to decode messageExtendedMediaPreview#7703a347: field duration: %w", err) - } - m.Duration = value - } - { - if err := m.Minithumbnail.Decode(b); err != nil { - return fmt.Errorf("unable to decode messageExtendedMediaPreview#7703a347: field minithumbnail: %w", err) - } - } - { - if err := m.Caption.Decode(b); err != nil { - return fmt.Errorf("unable to decode messageExtendedMediaPreview#7703a347: field caption: %w", err) - } - } - return nil -} - -// EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (m *MessageExtendedMediaPreview) EncodeTDLibJSON(b tdjson.Encoder) error { - if m == nil { - return fmt.Errorf("can't encode messageExtendedMediaPreview#7703a347 as nil") - } - b.ObjStart() - b.PutID("messageExtendedMediaPreview") - b.Comma() - b.FieldStart("width") - b.PutInt32(m.Width) - b.Comma() - b.FieldStart("height") - b.PutInt32(m.Height) - b.Comma() - b.FieldStart("duration") - b.PutInt32(m.Duration) - b.Comma() - b.FieldStart("minithumbnail") - if err := m.Minithumbnail.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode messageExtendedMediaPreview#7703a347: field minithumbnail: %w", err) - } - b.Comma() - b.FieldStart("caption") - if err := m.Caption.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode messageExtendedMediaPreview#7703a347: field caption: %w", err) - } - b.Comma() - b.StripComma() - b.ObjEnd() - return nil -} - -// DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (m *MessageExtendedMediaPreview) DecodeTDLibJSON(b tdjson.Decoder) error { - if m == nil { - return fmt.Errorf("can't decode messageExtendedMediaPreview#7703a347 to nil") - } - - return b.Obj(func(b tdjson.Decoder, key []byte) error { - switch string(key) { - case tdjson.TypeField: - if err := b.ConsumeID("messageExtendedMediaPreview"); err != nil { - return fmt.Errorf("unable to decode messageExtendedMediaPreview#7703a347: %w", err) - } - case "width": - value, err := b.Int32() - if err != nil { - return fmt.Errorf("unable to decode messageExtendedMediaPreview#7703a347: field width: %w", err) - } - m.Width = value - case "height": - value, err := b.Int32() - if err != nil { - return fmt.Errorf("unable to decode messageExtendedMediaPreview#7703a347: field height: %w", err) - } - m.Height = value - case "duration": - value, err := b.Int32() - if err != nil { - return fmt.Errorf("unable to decode messageExtendedMediaPreview#7703a347: field duration: %w", err) - } - m.Duration = value - case "minithumbnail": - if err := m.Minithumbnail.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode messageExtendedMediaPreview#7703a347: field minithumbnail: %w", err) - } - case "caption": - if err := m.Caption.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode messageExtendedMediaPreview#7703a347: field caption: %w", err) - } - default: - return b.Skip() - } - return nil - }) -} - -// GetWidth returns value of Width field. -func (m *MessageExtendedMediaPreview) GetWidth() (value int32) { - if m == nil { - return - } - return m.Width -} - -// GetHeight returns value of Height field. -func (m *MessageExtendedMediaPreview) GetHeight() (value int32) { - if m == nil { - return - } - return m.Height -} - -// GetDuration returns value of Duration field. -func (m *MessageExtendedMediaPreview) GetDuration() (value int32) { - if m == nil { - return - } - return m.Duration -} - -// GetMinithumbnail returns value of Minithumbnail field. -func (m *MessageExtendedMediaPreview) GetMinithumbnail() (value Minithumbnail) { - if m == nil { - return - } - return m.Minithumbnail -} - -// GetCaption returns value of Caption field. -func (m *MessageExtendedMediaPreview) GetCaption() (value FormattedText) { - if m == nil { - return - } - return m.Caption -} - -// MessageExtendedMediaPhoto represents TL type `messageExtendedMediaPhoto#c68b4530`. -type MessageExtendedMediaPhoto struct { - // The photo - Photo Photo - // Photo caption - Caption FormattedText -} - -// MessageExtendedMediaPhotoTypeID is TL type id of MessageExtendedMediaPhoto. -const MessageExtendedMediaPhotoTypeID = 0xc68b4530 - -// construct implements constructor of MessageExtendedMediaClass. -func (m MessageExtendedMediaPhoto) construct() MessageExtendedMediaClass { return &m } - -// Ensuring interfaces in compile-time for MessageExtendedMediaPhoto. -var ( - _ bin.Encoder = &MessageExtendedMediaPhoto{} - _ bin.Decoder = &MessageExtendedMediaPhoto{} - _ bin.BareEncoder = &MessageExtendedMediaPhoto{} - _ bin.BareDecoder = &MessageExtendedMediaPhoto{} - - _ MessageExtendedMediaClass = &MessageExtendedMediaPhoto{} -) - -func (m *MessageExtendedMediaPhoto) Zero() bool { - if m == nil { - return true - } - if !(m.Photo.Zero()) { - return false - } - if !(m.Caption.Zero()) { - return false - } - - return true -} - -// String implements fmt.Stringer. -func (m *MessageExtendedMediaPhoto) String() string { - if m == nil { - return "MessageExtendedMediaPhoto(nil)" - } - type Alias MessageExtendedMediaPhoto - return fmt.Sprintf("MessageExtendedMediaPhoto%+v", Alias(*m)) -} - -// TypeID returns type id in TL schema. -// -// See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*MessageExtendedMediaPhoto) TypeID() uint32 { - return MessageExtendedMediaPhotoTypeID -} - -// TypeName returns name of type in TL schema. -func (*MessageExtendedMediaPhoto) TypeName() string { - return "messageExtendedMediaPhoto" -} - -// TypeInfo returns info about TL type. -func (m *MessageExtendedMediaPhoto) TypeInfo() tdp.Type { - typ := tdp.Type{ - Name: "messageExtendedMediaPhoto", - ID: MessageExtendedMediaPhotoTypeID, - } - if m == nil { - typ.Null = true - return typ - } - typ.Fields = []tdp.Field{ - { - Name: "Photo", - SchemaName: "photo", - }, - { - Name: "Caption", - SchemaName: "caption", - }, - } - return typ -} - -// Encode implements bin.Encoder. -func (m *MessageExtendedMediaPhoto) Encode(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't encode messageExtendedMediaPhoto#c68b4530 as nil") - } - b.PutID(MessageExtendedMediaPhotoTypeID) - return m.EncodeBare(b) -} - -// EncodeBare implements bin.BareEncoder. -func (m *MessageExtendedMediaPhoto) EncodeBare(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't encode messageExtendedMediaPhoto#c68b4530 as nil") - } - if err := m.Photo.Encode(b); err != nil { - return fmt.Errorf("unable to encode messageExtendedMediaPhoto#c68b4530: field photo: %w", err) - } - if err := m.Caption.Encode(b); err != nil { - return fmt.Errorf("unable to encode messageExtendedMediaPhoto#c68b4530: field caption: %w", err) - } - return nil -} - -// Decode implements bin.Decoder. -func (m *MessageExtendedMediaPhoto) Decode(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't decode messageExtendedMediaPhoto#c68b4530 to nil") - } - if err := b.ConsumeID(MessageExtendedMediaPhotoTypeID); err != nil { - return fmt.Errorf("unable to decode messageExtendedMediaPhoto#c68b4530: %w", err) - } - return m.DecodeBare(b) -} - -// DecodeBare implements bin.BareDecoder. -func (m *MessageExtendedMediaPhoto) DecodeBare(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't decode messageExtendedMediaPhoto#c68b4530 to nil") - } - { - if err := m.Photo.Decode(b); err != nil { - return fmt.Errorf("unable to decode messageExtendedMediaPhoto#c68b4530: field photo: %w", err) - } - } - { - if err := m.Caption.Decode(b); err != nil { - return fmt.Errorf("unable to decode messageExtendedMediaPhoto#c68b4530: field caption: %w", err) - } - } - return nil -} - -// EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (m *MessageExtendedMediaPhoto) EncodeTDLibJSON(b tdjson.Encoder) error { - if m == nil { - return fmt.Errorf("can't encode messageExtendedMediaPhoto#c68b4530 as nil") - } - b.ObjStart() - b.PutID("messageExtendedMediaPhoto") - b.Comma() - b.FieldStart("photo") - if err := m.Photo.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode messageExtendedMediaPhoto#c68b4530: field photo: %w", err) - } - b.Comma() - b.FieldStart("caption") - if err := m.Caption.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode messageExtendedMediaPhoto#c68b4530: field caption: %w", err) - } - b.Comma() - b.StripComma() - b.ObjEnd() - return nil -} - -// DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (m *MessageExtendedMediaPhoto) DecodeTDLibJSON(b tdjson.Decoder) error { - if m == nil { - return fmt.Errorf("can't decode messageExtendedMediaPhoto#c68b4530 to nil") - } - - return b.Obj(func(b tdjson.Decoder, key []byte) error { - switch string(key) { - case tdjson.TypeField: - if err := b.ConsumeID("messageExtendedMediaPhoto"); err != nil { - return fmt.Errorf("unable to decode messageExtendedMediaPhoto#c68b4530: %w", err) - } - case "photo": - if err := m.Photo.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode messageExtendedMediaPhoto#c68b4530: field photo: %w", err) - } - case "caption": - if err := m.Caption.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode messageExtendedMediaPhoto#c68b4530: field caption: %w", err) - } - default: - return b.Skip() - } - return nil - }) -} - -// GetPhoto returns value of Photo field. -func (m *MessageExtendedMediaPhoto) GetPhoto() (value Photo) { - if m == nil { - return - } - return m.Photo -} - -// GetCaption returns value of Caption field. -func (m *MessageExtendedMediaPhoto) GetCaption() (value FormattedText) { - if m == nil { - return - } - return m.Caption -} - -// MessageExtendedMediaVideo represents TL type `messageExtendedMediaVideo#11acbf3b`. -type MessageExtendedMediaVideo struct { - // The video - Video Video - // Photo caption - Caption FormattedText -} - -// MessageExtendedMediaVideoTypeID is TL type id of MessageExtendedMediaVideo. -const MessageExtendedMediaVideoTypeID = 0x11acbf3b - -// construct implements constructor of MessageExtendedMediaClass. -func (m MessageExtendedMediaVideo) construct() MessageExtendedMediaClass { return &m } - -// Ensuring interfaces in compile-time for MessageExtendedMediaVideo. -var ( - _ bin.Encoder = &MessageExtendedMediaVideo{} - _ bin.Decoder = &MessageExtendedMediaVideo{} - _ bin.BareEncoder = &MessageExtendedMediaVideo{} - _ bin.BareDecoder = &MessageExtendedMediaVideo{} - - _ MessageExtendedMediaClass = &MessageExtendedMediaVideo{} -) - -func (m *MessageExtendedMediaVideo) Zero() bool { - if m == nil { - return true - } - if !(m.Video.Zero()) { - return false - } - if !(m.Caption.Zero()) { - return false - } - - return true -} - -// String implements fmt.Stringer. -func (m *MessageExtendedMediaVideo) String() string { - if m == nil { - return "MessageExtendedMediaVideo(nil)" - } - type Alias MessageExtendedMediaVideo - return fmt.Sprintf("MessageExtendedMediaVideo%+v", Alias(*m)) -} - -// TypeID returns type id in TL schema. -// -// See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*MessageExtendedMediaVideo) TypeID() uint32 { - return MessageExtendedMediaVideoTypeID -} - -// TypeName returns name of type in TL schema. -func (*MessageExtendedMediaVideo) TypeName() string { - return "messageExtendedMediaVideo" -} - -// TypeInfo returns info about TL type. -func (m *MessageExtendedMediaVideo) TypeInfo() tdp.Type { - typ := tdp.Type{ - Name: "messageExtendedMediaVideo", - ID: MessageExtendedMediaVideoTypeID, - } - if m == nil { - typ.Null = true - return typ - } - typ.Fields = []tdp.Field{ - { - Name: "Video", - SchemaName: "video", - }, - { - Name: "Caption", - SchemaName: "caption", - }, - } - return typ -} - -// Encode implements bin.Encoder. -func (m *MessageExtendedMediaVideo) Encode(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't encode messageExtendedMediaVideo#11acbf3b as nil") - } - b.PutID(MessageExtendedMediaVideoTypeID) - return m.EncodeBare(b) -} - -// EncodeBare implements bin.BareEncoder. -func (m *MessageExtendedMediaVideo) EncodeBare(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't encode messageExtendedMediaVideo#11acbf3b as nil") - } - if err := m.Video.Encode(b); err != nil { - return fmt.Errorf("unable to encode messageExtendedMediaVideo#11acbf3b: field video: %w", err) - } - if err := m.Caption.Encode(b); err != nil { - return fmt.Errorf("unable to encode messageExtendedMediaVideo#11acbf3b: field caption: %w", err) - } - return nil -} - -// Decode implements bin.Decoder. -func (m *MessageExtendedMediaVideo) Decode(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't decode messageExtendedMediaVideo#11acbf3b to nil") - } - if err := b.ConsumeID(MessageExtendedMediaVideoTypeID); err != nil { - return fmt.Errorf("unable to decode messageExtendedMediaVideo#11acbf3b: %w", err) - } - return m.DecodeBare(b) -} - -// DecodeBare implements bin.BareDecoder. -func (m *MessageExtendedMediaVideo) DecodeBare(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't decode messageExtendedMediaVideo#11acbf3b to nil") - } - { - if err := m.Video.Decode(b); err != nil { - return fmt.Errorf("unable to decode messageExtendedMediaVideo#11acbf3b: field video: %w", err) - } - } - { - if err := m.Caption.Decode(b); err != nil { - return fmt.Errorf("unable to decode messageExtendedMediaVideo#11acbf3b: field caption: %w", err) - } - } - return nil -} - -// EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (m *MessageExtendedMediaVideo) EncodeTDLibJSON(b tdjson.Encoder) error { - if m == nil { - return fmt.Errorf("can't encode messageExtendedMediaVideo#11acbf3b as nil") - } - b.ObjStart() - b.PutID("messageExtendedMediaVideo") - b.Comma() - b.FieldStart("video") - if err := m.Video.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode messageExtendedMediaVideo#11acbf3b: field video: %w", err) - } - b.Comma() - b.FieldStart("caption") - if err := m.Caption.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode messageExtendedMediaVideo#11acbf3b: field caption: %w", err) - } - b.Comma() - b.StripComma() - b.ObjEnd() - return nil -} - -// DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (m *MessageExtendedMediaVideo) DecodeTDLibJSON(b tdjson.Decoder) error { - if m == nil { - return fmt.Errorf("can't decode messageExtendedMediaVideo#11acbf3b to nil") - } - - return b.Obj(func(b tdjson.Decoder, key []byte) error { - switch string(key) { - case tdjson.TypeField: - if err := b.ConsumeID("messageExtendedMediaVideo"); err != nil { - return fmt.Errorf("unable to decode messageExtendedMediaVideo#11acbf3b: %w", err) - } - case "video": - if err := m.Video.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode messageExtendedMediaVideo#11acbf3b: field video: %w", err) - } - case "caption": - if err := m.Caption.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode messageExtendedMediaVideo#11acbf3b: field caption: %w", err) - } - default: - return b.Skip() - } - return nil - }) -} - -// GetVideo returns value of Video field. -func (m *MessageExtendedMediaVideo) GetVideo() (value Video) { - if m == nil { - return - } - return m.Video -} - -// GetCaption returns value of Caption field. -func (m *MessageExtendedMediaVideo) GetCaption() (value FormattedText) { - if m == nil { - return - } - return m.Caption -} - -// MessageExtendedMediaUnsupported represents TL type `messageExtendedMediaUnsupported#141f5020`. -type MessageExtendedMediaUnsupported struct { - // Media caption - Caption FormattedText -} - -// MessageExtendedMediaUnsupportedTypeID is TL type id of MessageExtendedMediaUnsupported. -const MessageExtendedMediaUnsupportedTypeID = 0x141f5020 - -// construct implements constructor of MessageExtendedMediaClass. -func (m MessageExtendedMediaUnsupported) construct() MessageExtendedMediaClass { return &m } - -// Ensuring interfaces in compile-time for MessageExtendedMediaUnsupported. -var ( - _ bin.Encoder = &MessageExtendedMediaUnsupported{} - _ bin.Decoder = &MessageExtendedMediaUnsupported{} - _ bin.BareEncoder = &MessageExtendedMediaUnsupported{} - _ bin.BareDecoder = &MessageExtendedMediaUnsupported{} - - _ MessageExtendedMediaClass = &MessageExtendedMediaUnsupported{} -) - -func (m *MessageExtendedMediaUnsupported) Zero() bool { - if m == nil { - return true - } - if !(m.Caption.Zero()) { - return false - } - - return true -} - -// String implements fmt.Stringer. -func (m *MessageExtendedMediaUnsupported) String() string { - if m == nil { - return "MessageExtendedMediaUnsupported(nil)" - } - type Alias MessageExtendedMediaUnsupported - return fmt.Sprintf("MessageExtendedMediaUnsupported%+v", Alias(*m)) -} - -// TypeID returns type id in TL schema. -// -// See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*MessageExtendedMediaUnsupported) TypeID() uint32 { - return MessageExtendedMediaUnsupportedTypeID -} - -// TypeName returns name of type in TL schema. -func (*MessageExtendedMediaUnsupported) TypeName() string { - return "messageExtendedMediaUnsupported" -} - -// TypeInfo returns info about TL type. -func (m *MessageExtendedMediaUnsupported) TypeInfo() tdp.Type { - typ := tdp.Type{ - Name: "messageExtendedMediaUnsupported", - ID: MessageExtendedMediaUnsupportedTypeID, - } - if m == nil { - typ.Null = true - return typ - } - typ.Fields = []tdp.Field{ - { - Name: "Caption", - SchemaName: "caption", - }, - } - return typ -} - -// Encode implements bin.Encoder. -func (m *MessageExtendedMediaUnsupported) Encode(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't encode messageExtendedMediaUnsupported#141f5020 as nil") - } - b.PutID(MessageExtendedMediaUnsupportedTypeID) - return m.EncodeBare(b) -} - -// EncodeBare implements bin.BareEncoder. -func (m *MessageExtendedMediaUnsupported) EncodeBare(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't encode messageExtendedMediaUnsupported#141f5020 as nil") - } - if err := m.Caption.Encode(b); err != nil { - return fmt.Errorf("unable to encode messageExtendedMediaUnsupported#141f5020: field caption: %w", err) - } - return nil -} - -// Decode implements bin.Decoder. -func (m *MessageExtendedMediaUnsupported) Decode(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't decode messageExtendedMediaUnsupported#141f5020 to nil") - } - if err := b.ConsumeID(MessageExtendedMediaUnsupportedTypeID); err != nil { - return fmt.Errorf("unable to decode messageExtendedMediaUnsupported#141f5020: %w", err) - } - return m.DecodeBare(b) -} - -// DecodeBare implements bin.BareDecoder. -func (m *MessageExtendedMediaUnsupported) DecodeBare(b *bin.Buffer) error { - if m == nil { - return fmt.Errorf("can't decode messageExtendedMediaUnsupported#141f5020 to nil") - } - { - if err := m.Caption.Decode(b); err != nil { - return fmt.Errorf("unable to decode messageExtendedMediaUnsupported#141f5020: field caption: %w", err) - } - } - return nil -} - -// EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (m *MessageExtendedMediaUnsupported) EncodeTDLibJSON(b tdjson.Encoder) error { - if m == nil { - return fmt.Errorf("can't encode messageExtendedMediaUnsupported#141f5020 as nil") - } - b.ObjStart() - b.PutID("messageExtendedMediaUnsupported") - b.Comma() - b.FieldStart("caption") - if err := m.Caption.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode messageExtendedMediaUnsupported#141f5020: field caption: %w", err) - } - b.Comma() - b.StripComma() - b.ObjEnd() - return nil -} - -// DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (m *MessageExtendedMediaUnsupported) DecodeTDLibJSON(b tdjson.Decoder) error { - if m == nil { - return fmt.Errorf("can't decode messageExtendedMediaUnsupported#141f5020 to nil") - } - - return b.Obj(func(b tdjson.Decoder, key []byte) error { - switch string(key) { - case tdjson.TypeField: - if err := b.ConsumeID("messageExtendedMediaUnsupported"); err != nil { - return fmt.Errorf("unable to decode messageExtendedMediaUnsupported#141f5020: %w", err) - } - case "caption": - if err := m.Caption.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode messageExtendedMediaUnsupported#141f5020: field caption: %w", err) - } - default: - return b.Skip() - } - return nil - }) -} - -// GetCaption returns value of Caption field. -func (m *MessageExtendedMediaUnsupported) GetCaption() (value FormattedText) { - if m == nil { - return - } - return m.Caption -} - -// MessageExtendedMediaClassName is schema name of MessageExtendedMediaClass. -const MessageExtendedMediaClassName = "MessageExtendedMedia" - -// MessageExtendedMediaClass represents MessageExtendedMedia generic type. -// -// Example: -// -// g, err := tdapi.DecodeMessageExtendedMedia(buf) -// if err != nil { -// panic(err) -// } -// switch v := g.(type) { -// case *tdapi.MessageExtendedMediaPreview: // messageExtendedMediaPreview#7703a347 -// case *tdapi.MessageExtendedMediaPhoto: // messageExtendedMediaPhoto#c68b4530 -// case *tdapi.MessageExtendedMediaVideo: // messageExtendedMediaVideo#11acbf3b -// case *tdapi.MessageExtendedMediaUnsupported: // messageExtendedMediaUnsupported#141f5020 -// default: panic(v) -// } -type MessageExtendedMediaClass interface { - bin.Encoder - bin.Decoder - bin.BareEncoder - bin.BareDecoder - construct() MessageExtendedMediaClass - - // 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 - - // Media caption - GetCaption() (value FormattedText) -} - -// DecodeMessageExtendedMedia implements binary de-serialization for MessageExtendedMediaClass. -func DecodeMessageExtendedMedia(buf *bin.Buffer) (MessageExtendedMediaClass, error) { - id, err := buf.PeekID() - if err != nil { - return nil, err - } - switch id { - case MessageExtendedMediaPreviewTypeID: - // Decoding messageExtendedMediaPreview#7703a347. - v := MessageExtendedMediaPreview{} - if err := v.Decode(buf); err != nil { - return nil, fmt.Errorf("unable to decode MessageExtendedMediaClass: %w", err) - } - return &v, nil - case MessageExtendedMediaPhotoTypeID: - // Decoding messageExtendedMediaPhoto#c68b4530. - v := MessageExtendedMediaPhoto{} - if err := v.Decode(buf); err != nil { - return nil, fmt.Errorf("unable to decode MessageExtendedMediaClass: %w", err) - } - return &v, nil - case MessageExtendedMediaVideoTypeID: - // Decoding messageExtendedMediaVideo#11acbf3b. - v := MessageExtendedMediaVideo{} - if err := v.Decode(buf); err != nil { - return nil, fmt.Errorf("unable to decode MessageExtendedMediaClass: %w", err) - } - return &v, nil - case MessageExtendedMediaUnsupportedTypeID: - // Decoding messageExtendedMediaUnsupported#141f5020. - v := MessageExtendedMediaUnsupported{} - if err := v.Decode(buf); err != nil { - return nil, fmt.Errorf("unable to decode MessageExtendedMediaClass: %w", err) - } - return &v, nil - default: - return nil, fmt.Errorf("unable to decode MessageExtendedMediaClass: %w", bin.NewUnexpectedID(id)) - } -} - -// DecodeTDLibJSONMessageExtendedMedia implements binary de-serialization for MessageExtendedMediaClass. -func DecodeTDLibJSONMessageExtendedMedia(buf tdjson.Decoder) (MessageExtendedMediaClass, error) { - id, err := buf.FindTypeID() - if err != nil { - return nil, err - } - switch id { - case "messageExtendedMediaPreview": - // Decoding messageExtendedMediaPreview#7703a347. - v := MessageExtendedMediaPreview{} - if err := v.DecodeTDLibJSON(buf); err != nil { - return nil, fmt.Errorf("unable to decode MessageExtendedMediaClass: %w", err) - } - return &v, nil - case "messageExtendedMediaPhoto": - // Decoding messageExtendedMediaPhoto#c68b4530. - v := MessageExtendedMediaPhoto{} - if err := v.DecodeTDLibJSON(buf); err != nil { - return nil, fmt.Errorf("unable to decode MessageExtendedMediaClass: %w", err) - } - return &v, nil - case "messageExtendedMediaVideo": - // Decoding messageExtendedMediaVideo#11acbf3b. - v := MessageExtendedMediaVideo{} - if err := v.DecodeTDLibJSON(buf); err != nil { - return nil, fmt.Errorf("unable to decode MessageExtendedMediaClass: %w", err) - } - return &v, nil - case "messageExtendedMediaUnsupported": - // Decoding messageExtendedMediaUnsupported#141f5020. - v := MessageExtendedMediaUnsupported{} - if err := v.DecodeTDLibJSON(buf); err != nil { - return nil, fmt.Errorf("unable to decode MessageExtendedMediaClass: %w", err) - } - return &v, nil - default: - return nil, fmt.Errorf("unable to decode MessageExtendedMediaClass: %w", tdjson.NewUnexpectedID(id)) - } -} - -// MessageExtendedMedia boxes the MessageExtendedMediaClass providing a helper. -type MessageExtendedMediaBox struct { - MessageExtendedMedia MessageExtendedMediaClass -} - -// Decode implements bin.Decoder for MessageExtendedMediaBox. -func (b *MessageExtendedMediaBox) Decode(buf *bin.Buffer) error { - if b == nil { - return fmt.Errorf("unable to decode MessageExtendedMediaBox to nil") - } - v, err := DecodeMessageExtendedMedia(buf) - if err != nil { - return fmt.Errorf("unable to decode boxed value: %w", err) - } - b.MessageExtendedMedia = v - return nil -} - -// Encode implements bin.Encode for MessageExtendedMediaBox. -func (b *MessageExtendedMediaBox) Encode(buf *bin.Buffer) error { - if b == nil || b.MessageExtendedMedia == nil { - return fmt.Errorf("unable to encode MessageExtendedMediaClass as nil") - } - return b.MessageExtendedMedia.Encode(buf) -} - -// DecodeTDLibJSON implements bin.Decoder for MessageExtendedMediaBox. -func (b *MessageExtendedMediaBox) DecodeTDLibJSON(buf tdjson.Decoder) error { - if b == nil { - return fmt.Errorf("unable to decode MessageExtendedMediaBox to nil") - } - v, err := DecodeTDLibJSONMessageExtendedMedia(buf) - if err != nil { - return fmt.Errorf("unable to decode boxed value: %w", err) - } - b.MessageExtendedMedia = v - return nil -} - -// EncodeTDLibJSON implements bin.Encode for MessageExtendedMediaBox. -func (b *MessageExtendedMediaBox) EncodeTDLibJSON(buf tdjson.Encoder) error { - if b == nil || b.MessageExtendedMedia == nil { - return fmt.Errorf("unable to encode MessageExtendedMediaClass as nil") - } - return b.MessageExtendedMedia.EncodeTDLibJSON(buf) -} diff --git a/tdapi/tl_paid_media_gen.go b/tdapi/tl_paid_media_gen.go new file mode 100644 index 0000000000..5e1ab31680 --- /dev/null +++ b/tdapi/tl_paid_media_gen.go @@ -0,0 +1,930 @@ +// 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{} +) + +// PaidMediaPreview represents TL type `paidMediaPreview#bcc1c474`. +type PaidMediaPreview struct { + // Media width; 0 if unknown + Width int32 + // Media height; 0 if unknown + Height int32 + // Media duration, in seconds; 0 if unknown + Duration int32 + // Media minithumbnail; may be null + Minithumbnail Minithumbnail +} + +// PaidMediaPreviewTypeID is TL type id of PaidMediaPreview. +const PaidMediaPreviewTypeID = 0xbcc1c474 + +// construct implements constructor of PaidMediaClass. +func (p PaidMediaPreview) construct() PaidMediaClass { return &p } + +// Ensuring interfaces in compile-time for PaidMediaPreview. +var ( + _ bin.Encoder = &PaidMediaPreview{} + _ bin.Decoder = &PaidMediaPreview{} + _ bin.BareEncoder = &PaidMediaPreview{} + _ bin.BareDecoder = &PaidMediaPreview{} + + _ PaidMediaClass = &PaidMediaPreview{} +) + +func (p *PaidMediaPreview) Zero() bool { + if p == nil { + return true + } + if !(p.Width == 0) { + return false + } + if !(p.Height == 0) { + return false + } + if !(p.Duration == 0) { + return false + } + if !(p.Minithumbnail.Zero()) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (p *PaidMediaPreview) String() string { + if p == nil { + return "PaidMediaPreview(nil)" + } + type Alias PaidMediaPreview + return fmt.Sprintf("PaidMediaPreview%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PaidMediaPreview) TypeID() uint32 { + return PaidMediaPreviewTypeID +} + +// TypeName returns name of type in TL schema. +func (*PaidMediaPreview) TypeName() string { + return "paidMediaPreview" +} + +// TypeInfo returns info about TL type. +func (p *PaidMediaPreview) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "paidMediaPreview", + ID: PaidMediaPreviewTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Width", + SchemaName: "width", + }, + { + Name: "Height", + SchemaName: "height", + }, + { + Name: "Duration", + SchemaName: "duration", + }, + { + Name: "Minithumbnail", + SchemaName: "minithumbnail", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (p *PaidMediaPreview) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode paidMediaPreview#bcc1c474 as nil") + } + b.PutID(PaidMediaPreviewTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PaidMediaPreview) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode paidMediaPreview#bcc1c474 as nil") + } + b.PutInt32(p.Width) + b.PutInt32(p.Height) + b.PutInt32(p.Duration) + if err := p.Minithumbnail.Encode(b); err != nil { + return fmt.Errorf("unable to encode paidMediaPreview#bcc1c474: field minithumbnail: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (p *PaidMediaPreview) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode paidMediaPreview#bcc1c474 to nil") + } + if err := b.ConsumeID(PaidMediaPreviewTypeID); err != nil { + return fmt.Errorf("unable to decode paidMediaPreview#bcc1c474: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PaidMediaPreview) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode paidMediaPreview#bcc1c474 to nil") + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode paidMediaPreview#bcc1c474: field width: %w", err) + } + p.Width = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode paidMediaPreview#bcc1c474: field height: %w", err) + } + p.Height = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode paidMediaPreview#bcc1c474: field duration: %w", err) + } + p.Duration = value + } + { + if err := p.Minithumbnail.Decode(b); err != nil { + return fmt.Errorf("unable to decode paidMediaPreview#bcc1c474: field minithumbnail: %w", err) + } + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PaidMediaPreview) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode paidMediaPreview#bcc1c474 as nil") + } + b.ObjStart() + b.PutID("paidMediaPreview") + b.Comma() + b.FieldStart("width") + b.PutInt32(p.Width) + b.Comma() + b.FieldStart("height") + b.PutInt32(p.Height) + b.Comma() + b.FieldStart("duration") + b.PutInt32(p.Duration) + b.Comma() + b.FieldStart("minithumbnail") + if err := p.Minithumbnail.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode paidMediaPreview#bcc1c474: field minithumbnail: %w", err) + } + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PaidMediaPreview) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode paidMediaPreview#bcc1c474 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("paidMediaPreview"); err != nil { + return fmt.Errorf("unable to decode paidMediaPreview#bcc1c474: %w", err) + } + case "width": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode paidMediaPreview#bcc1c474: field width: %w", err) + } + p.Width = value + case "height": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode paidMediaPreview#bcc1c474: field height: %w", err) + } + p.Height = value + case "duration": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode paidMediaPreview#bcc1c474: field duration: %w", err) + } + p.Duration = value + case "minithumbnail": + if err := p.Minithumbnail.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode paidMediaPreview#bcc1c474: field minithumbnail: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetWidth returns value of Width field. +func (p *PaidMediaPreview) GetWidth() (value int32) { + if p == nil { + return + } + return p.Width +} + +// GetHeight returns value of Height field. +func (p *PaidMediaPreview) GetHeight() (value int32) { + if p == nil { + return + } + return p.Height +} + +// GetDuration returns value of Duration field. +func (p *PaidMediaPreview) GetDuration() (value int32) { + if p == nil { + return + } + return p.Duration +} + +// GetMinithumbnail returns value of Minithumbnail field. +func (p *PaidMediaPreview) GetMinithumbnail() (value Minithumbnail) { + if p == nil { + return + } + return p.Minithumbnail +} + +// PaidMediaPhoto represents TL type `paidMediaPhoto#ba82551a`. +type PaidMediaPhoto struct { + // The photo + Photo Photo +} + +// PaidMediaPhotoTypeID is TL type id of PaidMediaPhoto. +const PaidMediaPhotoTypeID = 0xba82551a + +// construct implements constructor of PaidMediaClass. +func (p PaidMediaPhoto) construct() PaidMediaClass { return &p } + +// Ensuring interfaces in compile-time for PaidMediaPhoto. +var ( + _ bin.Encoder = &PaidMediaPhoto{} + _ bin.Decoder = &PaidMediaPhoto{} + _ bin.BareEncoder = &PaidMediaPhoto{} + _ bin.BareDecoder = &PaidMediaPhoto{} + + _ PaidMediaClass = &PaidMediaPhoto{} +) + +func (p *PaidMediaPhoto) Zero() bool { + if p == nil { + return true + } + if !(p.Photo.Zero()) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (p *PaidMediaPhoto) String() string { + if p == nil { + return "PaidMediaPhoto(nil)" + } + type Alias PaidMediaPhoto + return fmt.Sprintf("PaidMediaPhoto%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PaidMediaPhoto) TypeID() uint32 { + return PaidMediaPhotoTypeID +} + +// TypeName returns name of type in TL schema. +func (*PaidMediaPhoto) TypeName() string { + return "paidMediaPhoto" +} + +// TypeInfo returns info about TL type. +func (p *PaidMediaPhoto) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "paidMediaPhoto", + ID: PaidMediaPhotoTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Photo", + SchemaName: "photo", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (p *PaidMediaPhoto) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode paidMediaPhoto#ba82551a as nil") + } + b.PutID(PaidMediaPhotoTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PaidMediaPhoto) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode paidMediaPhoto#ba82551a as nil") + } + if err := p.Photo.Encode(b); err != nil { + return fmt.Errorf("unable to encode paidMediaPhoto#ba82551a: field photo: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (p *PaidMediaPhoto) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode paidMediaPhoto#ba82551a to nil") + } + if err := b.ConsumeID(PaidMediaPhotoTypeID); err != nil { + return fmt.Errorf("unable to decode paidMediaPhoto#ba82551a: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PaidMediaPhoto) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode paidMediaPhoto#ba82551a to nil") + } + { + if err := p.Photo.Decode(b); err != nil { + return fmt.Errorf("unable to decode paidMediaPhoto#ba82551a: field photo: %w", err) + } + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PaidMediaPhoto) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode paidMediaPhoto#ba82551a as nil") + } + b.ObjStart() + b.PutID("paidMediaPhoto") + b.Comma() + b.FieldStart("photo") + if err := p.Photo.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode paidMediaPhoto#ba82551a: field photo: %w", err) + } + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PaidMediaPhoto) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode paidMediaPhoto#ba82551a to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("paidMediaPhoto"); err != nil { + return fmt.Errorf("unable to decode paidMediaPhoto#ba82551a: %w", err) + } + case "photo": + if err := p.Photo.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode paidMediaPhoto#ba82551a: field photo: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetPhoto returns value of Photo field. +func (p *PaidMediaPhoto) GetPhoto() (value Photo) { + if p == nil { + return + } + return p.Photo +} + +// PaidMediaVideo represents TL type `paidMediaVideo#1bb52e09`. +type PaidMediaVideo struct { + // The video + Video Video +} + +// PaidMediaVideoTypeID is TL type id of PaidMediaVideo. +const PaidMediaVideoTypeID = 0x1bb52e09 + +// construct implements constructor of PaidMediaClass. +func (p PaidMediaVideo) construct() PaidMediaClass { return &p } + +// Ensuring interfaces in compile-time for PaidMediaVideo. +var ( + _ bin.Encoder = &PaidMediaVideo{} + _ bin.Decoder = &PaidMediaVideo{} + _ bin.BareEncoder = &PaidMediaVideo{} + _ bin.BareDecoder = &PaidMediaVideo{} + + _ PaidMediaClass = &PaidMediaVideo{} +) + +func (p *PaidMediaVideo) Zero() bool { + if p == nil { + return true + } + if !(p.Video.Zero()) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (p *PaidMediaVideo) String() string { + if p == nil { + return "PaidMediaVideo(nil)" + } + type Alias PaidMediaVideo + return fmt.Sprintf("PaidMediaVideo%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PaidMediaVideo) TypeID() uint32 { + return PaidMediaVideoTypeID +} + +// TypeName returns name of type in TL schema. +func (*PaidMediaVideo) TypeName() string { + return "paidMediaVideo" +} + +// TypeInfo returns info about TL type. +func (p *PaidMediaVideo) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "paidMediaVideo", + ID: PaidMediaVideoTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Video", + SchemaName: "video", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (p *PaidMediaVideo) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode paidMediaVideo#1bb52e09 as nil") + } + b.PutID(PaidMediaVideoTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PaidMediaVideo) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode paidMediaVideo#1bb52e09 as nil") + } + if err := p.Video.Encode(b); err != nil { + return fmt.Errorf("unable to encode paidMediaVideo#1bb52e09: field video: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (p *PaidMediaVideo) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode paidMediaVideo#1bb52e09 to nil") + } + if err := b.ConsumeID(PaidMediaVideoTypeID); err != nil { + return fmt.Errorf("unable to decode paidMediaVideo#1bb52e09: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PaidMediaVideo) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode paidMediaVideo#1bb52e09 to nil") + } + { + if err := p.Video.Decode(b); err != nil { + return fmt.Errorf("unable to decode paidMediaVideo#1bb52e09: field video: %w", err) + } + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PaidMediaVideo) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode paidMediaVideo#1bb52e09 as nil") + } + b.ObjStart() + b.PutID("paidMediaVideo") + b.Comma() + b.FieldStart("video") + if err := p.Video.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode paidMediaVideo#1bb52e09: field video: %w", err) + } + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PaidMediaVideo) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode paidMediaVideo#1bb52e09 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("paidMediaVideo"); err != nil { + return fmt.Errorf("unable to decode paidMediaVideo#1bb52e09: %w", err) + } + case "video": + if err := p.Video.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode paidMediaVideo#1bb52e09: field video: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetVideo returns value of Video field. +func (p *PaidMediaVideo) GetVideo() (value Video) { + if p == nil { + return + } + return p.Video +} + +// PaidMediaUnsupported represents TL type `paidMediaUnsupported#6bc3e26`. +type PaidMediaUnsupported struct { +} + +// PaidMediaUnsupportedTypeID is TL type id of PaidMediaUnsupported. +const PaidMediaUnsupportedTypeID = 0x6bc3e26 + +// construct implements constructor of PaidMediaClass. +func (p PaidMediaUnsupported) construct() PaidMediaClass { return &p } + +// Ensuring interfaces in compile-time for PaidMediaUnsupported. +var ( + _ bin.Encoder = &PaidMediaUnsupported{} + _ bin.Decoder = &PaidMediaUnsupported{} + _ bin.BareEncoder = &PaidMediaUnsupported{} + _ bin.BareDecoder = &PaidMediaUnsupported{} + + _ PaidMediaClass = &PaidMediaUnsupported{} +) + +func (p *PaidMediaUnsupported) Zero() bool { + if p == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (p *PaidMediaUnsupported) String() string { + if p == nil { + return "PaidMediaUnsupported(nil)" + } + type Alias PaidMediaUnsupported + return fmt.Sprintf("PaidMediaUnsupported%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PaidMediaUnsupported) TypeID() uint32 { + return PaidMediaUnsupportedTypeID +} + +// TypeName returns name of type in TL schema. +func (*PaidMediaUnsupported) TypeName() string { + return "paidMediaUnsupported" +} + +// TypeInfo returns info about TL type. +func (p *PaidMediaUnsupported) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "paidMediaUnsupported", + ID: PaidMediaUnsupportedTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (p *PaidMediaUnsupported) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode paidMediaUnsupported#6bc3e26 as nil") + } + b.PutID(PaidMediaUnsupportedTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PaidMediaUnsupported) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode paidMediaUnsupported#6bc3e26 as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (p *PaidMediaUnsupported) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode paidMediaUnsupported#6bc3e26 to nil") + } + if err := b.ConsumeID(PaidMediaUnsupportedTypeID); err != nil { + return fmt.Errorf("unable to decode paidMediaUnsupported#6bc3e26: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PaidMediaUnsupported) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode paidMediaUnsupported#6bc3e26 to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PaidMediaUnsupported) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode paidMediaUnsupported#6bc3e26 as nil") + } + b.ObjStart() + b.PutID("paidMediaUnsupported") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PaidMediaUnsupported) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode paidMediaUnsupported#6bc3e26 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("paidMediaUnsupported"); err != nil { + return fmt.Errorf("unable to decode paidMediaUnsupported#6bc3e26: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// PaidMediaClassName is schema name of PaidMediaClass. +const PaidMediaClassName = "PaidMedia" + +// PaidMediaClass represents PaidMedia generic type. +// +// Example: +// +// g, err := tdapi.DecodePaidMedia(buf) +// if err != nil { +// panic(err) +// } +// switch v := g.(type) { +// case *tdapi.PaidMediaPreview: // paidMediaPreview#bcc1c474 +// case *tdapi.PaidMediaPhoto: // paidMediaPhoto#ba82551a +// case *tdapi.PaidMediaVideo: // paidMediaVideo#1bb52e09 +// case *tdapi.PaidMediaUnsupported: // paidMediaUnsupported#6bc3e26 +// default: panic(v) +// } +type PaidMediaClass interface { + bin.Encoder + bin.Decoder + bin.BareEncoder + bin.BareDecoder + construct() PaidMediaClass + + // 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 +} + +// DecodePaidMedia implements binary de-serialization for PaidMediaClass. +func DecodePaidMedia(buf *bin.Buffer) (PaidMediaClass, error) { + id, err := buf.PeekID() + if err != nil { + return nil, err + } + switch id { + case PaidMediaPreviewTypeID: + // Decoding paidMediaPreview#bcc1c474. + v := PaidMediaPreview{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode PaidMediaClass: %w", err) + } + return &v, nil + case PaidMediaPhotoTypeID: + // Decoding paidMediaPhoto#ba82551a. + v := PaidMediaPhoto{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode PaidMediaClass: %w", err) + } + return &v, nil + case PaidMediaVideoTypeID: + // Decoding paidMediaVideo#1bb52e09. + v := PaidMediaVideo{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode PaidMediaClass: %w", err) + } + return &v, nil + case PaidMediaUnsupportedTypeID: + // Decoding paidMediaUnsupported#6bc3e26. + v := PaidMediaUnsupported{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode PaidMediaClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode PaidMediaClass: %w", bin.NewUnexpectedID(id)) + } +} + +// DecodeTDLibJSONPaidMedia implements binary de-serialization for PaidMediaClass. +func DecodeTDLibJSONPaidMedia(buf tdjson.Decoder) (PaidMediaClass, error) { + id, err := buf.FindTypeID() + if err != nil { + return nil, err + } + switch id { + case "paidMediaPreview": + // Decoding paidMediaPreview#bcc1c474. + v := PaidMediaPreview{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode PaidMediaClass: %w", err) + } + return &v, nil + case "paidMediaPhoto": + // Decoding paidMediaPhoto#ba82551a. + v := PaidMediaPhoto{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode PaidMediaClass: %w", err) + } + return &v, nil + case "paidMediaVideo": + // Decoding paidMediaVideo#1bb52e09. + v := PaidMediaVideo{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode PaidMediaClass: %w", err) + } + return &v, nil + case "paidMediaUnsupported": + // Decoding paidMediaUnsupported#6bc3e26. + v := PaidMediaUnsupported{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode PaidMediaClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode PaidMediaClass: %w", tdjson.NewUnexpectedID(id)) + } +} + +// PaidMedia boxes the PaidMediaClass providing a helper. +type PaidMediaBox struct { + PaidMedia PaidMediaClass +} + +// Decode implements bin.Decoder for PaidMediaBox. +func (b *PaidMediaBox) Decode(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("unable to decode PaidMediaBox to nil") + } + v, err := DecodePaidMedia(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.PaidMedia = v + return nil +} + +// Encode implements bin.Encode for PaidMediaBox. +func (b *PaidMediaBox) Encode(buf *bin.Buffer) error { + if b == nil || b.PaidMedia == nil { + return fmt.Errorf("unable to encode PaidMediaClass as nil") + } + return b.PaidMedia.Encode(buf) +} + +// DecodeTDLibJSON implements bin.Decoder for PaidMediaBox. +func (b *PaidMediaBox) DecodeTDLibJSON(buf tdjson.Decoder) error { + if b == nil { + return fmt.Errorf("unable to decode PaidMediaBox to nil") + } + v, err := DecodeTDLibJSONPaidMedia(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.PaidMedia = v + return nil +} + +// EncodeTDLibJSON implements bin.Encode for PaidMediaBox. +func (b *PaidMediaBox) EncodeTDLibJSON(buf tdjson.Encoder) error { + if b == nil || b.PaidMedia == nil { + return fmt.Errorf("unable to encode PaidMediaClass as nil") + } + return b.PaidMedia.EncodeTDLibJSON(buf) +} diff --git a/tdapi/tl_premium_feature_gen.go b/tdapi/tl_premium_feature_gen.go index fe9c1e8c0c..37fdbb4783 100644 --- a/tdapi/tl_premium_feature_gen.go +++ b/tdapi/tl_premium_feature_gen.go @@ -3044,6 +3044,137 @@ func (p *PremiumFeatureBusiness) DecodeTDLibJSON(b tdjson.Decoder) error { }) } +// PremiumFeatureMessageEffects represents TL type `premiumFeatureMessageEffects#d4e35061`. +type PremiumFeatureMessageEffects struct { +} + +// PremiumFeatureMessageEffectsTypeID is TL type id of PremiumFeatureMessageEffects. +const PremiumFeatureMessageEffectsTypeID = 0xd4e35061 + +// construct implements constructor of PremiumFeatureClass. +func (p PremiumFeatureMessageEffects) construct() PremiumFeatureClass { return &p } + +// Ensuring interfaces in compile-time for PremiumFeatureMessageEffects. +var ( + _ bin.Encoder = &PremiumFeatureMessageEffects{} + _ bin.Decoder = &PremiumFeatureMessageEffects{} + _ bin.BareEncoder = &PremiumFeatureMessageEffects{} + _ bin.BareDecoder = &PremiumFeatureMessageEffects{} + + _ PremiumFeatureClass = &PremiumFeatureMessageEffects{} +) + +func (p *PremiumFeatureMessageEffects) Zero() bool { + if p == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (p *PremiumFeatureMessageEffects) String() string { + if p == nil { + return "PremiumFeatureMessageEffects(nil)" + } + type Alias PremiumFeatureMessageEffects + return fmt.Sprintf("PremiumFeatureMessageEffects%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PremiumFeatureMessageEffects) TypeID() uint32 { + return PremiumFeatureMessageEffectsTypeID +} + +// TypeName returns name of type in TL schema. +func (*PremiumFeatureMessageEffects) TypeName() string { + return "premiumFeatureMessageEffects" +} + +// TypeInfo returns info about TL type. +func (p *PremiumFeatureMessageEffects) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "premiumFeatureMessageEffects", + ID: PremiumFeatureMessageEffectsTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (p *PremiumFeatureMessageEffects) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumFeatureMessageEffects#d4e35061 as nil") + } + b.PutID(PremiumFeatureMessageEffectsTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PremiumFeatureMessageEffects) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode premiumFeatureMessageEffects#d4e35061 as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (p *PremiumFeatureMessageEffects) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumFeatureMessageEffects#d4e35061 to nil") + } + if err := b.ConsumeID(PremiumFeatureMessageEffectsTypeID); err != nil { + return fmt.Errorf("unable to decode premiumFeatureMessageEffects#d4e35061: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PremiumFeatureMessageEffects) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode premiumFeatureMessageEffects#d4e35061 to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PremiumFeatureMessageEffects) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode premiumFeatureMessageEffects#d4e35061 as nil") + } + b.ObjStart() + b.PutID("premiumFeatureMessageEffects") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PremiumFeatureMessageEffects) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode premiumFeatureMessageEffects#d4e35061 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("premiumFeatureMessageEffects"); err != nil { + return fmt.Errorf("unable to decode premiumFeatureMessageEffects#d4e35061: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + // PremiumFeatureClassName is schema name of PremiumFeatureClass. const PremiumFeatureClassName = "PremiumFeature" @@ -3079,6 +3210,7 @@ const PremiumFeatureClassName = "PremiumFeature" // case *tdapi.PremiumFeatureMessagePrivacy: // premiumFeatureMessagePrivacy#2fd278f6 // case *tdapi.PremiumFeatureLastSeenTimes: // premiumFeatureLastSeenTimes#d2914a8f // case *tdapi.PremiumFeatureBusiness: // premiumFeatureBusiness#a6609704 +// case *tdapi.PremiumFeatureMessageEffects: // premiumFeatureMessageEffects#d4e35061 // default: panic(v) // } type PremiumFeatureClass interface { @@ -3271,6 +3403,13 @@ func DecodePremiumFeature(buf *bin.Buffer) (PremiumFeatureClass, error) { return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err) } return &v, nil + case PremiumFeatureMessageEffectsTypeID: + // Decoding premiumFeatureMessageEffects#d4e35061. + v := PremiumFeatureMessageEffects{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err) + } + return &v, nil default: return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", bin.NewUnexpectedID(id)) } @@ -3444,6 +3583,13 @@ func DecodeTDLibJSONPremiumFeature(buf tdjson.Decoder) (PremiumFeatureClass, err return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err) } return &v, nil + case "premiumFeatureMessageEffects": + // Decoding premiumFeatureMessageEffects#d4e35061. + v := PremiumFeatureMessageEffects{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", err) + } + return &v, nil default: return nil, fmt.Errorf("unable to decode PremiumFeatureClass: %w", tdjson.NewUnexpectedID(id)) } diff --git a/tdapi/tl_push_message_content_gen.go b/tdapi/tl_push_message_content_gen.go index 24f96bf068..6618630826 100644 --- a/tdapi/tl_push_message_content_gen.go +++ b/tdapi/tl_push_message_content_gen.go @@ -1996,6 +1996,206 @@ func (p *PushMessageContentLocation) GetIsPinned() (value bool) { return p.IsPinned } +// PushMessageContentPaidMedia represents TL type `pushMessageContentPaidMedia#b556e74a`. +type PushMessageContentPaidMedia struct { + // Number of stars needed to buy access to the media in the message; 0 for pinned message + StarCount int64 + // True, if the message is a pinned message with the specified content + IsPinned bool +} + +// PushMessageContentPaidMediaTypeID is TL type id of PushMessageContentPaidMedia. +const PushMessageContentPaidMediaTypeID = 0xb556e74a + +// construct implements constructor of PushMessageContentClass. +func (p PushMessageContentPaidMedia) construct() PushMessageContentClass { return &p } + +// Ensuring interfaces in compile-time for PushMessageContentPaidMedia. +var ( + _ bin.Encoder = &PushMessageContentPaidMedia{} + _ bin.Decoder = &PushMessageContentPaidMedia{} + _ bin.BareEncoder = &PushMessageContentPaidMedia{} + _ bin.BareDecoder = &PushMessageContentPaidMedia{} + + _ PushMessageContentClass = &PushMessageContentPaidMedia{} +) + +func (p *PushMessageContentPaidMedia) Zero() bool { + if p == nil { + return true + } + if !(p.StarCount == 0) { + return false + } + if !(p.IsPinned == false) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (p *PushMessageContentPaidMedia) String() string { + if p == nil { + return "PushMessageContentPaidMedia(nil)" + } + type Alias PushMessageContentPaidMedia + return fmt.Sprintf("PushMessageContentPaidMedia%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PushMessageContentPaidMedia) TypeID() uint32 { + return PushMessageContentPaidMediaTypeID +} + +// TypeName returns name of type in TL schema. +func (*PushMessageContentPaidMedia) TypeName() string { + return "pushMessageContentPaidMedia" +} + +// TypeInfo returns info about TL type. +func (p *PushMessageContentPaidMedia) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "pushMessageContentPaidMedia", + ID: PushMessageContentPaidMediaTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "StarCount", + SchemaName: "star_count", + }, + { + Name: "IsPinned", + SchemaName: "is_pinned", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (p *PushMessageContentPaidMedia) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode pushMessageContentPaidMedia#b556e74a as nil") + } + b.PutID(PushMessageContentPaidMediaTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PushMessageContentPaidMedia) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode pushMessageContentPaidMedia#b556e74a as nil") + } + b.PutInt53(p.StarCount) + b.PutBool(p.IsPinned) + return nil +} + +// Decode implements bin.Decoder. +func (p *PushMessageContentPaidMedia) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode pushMessageContentPaidMedia#b556e74a to nil") + } + if err := b.ConsumeID(PushMessageContentPaidMediaTypeID); err != nil { + return fmt.Errorf("unable to decode pushMessageContentPaidMedia#b556e74a: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PushMessageContentPaidMedia) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode pushMessageContentPaidMedia#b556e74a to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode pushMessageContentPaidMedia#b556e74a: field star_count: %w", err) + } + p.StarCount = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode pushMessageContentPaidMedia#b556e74a: field is_pinned: %w", err) + } + p.IsPinned = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PushMessageContentPaidMedia) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode pushMessageContentPaidMedia#b556e74a as nil") + } + b.ObjStart() + b.PutID("pushMessageContentPaidMedia") + b.Comma() + b.FieldStart("star_count") + b.PutInt53(p.StarCount) + b.Comma() + b.FieldStart("is_pinned") + b.PutBool(p.IsPinned) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PushMessageContentPaidMedia) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode pushMessageContentPaidMedia#b556e74a to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("pushMessageContentPaidMedia"); err != nil { + return fmt.Errorf("unable to decode pushMessageContentPaidMedia#b556e74a: %w", err) + } + case "star_count": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode pushMessageContentPaidMedia#b556e74a: field star_count: %w", err) + } + p.StarCount = value + case "is_pinned": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode pushMessageContentPaidMedia#b556e74a: field is_pinned: %w", err) + } + p.IsPinned = value + default: + return b.Skip() + } + return nil + }) +} + +// GetStarCount returns value of StarCount field. +func (p *PushMessageContentPaidMedia) GetStarCount() (value int64) { + if p == nil { + return + } + return p.StarCount +} + +// GetIsPinned returns value of IsPinned field. +func (p *PushMessageContentPaidMedia) GetIsPinned() (value bool) { + if p == nil { + return + } + return p.IsPinned +} + // PushMessageContentPhoto represents TL type `pushMessageContentPhoto#861dc52`. type PushMessageContentPhoto struct { // Message content; may be null @@ -6578,6 +6778,7 @@ const PushMessageContentClassName = "PushMessageContent" // case *tdapi.PushMessageContentGameScore: // pushMessageContentGameScore#35b8cd88 // case *tdapi.PushMessageContentInvoice: // pushMessageContentInvoice#98c88bbc // case *tdapi.PushMessageContentLocation: // pushMessageContentLocation#b33a97b3 +// case *tdapi.PushMessageContentPaidMedia: // pushMessageContentPaidMedia#b556e74a // case *tdapi.PushMessageContentPhoto: // pushMessageContentPhoto#861dc52 // case *tdapi.PushMessageContentPoll: // pushMessageContentPoll#fd5a743a // case *tdapi.PushMessageContentPremiumGiftCode: // pushMessageContentPremiumGiftCode#18a15025 @@ -6703,6 +6904,13 @@ func DecodePushMessageContent(buf *bin.Buffer) (PushMessageContentClass, error) return nil, fmt.Errorf("unable to decode PushMessageContentClass: %w", err) } return &v, nil + case PushMessageContentPaidMediaTypeID: + // Decoding pushMessageContentPaidMedia#b556e74a. + v := PushMessageContentPaidMedia{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode PushMessageContentClass: %w", err) + } + return &v, nil case PushMessageContentPhotoTypeID: // Decoding pushMessageContentPhoto#861dc52. v := PushMessageContentPhoto{} @@ -6953,6 +7161,13 @@ func DecodeTDLibJSONPushMessageContent(buf tdjson.Decoder) (PushMessageContentCl return nil, fmt.Errorf("unable to decode PushMessageContentClass: %w", err) } return &v, nil + case "pushMessageContentPaidMedia": + // Decoding pushMessageContentPaidMedia#b556e74a. + v := PushMessageContentPaidMedia{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode PushMessageContentClass: %w", err) + } + return &v, nil case "pushMessageContentPhoto": // Decoding pushMessageContentPhoto#861dc52. v := PushMessageContentPhoto{} diff --git a/tdapi/tl_read_date_privacy_settings_gen.go b/tdapi/tl_read_date_privacy_settings_gen.go index ec048fbe89..0af46abc3c 100644 --- a/tdapi/tl_read_date_privacy_settings_gen.go +++ b/tdapi/tl_read_date_privacy_settings_gen.go @@ -35,7 +35,7 @@ var ( type ReadDatePrivacySettings struct { // True, if message read date is shown to other users in private chats. If false and the // current user isn't a Telegram Premium user, then they will not be able to see other's - // message read date. + // message read date ShowReadDate bool } diff --git a/tdapi/tl_registry_gen.go b/tdapi/tl_registry_gen.go index 7bc0082f70..d4f309ade4 100644 --- a/tdapi/tl_registry_gen.go +++ b/tdapi/tl_registry_gen.go @@ -52,7 +52,7 @@ func TypesMap() map[uint32]string { AuthenticationCodeTypeFlashCallTypeID: "authenticationCodeTypeFlashCall#533379a2", AuthenticationCodeTypeMissedCallTypeID: "authenticationCodeTypeMissedCall#29bb0a87", AuthenticationCodeTypeFragmentTypeID: "authenticationCodeTypeFragment#810f74cd", - AuthenticationCodeTypeFirebaseAndroidTypeID: "authenticationCodeTypeFirebaseAndroid#e5a1fe7d", + AuthenticationCodeTypeFirebaseAndroidTypeID: "authenticationCodeTypeFirebaseAndroid#6f9bb51e", AuthenticationCodeTypeFirebaseIosTypeID: "authenticationCodeTypeFirebaseIos#ff55aa93", AuthenticationCodeInfoTypeID: "authenticationCodeInfo#ccb82bb8", EmailAddressAuthenticationCodeInfoTypeID: "emailAddressAuthenticationCodeInfo#449be223", @@ -77,6 +77,8 @@ func TypesMap() map[uint32]string { AuthorizationStateLoggingOutTypeID: "authorizationStateLoggingOut#934b576", AuthorizationStateClosingTypeID: "authorizationStateClosing#1a93364f", AuthorizationStateClosedTypeID: "authorizationStateClosed#5af5a360", + FirebaseDeviceVerificationParametersSafetyNetTypeID: "firebaseDeviceVerificationParametersSafetyNet#2b96b2f1", + FirebaseDeviceVerificationParametersPlayIntegrityTypeID: "firebaseDeviceVerificationParametersPlayIntegrity#caf4a58a", PasswordStateTypeID: "passwordState#1cd63828", RecoveryEmailAddressTypeID: "recoveryEmailAddress#4cebddeb", TemporaryPasswordStateTypeID: "temporaryPasswordState#3804c7e2", @@ -188,8 +190,9 @@ func TypesMap() map[uint32]string { StarTransactionPartnerAppStoreTypeID: "starTransactionPartnerAppStore#e34026dc", StarTransactionPartnerGooglePlayTypeID: "starTransactionPartnerGooglePlay#f229f2a0", StarTransactionPartnerFragmentTypeID: "starTransactionPartnerFragment#da1849b5", - StarTransactionPartnerUserTypeID: "starTransactionPartnerUser#bf9b5805", - StarTransactionPartnerChannelTypeID: "starTransactionPartnerChannel#6ddac2f4", + StarTransactionPartnerTelegramAdsTypeID: "starTransactionPartnerTelegramAds#91f9c6b", + StarTransactionPartnerBotTypeID: "starTransactionPartnerBot#1bdcb459", + StarTransactionPartnerChannelTypeID: "starTransactionPartnerChannel#44b29c29", StarTransactionPartnerUnsupportedTypeID: "starTransactionPartnerUnsupported#c4b20d73", StarTransactionTypeID: "starTransaction#ce1084a8", StarTransactionsTypeID: "starTransactions#306a010e", @@ -251,7 +254,7 @@ func TypesMap() map[uint32]string { BasicGroupTypeID: "basicGroup#f464168f", BasicGroupFullInfoTypeID: "basicGroupFullInfo#d62e521e", SupergroupTypeID: "supergroup#39a14289", - SupergroupFullInfoTypeID: "supergroupFullInfo#d262590a", + SupergroupFullInfoTypeID: "supergroupFullInfo#c02dd0a6", SecretChatStatePendingTypeID: "secretChatStatePending#9e6c967c", SecretChatStateReadyTypeID: "secretChatStateReady#9ff4b7e9", SecretChatStateClosedTypeID: "secretChatStateClosed#8c1006ed", @@ -485,7 +488,7 @@ func TypesMap() map[uint32]string { BankCardInfoTypeID: "bankCardInfo#2bc7da9f", AddressTypeID: "address#86304f3a", LocationAddressTypeID: "locationAddress#a3dad322", - ThemeParametersTypeID: "themeParameters#af3f42fc", + ThemeParametersTypeID: "themeParameters#b47510c1", LabeledPricePartTypeID: "labeledPricePart#20f2e726", InvoiceTypeID: "invoice#c19b2377", OrderInfoTypeID: "orderInfo#2ebad96e", @@ -510,10 +513,10 @@ func TypesMap() map[uint32]string { InputInvoiceMessageTypeID: "inputInvoiceMessage#58dcea10", InputInvoiceNameTypeID: "inputInvoiceName#b1ca16f3", InputInvoiceTelegramTypeID: "inputInvoiceTelegram#96ecfeed", - MessageExtendedMediaPreviewTypeID: "messageExtendedMediaPreview#7703a347", - MessageExtendedMediaPhotoTypeID: "messageExtendedMediaPhoto#c68b4530", - MessageExtendedMediaVideoTypeID: "messageExtendedMediaVideo#11acbf3b", - MessageExtendedMediaUnsupportedTypeID: "messageExtendedMediaUnsupported#141f5020", + PaidMediaPreviewTypeID: "paidMediaPreview#bcc1c474", + PaidMediaPhotoTypeID: "paidMediaPhoto#ba82551a", + PaidMediaVideoTypeID: "paidMediaVideo#1bb52e09", + PaidMediaUnsupportedTypeID: "paidMediaUnsupported#6bc3e26", PremiumGiveawayParametersTypeID: "premiumGiveawayParameters#f9f5bf5e", DatedFileTypeID: "datedFile#9247b09d", PassportElementTypePersonalDetailsTypeID: "passportElementTypePersonalDetails#c27ad953", @@ -592,6 +595,7 @@ func TypesMap() map[uint32]string { MessageAnimationTypeID: "messageAnimation#8ecb1128", MessageAudioTypeID: "messageAudio#107e741c", MessageDocumentTypeID: "messageDocument#2394ab77", + MessagePaidMediaTypeID: "messagePaidMedia#3e5fd7c2", MessagePhotoTypeID: "messagePhoto#754c7e1f", MessageStickerTypeID: "messageSticker#e5f0dcca", MessageVideoTypeID: "messageVideo#adc2be09", @@ -609,7 +613,7 @@ func TypesMap() map[uint32]string { MessageGameTypeID: "messageGame#fbdc6976", MessagePollTypeID: "messagePoll#d888b24d", MessageStoryTypeID: "messageStory#3329f2d4", - MessageInvoiceTypeID: "messageInvoice#d8201a53", + MessageInvoiceTypeID: "messageInvoice#fadfd46", MessageCallTypeID: "messageCall#201ede00", MessageVideoChatScheduledTypeID: "messageVideoChatScheduled#916c1db7", MessageVideoChatStartedTypeID: "messageVideoChatStarted#1f114559", @@ -680,6 +684,9 @@ func TypesMap() map[uint32]string { TextEntityTypeCustomEmojiTypeID: "textEntityTypeCustomEmoji#66ceacc5", TextEntityTypeMediaTimestampTypeID: "textEntityTypeMediaTimestamp#9236da10", InputThumbnailTypeID: "inputThumbnail#5e515024", + InputPaidMediaTypePhotoTypeID: "inputPaidMediaTypePhoto#d299fd1a", + InputPaidMediaTypeVideoTypeID: "inputPaidMediaTypeVideo#b053f9fc", + InputPaidMediaTypeID: "inputPaidMedia#19f0fc79", MessageSchedulingStateSendAtDateTypeID: "messageSchedulingStateSendAtDate#a773ffe7", MessageSchedulingStateSendWhenOnlineTypeID: "messageSchedulingStateSendWhenOnline#7cbfd808", MessageSelfDestructTypeTimerTypeID: "messageSelfDestructTypeTimer#508d57cd", @@ -690,6 +697,7 @@ func TypesMap() map[uint32]string { InputMessageAnimationTypeID: "inputMessageAnimation#19fe563", InputMessageAudioTypeID: "inputMessageAudio#daa400b2", InputMessageDocumentTypeID: "inputMessageDocument#615b72b9", + InputMessagePaidMediaTypeID: "inputMessagePaidMedia#36f9c23c", InputMessagePhotoTypeID: "inputMessagePhoto#bc78dbcc", InputMessageStickerTypeID: "inputMessageSticker#3ff1b6f9", InputMessageVideoTypeID: "inputMessageVideo#1a64cc26", @@ -700,7 +708,7 @@ func TypesMap() map[uint32]string { InputMessageContactTypeID: "inputMessageContact#c5710cff", InputMessageDiceTypeID: "inputMessageDice#322967a9", InputMessageGameTypeID: "inputMessageGame#4aae6ae2", - InputMessageInvoiceTypeID: "inputMessageInvoice#34cd1d60", + InputMessageInvoiceTypeID: "inputMessageInvoice#babc8f71", InputMessagePollTypeID: "inputMessagePoll#9046c716", InputMessageStoryTypeID: "inputMessageStory#21099d63", InputMessageForwardedTypeID: "inputMessageForwarded#651a73f8", @@ -1016,6 +1024,7 @@ func TypesMap() map[uint32]string { PremiumFeatureMessagePrivacyTypeID: "premiumFeatureMessagePrivacy#2fd278f6", PremiumFeatureLastSeenTimesTypeID: "premiumFeatureLastSeenTimes#d2914a8f", PremiumFeatureBusinessTypeID: "premiumFeatureBusiness#a6609704", + PremiumFeatureMessageEffectsTypeID: "premiumFeatureMessageEffects#d4e35061", BusinessFeatureLocationTypeID: "businessFeatureLocation#c090027c", BusinessFeatureOpeningHoursTypeID: "businessFeatureOpeningHours#1b7b22ed", BusinessFeatureQuickRepliesTypeID: "businessFeatureQuickReplies#9c380a82", @@ -1117,6 +1126,7 @@ func TypesMap() map[uint32]string { PushMessageContentGameScoreTypeID: "pushMessageContentGameScore#35b8cd88", PushMessageContentInvoiceTypeID: "pushMessageContentInvoice#98c88bbc", PushMessageContentLocationTypeID: "pushMessageContentLocation#b33a97b3", + PushMessageContentPaidMediaTypeID: "pushMessageContentPaidMedia#b556e74a", PushMessageContentPhotoTypeID: "pushMessageContentPhoto#861dc52", PushMessageContentPollTypeID: "pushMessageContentPoll#fd5a743a", PushMessageContentPremiumGiftCodeTypeID: "pushMessageContentPremiumGiftCode#18a15025", @@ -1264,7 +1274,7 @@ func TypesMap() map[uint32]string { InternalLinkTypeQrCodeAuthenticationTypeID: "internalLinkTypeQrCodeAuthentication#bf121924", InternalLinkTypeRestorePurchasesTypeID: "internalLinkTypeRestorePurchases#24203483", InternalLinkTypeSettingsTypeID: "internalLinkTypeSettings#177545b4", - InternalLinkTypeSideMenuBotTypeID: "internalLinkTypeSideMenuBot#a260e77d", + InternalLinkTypeSideMenuBotTypeID: "internalLinkTypeSideMenuBot#c45f0c16", InternalLinkTypeStickerSetTypeID: "internalLinkTypeStickerSet#a1464fa2", InternalLinkTypeStoryTypeID: "internalLinkTypeStory#57bce647", InternalLinkTypeThemeTypeID: "internalLinkTypeTheme#f405f807", @@ -1274,7 +1284,7 @@ func TypesMap() map[uint32]string { InternalLinkTypeUserPhoneNumberTypeID: "internalLinkTypeUserPhoneNumber#77c08091", InternalLinkTypeUserTokenTypeID: "internalLinkTypeUserToken#a8d7db59", InternalLinkTypeVideoChatTypeID: "internalLinkTypeVideoChat#8796f8b4", - InternalLinkTypeWebAppTypeID: "internalLinkTypeWebApp#fc98d04f", + InternalLinkTypeWebAppTypeID: "internalLinkTypeWebApp#4c68bb0d", MessageLinkTypeID: "messageLink#af4a3aa6", MessageLinkInfoTypeID: "messageLinkInfo#2b96fb50", ChatBoostLinkTypeID: "chatBoostLink#b5417c71", @@ -1488,7 +1498,7 @@ func TypesMap() map[uint32]string { UpdateFileAddedToDownloadsTypeID: "updateFileAddedToDownloads#5ff5921a", UpdateFileDownloadTypeID: "updateFileDownload#342f83ca", UpdateFileRemovedFromDownloadsTypeID: "updateFileRemovedFromDownloads#6e7c14e8", - UpdateApplicationVerificationRequiredTypeID: "updateApplicationVerificationRequired#32079e05", + UpdateApplicationVerificationRequiredTypeID: "updateApplicationVerificationRequired#c59c61d7", UpdateCallTypeID: "updateCall#4fb3d0dd", UpdateGroupCallTypeID: "updateGroupCall#30324e00", UpdateGroupCallParticipantTypeID: "updateGroupCallParticipant#d0213cf9", @@ -2221,6 +2231,7 @@ func TypesMap() map[uint32]string { GetChatRevenueTransactionsRequestTypeID: "getChatRevenueTransactions#472f0715", GetStarRevenueStatisticsRequestTypeID: "getStarRevenueStatistics#f07b4517", GetStarWithdrawalURLRequestTypeID: "getStarWithdrawalUrl#a9d23712", + GetStarAdAccountURLRequestTypeID: "getStarAdAccountUrl#73a9455d", GetChatStatisticsRequestTypeID: "getChatStatistics#137e8198", GetMessageStatisticsRequestTypeID: "getMessageStatistics#4bb5a1d8", GetMessagePublicForwardsRequestTypeID: "getMessagePublicForwards#519da4b4", @@ -2339,850 +2350,858 @@ func TypesMap() map[uint32]string { // NamesMap returns mapping from type names to TL type ids. func NamesMap() map[string]uint32 { return map[string]uint32{ - "double": DoubleTypeID, - "string": StringTypeID, - "int32": Int32TypeID, - "int53": Int53TypeID, - "int64": Int64TypeID, - "bytes": BytesTypeID, - "boolFalse": BoolFalseTypeID, - "boolTrue": BoolTrueTypeID, - "error": ErrorTypeID, - "ok": OkTypeID, - "authenticationCodeTypeTelegramMessage": AuthenticationCodeTypeTelegramMessageTypeID, - "authenticationCodeTypeSms": AuthenticationCodeTypeSMSTypeID, - "authenticationCodeTypeSmsWord": AuthenticationCodeTypeSMSWordTypeID, - "authenticationCodeTypeSmsPhrase": AuthenticationCodeTypeSMSPhraseTypeID, - "authenticationCodeTypeCall": AuthenticationCodeTypeCallTypeID, - "authenticationCodeTypeFlashCall": AuthenticationCodeTypeFlashCallTypeID, - "authenticationCodeTypeMissedCall": AuthenticationCodeTypeMissedCallTypeID, - "authenticationCodeTypeFragment": AuthenticationCodeTypeFragmentTypeID, - "authenticationCodeTypeFirebaseAndroid": AuthenticationCodeTypeFirebaseAndroidTypeID, - "authenticationCodeTypeFirebaseIos": AuthenticationCodeTypeFirebaseIosTypeID, - "authenticationCodeInfo": AuthenticationCodeInfoTypeID, - "emailAddressAuthenticationCodeInfo": EmailAddressAuthenticationCodeInfoTypeID, - "emailAddressAuthenticationCode": EmailAddressAuthenticationCodeTypeID, - "emailAddressAuthenticationAppleId": EmailAddressAuthenticationAppleIDTypeID, - "emailAddressAuthenticationGoogleId": EmailAddressAuthenticationGoogleIDTypeID, - "emailAddressResetStateAvailable": EmailAddressResetStateAvailableTypeID, - "emailAddressResetStatePending": EmailAddressResetStatePendingTypeID, - "textEntity": TextEntityTypeID, - "textEntities": TextEntitiesTypeID, - "formattedText": FormattedTextTypeID, - "termsOfService": TermsOfServiceTypeID, - "authorizationStateWaitTdlibParameters": AuthorizationStateWaitTdlibParametersTypeID, - "authorizationStateWaitPhoneNumber": AuthorizationStateWaitPhoneNumberTypeID, - "authorizationStateWaitEmailAddress": AuthorizationStateWaitEmailAddressTypeID, - "authorizationStateWaitEmailCode": AuthorizationStateWaitEmailCodeTypeID, - "authorizationStateWaitCode": AuthorizationStateWaitCodeTypeID, - "authorizationStateWaitOtherDeviceConfirmation": AuthorizationStateWaitOtherDeviceConfirmationTypeID, - "authorizationStateWaitRegistration": AuthorizationStateWaitRegistrationTypeID, - "authorizationStateWaitPassword": AuthorizationStateWaitPasswordTypeID, - "authorizationStateReady": AuthorizationStateReadyTypeID, - "authorizationStateLoggingOut": AuthorizationStateLoggingOutTypeID, - "authorizationStateClosing": AuthorizationStateClosingTypeID, - "authorizationStateClosed": AuthorizationStateClosedTypeID, - "passwordState": PasswordStateTypeID, - "recoveryEmailAddress": RecoveryEmailAddressTypeID, - "temporaryPasswordState": TemporaryPasswordStateTypeID, - "localFile": LocalFileTypeID, - "remoteFile": RemoteFileTypeID, - "file": FileTypeID, - "inputFileId": InputFileIDTypeID, - "inputFileRemote": InputFileRemoteTypeID, - "inputFileLocal": InputFileLocalTypeID, - "inputFileGenerated": InputFileGeneratedTypeID, - "photoSize": PhotoSizeTypeID, - "minithumbnail": MinithumbnailTypeID, - "thumbnailFormatJpeg": ThumbnailFormatJpegTypeID, - "thumbnailFormatGif": ThumbnailFormatGifTypeID, - "thumbnailFormatMpeg4": ThumbnailFormatMpeg4TypeID, - "thumbnailFormatPng": ThumbnailFormatPngTypeID, - "thumbnailFormatTgs": ThumbnailFormatTgsTypeID, - "thumbnailFormatWebm": ThumbnailFormatWebmTypeID, - "thumbnailFormatWebp": ThumbnailFormatWebpTypeID, - "thumbnail": ThumbnailTypeID, - "maskPointForehead": MaskPointForeheadTypeID, - "maskPointEyes": MaskPointEyesTypeID, - "maskPointMouth": MaskPointMouthTypeID, - "maskPointChin": MaskPointChinTypeID, - "maskPosition": MaskPositionTypeID, - "stickerFormatWebp": StickerFormatWebpTypeID, - "stickerFormatTgs": StickerFormatTgsTypeID, - "stickerFormatWebm": StickerFormatWebmTypeID, - "stickerTypeRegular": StickerTypeRegularTypeID, - "stickerTypeMask": StickerTypeMaskTypeID, - "stickerTypeCustomEmoji": StickerTypeCustomEmojiTypeID, - "stickerFullTypeRegular": StickerFullTypeRegularTypeID, - "stickerFullTypeMask": StickerFullTypeMaskTypeID, - "stickerFullTypeCustomEmoji": StickerFullTypeCustomEmojiTypeID, - "closedVectorPath": ClosedVectorPathTypeID, - "pollOption": PollOptionTypeID, - "pollTypeRegular": PollTypeRegularTypeID, - "pollTypeQuiz": PollTypeQuizTypeID, - "animation": AnimationTypeID, - "audio": AudioTypeID, - "document": DocumentTypeID, - "photo": PhotoTypeID, - "sticker": StickerTypeID, - "video": VideoTypeID, - "videoNote": VideoNoteTypeID, - "voiceNote": VoiceNoteTypeID, - "animatedEmoji": AnimatedEmojiTypeID, - "contact": ContactTypeID, - "location": LocationTypeID, - "venue": VenueTypeID, - "game": GameTypeID, - "webApp": WebAppTypeID, - "poll": PollTypeID, - "background": BackgroundTypeID, - "backgrounds": BackgroundsTypeID, - "chatBackground": ChatBackgroundTypeID, - "profilePhoto": ProfilePhotoTypeID, - "chatPhotoInfo": ChatPhotoInfoTypeID, - "userTypeRegular": UserTypeRegularTypeID, - "userTypeDeleted": UserTypeDeletedTypeID, - "userTypeBot": UserTypeBotTypeID, - "userTypeUnknown": UserTypeUnknownTypeID, - "botCommand": BotCommandTypeID, - "botCommands": BotCommandsTypeID, - "botMenuButton": BotMenuButtonTypeID, - "chatLocation": ChatLocationTypeID, - "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, - "productInfo": ProductInfoTypeID, - "premiumPaymentOption": PremiumPaymentOptionTypeID, - "premiumStatePaymentOption": PremiumStatePaymentOptionTypeID, - "premiumGiftCodePaymentOption": PremiumGiftCodePaymentOptionTypeID, - "premiumGiftCodePaymentOptions": PremiumGiftCodePaymentOptionsTypeID, - "premiumGiftCodeInfo": PremiumGiftCodeInfoTypeID, - "starPaymentOption": StarPaymentOptionTypeID, - "starPaymentOptions": StarPaymentOptionsTypeID, - "starTransactionDirectionIncoming": StarTransactionDirectionIncomingTypeID, - "starTransactionDirectionOutgoing": StarTransactionDirectionOutgoingTypeID, - "starTransactionPartnerTelegram": StarTransactionPartnerTelegramTypeID, - "starTransactionPartnerAppStore": StarTransactionPartnerAppStoreTypeID, - "starTransactionPartnerGooglePlay": StarTransactionPartnerGooglePlayTypeID, - "starTransactionPartnerFragment": StarTransactionPartnerFragmentTypeID, - "starTransactionPartnerUser": StarTransactionPartnerUserTypeID, - "starTransactionPartnerChannel": StarTransactionPartnerChannelTypeID, - "starTransactionPartnerUnsupported": StarTransactionPartnerUnsupportedTypeID, - "starTransaction": StarTransactionTypeID, - "starTransactions": StarTransactionsTypeID, - "premiumGiveawayParticipantStatusEligible": PremiumGiveawayParticipantStatusEligibleTypeID, - "premiumGiveawayParticipantStatusParticipating": PremiumGiveawayParticipantStatusParticipatingTypeID, - "premiumGiveawayParticipantStatusAlreadyWasMember": PremiumGiveawayParticipantStatusAlreadyWasMemberTypeID, - "premiumGiveawayParticipantStatusAdministrator": PremiumGiveawayParticipantStatusAdministratorTypeID, - "premiumGiveawayParticipantStatusDisallowedCountry": PremiumGiveawayParticipantStatusDisallowedCountryTypeID, - "premiumGiveawayInfoOngoing": PremiumGiveawayInfoOngoingTypeID, - "premiumGiveawayInfoCompleted": PremiumGiveawayInfoCompletedTypeID, - "accentColor": AccentColorTypeID, - "profileAccentColors": ProfileAccentColorsTypeID, - "profileAccentColor": ProfileAccentColorTypeID, - "emojiStatus": EmojiStatusTypeID, - "emojiStatuses": EmojiStatusesTypeID, - "usernames": UsernamesTypeID, - "user": UserTypeID, - "botInfo": BotInfoTypeID, - "userFullInfo": UserFullInfoTypeID, - "users": UsersTypeID, - "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, - "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, - "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, - "messageThreadInfo": MessageThreadInfoTypeID, - "savedMessagesTopicTypeMyNotes": SavedMessagesTopicTypeMyNotesTypeID, - "savedMessagesTopicTypeAuthorHidden": SavedMessagesTopicTypeAuthorHiddenTypeID, - "savedMessagesTopicTypeSavedFromChat": SavedMessagesTopicTypeSavedFromChatTypeID, - "savedMessagesTopic": SavedMessagesTopicTypeID, - "forumTopicIcon": ForumTopicIconTypeID, - "forumTopicInfo": ForumTopicInfoTypeID, - "forumTopic": ForumTopicTypeID, - "forumTopics": ForumTopicsTypeID, - "linkPreviewOptions": LinkPreviewOptionsTypeID, - "sharedUser": SharedUserTypeID, - "sharedChat": SharedChatTypeID, - "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, - "webPage": WebPageTypeID, - "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, - "messageExtendedMediaPreview": MessageExtendedMediaPreviewTypeID, - "messageExtendedMediaPhoto": MessageExtendedMediaPhotoTypeID, - "messageExtendedMediaVideo": MessageExtendedMediaVideoTypeID, - "messageExtendedMediaUnsupported": MessageExtendedMediaUnsupportedTypeID, - "premiumGiveawayParameters": PremiumGiveawayParametersTypeID, - "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, - "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, - "messageGiftedPremium": MessageGiftedPremiumTypeID, - "messagePremiumGiftCode": MessagePremiumGiftCodeTypeID, - "messagePremiumGiveawayCreated": MessagePremiumGiveawayCreatedTypeID, - "messagePremiumGiveaway": MessagePremiumGiveawayTypeID, - "messagePremiumGiveawayCompleted": MessagePremiumGiveawayCompletedTypeID, - "messagePremiumGiveawayWinners": MessagePremiumGiveawayWinnersTypeID, - "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, - "messageSchedulingStateSendAtDate": MessageSchedulingStateSendAtDateTypeID, - "messageSchedulingStateSendWhenOnline": MessageSchedulingStateSendWhenOnlineTypeID, - "messageSelfDestructTypeTimer": MessageSelfDestructTypeTimerTypeID, - "messageSelfDestructTypeImmediately": MessageSelfDestructTypeImmediatelyTypeID, - "messageSendOptions": MessageSendOptionsTypeID, - "messageCopyOptions": MessageCopyOptionsTypeID, - "inputMessageText": InputMessageTextTypeID, - "inputMessageAnimation": InputMessageAnimationTypeID, - "inputMessageAudio": InputMessageAudioTypeID, - "inputMessageDocument": InputMessageDocumentTypeID, - "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, - "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, - "storyAreaPosition": StoryAreaPositionTypeID, - "storyAreaTypeLocation": StoryAreaTypeLocationTypeID, - "storyAreaTypeVenue": StoryAreaTypeVenueTypeID, - "storyAreaTypeSuggestedReaction": StoryAreaTypeSuggestedReactionTypeID, - "storyAreaTypeMessage": StoryAreaTypeMessageTypeID, - "storyAreaTypeLink": StoryAreaTypeLinkTypeID, - "storyArea": StoryAreaTypeID, - "inputStoryAreaTypeLocation": InputStoryAreaTypeLocationTypeID, - "inputStoryAreaTypeFoundVenue": InputStoryAreaTypeFoundVenueTypeID, - "inputStoryAreaTypePreviousVenue": InputStoryAreaTypePreviousVenueTypeID, - "inputStoryAreaTypeSuggestedReaction": InputStoryAreaTypeSuggestedReactionTypeID, - "inputStoryAreaTypeMessage": InputStoryAreaTypeMessageTypeID, - "inputStoryAreaTypeLink": InputStoryAreaTypeLinkTypeID, - "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, - "chatBoostLevelFeatures": ChatBoostLevelFeaturesTypeID, - "chatBoostFeatures": ChatBoostFeaturesTypeID, - "chatBoostSourceGiftCode": ChatBoostSourceGiftCodeTypeID, - "chatBoostSourceGiveaway": ChatBoostSourceGiveawayTypeID, - "chatBoostSourcePremium": ChatBoostSourcePremiumTypeID, - "prepaidPremiumGiveaway": PrepaidPremiumGiveawayTypeID, - "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, + "double": DoubleTypeID, + "string": StringTypeID, + "int32": Int32TypeID, + "int53": Int53TypeID, + "int64": Int64TypeID, + "bytes": BytesTypeID, + "boolFalse": BoolFalseTypeID, + "boolTrue": BoolTrueTypeID, + "error": ErrorTypeID, + "ok": OkTypeID, + "authenticationCodeTypeTelegramMessage": AuthenticationCodeTypeTelegramMessageTypeID, + "authenticationCodeTypeSms": AuthenticationCodeTypeSMSTypeID, + "authenticationCodeTypeSmsWord": AuthenticationCodeTypeSMSWordTypeID, + "authenticationCodeTypeSmsPhrase": AuthenticationCodeTypeSMSPhraseTypeID, + "authenticationCodeTypeCall": AuthenticationCodeTypeCallTypeID, + "authenticationCodeTypeFlashCall": AuthenticationCodeTypeFlashCallTypeID, + "authenticationCodeTypeMissedCall": AuthenticationCodeTypeMissedCallTypeID, + "authenticationCodeTypeFragment": AuthenticationCodeTypeFragmentTypeID, + "authenticationCodeTypeFirebaseAndroid": AuthenticationCodeTypeFirebaseAndroidTypeID, + "authenticationCodeTypeFirebaseIos": AuthenticationCodeTypeFirebaseIosTypeID, + "authenticationCodeInfo": AuthenticationCodeInfoTypeID, + "emailAddressAuthenticationCodeInfo": EmailAddressAuthenticationCodeInfoTypeID, + "emailAddressAuthenticationCode": EmailAddressAuthenticationCodeTypeID, + "emailAddressAuthenticationAppleId": EmailAddressAuthenticationAppleIDTypeID, + "emailAddressAuthenticationGoogleId": EmailAddressAuthenticationGoogleIDTypeID, + "emailAddressResetStateAvailable": EmailAddressResetStateAvailableTypeID, + "emailAddressResetStatePending": EmailAddressResetStatePendingTypeID, + "textEntity": TextEntityTypeID, + "textEntities": TextEntitiesTypeID, + "formattedText": FormattedTextTypeID, + "termsOfService": TermsOfServiceTypeID, + "authorizationStateWaitTdlibParameters": AuthorizationStateWaitTdlibParametersTypeID, + "authorizationStateWaitPhoneNumber": AuthorizationStateWaitPhoneNumberTypeID, + "authorizationStateWaitEmailAddress": AuthorizationStateWaitEmailAddressTypeID, + "authorizationStateWaitEmailCode": AuthorizationStateWaitEmailCodeTypeID, + "authorizationStateWaitCode": AuthorizationStateWaitCodeTypeID, + "authorizationStateWaitOtherDeviceConfirmation": AuthorizationStateWaitOtherDeviceConfirmationTypeID, + "authorizationStateWaitRegistration": AuthorizationStateWaitRegistrationTypeID, + "authorizationStateWaitPassword": AuthorizationStateWaitPasswordTypeID, + "authorizationStateReady": AuthorizationStateReadyTypeID, + "authorizationStateLoggingOut": AuthorizationStateLoggingOutTypeID, + "authorizationStateClosing": AuthorizationStateClosingTypeID, + "authorizationStateClosed": AuthorizationStateClosedTypeID, + "firebaseDeviceVerificationParametersSafetyNet": FirebaseDeviceVerificationParametersSafetyNetTypeID, + "firebaseDeviceVerificationParametersPlayIntegrity": FirebaseDeviceVerificationParametersPlayIntegrityTypeID, + "passwordState": PasswordStateTypeID, + "recoveryEmailAddress": RecoveryEmailAddressTypeID, + "temporaryPasswordState": TemporaryPasswordStateTypeID, + "localFile": LocalFileTypeID, + "remoteFile": RemoteFileTypeID, + "file": FileTypeID, + "inputFileId": InputFileIDTypeID, + "inputFileRemote": InputFileRemoteTypeID, + "inputFileLocal": InputFileLocalTypeID, + "inputFileGenerated": InputFileGeneratedTypeID, + "photoSize": PhotoSizeTypeID, + "minithumbnail": MinithumbnailTypeID, + "thumbnailFormatJpeg": ThumbnailFormatJpegTypeID, + "thumbnailFormatGif": ThumbnailFormatGifTypeID, + "thumbnailFormatMpeg4": ThumbnailFormatMpeg4TypeID, + "thumbnailFormatPng": ThumbnailFormatPngTypeID, + "thumbnailFormatTgs": ThumbnailFormatTgsTypeID, + "thumbnailFormatWebm": ThumbnailFormatWebmTypeID, + "thumbnailFormatWebp": ThumbnailFormatWebpTypeID, + "thumbnail": ThumbnailTypeID, + "maskPointForehead": MaskPointForeheadTypeID, + "maskPointEyes": MaskPointEyesTypeID, + "maskPointMouth": MaskPointMouthTypeID, + "maskPointChin": MaskPointChinTypeID, + "maskPosition": MaskPositionTypeID, + "stickerFormatWebp": StickerFormatWebpTypeID, + "stickerFormatTgs": StickerFormatTgsTypeID, + "stickerFormatWebm": StickerFormatWebmTypeID, + "stickerTypeRegular": StickerTypeRegularTypeID, + "stickerTypeMask": StickerTypeMaskTypeID, + "stickerTypeCustomEmoji": StickerTypeCustomEmojiTypeID, + "stickerFullTypeRegular": StickerFullTypeRegularTypeID, + "stickerFullTypeMask": StickerFullTypeMaskTypeID, + "stickerFullTypeCustomEmoji": StickerFullTypeCustomEmojiTypeID, + "closedVectorPath": ClosedVectorPathTypeID, + "pollOption": PollOptionTypeID, + "pollTypeRegular": PollTypeRegularTypeID, + "pollTypeQuiz": PollTypeQuizTypeID, + "animation": AnimationTypeID, + "audio": AudioTypeID, + "document": DocumentTypeID, + "photo": PhotoTypeID, + "sticker": StickerTypeID, + "video": VideoTypeID, + "videoNote": VideoNoteTypeID, + "voiceNote": VoiceNoteTypeID, + "animatedEmoji": AnimatedEmojiTypeID, + "contact": ContactTypeID, + "location": LocationTypeID, + "venue": VenueTypeID, + "game": GameTypeID, + "webApp": WebAppTypeID, + "poll": PollTypeID, + "background": BackgroundTypeID, + "backgrounds": BackgroundsTypeID, + "chatBackground": ChatBackgroundTypeID, + "profilePhoto": ProfilePhotoTypeID, + "chatPhotoInfo": ChatPhotoInfoTypeID, + "userTypeRegular": UserTypeRegularTypeID, + "userTypeDeleted": UserTypeDeletedTypeID, + "userTypeBot": UserTypeBotTypeID, + "userTypeUnknown": UserTypeUnknownTypeID, + "botCommand": BotCommandTypeID, + "botCommands": BotCommandsTypeID, + "botMenuButton": BotMenuButtonTypeID, + "chatLocation": ChatLocationTypeID, + "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, + "productInfo": ProductInfoTypeID, + "premiumPaymentOption": PremiumPaymentOptionTypeID, + "premiumStatePaymentOption": PremiumStatePaymentOptionTypeID, + "premiumGiftCodePaymentOption": PremiumGiftCodePaymentOptionTypeID, + "premiumGiftCodePaymentOptions": PremiumGiftCodePaymentOptionsTypeID, + "premiumGiftCodeInfo": PremiumGiftCodeInfoTypeID, + "starPaymentOption": StarPaymentOptionTypeID, + "starPaymentOptions": StarPaymentOptionsTypeID, + "starTransactionDirectionIncoming": StarTransactionDirectionIncomingTypeID, + "starTransactionDirectionOutgoing": StarTransactionDirectionOutgoingTypeID, + "starTransactionPartnerTelegram": StarTransactionPartnerTelegramTypeID, + "starTransactionPartnerAppStore": StarTransactionPartnerAppStoreTypeID, + "starTransactionPartnerGooglePlay": StarTransactionPartnerGooglePlayTypeID, + "starTransactionPartnerFragment": StarTransactionPartnerFragmentTypeID, + "starTransactionPartnerTelegramAds": StarTransactionPartnerTelegramAdsTypeID, + "starTransactionPartnerBot": StarTransactionPartnerBotTypeID, + "starTransactionPartnerChannel": StarTransactionPartnerChannelTypeID, + "starTransactionPartnerUnsupported": StarTransactionPartnerUnsupportedTypeID, + "starTransaction": StarTransactionTypeID, + "starTransactions": StarTransactionsTypeID, + "premiumGiveawayParticipantStatusEligible": PremiumGiveawayParticipantStatusEligibleTypeID, + "premiumGiveawayParticipantStatusParticipating": PremiumGiveawayParticipantStatusParticipatingTypeID, + "premiumGiveawayParticipantStatusAlreadyWasMember": PremiumGiveawayParticipantStatusAlreadyWasMemberTypeID, + "premiumGiveawayParticipantStatusAdministrator": PremiumGiveawayParticipantStatusAdministratorTypeID, + "premiumGiveawayParticipantStatusDisallowedCountry": PremiumGiveawayParticipantStatusDisallowedCountryTypeID, + "premiumGiveawayInfoOngoing": PremiumGiveawayInfoOngoingTypeID, + "premiumGiveawayInfoCompleted": PremiumGiveawayInfoCompletedTypeID, + "accentColor": AccentColorTypeID, + "profileAccentColors": ProfileAccentColorsTypeID, + "profileAccentColor": ProfileAccentColorTypeID, + "emojiStatus": EmojiStatusTypeID, + "emojiStatuses": EmojiStatusesTypeID, + "usernames": UsernamesTypeID, + "user": UserTypeID, + "botInfo": BotInfoTypeID, + "userFullInfo": UserFullInfoTypeID, + "users": UsersTypeID, + "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, + "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, + "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, + "messageThreadInfo": MessageThreadInfoTypeID, + "savedMessagesTopicTypeMyNotes": SavedMessagesTopicTypeMyNotesTypeID, + "savedMessagesTopicTypeAuthorHidden": SavedMessagesTopicTypeAuthorHiddenTypeID, + "savedMessagesTopicTypeSavedFromChat": SavedMessagesTopicTypeSavedFromChatTypeID, + "savedMessagesTopic": SavedMessagesTopicTypeID, + "forumTopicIcon": ForumTopicIconTypeID, + "forumTopicInfo": ForumTopicInfoTypeID, + "forumTopic": ForumTopicTypeID, + "forumTopics": ForumTopicsTypeID, + "linkPreviewOptions": LinkPreviewOptionsTypeID, + "sharedUser": SharedUserTypeID, + "sharedChat": SharedChatTypeID, + "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, + "webPage": WebPageTypeID, + "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, + "premiumGiveawayParameters": PremiumGiveawayParametersTypeID, + "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, + "messageGiftedPremium": MessageGiftedPremiumTypeID, + "messagePremiumGiftCode": MessagePremiumGiftCodeTypeID, + "messagePremiumGiveawayCreated": MessagePremiumGiveawayCreatedTypeID, + "messagePremiumGiveaway": MessagePremiumGiveawayTypeID, + "messagePremiumGiveawayCompleted": MessagePremiumGiveawayCompletedTypeID, + "messagePremiumGiveawayWinners": MessagePremiumGiveawayWinnersTypeID, + "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, + "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, + "storyAreaPosition": StoryAreaPositionTypeID, + "storyAreaTypeLocation": StoryAreaTypeLocationTypeID, + "storyAreaTypeVenue": StoryAreaTypeVenueTypeID, + "storyAreaTypeSuggestedReaction": StoryAreaTypeSuggestedReactionTypeID, + "storyAreaTypeMessage": StoryAreaTypeMessageTypeID, + "storyAreaTypeLink": StoryAreaTypeLinkTypeID, + "storyArea": StoryAreaTypeID, + "inputStoryAreaTypeLocation": InputStoryAreaTypeLocationTypeID, + "inputStoryAreaTypeFoundVenue": InputStoryAreaTypeFoundVenueTypeID, + "inputStoryAreaTypePreviousVenue": InputStoryAreaTypePreviousVenueTypeID, + "inputStoryAreaTypeSuggestedReaction": InputStoryAreaTypeSuggestedReactionTypeID, + "inputStoryAreaTypeMessage": InputStoryAreaTypeMessageTypeID, + "inputStoryAreaTypeLink": InputStoryAreaTypeLinkTypeID, + "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, + "chatBoostLevelFeatures": ChatBoostLevelFeaturesTypeID, + "chatBoostFeatures": ChatBoostFeaturesTypeID, + "chatBoostSourceGiftCode": ChatBoostSourceGiftCodeTypeID, + "chatBoostSourceGiveaway": ChatBoostSourceGiveawayTypeID, + "chatBoostSourcePremium": ChatBoostSourcePremiumTypeID, + "prepaidPremiumGiveaway": PrepaidPremiumGiveawayTypeID, + "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, @@ -3321,6 +3340,7 @@ func NamesMap() map[string]uint32 { "premiumFeatureMessagePrivacy": PremiumFeatureMessagePrivacyTypeID, "premiumFeatureLastSeenTimes": PremiumFeatureLastSeenTimesTypeID, "premiumFeatureBusiness": PremiumFeatureBusinessTypeID, + "premiumFeatureMessageEffects": PremiumFeatureMessageEffectsTypeID, "businessFeatureLocation": BusinessFeatureLocationTypeID, "businessFeatureOpeningHours": BusinessFeatureOpeningHoursTypeID, "businessFeatureQuickReplies": BusinessFeatureQuickRepliesTypeID, @@ -3422,6 +3442,7 @@ func NamesMap() map[string]uint32 { "pushMessageContentGameScore": PushMessageContentGameScoreTypeID, "pushMessageContentInvoice": PushMessageContentInvoiceTypeID, "pushMessageContentLocation": PushMessageContentLocationTypeID, + "pushMessageContentPaidMedia": PushMessageContentPaidMediaTypeID, "pushMessageContentPhoto": PushMessageContentPhotoTypeID, "pushMessageContentPoll": PushMessageContentPollTypeID, "pushMessageContentPremiumGiftCode": PushMessageContentPremiumGiftCodeTypeID, @@ -4526,6 +4547,7 @@ func NamesMap() map[string]uint32 { "getChatRevenueTransactions": GetChatRevenueTransactionsRequestTypeID, "getStarRevenueStatistics": GetStarRevenueStatisticsRequestTypeID, "getStarWithdrawalUrl": GetStarWithdrawalURLRequestTypeID, + "getStarAdAccountUrl": GetStarAdAccountURLRequestTypeID, "getChatStatistics": GetChatStatisticsRequestTypeID, "getMessageStatistics": GetMessageStatisticsRequestTypeID, "getMessagePublicForwards": GetMessagePublicForwardsRequestTypeID, @@ -4687,6 +4709,8 @@ func TypesConstructorMap() map[uint32]func() bin.Object { AuthorizationStateLoggingOutTypeID: func() bin.Object { return &AuthorizationStateLoggingOut{} }, AuthorizationStateClosingTypeID: func() bin.Object { return &AuthorizationStateClosing{} }, AuthorizationStateClosedTypeID: func() bin.Object { return &AuthorizationStateClosed{} }, + FirebaseDeviceVerificationParametersSafetyNetTypeID: func() bin.Object { return &FirebaseDeviceVerificationParametersSafetyNet{} }, + FirebaseDeviceVerificationParametersPlayIntegrityTypeID: func() bin.Object { return &FirebaseDeviceVerificationParametersPlayIntegrity{} }, PasswordStateTypeID: func() bin.Object { return &PasswordState{} }, RecoveryEmailAddressTypeID: func() bin.Object { return &RecoveryEmailAddress{} }, TemporaryPasswordStateTypeID: func() bin.Object { return &TemporaryPasswordState{} }, @@ -4798,7 +4822,8 @@ func TypesConstructorMap() map[uint32]func() bin.Object { StarTransactionPartnerAppStoreTypeID: func() bin.Object { return &StarTransactionPartnerAppStore{} }, StarTransactionPartnerGooglePlayTypeID: func() bin.Object { return &StarTransactionPartnerGooglePlay{} }, StarTransactionPartnerFragmentTypeID: func() bin.Object { return &StarTransactionPartnerFragment{} }, - StarTransactionPartnerUserTypeID: func() bin.Object { return &StarTransactionPartnerUser{} }, + StarTransactionPartnerTelegramAdsTypeID: func() bin.Object { return &StarTransactionPartnerTelegramAds{} }, + StarTransactionPartnerBotTypeID: func() bin.Object { return &StarTransactionPartnerBot{} }, StarTransactionPartnerChannelTypeID: func() bin.Object { return &StarTransactionPartnerChannel{} }, StarTransactionPartnerUnsupportedTypeID: func() bin.Object { return &StarTransactionPartnerUnsupported{} }, StarTransactionTypeID: func() bin.Object { return &StarTransaction{} }, @@ -5120,10 +5145,10 @@ func TypesConstructorMap() map[uint32]func() bin.Object { InputInvoiceMessageTypeID: func() bin.Object { return &InputInvoiceMessage{} }, InputInvoiceNameTypeID: func() bin.Object { return &InputInvoiceName{} }, InputInvoiceTelegramTypeID: func() bin.Object { return &InputInvoiceTelegram{} }, - MessageExtendedMediaPreviewTypeID: func() bin.Object { return &MessageExtendedMediaPreview{} }, - MessageExtendedMediaPhotoTypeID: func() bin.Object { return &MessageExtendedMediaPhoto{} }, - MessageExtendedMediaVideoTypeID: func() bin.Object { return &MessageExtendedMediaVideo{} }, - MessageExtendedMediaUnsupportedTypeID: func() bin.Object { return &MessageExtendedMediaUnsupported{} }, + PaidMediaPreviewTypeID: func() bin.Object { return &PaidMediaPreview{} }, + PaidMediaPhotoTypeID: func() bin.Object { return &PaidMediaPhoto{} }, + PaidMediaVideoTypeID: func() bin.Object { return &PaidMediaVideo{} }, + PaidMediaUnsupportedTypeID: func() bin.Object { return &PaidMediaUnsupported{} }, PremiumGiveawayParametersTypeID: func() bin.Object { return &PremiumGiveawayParameters{} }, DatedFileTypeID: func() bin.Object { return &DatedFile{} }, PassportElementTypePersonalDetailsTypeID: func() bin.Object { return &PassportElementTypePersonalDetails{} }, @@ -5202,6 +5227,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { MessageAnimationTypeID: func() bin.Object { return &MessageAnimation{} }, MessageAudioTypeID: func() bin.Object { return &MessageAudio{} }, MessageDocumentTypeID: func() bin.Object { return &MessageDocument{} }, + MessagePaidMediaTypeID: func() bin.Object { return &MessagePaidMedia{} }, MessagePhotoTypeID: func() bin.Object { return &MessagePhoto{} }, MessageStickerTypeID: func() bin.Object { return &MessageSticker{} }, MessageVideoTypeID: func() bin.Object { return &MessageVideo{} }, @@ -5290,6 +5316,9 @@ func TypesConstructorMap() map[uint32]func() bin.Object { TextEntityTypeCustomEmojiTypeID: func() bin.Object { return &TextEntityTypeCustomEmoji{} }, TextEntityTypeMediaTimestampTypeID: func() bin.Object { return &TextEntityTypeMediaTimestamp{} }, InputThumbnailTypeID: func() bin.Object { return &InputThumbnail{} }, + InputPaidMediaTypePhotoTypeID: func() bin.Object { return &InputPaidMediaTypePhoto{} }, + InputPaidMediaTypeVideoTypeID: func() bin.Object { return &InputPaidMediaTypeVideo{} }, + InputPaidMediaTypeID: func() bin.Object { return &InputPaidMedia{} }, MessageSchedulingStateSendAtDateTypeID: func() bin.Object { return &MessageSchedulingStateSendAtDate{} }, MessageSchedulingStateSendWhenOnlineTypeID: func() bin.Object { return &MessageSchedulingStateSendWhenOnline{} }, MessageSelfDestructTypeTimerTypeID: func() bin.Object { return &MessageSelfDestructTypeTimer{} }, @@ -5300,6 +5329,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { InputMessageAnimationTypeID: func() bin.Object { return &InputMessageAnimation{} }, InputMessageAudioTypeID: func() bin.Object { return &InputMessageAudio{} }, InputMessageDocumentTypeID: func() bin.Object { return &InputMessageDocument{} }, + InputMessagePaidMediaTypeID: func() bin.Object { return &InputMessagePaidMedia{} }, InputMessagePhotoTypeID: func() bin.Object { return &InputMessagePhoto{} }, InputMessageStickerTypeID: func() bin.Object { return &InputMessageSticker{} }, InputMessageVideoTypeID: func() bin.Object { return &InputMessageVideo{} }, @@ -5626,6 +5656,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { PremiumFeatureMessagePrivacyTypeID: func() bin.Object { return &PremiumFeatureMessagePrivacy{} }, PremiumFeatureLastSeenTimesTypeID: func() bin.Object { return &PremiumFeatureLastSeenTimes{} }, PremiumFeatureBusinessTypeID: func() bin.Object { return &PremiumFeatureBusiness{} }, + PremiumFeatureMessageEffectsTypeID: func() bin.Object { return &PremiumFeatureMessageEffects{} }, BusinessFeatureLocationTypeID: func() bin.Object { return &BusinessFeatureLocation{} }, BusinessFeatureOpeningHoursTypeID: func() bin.Object { return &BusinessFeatureOpeningHours{} }, BusinessFeatureQuickRepliesTypeID: func() bin.Object { return &BusinessFeatureQuickReplies{} }, @@ -5727,6 +5758,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { PushMessageContentGameScoreTypeID: func() bin.Object { return &PushMessageContentGameScore{} }, PushMessageContentInvoiceTypeID: func() bin.Object { return &PushMessageContentInvoice{} }, PushMessageContentLocationTypeID: func() bin.Object { return &PushMessageContentLocation{} }, + PushMessageContentPaidMediaTypeID: func() bin.Object { return &PushMessageContentPaidMedia{} }, PushMessageContentPhotoTypeID: func() bin.Object { return &PushMessageContentPhoto{} }, PushMessageContentPollTypeID: func() bin.Object { return &PushMessageContentPoll{} }, PushMessageContentPremiumGiftCodeTypeID: func() bin.Object { return &PushMessageContentPremiumGiftCode{} }, @@ -6831,6 +6863,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { GetChatRevenueTransactionsRequestTypeID: func() bin.Object { return &GetChatRevenueTransactionsRequest{} }, GetStarRevenueStatisticsRequestTypeID: func() bin.Object { return &GetStarRevenueStatisticsRequest{} }, GetStarWithdrawalURLRequestTypeID: func() bin.Object { return &GetStarWithdrawalURLRequest{} }, + GetStarAdAccountURLRequestTypeID: func() bin.Object { return &GetStarAdAccountURLRequest{} }, GetChatStatisticsRequestTypeID: func() bin.Object { return &GetChatStatisticsRequest{} }, GetMessageStatisticsRequestTypeID: func() bin.Object { return &GetMessageStatisticsRequest{} }, GetMessagePublicForwardsRequestTypeID: func() bin.Object { return &GetMessagePublicForwardsRequest{} }, @@ -7308,6 +7341,10 @@ func ClassConstructorsMap() map[string][]uint32 { FirebaseAuthenticationSettingsAndroidTypeID, FirebaseAuthenticationSettingsIosTypeID, }, + FirebaseDeviceVerificationParametersClassName: { + FirebaseDeviceVerificationParametersSafetyNetTypeID, + FirebaseDeviceVerificationParametersPlayIntegrityTypeID, + }, GroupCallVideoQualityClassName: { GroupCallVideoQualityThumbnailTypeID, GroupCallVideoQualityMediumTypeID, @@ -7389,6 +7426,7 @@ func ClassConstructorsMap() map[string][]uint32 { InputMessageAnimationTypeID, InputMessageAudioTypeID, InputMessageDocumentTypeID, + InputMessagePaidMediaTypeID, InputMessagePhotoTypeID, InputMessageStickerTypeID, InputMessageVideoTypeID, @@ -7409,6 +7447,10 @@ func ClassConstructorsMap() map[string][]uint32 { InputMessageReplyToExternalMessageTypeID, InputMessageReplyToStoryTypeID, }, + InputPaidMediaTypeClassName: { + InputPaidMediaTypePhotoTypeID, + InputPaidMediaTypeVideoTypeID, + }, InputPassportElementClassName: { InputPassportElementPersonalDetailsTypeID, InputPassportElementPassportTypeID, @@ -7540,6 +7582,7 @@ func ClassConstructorsMap() map[string][]uint32 { MessageAnimationTypeID, MessageAudioTypeID, MessageDocumentTypeID, + MessagePaidMediaTypeID, MessagePhotoTypeID, MessageStickerTypeID, MessageVideoTypeID, @@ -7610,12 +7653,6 @@ func ClassConstructorsMap() map[string][]uint32 { MessageEffectTypeEmojiReactionTypeID, MessageEffectTypePremiumStickerTypeID, }, - MessageExtendedMediaClassName: { - MessageExtendedMediaPreviewTypeID, - MessageExtendedMediaPhotoTypeID, - MessageExtendedMediaVideoTypeID, - MessageExtendedMediaUnsupportedTypeID, - }, MessageFileTypeClassName: { MessageFileTypePrivateTypeID, MessageFileTypeGroupTypeID, @@ -7741,6 +7778,12 @@ func ClassConstructorsMap() map[string][]uint32 { PageBlockVerticalAlignmentMiddleTypeID, PageBlockVerticalAlignmentBottomTypeID, }, + PaidMediaClassName: { + PaidMediaPreviewTypeID, + PaidMediaPhotoTypeID, + PaidMediaVideoTypeID, + PaidMediaUnsupportedTypeID, + }, PassportElementClassName: { PassportElementPersonalDetailsTypeID, PassportElementPassportTypeID, @@ -7828,6 +7871,7 @@ func ClassConstructorsMap() map[string][]uint32 { PremiumFeatureMessagePrivacyTypeID, PremiumFeatureLastSeenTimesTypeID, PremiumFeatureBusinessTypeID, + PremiumFeatureMessageEffectsTypeID, }, PremiumGiveawayInfoClassName: { PremiumGiveawayInfoOngoingTypeID, @@ -7902,6 +7946,7 @@ func ClassConstructorsMap() map[string][]uint32 { PushMessageContentGameScoreTypeID, PushMessageContentInvoiceTypeID, PushMessageContentLocationTypeID, + PushMessageContentPaidMediaTypeID, PushMessageContentPhotoTypeID, PushMessageContentPollTypeID, PushMessageContentPremiumGiftCodeTypeID, @@ -8060,7 +8105,8 @@ func ClassConstructorsMap() map[string][]uint32 { StarTransactionPartnerAppStoreTypeID, StarTransactionPartnerGooglePlayTypeID, StarTransactionPartnerFragmentTypeID, - StarTransactionPartnerUserTypeID, + StarTransactionPartnerTelegramAdsTypeID, + StarTransactionPartnerBotTypeID, StarTransactionPartnerChannelTypeID, StarTransactionPartnerUnsupportedTypeID, }, diff --git a/tdapi/tl_resend_code_reason_gen.go b/tdapi/tl_resend_code_reason_gen.go index 014f124e6a..99869107c3 100644 --- a/tdapi/tl_resend_code_reason_gen.go +++ b/tdapi/tl_resend_code_reason_gen.go @@ -165,7 +165,7 @@ func (r *ResendCodeReasonUserRequest) DecodeTDLibJSON(b tdjson.Decoder) error { // ResendCodeReasonVerificationFailed represents TL type `resendCodeReasonVerificationFailed#1f952dc1`. type ResendCodeReasonVerificationFailed struct { // Cause of the verification failure, for example, PLAY_SERVICES_NOT_AVAILABLE, - // APNS_RECEIVE_TIMEOUT, APNS_INIT_FAILED, etc. + // APNS_RECEIVE_TIMEOUT, or APNS_INIT_FAILED ErrorMessage string } diff --git a/tdapi/tl_star_transaction_partner_gen.go b/tdapi/tl_star_transaction_partner_gen.go index 8f51a311e2..d8279bb2d3 100644 --- a/tdapi/tl_star_transaction_partner_gen.go +++ b/tdapi/tl_star_transaction_partner_gen.go @@ -600,70 +600,206 @@ func (s *StarTransactionPartnerFragment) GetWithdrawalState() (value RevenueWith return s.WithdrawalState } -// StarTransactionPartnerUser represents TL type `starTransactionPartnerUser#bf9b5805`. -type StarTransactionPartnerUser struct { - // Identifier of the user - UserID int64 - // Information about the bought product; may be null if none +// StarTransactionPartnerTelegramAds represents TL type `starTransactionPartnerTelegramAds#91f9c6b`. +type StarTransactionPartnerTelegramAds struct { +} + +// StarTransactionPartnerTelegramAdsTypeID is TL type id of StarTransactionPartnerTelegramAds. +const StarTransactionPartnerTelegramAdsTypeID = 0x91f9c6b + +// construct implements constructor of StarTransactionPartnerClass. +func (s StarTransactionPartnerTelegramAds) construct() StarTransactionPartnerClass { return &s } + +// Ensuring interfaces in compile-time for StarTransactionPartnerTelegramAds. +var ( + _ bin.Encoder = &StarTransactionPartnerTelegramAds{} + _ bin.Decoder = &StarTransactionPartnerTelegramAds{} + _ bin.BareEncoder = &StarTransactionPartnerTelegramAds{} + _ bin.BareDecoder = &StarTransactionPartnerTelegramAds{} + + _ StarTransactionPartnerClass = &StarTransactionPartnerTelegramAds{} +) + +func (s *StarTransactionPartnerTelegramAds) Zero() bool { + if s == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (s *StarTransactionPartnerTelegramAds) String() string { + if s == nil { + return "StarTransactionPartnerTelegramAds(nil)" + } + type Alias StarTransactionPartnerTelegramAds + return fmt.Sprintf("StarTransactionPartnerTelegramAds%+v", Alias(*s)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*StarTransactionPartnerTelegramAds) TypeID() uint32 { + return StarTransactionPartnerTelegramAdsTypeID +} + +// TypeName returns name of type in TL schema. +func (*StarTransactionPartnerTelegramAds) TypeName() string { + return "starTransactionPartnerTelegramAds" +} + +// TypeInfo returns info about TL type. +func (s *StarTransactionPartnerTelegramAds) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "starTransactionPartnerTelegramAds", + ID: StarTransactionPartnerTelegramAdsTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (s *StarTransactionPartnerTelegramAds) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode starTransactionPartnerTelegramAds#91f9c6b as nil") + } + b.PutID(StarTransactionPartnerTelegramAdsTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *StarTransactionPartnerTelegramAds) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode starTransactionPartnerTelegramAds#91f9c6b as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (s *StarTransactionPartnerTelegramAds) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode starTransactionPartnerTelegramAds#91f9c6b to nil") + } + if err := b.ConsumeID(StarTransactionPartnerTelegramAdsTypeID); err != nil { + return fmt.Errorf("unable to decode starTransactionPartnerTelegramAds#91f9c6b: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *StarTransactionPartnerTelegramAds) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode starTransactionPartnerTelegramAds#91f9c6b to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (s *StarTransactionPartnerTelegramAds) EncodeTDLibJSON(b tdjson.Encoder) error { + if s == nil { + return fmt.Errorf("can't encode starTransactionPartnerTelegramAds#91f9c6b as nil") + } + b.ObjStart() + b.PutID("starTransactionPartnerTelegramAds") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (s *StarTransactionPartnerTelegramAds) DecodeTDLibJSON(b tdjson.Decoder) error { + if s == nil { + return fmt.Errorf("can't decode starTransactionPartnerTelegramAds#91f9c6b to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("starTransactionPartnerTelegramAds"); err != nil { + return fmt.Errorf("unable to decode starTransactionPartnerTelegramAds#91f9c6b: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// StarTransactionPartnerBot represents TL type `starTransactionPartnerBot#1bdcb459`. +type StarTransactionPartnerBot struct { + // Identifier of the bot + BotUserID int64 + // Information about the bought product; may be null if not applicable ProductInfo ProductInfo + // Invoice payload; for bots only + InvoicePayload []byte } -// StarTransactionPartnerUserTypeID is TL type id of StarTransactionPartnerUser. -const StarTransactionPartnerUserTypeID = 0xbf9b5805 +// StarTransactionPartnerBotTypeID is TL type id of StarTransactionPartnerBot. +const StarTransactionPartnerBotTypeID = 0x1bdcb459 // construct implements constructor of StarTransactionPartnerClass. -func (s StarTransactionPartnerUser) construct() StarTransactionPartnerClass { return &s } +func (s StarTransactionPartnerBot) construct() StarTransactionPartnerClass { return &s } -// Ensuring interfaces in compile-time for StarTransactionPartnerUser. +// Ensuring interfaces in compile-time for StarTransactionPartnerBot. var ( - _ bin.Encoder = &StarTransactionPartnerUser{} - _ bin.Decoder = &StarTransactionPartnerUser{} - _ bin.BareEncoder = &StarTransactionPartnerUser{} - _ bin.BareDecoder = &StarTransactionPartnerUser{} + _ bin.Encoder = &StarTransactionPartnerBot{} + _ bin.Decoder = &StarTransactionPartnerBot{} + _ bin.BareEncoder = &StarTransactionPartnerBot{} + _ bin.BareDecoder = &StarTransactionPartnerBot{} - _ StarTransactionPartnerClass = &StarTransactionPartnerUser{} + _ StarTransactionPartnerClass = &StarTransactionPartnerBot{} ) -func (s *StarTransactionPartnerUser) Zero() bool { +func (s *StarTransactionPartnerBot) Zero() bool { if s == nil { return true } - if !(s.UserID == 0) { + if !(s.BotUserID == 0) { return false } if !(s.ProductInfo.Zero()) { return false } + if !(s.InvoicePayload == nil) { + return false + } return true } // String implements fmt.Stringer. -func (s *StarTransactionPartnerUser) String() string { +func (s *StarTransactionPartnerBot) String() string { if s == nil { - return "StarTransactionPartnerUser(nil)" + return "StarTransactionPartnerBot(nil)" } - type Alias StarTransactionPartnerUser - return fmt.Sprintf("StarTransactionPartnerUser%+v", Alias(*s)) + type Alias StarTransactionPartnerBot + return fmt.Sprintf("StarTransactionPartnerBot%+v", Alias(*s)) } // TypeID returns type id in TL schema. // // See https://core.telegram.org/mtproto/TL-tl#remarks. -func (*StarTransactionPartnerUser) TypeID() uint32 { - return StarTransactionPartnerUserTypeID +func (*StarTransactionPartnerBot) TypeID() uint32 { + return StarTransactionPartnerBotTypeID } // TypeName returns name of type in TL schema. -func (*StarTransactionPartnerUser) TypeName() string { - return "starTransactionPartnerUser" +func (*StarTransactionPartnerBot) TypeName() string { + return "starTransactionPartnerBot" } // TypeInfo returns info about TL type. -func (s *StarTransactionPartnerUser) TypeInfo() tdp.Type { +func (s *StarTransactionPartnerBot) TypeInfo() tdp.Type { typ := tdp.Type{ - Name: "starTransactionPartnerUser", - ID: StarTransactionPartnerUserTypeID, + Name: "starTransactionPartnerBot", + ID: StarTransactionPartnerBotTypeID, } if s == nil { typ.Null = true @@ -671,112 +807,133 @@ func (s *StarTransactionPartnerUser) TypeInfo() tdp.Type { } typ.Fields = []tdp.Field{ { - Name: "UserID", - SchemaName: "user_id", + Name: "BotUserID", + SchemaName: "bot_user_id", }, { Name: "ProductInfo", SchemaName: "product_info", }, + { + Name: "InvoicePayload", + SchemaName: "invoice_payload", + }, } return typ } // Encode implements bin.Encoder. -func (s *StarTransactionPartnerUser) Encode(b *bin.Buffer) error { +func (s *StarTransactionPartnerBot) Encode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode starTransactionPartnerUser#bf9b5805 as nil") + return fmt.Errorf("can't encode starTransactionPartnerBot#1bdcb459 as nil") } - b.PutID(StarTransactionPartnerUserTypeID) + b.PutID(StarTransactionPartnerBotTypeID) return s.EncodeBare(b) } // EncodeBare implements bin.BareEncoder. -func (s *StarTransactionPartnerUser) EncodeBare(b *bin.Buffer) error { +func (s *StarTransactionPartnerBot) EncodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode starTransactionPartnerUser#bf9b5805 as nil") + return fmt.Errorf("can't encode starTransactionPartnerBot#1bdcb459 as nil") } - b.PutInt53(s.UserID) + b.PutInt53(s.BotUserID) if err := s.ProductInfo.Encode(b); err != nil { - return fmt.Errorf("unable to encode starTransactionPartnerUser#bf9b5805: field product_info: %w", err) + return fmt.Errorf("unable to encode starTransactionPartnerBot#1bdcb459: field product_info: %w", err) } + b.PutBytes(s.InvoicePayload) return nil } // Decode implements bin.Decoder. -func (s *StarTransactionPartnerUser) Decode(b *bin.Buffer) error { +func (s *StarTransactionPartnerBot) Decode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode starTransactionPartnerUser#bf9b5805 to nil") + return fmt.Errorf("can't decode starTransactionPartnerBot#1bdcb459 to nil") } - if err := b.ConsumeID(StarTransactionPartnerUserTypeID); err != nil { - return fmt.Errorf("unable to decode starTransactionPartnerUser#bf9b5805: %w", err) + if err := b.ConsumeID(StarTransactionPartnerBotTypeID); err != nil { + return fmt.Errorf("unable to decode starTransactionPartnerBot#1bdcb459: %w", err) } return s.DecodeBare(b) } // DecodeBare implements bin.BareDecoder. -func (s *StarTransactionPartnerUser) DecodeBare(b *bin.Buffer) error { +func (s *StarTransactionPartnerBot) DecodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode starTransactionPartnerUser#bf9b5805 to nil") + return fmt.Errorf("can't decode starTransactionPartnerBot#1bdcb459 to nil") } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode starTransactionPartnerUser#bf9b5805: field user_id: %w", err) + return fmt.Errorf("unable to decode starTransactionPartnerBot#1bdcb459: field bot_user_id: %w", err) } - s.UserID = value + s.BotUserID = value } { if err := s.ProductInfo.Decode(b); err != nil { - return fmt.Errorf("unable to decode starTransactionPartnerUser#bf9b5805: field product_info: %w", err) + return fmt.Errorf("unable to decode starTransactionPartnerBot#1bdcb459: field product_info: %w", err) + } + } + { + value, err := b.Bytes() + if err != nil { + return fmt.Errorf("unable to decode starTransactionPartnerBot#1bdcb459: field invoice_payload: %w", err) } + s.InvoicePayload = value } return nil } // EncodeTDLibJSON implements tdjson.TDLibEncoder. -func (s *StarTransactionPartnerUser) EncodeTDLibJSON(b tdjson.Encoder) error { +func (s *StarTransactionPartnerBot) EncodeTDLibJSON(b tdjson.Encoder) error { if s == nil { - return fmt.Errorf("can't encode starTransactionPartnerUser#bf9b5805 as nil") + return fmt.Errorf("can't encode starTransactionPartnerBot#1bdcb459 as nil") } b.ObjStart() - b.PutID("starTransactionPartnerUser") + b.PutID("starTransactionPartnerBot") b.Comma() - b.FieldStart("user_id") - b.PutInt53(s.UserID) + b.FieldStart("bot_user_id") + b.PutInt53(s.BotUserID) b.Comma() b.FieldStart("product_info") if err := s.ProductInfo.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode starTransactionPartnerUser#bf9b5805: field product_info: %w", err) + return fmt.Errorf("unable to encode starTransactionPartnerBot#1bdcb459: field product_info: %w", err) } b.Comma() + b.FieldStart("invoice_payload") + b.PutBytes(s.InvoicePayload) + b.Comma() b.StripComma() b.ObjEnd() return nil } // DecodeTDLibJSON implements tdjson.TDLibDecoder. -func (s *StarTransactionPartnerUser) DecodeTDLibJSON(b tdjson.Decoder) error { +func (s *StarTransactionPartnerBot) DecodeTDLibJSON(b tdjson.Decoder) error { if s == nil { - return fmt.Errorf("can't decode starTransactionPartnerUser#bf9b5805 to nil") + return fmt.Errorf("can't decode starTransactionPartnerBot#1bdcb459 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#bf9b5805: %w", err) + if err := b.ConsumeID("starTransactionPartnerBot"); err != nil { + return fmt.Errorf("unable to decode starTransactionPartnerBot#1bdcb459: %w", err) } - case "user_id": + case "bot_user_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode starTransactionPartnerUser#bf9b5805: field user_id: %w", err) + return fmt.Errorf("unable to decode starTransactionPartnerBot#1bdcb459: field bot_user_id: %w", err) } - s.UserID = value + s.BotUserID = value case "product_info": if err := s.ProductInfo.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode starTransactionPartnerUser#bf9b5805: field product_info: %w", err) + return fmt.Errorf("unable to decode starTransactionPartnerBot#1bdcb459: field product_info: %w", err) + } + case "invoice_payload": + value, err := b.Bytes() + if err != nil { + return fmt.Errorf("unable to decode starTransactionPartnerBot#1bdcb459: field invoice_payload: %w", err) } + s.InvoicePayload = value default: return b.Skip() } @@ -784,30 +941,43 @@ func (s *StarTransactionPartnerUser) DecodeTDLibJSON(b tdjson.Decoder) error { }) } -// GetUserID returns value of UserID field. -func (s *StarTransactionPartnerUser) GetUserID() (value int64) { +// GetBotUserID returns value of BotUserID field. +func (s *StarTransactionPartnerBot) GetBotUserID() (value int64) { if s == nil { return } - return s.UserID + return s.BotUserID } // GetProductInfo returns value of ProductInfo field. -func (s *StarTransactionPartnerUser) GetProductInfo() (value ProductInfo) { +func (s *StarTransactionPartnerBot) GetProductInfo() (value ProductInfo) { if s == nil { return } return s.ProductInfo } -// StarTransactionPartnerChannel represents TL type `starTransactionPartnerChannel#6ddac2f4`. +// GetInvoicePayload returns value of InvoicePayload field. +func (s *StarTransactionPartnerBot) GetInvoicePayload() (value []byte) { + if s == nil { + return + } + return s.InvoicePayload +} + +// StarTransactionPartnerChannel represents TL type `starTransactionPartnerChannel#44b29c29`. type StarTransactionPartnerChannel struct { // Identifier of the chat ChatID int64 + // Identifier of the corresponding message with paid media; can be an identifier of a + // deleted message + PaidMediaMessageID int64 + // Information about the bought media + Media []PaidMediaClass } // StarTransactionPartnerChannelTypeID is TL type id of StarTransactionPartnerChannel. -const StarTransactionPartnerChannelTypeID = 0x6ddac2f4 +const StarTransactionPartnerChannelTypeID = 0x44b29c29 // construct implements constructor of StarTransactionPartnerClass. func (s StarTransactionPartnerChannel) construct() StarTransactionPartnerClass { return &s } @@ -829,6 +999,12 @@ func (s *StarTransactionPartnerChannel) Zero() bool { if !(s.ChatID == 0) { return false } + if !(s.PaidMediaMessageID == 0) { + return false + } + if !(s.Media == nil) { + return false + } return true } @@ -869,6 +1045,14 @@ func (s *StarTransactionPartnerChannel) TypeInfo() tdp.Type { Name: "ChatID", SchemaName: "chat_id", }, + { + Name: "PaidMediaMessageID", + SchemaName: "paid_media_message_id", + }, + { + Name: "Media", + SchemaName: "media", + }, } return typ } @@ -876,7 +1060,7 @@ func (s *StarTransactionPartnerChannel) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (s *StarTransactionPartnerChannel) Encode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode starTransactionPartnerChannel#6ddac2f4 as nil") + return fmt.Errorf("can't encode starTransactionPartnerChannel#44b29c29 as nil") } b.PutID(StarTransactionPartnerChannelTypeID) return s.EncodeBare(b) @@ -885,19 +1069,29 @@ func (s *StarTransactionPartnerChannel) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (s *StarTransactionPartnerChannel) EncodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode starTransactionPartnerChannel#6ddac2f4 as nil") + return fmt.Errorf("can't encode starTransactionPartnerChannel#44b29c29 as nil") } b.PutInt53(s.ChatID) + b.PutInt53(s.PaidMediaMessageID) + b.PutInt(len(s.Media)) + for idx, v := range s.Media { + if v == nil { + return fmt.Errorf("unable to encode starTransactionPartnerChannel#44b29c29: field media element with index %d is nil", idx) + } + if err := v.EncodeBare(b); err != nil { + return fmt.Errorf("unable to encode bare starTransactionPartnerChannel#44b29c29: field media element with index %d: %w", idx, err) + } + } return nil } // Decode implements bin.Decoder. func (s *StarTransactionPartnerChannel) Decode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode starTransactionPartnerChannel#6ddac2f4 to nil") + return fmt.Errorf("can't decode starTransactionPartnerChannel#44b29c29 to nil") } if err := b.ConsumeID(StarTransactionPartnerChannelTypeID); err != nil { - return fmt.Errorf("unable to decode starTransactionPartnerChannel#6ddac2f4: %w", err) + return fmt.Errorf("unable to decode starTransactionPartnerChannel#44b29c29: %w", err) } return s.DecodeBare(b) } @@ -905,22 +1099,46 @@ func (s *StarTransactionPartnerChannel) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (s *StarTransactionPartnerChannel) DecodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode starTransactionPartnerChannel#6ddac2f4 to nil") + return fmt.Errorf("can't decode starTransactionPartnerChannel#44b29c29 to nil") } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode starTransactionPartnerChannel#6ddac2f4: field chat_id: %w", err) + return fmt.Errorf("unable to decode starTransactionPartnerChannel#44b29c29: field chat_id: %w", err) } s.ChatID = value } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode starTransactionPartnerChannel#44b29c29: field paid_media_message_id: %w", err) + } + s.PaidMediaMessageID = value + } + { + headerLen, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode starTransactionPartnerChannel#44b29c29: field media: %w", err) + } + + if headerLen > 0 { + s.Media = make([]PaidMediaClass, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + value, err := DecodePaidMedia(b) + if err != nil { + return fmt.Errorf("unable to decode starTransactionPartnerChannel#44b29c29: field media: %w", err) + } + s.Media = append(s.Media, value) + } + } return nil } // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (s *StarTransactionPartnerChannel) EncodeTDLibJSON(b tdjson.Encoder) error { if s == nil { - return fmt.Errorf("can't encode starTransactionPartnerChannel#6ddac2f4 as nil") + return fmt.Errorf("can't encode starTransactionPartnerChannel#44b29c29 as nil") } b.ObjStart() b.PutID("starTransactionPartnerChannel") @@ -928,6 +1146,23 @@ func (s *StarTransactionPartnerChannel) EncodeTDLibJSON(b tdjson.Encoder) error b.FieldStart("chat_id") b.PutInt53(s.ChatID) b.Comma() + b.FieldStart("paid_media_message_id") + b.PutInt53(s.PaidMediaMessageID) + b.Comma() + b.FieldStart("media") + b.ArrStart() + for idx, v := range s.Media { + if v == nil { + return fmt.Errorf("unable to encode starTransactionPartnerChannel#44b29c29: field media element with index %d is nil", idx) + } + if err := v.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode starTransactionPartnerChannel#44b29c29: field media element with index %d: %w", idx, err) + } + b.Comma() + } + b.StripComma() + b.ArrEnd() + b.Comma() b.StripComma() b.ObjEnd() return nil @@ -936,21 +1171,38 @@ func (s *StarTransactionPartnerChannel) EncodeTDLibJSON(b tdjson.Encoder) error // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (s *StarTransactionPartnerChannel) DecodeTDLibJSON(b tdjson.Decoder) error { if s == nil { - return fmt.Errorf("can't decode starTransactionPartnerChannel#6ddac2f4 to nil") + return fmt.Errorf("can't decode starTransactionPartnerChannel#44b29c29 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("starTransactionPartnerChannel"); err != nil { - return fmt.Errorf("unable to decode starTransactionPartnerChannel#6ddac2f4: %w", err) + return fmt.Errorf("unable to decode starTransactionPartnerChannel#44b29c29: %w", err) } case "chat_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode starTransactionPartnerChannel#6ddac2f4: field chat_id: %w", err) + return fmt.Errorf("unable to decode starTransactionPartnerChannel#44b29c29: field chat_id: %w", err) } s.ChatID = value + case "paid_media_message_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode starTransactionPartnerChannel#44b29c29: field paid_media_message_id: %w", err) + } + s.PaidMediaMessageID = value + case "media": + if err := b.Arr(func(b tdjson.Decoder) error { + value, err := DecodeTDLibJSONPaidMedia(b) + if err != nil { + return fmt.Errorf("unable to decode starTransactionPartnerChannel#44b29c29: field media: %w", err) + } + s.Media = append(s.Media, value) + return nil + }); err != nil { + return fmt.Errorf("unable to decode starTransactionPartnerChannel#44b29c29: field media: %w", err) + } default: return b.Skip() } @@ -966,6 +1218,22 @@ func (s *StarTransactionPartnerChannel) GetChatID() (value int64) { return s.ChatID } +// GetPaidMediaMessageID returns value of PaidMediaMessageID field. +func (s *StarTransactionPartnerChannel) GetPaidMediaMessageID() (value int64) { + if s == nil { + return + } + return s.PaidMediaMessageID +} + +// GetMedia returns value of Media field. +func (s *StarTransactionPartnerChannel) GetMedia() (value []PaidMediaClass) { + if s == nil { + return + } + return s.Media +} + // StarTransactionPartnerUnsupported represents TL type `starTransactionPartnerUnsupported#c4b20d73`. type StarTransactionPartnerUnsupported struct { } @@ -1113,8 +1381,9 @@ const StarTransactionPartnerClassName = "StarTransactionPartner" // case *tdapi.StarTransactionPartnerAppStore: // starTransactionPartnerAppStore#e34026dc // case *tdapi.StarTransactionPartnerGooglePlay: // starTransactionPartnerGooglePlay#f229f2a0 // case *tdapi.StarTransactionPartnerFragment: // starTransactionPartnerFragment#da1849b5 -// case *tdapi.StarTransactionPartnerUser: // starTransactionPartnerUser#bf9b5805 -// case *tdapi.StarTransactionPartnerChannel: // starTransactionPartnerChannel#6ddac2f4 +// case *tdapi.StarTransactionPartnerTelegramAds: // starTransactionPartnerTelegramAds#91f9c6b +// case *tdapi.StarTransactionPartnerBot: // starTransactionPartnerBot#1bdcb459 +// case *tdapi.StarTransactionPartnerChannel: // starTransactionPartnerChannel#44b29c29 // case *tdapi.StarTransactionPartnerUnsupported: // starTransactionPartnerUnsupported#c4b20d73 // default: panic(v) // } @@ -1175,15 +1444,22 @@ func DecodeStarTransactionPartner(buf *bin.Buffer) (StarTransactionPartnerClass, return nil, fmt.Errorf("unable to decode StarTransactionPartnerClass: %w", err) } return &v, nil - case StarTransactionPartnerUserTypeID: - // Decoding starTransactionPartnerUser#bf9b5805. - v := StarTransactionPartnerUser{} + case StarTransactionPartnerTelegramAdsTypeID: + // Decoding starTransactionPartnerTelegramAds#91f9c6b. + v := StarTransactionPartnerTelegramAds{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode StarTransactionPartnerClass: %w", err) + } + return &v, nil + case StarTransactionPartnerBotTypeID: + // Decoding starTransactionPartnerBot#1bdcb459. + v := StarTransactionPartnerBot{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode StarTransactionPartnerClass: %w", err) } return &v, nil case StarTransactionPartnerChannelTypeID: - // Decoding starTransactionPartnerChannel#6ddac2f4. + // Decoding starTransactionPartnerChannel#44b29c29. v := StarTransactionPartnerChannel{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode StarTransactionPartnerClass: %w", err) @@ -1236,15 +1512,22 @@ func DecodeTDLibJSONStarTransactionPartner(buf tdjson.Decoder) (StarTransactionP return nil, fmt.Errorf("unable to decode StarTransactionPartnerClass: %w", err) } return &v, nil - case "starTransactionPartnerUser": - // Decoding starTransactionPartnerUser#bf9b5805. - v := StarTransactionPartnerUser{} + case "starTransactionPartnerTelegramAds": + // Decoding starTransactionPartnerTelegramAds#91f9c6b. + v := StarTransactionPartnerTelegramAds{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode StarTransactionPartnerClass: %w", err) + } + return &v, nil + case "starTransactionPartnerBot": + // Decoding starTransactionPartnerBot#1bdcb459. + v := StarTransactionPartnerBot{} if err := v.DecodeTDLibJSON(buf); err != nil { return nil, fmt.Errorf("unable to decode StarTransactionPartnerClass: %w", err) } return &v, nil case "starTransactionPartnerChannel": - // Decoding starTransactionPartnerChannel#6ddac2f4. + // Decoding starTransactionPartnerChannel#44b29c29. v := StarTransactionPartnerChannel{} if err := v.DecodeTDLibJSON(buf); err != nil { return nil, fmt.Errorf("unable to decode StarTransactionPartnerClass: %w", err) diff --git a/tdapi/tl_supergroup_full_info_gen.go b/tdapi/tl_supergroup_full_info_gen.go index 8d9727261c..82fefeb4d5 100644 --- a/tdapi/tl_supergroup_full_info_gen.go +++ b/tdapi/tl_supergroup_full_info_gen.go @@ -31,7 +31,7 @@ var ( _ = tdjson.Encoder{} ) -// SupergroupFullInfo represents TL type `supergroupFullInfo#d262590a`. +// SupergroupFullInfo represents TL type `supergroupFullInfo#c02dd0a6`. type SupergroupFullInfo struct { // Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as // in chat.photo @@ -84,6 +84,8 @@ type SupergroupFullInfo struct { // True, if aggressive anti-spam checks are enabled in the supergroup. The value of this // field is only available to chat administrators HasAggressiveAntiSpamEnabled bool + // True, if paid media can be sent and forwarded to the channel chat; for channels only + HasPaidMediaAllowed bool // True, if the supergroup or channel has pinned stories HasPinnedStories bool // Number of times the current user boosted the supergroup or channel @@ -112,7 +114,7 @@ type SupergroupFullInfo struct { } // SupergroupFullInfoTypeID is TL type id of SupergroupFullInfo. -const SupergroupFullInfoTypeID = 0xd262590a +const SupergroupFullInfoTypeID = 0xc02dd0a6 // Ensuring interfaces in compile-time for SupergroupFullInfo. var ( @@ -186,6 +188,9 @@ func (s *SupergroupFullInfo) Zero() bool { if !(s.HasAggressiveAntiSpamEnabled == false) { return false } + if !(s.HasPaidMediaAllowed == false) { + return false + } if !(s.HasPinnedStories == false) { return false } @@ -332,6 +337,10 @@ func (s *SupergroupFullInfo) TypeInfo() tdp.Type { Name: "HasAggressiveAntiSpamEnabled", SchemaName: "has_aggressive_anti_spam_enabled", }, + { + Name: "HasPaidMediaAllowed", + SchemaName: "has_paid_media_allowed", + }, { Name: "HasPinnedStories", SchemaName: "has_pinned_stories", @@ -379,7 +388,7 @@ func (s *SupergroupFullInfo) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (s *SupergroupFullInfo) Encode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode supergroupFullInfo#d262590a as nil") + return fmt.Errorf("can't encode supergroupFullInfo#c02dd0a6 as nil") } b.PutID(SupergroupFullInfoTypeID) return s.EncodeBare(b) @@ -388,10 +397,10 @@ func (s *SupergroupFullInfo) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (s *SupergroupFullInfo) EncodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode supergroupFullInfo#d262590a as nil") + return fmt.Errorf("can't encode supergroupFullInfo#c02dd0a6 as nil") } if err := s.Photo.Encode(b); err != nil { - return fmt.Errorf("unable to encode supergroupFullInfo#d262590a: field photo: %w", err) + return fmt.Errorf("unable to encode supergroupFullInfo#c02dd0a6: field photo: %w", err) } b.PutString(s.Description) b.PutInt32(s.MemberCount) @@ -412,21 +421,22 @@ func (s *SupergroupFullInfo) EncodeBare(b *bin.Buffer) error { b.PutBool(s.IsAllHistoryAvailable) b.PutBool(s.CanHaveSponsoredMessages) b.PutBool(s.HasAggressiveAntiSpamEnabled) + b.PutBool(s.HasPaidMediaAllowed) b.PutBool(s.HasPinnedStories) b.PutInt32(s.MyBoostCount) b.PutInt32(s.UnrestrictBoostCount) b.PutLong(s.StickerSetID) b.PutLong(s.CustomEmojiStickerSetID) if err := s.Location.Encode(b); err != nil { - return fmt.Errorf("unable to encode supergroupFullInfo#d262590a: field location: %w", err) + return fmt.Errorf("unable to encode supergroupFullInfo#c02dd0a6: field location: %w", err) } if err := s.InviteLink.Encode(b); err != nil { - return fmt.Errorf("unable to encode supergroupFullInfo#d262590a: field invite_link: %w", err) + return fmt.Errorf("unable to encode supergroupFullInfo#c02dd0a6: field invite_link: %w", err) } b.PutInt(len(s.BotCommands)) for idx, v := range s.BotCommands { if err := v.EncodeBare(b); err != nil { - return fmt.Errorf("unable to encode bare supergroupFullInfo#d262590a: field bot_commands element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode bare supergroupFullInfo#c02dd0a6: field bot_commands element with index %d: %w", idx, err) } } b.PutInt53(s.UpgradedFromBasicGroupID) @@ -437,10 +447,10 @@ func (s *SupergroupFullInfo) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (s *SupergroupFullInfo) Decode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode supergroupFullInfo#d262590a to nil") + return fmt.Errorf("can't decode supergroupFullInfo#c02dd0a6 to nil") } if err := b.ConsumeID(SupergroupFullInfoTypeID); err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: %w", err) } return s.DecodeBare(b) } @@ -448,195 +458,202 @@ func (s *SupergroupFullInfo) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (s *SupergroupFullInfo) DecodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode supergroupFullInfo#d262590a to nil") + return fmt.Errorf("can't decode supergroupFullInfo#c02dd0a6 to nil") } { if err := s.Photo.Decode(b); err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field photo: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field photo: %w", err) } } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field description: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field description: %w", err) } s.Description = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field member_count: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field member_count: %w", err) } s.MemberCount = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field administrator_count: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field administrator_count: %w", err) } s.AdministratorCount = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field restricted_count: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field restricted_count: %w", err) } s.RestrictedCount = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field banned_count: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field banned_count: %w", err) } s.BannedCount = value } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field linked_chat_id: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field linked_chat_id: %w", err) } s.LinkedChatID = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field slow_mode_delay: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field slow_mode_delay: %w", err) } s.SlowModeDelay = value } { value, err := b.Double() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field slow_mode_delay_expires_in: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field slow_mode_delay_expires_in: %w", err) } s.SlowModeDelayExpiresIn = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field can_get_members: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field can_get_members: %w", err) } s.CanGetMembers = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field has_hidden_members: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field has_hidden_members: %w", err) } s.HasHiddenMembers = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field can_hide_members: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field can_hide_members: %w", err) } s.CanHideMembers = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field can_set_sticker_set: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field can_set_sticker_set: %w", err) } s.CanSetStickerSet = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field can_set_location: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field can_set_location: %w", err) } s.CanSetLocation = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field can_get_statistics: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field can_get_statistics: %w", err) } s.CanGetStatistics = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field can_get_revenue_statistics: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field can_get_revenue_statistics: %w", err) } s.CanGetRevenueStatistics = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field can_toggle_aggressive_anti_spam: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field can_toggle_aggressive_anti_spam: %w", err) } s.CanToggleAggressiveAntiSpam = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field is_all_history_available: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field is_all_history_available: %w", err) } s.IsAllHistoryAvailable = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field can_have_sponsored_messages: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field can_have_sponsored_messages: %w", err) } s.CanHaveSponsoredMessages = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field has_aggressive_anti_spam_enabled: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field has_aggressive_anti_spam_enabled: %w", err) } s.HasAggressiveAntiSpamEnabled = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field has_pinned_stories: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field has_paid_media_allowed: %w", err) + } + s.HasPaidMediaAllowed = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field has_pinned_stories: %w", err) } s.HasPinnedStories = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field my_boost_count: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field my_boost_count: %w", err) } s.MyBoostCount = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field unrestrict_boost_count: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field unrestrict_boost_count: %w", err) } s.UnrestrictBoostCount = value } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field sticker_set_id: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field sticker_set_id: %w", err) } s.StickerSetID = value } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field custom_emoji_sticker_set_id: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field custom_emoji_sticker_set_id: %w", err) } s.CustomEmojiStickerSetID = value } { if err := s.Location.Decode(b); err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field location: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field location: %w", err) } } { if err := s.InviteLink.Decode(b); err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field invite_link: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field invite_link: %w", err) } } { headerLen, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field bot_commands: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field bot_commands: %w", err) } if headerLen > 0 { @@ -645,7 +662,7 @@ func (s *SupergroupFullInfo) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { var value BotCommands if err := value.DecodeBare(b); err != nil { - return fmt.Errorf("unable to decode bare supergroupFullInfo#d262590a: field bot_commands: %w", err) + return fmt.Errorf("unable to decode bare supergroupFullInfo#c02dd0a6: field bot_commands: %w", err) } s.BotCommands = append(s.BotCommands, value) } @@ -653,14 +670,14 @@ func (s *SupergroupFullInfo) DecodeBare(b *bin.Buffer) error { { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field upgraded_from_basic_group_id: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field upgraded_from_basic_group_id: %w", err) } s.UpgradedFromBasicGroupID = value } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field upgraded_from_max_message_id: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field upgraded_from_max_message_id: %w", err) } s.UpgradedFromMaxMessageID = value } @@ -670,14 +687,14 @@ func (s *SupergroupFullInfo) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (s *SupergroupFullInfo) EncodeTDLibJSON(b tdjson.Encoder) error { if s == nil { - return fmt.Errorf("can't encode supergroupFullInfo#d262590a as nil") + return fmt.Errorf("can't encode supergroupFullInfo#c02dd0a6 as nil") } b.ObjStart() b.PutID("supergroupFullInfo") b.Comma() b.FieldStart("photo") if err := s.Photo.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode supergroupFullInfo#d262590a: field photo: %w", err) + return fmt.Errorf("unable to encode supergroupFullInfo#c02dd0a6: field photo: %w", err) } b.Comma() b.FieldStart("description") @@ -737,6 +754,9 @@ func (s *SupergroupFullInfo) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("has_aggressive_anti_spam_enabled") b.PutBool(s.HasAggressiveAntiSpamEnabled) b.Comma() + b.FieldStart("has_paid_media_allowed") + b.PutBool(s.HasPaidMediaAllowed) + b.Comma() b.FieldStart("has_pinned_stories") b.PutBool(s.HasPinnedStories) b.Comma() @@ -754,19 +774,19 @@ func (s *SupergroupFullInfo) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("location") if err := s.Location.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode supergroupFullInfo#d262590a: field location: %w", err) + return fmt.Errorf("unable to encode supergroupFullInfo#c02dd0a6: field location: %w", err) } b.Comma() b.FieldStart("invite_link") if err := s.InviteLink.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode supergroupFullInfo#d262590a: field invite_link: %w", err) + return fmt.Errorf("unable to encode supergroupFullInfo#c02dd0a6: field invite_link: %w", err) } b.Comma() b.FieldStart("bot_commands") b.ArrStart() for idx, v := range s.BotCommands { if err := v.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode supergroupFullInfo#d262590a: field bot_commands element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode supergroupFullInfo#c02dd0a6: field bot_commands element with index %d: %w", idx, err) } b.Comma() } @@ -787,192 +807,198 @@ func (s *SupergroupFullInfo) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (s *SupergroupFullInfo) DecodeTDLibJSON(b tdjson.Decoder) error { if s == nil { - return fmt.Errorf("can't decode supergroupFullInfo#d262590a to nil") + return fmt.Errorf("can't decode supergroupFullInfo#c02dd0a6 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("supergroupFullInfo"); err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: %w", err) } case "photo": if err := s.Photo.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field photo: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field photo: %w", err) } case "description": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field description: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field description: %w", err) } s.Description = value case "member_count": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field member_count: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field member_count: %w", err) } s.MemberCount = value case "administrator_count": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field administrator_count: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field administrator_count: %w", err) } s.AdministratorCount = value case "restricted_count": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field restricted_count: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field restricted_count: %w", err) } s.RestrictedCount = value case "banned_count": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field banned_count: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field banned_count: %w", err) } s.BannedCount = value case "linked_chat_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field linked_chat_id: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field linked_chat_id: %w", err) } s.LinkedChatID = value case "slow_mode_delay": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field slow_mode_delay: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field slow_mode_delay: %w", err) } s.SlowModeDelay = value case "slow_mode_delay_expires_in": value, err := b.Double() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field slow_mode_delay_expires_in: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field slow_mode_delay_expires_in: %w", err) } s.SlowModeDelayExpiresIn = value case "can_get_members": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field can_get_members: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field can_get_members: %w", err) } s.CanGetMembers = value case "has_hidden_members": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field has_hidden_members: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field has_hidden_members: %w", err) } s.HasHiddenMembers = value case "can_hide_members": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field can_hide_members: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field can_hide_members: %w", err) } s.CanHideMembers = value case "can_set_sticker_set": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field can_set_sticker_set: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field can_set_sticker_set: %w", err) } s.CanSetStickerSet = value case "can_set_location": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field can_set_location: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field can_set_location: %w", err) } s.CanSetLocation = value case "can_get_statistics": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field can_get_statistics: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field can_get_statistics: %w", err) } s.CanGetStatistics = value case "can_get_revenue_statistics": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field can_get_revenue_statistics: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field can_get_revenue_statistics: %w", err) } s.CanGetRevenueStatistics = value case "can_toggle_aggressive_anti_spam": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field can_toggle_aggressive_anti_spam: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field can_toggle_aggressive_anti_spam: %w", err) } s.CanToggleAggressiveAntiSpam = value case "is_all_history_available": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field is_all_history_available: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field is_all_history_available: %w", err) } s.IsAllHistoryAvailable = value case "can_have_sponsored_messages": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field can_have_sponsored_messages: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field can_have_sponsored_messages: %w", err) } s.CanHaveSponsoredMessages = value case "has_aggressive_anti_spam_enabled": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field has_aggressive_anti_spam_enabled: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field has_aggressive_anti_spam_enabled: %w", err) } s.HasAggressiveAntiSpamEnabled = value + case "has_paid_media_allowed": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field has_paid_media_allowed: %w", err) + } + s.HasPaidMediaAllowed = value case "has_pinned_stories": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field has_pinned_stories: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field has_pinned_stories: %w", err) } s.HasPinnedStories = value case "my_boost_count": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field my_boost_count: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field my_boost_count: %w", err) } s.MyBoostCount = value case "unrestrict_boost_count": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field unrestrict_boost_count: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field unrestrict_boost_count: %w", err) } s.UnrestrictBoostCount = value case "sticker_set_id": value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field sticker_set_id: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field sticker_set_id: %w", err) } s.StickerSetID = value case "custom_emoji_sticker_set_id": value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field custom_emoji_sticker_set_id: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field custom_emoji_sticker_set_id: %w", err) } s.CustomEmojiStickerSetID = value case "location": if err := s.Location.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field location: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field location: %w", err) } case "invite_link": if err := s.InviteLink.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field invite_link: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field invite_link: %w", err) } case "bot_commands": if err := b.Arr(func(b tdjson.Decoder) error { var value BotCommands if err := value.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field bot_commands: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field bot_commands: %w", err) } s.BotCommands = append(s.BotCommands, value) return nil }); err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field bot_commands: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field bot_commands: %w", err) } case "upgraded_from_basic_group_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field upgraded_from_basic_group_id: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field upgraded_from_basic_group_id: %w", err) } s.UpgradedFromBasicGroupID = value case "upgraded_from_max_message_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode supergroupFullInfo#d262590a: field upgraded_from_max_message_id: %w", err) + return fmt.Errorf("unable to decode supergroupFullInfo#c02dd0a6: field upgraded_from_max_message_id: %w", err) } s.UpgradedFromMaxMessageID = value default: @@ -1142,6 +1168,14 @@ func (s *SupergroupFullInfo) GetHasAggressiveAntiSpamEnabled() (value bool) { return s.HasAggressiveAntiSpamEnabled } +// GetHasPaidMediaAllowed returns value of HasPaidMediaAllowed field. +func (s *SupergroupFullInfo) GetHasPaidMediaAllowed() (value bool) { + if s == nil { + return + } + return s.HasPaidMediaAllowed +} + // GetHasPinnedStories returns value of HasPinnedStories field. func (s *SupergroupFullInfo) GetHasPinnedStories() (value bool) { if s == nil { diff --git a/tdapi/tl_theme_parameters_gen.go b/tdapi/tl_theme_parameters_gen.go index 7c821d84a7..aea4b64865 100644 --- a/tdapi/tl_theme_parameters_gen.go +++ b/tdapi/tl_theme_parameters_gen.go @@ -31,7 +31,7 @@ var ( _ = tdjson.Encoder{} ) -// ThemeParameters represents TL type `themeParameters#af3f42fc`. +// ThemeParameters represents TL type `themeParameters#b47510c1`. type ThemeParameters struct { // A color of the background in the RGB24 format BackgroundColor int32 @@ -41,6 +41,8 @@ type ThemeParameters struct { HeaderBackgroundColor int32 // A color of the section background in the RGB24 format SectionBackgroundColor int32 + // A color of the section separator in the RGB24 format + SectionSeparatorColor int32 // A color of text in the RGB24 format TextColor int32 // An accent color of the text in the RGB24 format @@ -62,7 +64,7 @@ type ThemeParameters struct { } // ThemeParametersTypeID is TL type id of ThemeParameters. -const ThemeParametersTypeID = 0xaf3f42fc +const ThemeParametersTypeID = 0xb47510c1 // Ensuring interfaces in compile-time for ThemeParameters. var ( @@ -88,6 +90,9 @@ func (t *ThemeParameters) Zero() bool { if !(t.SectionBackgroundColor == 0) { return false } + if !(t.SectionSeparatorColor == 0) { + return false + } if !(t.TextColor == 0) { return false } @@ -167,6 +172,10 @@ func (t *ThemeParameters) TypeInfo() tdp.Type { Name: "SectionBackgroundColor", SchemaName: "section_background_color", }, + { + Name: "SectionSeparatorColor", + SchemaName: "section_separator_color", + }, { Name: "TextColor", SchemaName: "text_color", @@ -210,7 +219,7 @@ func (t *ThemeParameters) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (t *ThemeParameters) Encode(b *bin.Buffer) error { if t == nil { - return fmt.Errorf("can't encode themeParameters#af3f42fc as nil") + return fmt.Errorf("can't encode themeParameters#b47510c1 as nil") } b.PutID(ThemeParametersTypeID) return t.EncodeBare(b) @@ -219,12 +228,13 @@ func (t *ThemeParameters) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (t *ThemeParameters) EncodeBare(b *bin.Buffer) error { if t == nil { - return fmt.Errorf("can't encode themeParameters#af3f42fc as nil") + return fmt.Errorf("can't encode themeParameters#b47510c1 as nil") } b.PutInt32(t.BackgroundColor) b.PutInt32(t.SecondaryBackgroundColor) b.PutInt32(t.HeaderBackgroundColor) b.PutInt32(t.SectionBackgroundColor) + b.PutInt32(t.SectionSeparatorColor) b.PutInt32(t.TextColor) b.PutInt32(t.AccentTextColor) b.PutInt32(t.SectionHeaderTextColor) @@ -240,10 +250,10 @@ func (t *ThemeParameters) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (t *ThemeParameters) Decode(b *bin.Buffer) error { if t == nil { - return fmt.Errorf("can't decode themeParameters#af3f42fc to nil") + return fmt.Errorf("can't decode themeParameters#b47510c1 to nil") } if err := b.ConsumeID(ThemeParametersTypeID); err != nil { - return fmt.Errorf("unable to decode themeParameters#af3f42fc: %w", err) + return fmt.Errorf("unable to decode themeParameters#b47510c1: %w", err) } return t.DecodeBare(b) } @@ -251,96 +261,103 @@ func (t *ThemeParameters) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (t *ThemeParameters) DecodeBare(b *bin.Buffer) error { if t == nil { - return fmt.Errorf("can't decode themeParameters#af3f42fc to nil") + return fmt.Errorf("can't decode themeParameters#b47510c1 to nil") } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#af3f42fc: field background_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#b47510c1: field background_color: %w", err) } t.BackgroundColor = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#af3f42fc: field secondary_background_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#b47510c1: field secondary_background_color: %w", err) } t.SecondaryBackgroundColor = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#af3f42fc: field header_background_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#b47510c1: field header_background_color: %w", err) } t.HeaderBackgroundColor = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#af3f42fc: field section_background_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#b47510c1: field section_background_color: %w", err) } t.SectionBackgroundColor = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#af3f42fc: field text_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#b47510c1: field section_separator_color: %w", err) + } + t.SectionSeparatorColor = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode themeParameters#b47510c1: field text_color: %w", err) } t.TextColor = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#af3f42fc: field accent_text_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#b47510c1: field accent_text_color: %w", err) } t.AccentTextColor = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#af3f42fc: field section_header_text_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#b47510c1: field section_header_text_color: %w", err) } t.SectionHeaderTextColor = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#af3f42fc: field subtitle_text_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#b47510c1: field subtitle_text_color: %w", err) } t.SubtitleTextColor = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#af3f42fc: field destructive_text_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#b47510c1: field destructive_text_color: %w", err) } t.DestructiveTextColor = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#af3f42fc: field hint_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#b47510c1: field hint_color: %w", err) } t.HintColor = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#af3f42fc: field link_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#b47510c1: field link_color: %w", err) } t.LinkColor = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#af3f42fc: field button_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#b47510c1: field button_color: %w", err) } t.ButtonColor = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#af3f42fc: field button_text_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#b47510c1: field button_text_color: %w", err) } t.ButtonTextColor = value } @@ -350,7 +367,7 @@ func (t *ThemeParameters) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (t *ThemeParameters) EncodeTDLibJSON(b tdjson.Encoder) error { if t == nil { - return fmt.Errorf("can't encode themeParameters#af3f42fc as nil") + return fmt.Errorf("can't encode themeParameters#b47510c1 as nil") } b.ObjStart() b.PutID("themeParameters") @@ -367,6 +384,9 @@ func (t *ThemeParameters) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("section_background_color") b.PutInt32(t.SectionBackgroundColor) b.Comma() + b.FieldStart("section_separator_color") + b.PutInt32(t.SectionSeparatorColor) + b.Comma() b.FieldStart("text_color") b.PutInt32(t.TextColor) b.Comma() @@ -402,91 +422,97 @@ func (t *ThemeParameters) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (t *ThemeParameters) DecodeTDLibJSON(b tdjson.Decoder) error { if t == nil { - return fmt.Errorf("can't decode themeParameters#af3f42fc to nil") + return fmt.Errorf("can't decode themeParameters#b47510c1 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("themeParameters"); err != nil { - return fmt.Errorf("unable to decode themeParameters#af3f42fc: %w", err) + return fmt.Errorf("unable to decode themeParameters#b47510c1: %w", err) } case "background_color": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#af3f42fc: field background_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#b47510c1: field background_color: %w", err) } t.BackgroundColor = value case "secondary_background_color": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#af3f42fc: field secondary_background_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#b47510c1: field secondary_background_color: %w", err) } t.SecondaryBackgroundColor = value case "header_background_color": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#af3f42fc: field header_background_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#b47510c1: field header_background_color: %w", err) } t.HeaderBackgroundColor = value case "section_background_color": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#af3f42fc: field section_background_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#b47510c1: field section_background_color: %w", err) } t.SectionBackgroundColor = value + case "section_separator_color": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode themeParameters#b47510c1: field section_separator_color: %w", err) + } + t.SectionSeparatorColor = value case "text_color": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#af3f42fc: field text_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#b47510c1: field text_color: %w", err) } t.TextColor = value case "accent_text_color": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#af3f42fc: field accent_text_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#b47510c1: field accent_text_color: %w", err) } t.AccentTextColor = value case "section_header_text_color": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#af3f42fc: field section_header_text_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#b47510c1: field section_header_text_color: %w", err) } t.SectionHeaderTextColor = value case "subtitle_text_color": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#af3f42fc: field subtitle_text_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#b47510c1: field subtitle_text_color: %w", err) } t.SubtitleTextColor = value case "destructive_text_color": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#af3f42fc: field destructive_text_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#b47510c1: field destructive_text_color: %w", err) } t.DestructiveTextColor = value case "hint_color": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#af3f42fc: field hint_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#b47510c1: field hint_color: %w", err) } t.HintColor = value case "link_color": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#af3f42fc: field link_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#b47510c1: field link_color: %w", err) } t.LinkColor = value case "button_color": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#af3f42fc: field button_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#b47510c1: field button_color: %w", err) } t.ButtonColor = value case "button_text_color": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode themeParameters#af3f42fc: field button_text_color: %w", err) + return fmt.Errorf("unable to decode themeParameters#b47510c1: field button_text_color: %w", err) } t.ButtonTextColor = value default: @@ -528,6 +554,14 @@ func (t *ThemeParameters) GetSectionBackgroundColor() (value int32) { return t.SectionBackgroundColor } +// GetSectionSeparatorColor returns value of SectionSeparatorColor field. +func (t *ThemeParameters) GetSectionSeparatorColor() (value int32) { + if t == nil { + return + } + return t.SectionSeparatorColor +} + // GetTextColor returns value of TextColor field. func (t *ThemeParameters) GetTextColor() (value int32) { if t == nil { diff --git a/tdapi/tl_update_gen.go b/tdapi/tl_update_gen.go index 5a78446480..b85db031a3 100644 --- a/tdapi/tl_update_gen.go +++ b/tdapi/tl_update_gen.go @@ -17009,17 +17009,19 @@ func (u *UpdateFileRemovedFromDownloads) GetCounts() (value DownloadedFileCounts return u.Counts } -// UpdateApplicationVerificationRequired represents TL type `updateApplicationVerificationRequired#32079e05`. +// UpdateApplicationVerificationRequired represents TL type `updateApplicationVerificationRequired#c59c61d7`. type UpdateApplicationVerificationRequired struct { // Unique identifier for the verification process VerificationID int64 - // Unique nonce for the classic Play Integrity verification (https://developer.android - // com/google/play/integrity/classic) for Android, + // Unique base64url-encoded nonce for the classic Play Integrity verification + // (https://developer.android.com/google/play/integrity/classic) for Android, Nonce string + // Cloud project number to pass to the Play Integrity API on Android + CloudProjectNumber int64 } // UpdateApplicationVerificationRequiredTypeID is TL type id of UpdateApplicationVerificationRequired. -const UpdateApplicationVerificationRequiredTypeID = 0x32079e05 +const UpdateApplicationVerificationRequiredTypeID = 0xc59c61d7 // construct implements constructor of UpdateClass. func (u UpdateApplicationVerificationRequired) construct() UpdateClass { return &u } @@ -17044,6 +17046,9 @@ func (u *UpdateApplicationVerificationRequired) Zero() bool { if !(u.Nonce == "") { return false } + if !(u.CloudProjectNumber == 0) { + return false + } return true } @@ -17088,6 +17093,10 @@ func (u *UpdateApplicationVerificationRequired) TypeInfo() tdp.Type { Name: "Nonce", SchemaName: "nonce", }, + { + Name: "CloudProjectNumber", + SchemaName: "cloud_project_number", + }, } return typ } @@ -17095,7 +17104,7 @@ func (u *UpdateApplicationVerificationRequired) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (u *UpdateApplicationVerificationRequired) Encode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateApplicationVerificationRequired#32079e05 as nil") + return fmt.Errorf("can't encode updateApplicationVerificationRequired#c59c61d7 as nil") } b.PutID(UpdateApplicationVerificationRequiredTypeID) return u.EncodeBare(b) @@ -17104,20 +17113,21 @@ func (u *UpdateApplicationVerificationRequired) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (u *UpdateApplicationVerificationRequired) EncodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't encode updateApplicationVerificationRequired#32079e05 as nil") + return fmt.Errorf("can't encode updateApplicationVerificationRequired#c59c61d7 as nil") } b.PutInt53(u.VerificationID) b.PutString(u.Nonce) + b.PutLong(u.CloudProjectNumber) return nil } // Decode implements bin.Decoder. func (u *UpdateApplicationVerificationRequired) Decode(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateApplicationVerificationRequired#32079e05 to nil") + return fmt.Errorf("can't decode updateApplicationVerificationRequired#c59c61d7 to nil") } if err := b.ConsumeID(UpdateApplicationVerificationRequiredTypeID); err != nil { - return fmt.Errorf("unable to decode updateApplicationVerificationRequired#32079e05: %w", err) + return fmt.Errorf("unable to decode updateApplicationVerificationRequired#c59c61d7: %w", err) } return u.DecodeBare(b) } @@ -17125,29 +17135,36 @@ func (u *UpdateApplicationVerificationRequired) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (u *UpdateApplicationVerificationRequired) DecodeBare(b *bin.Buffer) error { if u == nil { - return fmt.Errorf("can't decode updateApplicationVerificationRequired#32079e05 to nil") + return fmt.Errorf("can't decode updateApplicationVerificationRequired#c59c61d7 to nil") } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode updateApplicationVerificationRequired#32079e05: field verification_id: %w", err) + return fmt.Errorf("unable to decode updateApplicationVerificationRequired#c59c61d7: field verification_id: %w", err) } u.VerificationID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode updateApplicationVerificationRequired#32079e05: field nonce: %w", err) + return fmt.Errorf("unable to decode updateApplicationVerificationRequired#c59c61d7: field nonce: %w", err) } u.Nonce = value } + { + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode updateApplicationVerificationRequired#c59c61d7: field cloud_project_number: %w", err) + } + u.CloudProjectNumber = value + } return nil } // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (u *UpdateApplicationVerificationRequired) EncodeTDLibJSON(b tdjson.Encoder) error { if u == nil { - return fmt.Errorf("can't encode updateApplicationVerificationRequired#32079e05 as nil") + return fmt.Errorf("can't encode updateApplicationVerificationRequired#c59c61d7 as nil") } b.ObjStart() b.PutID("updateApplicationVerificationRequired") @@ -17158,6 +17175,9 @@ func (u *UpdateApplicationVerificationRequired) EncodeTDLibJSON(b tdjson.Encoder b.FieldStart("nonce") b.PutString(u.Nonce) b.Comma() + b.FieldStart("cloud_project_number") + b.PutLong(u.CloudProjectNumber) + b.Comma() b.StripComma() b.ObjEnd() return nil @@ -17166,27 +17186,33 @@ func (u *UpdateApplicationVerificationRequired) EncodeTDLibJSON(b tdjson.Encoder // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (u *UpdateApplicationVerificationRequired) DecodeTDLibJSON(b tdjson.Decoder) error { if u == nil { - return fmt.Errorf("can't decode updateApplicationVerificationRequired#32079e05 to nil") + return fmt.Errorf("can't decode updateApplicationVerificationRequired#c59c61d7 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("updateApplicationVerificationRequired"); err != nil { - return fmt.Errorf("unable to decode updateApplicationVerificationRequired#32079e05: %w", err) + return fmt.Errorf("unable to decode updateApplicationVerificationRequired#c59c61d7: %w", err) } case "verification_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode updateApplicationVerificationRequired#32079e05: field verification_id: %w", err) + return fmt.Errorf("unable to decode updateApplicationVerificationRequired#c59c61d7: field verification_id: %w", err) } u.VerificationID = value case "nonce": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode updateApplicationVerificationRequired#32079e05: field nonce: %w", err) + return fmt.Errorf("unable to decode updateApplicationVerificationRequired#c59c61d7: field nonce: %w", err) } u.Nonce = value + case "cloud_project_number": + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode updateApplicationVerificationRequired#c59c61d7: field cloud_project_number: %w", err) + } + u.CloudProjectNumber = value default: return b.Skip() } @@ -17210,6 +17236,14 @@ func (u *UpdateApplicationVerificationRequired) GetNonce() (value string) { return u.Nonce } +// GetCloudProjectNumber returns value of CloudProjectNumber field. +func (u *UpdateApplicationVerificationRequired) GetCloudProjectNumber() (value int64) { + if u == nil { + return + } + return u.CloudProjectNumber +} + // UpdateCall represents TL type `updateCall#4fb3d0dd`. type UpdateCall struct { // New data about a call @@ -32773,7 +32807,7 @@ const UpdateClassName = "Update" // case *tdapi.UpdateFileAddedToDownloads: // updateFileAddedToDownloads#5ff5921a // case *tdapi.UpdateFileDownload: // updateFileDownload#342f83ca // case *tdapi.UpdateFileRemovedFromDownloads: // updateFileRemovedFromDownloads#6e7c14e8 -// case *tdapi.UpdateApplicationVerificationRequired: // updateApplicationVerificationRequired#32079e05 +// case *tdapi.UpdateApplicationVerificationRequired: // updateApplicationVerificationRequired#c59c61d7 // case *tdapi.UpdateCall: // updateCall#4fb3d0dd // case *tdapi.UpdateGroupCall: // updateGroupCall#30324e00 // case *tdapi.UpdateGroupCallParticipant: // updateGroupCallParticipant#d0213cf9 @@ -33434,7 +33468,7 @@ func DecodeUpdate(buf *bin.Buffer) (UpdateClass, error) { } return &v, nil case UpdateApplicationVerificationRequiredTypeID: - // Decoding updateApplicationVerificationRequired#32079e05. + // Decoding updateApplicationVerificationRequired#c59c61d7. v := UpdateApplicationVerificationRequired{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err) @@ -34489,7 +34523,7 @@ func DecodeTDLibJSONUpdate(buf tdjson.Decoder) (UpdateClass, error) { } return &v, nil case "updateApplicationVerificationRequired": - // Decoding updateApplicationVerificationRequired#32079e05. + // Decoding updateApplicationVerificationRequired#c59c61d7. v := UpdateApplicationVerificationRequired{} if err := v.DecodeTDLibJSON(buf); err != nil { return nil, fmt.Errorf("unable to decode UpdateClass: %w", err)