diff --git a/_schema/tdapi.tl b/_schema/tdapi.tl index fc68cac35..f4db946ce 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: 8e1ae8baa87c6e9fe519ce286006e9f88f96792870b2f88a23fb9b7ef9504772 +// SHA256: 0fcb92aaada422c71a42f164ed2442828a83f00df27e87f78f0ca9a5de34a9bb double#2210c154 ? = Double; @@ -361,10 +361,14 @@ stickerFullTypeMask#26dfbf37 mask_position:maskPosition = StickerFullType; //@needs_repainting True, if the sticker must be repainted to a text color in messages, the color of the Telegram Premium badge in emoji status, white color on chat photos, or another appropriate color in other places stickerFullTypeCustomEmoji#c37f05ab custom_emoji_id:int64 needs_repainting:Bool = StickerFullType; -//@description Represents a closed vector path. The path begins at the end point of the last command +//@description Represents a closed vector path. The path begins at the end point of the last command. The coordinate system origin is in the upper-left corner //@commands List of vector path commands closedVectorPath#2f9276b9 commands:vector = ClosedVectorPath; +//@description Represents outline of an image +//@paths The list of closed vector paths +outline#7d2ec0be paths:vector = Outline; + //@description Describes one answer option of a poll //@text Option text; 1-100 characters. Only custom emoji entities are allowed //@voter_count Number of voters for this option, available only for closed or voted polls @@ -430,10 +434,9 @@ photo#105a0689 has_stickers:Bool minithumbnail:minithumbnail sizes:vector thumbnail:thumbnail sticker:file = Sticker; +sticker#d96f5d3f id:int64 set_id:int64 width:int32 height:int32 emoji:string format:StickerFormat full_type:StickerFullType thumbnail:thumbnail sticker:file = Sticker; //@description Describes a video file //@duration Duration of the video, in seconds; as defined by the sender @@ -528,7 +531,7 @@ webApp#605ba8f3 short_name:string title:string description:string photo:photo an //@is_closed True, if the poll is closed poll#71d4870c id:int64 question:formattedText options:vector total_voter_count:int32 recent_voter_ids:vector is_anonymous:Bool type:PollType open_period:int32 close_date:int32 is_closed:Bool = Poll; -//@description Describes an alternative reencoded quality of a video file +//@description Describes an alternative re-encoded quality of a video file //@width Video width //@height Video height //@codec Codec used for video file encoding, for example, "h264", "h265", or "av1" @@ -818,21 +821,34 @@ chatPermissions#f8f25a79 can_send_basic_messages:Bool can_send_audios:Bool can_s //@is_anonymous True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only chatAdministratorRights#5f4f9044 can_manage_chat:Bool can_change_info:Bool can_post_messages:Bool can_edit_messages:Bool can_delete_messages:Bool can_invite_users:Bool can_restrict_members:Bool can_pin_messages:Bool can_manage_topics:Bool can_promote_members:Bool can_manage_video_chats:Bool can_post_stories:Bool can_edit_stories:Bool can_delete_stories:Bool is_anonymous:Bool = ChatAdministratorRights; +//@class StarSubscriptionType @description Describes type of subscription paid in Telegram Stars + +//@description Describes a subscription to a channel chat +//@can_reuse True, if the subscription is active and the user can use the method reuseStarSubscription to join the subscribed chat again +//@invite_link The invite link that can be used to renew the subscription if it has been expired; may be empty, if the link isn't available anymore +starSubscriptionTypeChannel#c29ab6f5 can_reuse:Bool invite_link:string = StarSubscriptionType; + +//@description Describes a subscription in a bot or a business account +//@is_canceled_by_bot True, if the subscription was canceled by the bot and can't be extended +//@title Subscription invoice title +//@photo Subscription invoice photo +//@invoice_link The link to the subscription invoice +starSubscriptionTypeBot#d78ddd2 is_canceled_by_bot:Bool title:string photo:photo invoice_link:string = StarSubscriptionType; + //@description Describes subscription plan paid in Telegram Stars //@period The number of seconds between consecutive Telegram Star debiting //@star_count The amount of Telegram Stars that must be paid for each period starSubscriptionPricing#96a28856 period:int32 star_count:int53 = StarSubscriptionPricing; -//@description Contains information about subscription to a channel chat paid in Telegram Stars +//@description Contains information about subscription to a channel chat, a bot, or a business account that was paid in Telegram Stars //@id Unique identifier of the subscription -//@chat_id Identifier of the channel chat that is subscribed +//@chat_id Identifier of the chat that is subscribed //@expiration_date Point in time (Unix timestamp) when the subscription will expire or expired -//@can_reuse True, if the subscription is active and the user can use the method reuseStarSubscription to join the subscribed chat again //@is_canceled True, if the subscription was canceled //@is_expiring True, if the subscription expires soon and there are no enough Telegram Stars on the user's balance to extend it -//@invite_link The invite link that can be used to renew the subscription if it has been expired; may be empty, if the link isn't available anymore //@pricing The subscription plan -starSubscription#6caf0ade id:string chat_id:int53 expiration_date:int32 can_reuse:Bool is_canceled:Bool is_expiring:Bool invite_link:string pricing:starSubscriptionPricing = StarSubscription; +//@type Type of the subscription +starSubscription#3a3811f5 id:string chat_id:int53 expiration_date:int32 is_canceled:Bool is_expiring:Bool pricing:starSubscriptionPricing type:StarSubscriptionType = StarSubscription; //@description Represents a list of Telegram Star subscriptions //@star_count The amount of owned Telegram Stars @@ -926,11 +942,12 @@ starGiveawayPaymentOptions#909fbf18 options:vector = //@sticker The sticker representing the gift //@star_count Number of Telegram Stars that must be paid for the gift //@default_sell_star_count Number of Telegram Stars that can be claimed by the receiver instead of the gift by default. If the gift was paid with just bought Telegram Stars, then full value can be claimed +//@is_for_birthday True, if the gift is a birthday gift //@remaining_count Number of remaining times the gift can be purchased by all users; 0 if not limited or the gift was sold out //@total_count Number of total times the gift can be purchased by all users; 0 if not limited //@first_send_date Point in time (Unix timestamp) when the gift was send for the first time; for sold out gifts only //@last_send_date Point in time (Unix timestamp) when the gift was send for the last time; for sold out gifts only -gift#9dc9b8a1 id:int64 sticker:sticker star_count:int53 default_sell_star_count:int53 remaining_count:int32 total_count:int32 first_send_date:int32 last_send_date:int32 = Gift; +gift#d3284cce id:int64 sticker:sticker star_count:int53 default_sell_star_count:int53 is_for_birthday:Bool remaining_count:int32 total_count:int32 first_send_date:int32 last_send_date:int32 = Gift; //@description Contains a list of gifts that can be sent to another user //@gifts The list of gifts @@ -944,7 +961,7 @@ gifts#7ea494b8 gifts:vector = Gifts; //@date Point in time (Unix timestamp) when the gift was sent //@gift The gift //@message_id Identifier of the message with the gift in the chat with the sender of the gift; can be 0 or an identifier of a deleted message; only for the gift receiver -//@sell_star_count Number of Telegram Stars that can be claimed by the receiver instead of the gift; only for the gift receiver +//@sell_star_count Number of Telegram Stars that can be claimed by the receiver instead of the gift; 0 if the gift can't be sold by the current user userGift#494eb721 sender_user_id:int53 text:formattedText is_private:Bool is_saved:Bool date:int32 gift:gift message_id:int53 sell_star_count:int53 = UserGift; //@description Represents a list of gifts received by a user @@ -973,6 +990,12 @@ botTransactionPurposePaidMedia#62952496 media:vector payload:string = //@invoice_payload Invoice payload; for bots only botTransactionPurposeInvoicePayment#699860ac product_info:productInfo invoice_payload:bytes = BotTransactionPurpose; +//@description User bought a subscription in a bot or a business account +//@period The number of seconds between consecutive Telegram Star debiting +//@product_info Information about the bought subscription; may be null if not applicable +//@invoice_payload Invoice payload; for bots only +botTransactionPurposeSubscription#e5796205 period:int32 product_info:productInfo invoice_payload:bytes = BotTransactionPurpose; + //@class ChatTransactionPurpose @description Describes purpose of a transaction with a supergroup or a channel //@description Paid media were bought @@ -998,11 +1021,11 @@ chatTransactionPurposeGiveaway#384c8b7f giveaway_message_id:int53 = ChatTransact //@sticker A sticker to be shown in the transaction information; may be null if unknown userTransactionPurposeGiftedStars#1fb3401 sticker:sticker = UserTransactionPurpose; -//@description The current user sold a gift received from another user +//@description The user sold a gift received from another user or bot //@gift The gift userTransactionPurposeGiftSell#195fcd8e gift:gift = UserTransactionPurpose; -//@description The current user sent a gift to another user +//@description The user or the bot sent a gift to a user //@gift The gift userTransactionPurposeGiftSend#b36e54df gift:gift = UserTransactionPurpose; @@ -1192,13 +1215,18 @@ user#18552c62 id:int53 first_name:string last_name:string usernames:usernames ph //@privacy_policy_url The HTTP link to the privacy policy of the bot. If empty, then /privacy command must be used if supported by the bot. If the command isn't supported, then https://telegram.org/privacy-tpa must be opened //@default_group_administrator_rights Default administrator rights for adding the bot to basic group and supergroup chats; may be null //@default_channel_administrator_rights Default administrator rights for adding the bot to channels; may be null -//@can_get_revenue_statistics True, if the bot's revenue statistics are available +//@web_app_background_light_color Default light background color for bot Web Apps; -1 if not specified +//@web_app_background_dark_color Default dark background color for bot Web Apps; -1 if not specified +//@web_app_header_light_color Default light header color for bot Web Apps; -1 if not specified +//@web_app_header_dark_color Default dark header color for bot Web Apps; -1 if not specified +//@can_get_revenue_statistics True, if the bot's revenue statistics are available to the current user +//@can_manage_emoji_status True, if the bot can manage emoji status of the current user //@has_media_previews True, if the bot has media previews //@edit_commands_link The internal link, which can be used to edit bot commands; may be null //@edit_description_link The internal link, which can be used to edit bot description; may be null //@edit_description_media_link The internal link, which can be used to edit the photo or animation shown in the chat with the bot if the chat is empty; may be null //@edit_settings_link The internal link, which can be used to edit bot settings; may be null -botInfo#bfacb6ae short_description:string description:string photo:photo animation:animation menu_button:botMenuButton commands:vector privacy_policy_url:string default_group_administrator_rights:chatAdministratorRights default_channel_administrator_rights:chatAdministratorRights can_get_revenue_statistics:Bool has_media_previews:Bool edit_commands_link:InternalLinkType edit_description_link:InternalLinkType edit_description_media_link:InternalLinkType edit_settings_link:InternalLinkType = BotInfo; +botInfo#15e58682 short_description:string description:string photo:photo animation:animation menu_button:botMenuButton commands:vector privacy_policy_url:string default_group_administrator_rights:chatAdministratorRights default_channel_administrator_rights:chatAdministratorRights web_app_background_light_color:int32 web_app_background_dark_color:int32 web_app_header_light_color:int32 web_app_header_dark_color:int32 can_get_revenue_statistics:Bool can_manage_emoji_status:Bool has_media_previews:Bool edit_commands_link:InternalLinkType edit_description_link:InternalLinkType edit_description_media_link:InternalLinkType edit_settings_link:InternalLinkType = BotInfo; //@description Contains full information about a user //@personal_photo User profile photo set by the current user for the contact; may be null. If null and user.profile_photo is null, then the photo is empty; otherwise, it is unknown. @@ -2410,6 +2438,35 @@ loginUrlInfoOpen#31e7ea02 url:string skip_confirmation:Bool = LoginUrlInfo; //@request_write_access True, if the user must be asked for the permission to the bot to send them messages loginUrlInfoRequestConfirmation#7edb242f url:string domain:string bot_user_id:int53 request_write_access:Bool = LoginUrlInfo; +//@description Contains parameters of the application theme +//@background_color A color of the background in the RGB format +//@secondary_background_color A secondary color for the background in the RGB format +//@header_background_color A color of the header background in the RGB format +//@bottom_bar_background_color A color of the bottom bar background in the RGB format +//@section_background_color A color of the section background in the RGB format +//@section_separator_color A color of the section separator in the RGB format +//@text_color A color of text in the RGB format +//@accent_text_color An accent color of the text in the RGB format +//@section_header_text_color A color of text on the section headers in the RGB format +//@subtitle_text_color A color of the subtitle text in the RGB format +//@destructive_text_color A color of the text for destructive actions in the RGB format +//@hint_color A color of hints in the RGB format +//@link_color A color of links in the RGB format +//@button_color A color of the buttons in the RGB format +//@button_text_color A color of text on the buttons in the RGB format +themeParameters#ef8395af background_color:int32 secondary_background_color:int32 header_background_color:int32 bottom_bar_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; + +//@class WebAppOpenMode @description Describes mode in which a Web App is opened + +//@description The Web App is opened in the compact mode +webAppOpenModeCompact#6604ffdb = WebAppOpenMode; + +//@description The Web App is opened in the full-size mode +webAppOpenModeFullSize#b48cd41 = WebAppOpenMode; + +//@description The Web App is opened in the full-screen mode +webAppOpenModeFullScreen#6f8a019d = WebAppOpenMode; + //@description Contains information about a Web App found by its short name //@web_app The Web App //@request_write_access True, if the user must be asked for the permission to the bot to send them messages @@ -2423,8 +2480,14 @@ webAppInfo#2efdb2e8 launch_id:int64 url:string = WebAppInfo; //@description Contains information about the main Web App of a bot //@url URL of the Web App to open -//@is_compact True, if the Web App must always be opened in the compact mode instead of the full-size mode -mainWebApp#4fb068f1 url:string is_compact:Bool = MainWebApp; +//@mode The mode in which the Web App must be opened +mainWebApp#73a7ac7a url:string mode:WebAppOpenMode = MainWebApp; + +//@description Options to be used when a Web App is opened +//@theme Preferred Web App theme; pass null to use the default theme +//@application_name Short name of the current application; 0-64 English letters, digits, and underscores +//@mode The mode in which the Web App is opened; pass null to open in webAppOpenModeFullSize +webAppOpenParameters#51fa466f theme:themeParameters application_name:string mode:WebAppOpenMode = WebAppOpenParameters; //@description Contains information about a message thread //@chat_id Identifier of the chat to which the message thread belongs @@ -3058,24 +3121,6 @@ address#86304f3a country_code:string state:string city:string street_line1:strin //@street The address; empty if unknown locationAddress#a3dad322 country_code:string state:string city:string street:string = LocationAddress; -//@description Contains parameters of the application theme -//@background_color A color of the background in the RGB format -//@secondary_background_color A secondary color for the background in the RGB format -//@header_background_color A color of the header background in the RGB format -//@bottom_bar_background_color A color of the bottom bar background in the RGB format -//@section_background_color A color of the section background in the RGB format -//@section_separator_color A color of the section separator in the RGB format -//@text_color A color of text in the RGB format -//@accent_text_color An accent color of the text in the RGB format -//@section_header_text_color A color of text on the section headers in the RGB format -//@subtitle_text_color A color of the subtitle text in the RGB format -//@destructive_text_color A color of the text for destructive actions in the RGB format -//@hint_color A color of hints in the RGB format -//@link_color A color of links in the RGB format -//@button_color A color of the buttons in the RGB format -//@button_text_color A color of text on the buttons in the RGB format -themeParameters#ef8395af background_color:int32 secondary_background_color:int32 header_background_color:int32 bottom_bar_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 //@amount Currency amount in the smallest units of the currency @@ -3084,6 +3129,7 @@ labeledPricePart#20f2e726 label:string amount:int53 = LabeledPricePart; //@description Product invoice //@currency ISO 4217 currency code //@price_parts A list of objects used to calculate the total price of the product +//@subscription_period The number of seconds between consecutive Telegram Star debiting for subscription invoices; 0 if the invoice doesn't create subscription //@max_tip_amount The maximum allowed amount of tip in the smallest units of the currency //@suggested_tip_amounts Suggested amounts of tip in the smallest units of the currency //@recurring_payment_terms_of_service_url An HTTP URL with terms of service for recurring payments. If non-empty, the invoice payment will result in recurring payments and the user must accept the terms of service before allowed to pay @@ -3096,7 +3142,7 @@ labeledPricePart#20f2e726 label:string amount:int53 = LabeledPricePart; //@send_phone_number_to_provider True, if the user's phone number will be sent to the provider //@send_email_address_to_provider True, if the user's email address will be sent to the provider //@is_flexible True, if the total price depends on the shipping method -invoice#c19b2377 currency:string price_parts:vector max_tip_amount:int53 suggested_tip_amounts:vector recurring_payment_terms_of_service_url:string terms_of_service_url:string is_test:Bool need_name:Bool need_phone_number:Bool need_email_address:Bool need_shipping_address:Bool send_phone_number_to_provider:Bool send_email_address_to_provider:Bool is_flexible:Bool = Invoice; +invoice#67dc0e89 currency:string price_parts:vector subscription_period:int32 max_tip_amount:int53 suggested_tip_amounts:vector recurring_payment_terms_of_service_url:string terms_of_service_url:string is_test:Bool need_name:Bool need_phone_number:Bool need_email_address:Bool need_shipping_address:Bool send_phone_number_to_provider:Bool send_email_address_to_provider:Bool is_flexible:Bool = Invoice; //@description Order information //@name Name of the user @@ -3175,6 +3221,10 @@ paymentFormTypeRegular#ba6d2f0f invoice:invoice payment_provider_user_id:int53 p //@star_count Number of Telegram Stars that will be paid paymentFormTypeStars#56b9d3d star_count:int53 = PaymentFormType; +//@description The payment form is for a payment in Telegram Stars for subscription +//@pricing Information about subscription plan +paymentFormTypeStarSubscription#102deb5b pricing:starSubscriptionPricing = PaymentFormType; + //@description Contains information about an invoice payment form //@id The payment form identifier //@type Type of the payment form @@ -3848,27 +3898,29 @@ messageCustomServiceAction#5595c772 text:string = MessageContent; //@score New score messageGameScore#50299d7f game_message_id:int53 game_id:int64 score:int32 = MessageContent; -//@description A payment has been completed +//@description A payment has been sent to a bot or a business account //@invoice_chat_id Identifier of the chat, containing the corresponding invoice message //@invoice_message_id Identifier of the message with the corresponding invoice; can be 0 or an identifier of a deleted message //@currency Currency for the price of the product //@total_amount Total price for the product, in the smallest units of the currency +//@subscription_until_date Point in time (Unix timestamp) when the subscription will expire; 0 if unknown or the payment isn't recurring //@is_recurring True, if this is a recurring payment //@is_first_recurring True, if this is the first recurring payment //@invoice_name Name of the invoice; may be empty if unknown -messagePaymentSuccessful#53d93cdc invoice_chat_id:int53 invoice_message_id:int53 currency:string total_amount:int53 is_recurring:Bool is_first_recurring:Bool invoice_name:string = MessageContent; +messagePaymentSuccessful#3e661911 invoice_chat_id:int53 invoice_message_id:int53 currency:string total_amount:int53 subscription_until_date:int32 is_recurring:Bool is_first_recurring:Bool invoice_name:string = MessageContent; -//@description A payment has been completed; for bots only +//@description A payment has been received by the bot or the business account //@currency Currency for price of the product //@total_amount Total price for the product, in the smallest units of the currency +//@subscription_until_date Point in time (Unix timestamp) when the subscription will expire; 0 if unknown or the payment isn't recurring //@is_recurring True, if this is a recurring payment //@is_first_recurring True, if this is the first recurring payment //@invoice_payload Invoice payload -//@shipping_option_id Identifier of the shipping option chosen by the user; may be empty if not applicable -//@order_info Information about the order; may be null +//@shipping_option_id Identifier of the shipping option chosen by the user; may be empty if not applicable; for bots only +//@order_info Information about the order; may be null; for bots only //@telegram_payment_charge_id Telegram payment identifier //@provider_payment_charge_id Provider payment identifier -messagePaymentSuccessfulBot#68e13eb9 currency:string total_amount:int53 is_recurring:Bool is_first_recurring:Bool invoice_payload:bytes shipping_option_id:string order_info:orderInfo telegram_payment_charge_id:string provider_payment_charge_id:string = MessageContent; +messagePaymentSuccessfulBot#c7664dbf currency:string total_amount:int53 subscription_until_date:int32 is_recurring:Bool is_first_recurring:Bool invoice_payload:bytes shipping_option_id:string order_info:orderInfo telegram_payment_charge_id:string provider_payment_charge_id:string = MessageContent; //@description A payment has been refunded //@owner_id Identifier of the previous owner of the Telegram Stars that refunds them @@ -3961,7 +4013,7 @@ messageGiveawayPrizeStars#aa0f5de3 star_count:int53 transaction_id:string booste //@description A gift was received or sent by the current user //@gift The gift //@text Message added to the gift -//@sell_star_count Number of Telegram Stars that can be claimed by the receiver instead of the gift +//@sell_star_count Number of Telegram Stars that can be claimed by the receiver instead of the gift; 0 if the gift can't be sold by the receiver //@is_private True, if the sender and gift text are shown only to the gift receiver; otherwise, everyone will be able to see them //@is_saved True, if the gift is displayed on the user's profile page; only for the receiver of the gift //@was_converted True, if the gift was converted to Telegram Stars; only for the receiver of the gift @@ -4215,7 +4267,7 @@ inputMessagePhoto#bc78dbcc photo:InputFile thumbnail:inputThumbnail added_sticke inputMessageSticker#3ff1b6f9 sticker:InputFile thumbnail:inputThumbnail width:int32 height:int32 emoji:string = InputMessageContent; //@description A video message -//@video Video to be sent. The video is expected to be reencoded to MPEG4 format with H.264 codec by the sender +//@video Video to be sent. The video is expected to be re-encoded to MPEG4 format with H.264 codec by the sender //@thumbnail Video thumbnail; pass null to skip thumbnail uploading //@added_sticker_file_ids File identifiers of the stickers added to the video, if applicable //@duration Duration of the video, in seconds @@ -4489,7 +4541,7 @@ emojis#77274a16 emojis:vector = Emojis; //@title Title of the sticker set //@name Name of the sticker set //@thumbnail Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed -//@thumbnail_outline Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner +//@thumbnail_outline Sticker set thumbnail's outline; may be null if unknown //@is_owned True, if the sticker set is owned by the current user //@is_installed True, if the sticker set has been installed by the current user //@is_archived True, if the sticker set has been archived. A sticker set can't be installed and archived simultaneously @@ -4500,14 +4552,14 @@ emojis#77274a16 emojis:vector = Emojis; //@is_viewed True for already viewed trending sticker sets //@stickers List of stickers in this set //@emojis A list of emojis corresponding to the stickers in the same order. The list is only for informational purposes, because a sticker is always sent with a fixed emoji from the corresponding Sticker object -stickerSet#bcf4d158 id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector is_owned:Bool is_installed:Bool is_archived:Bool is_official:Bool sticker_type:StickerType needs_repainting:Bool is_allowed_as_chat_emoji_status:Bool is_viewed:Bool stickers:vector emojis:vector = StickerSet; +stickerSet#e3b8a114 id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:outline is_owned:Bool is_installed:Bool is_archived:Bool is_official:Bool sticker_type:StickerType needs_repainting:Bool is_allowed_as_chat_emoji_status:Bool is_viewed:Bool stickers:vector emojis:vector = StickerSet; //@description Represents short information about a sticker set //@id Identifier of the sticker set //@title Title of the sticker set //@name Name of the sticker set //@thumbnail Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be null. The file can be downloaded only before the thumbnail is changed -//@thumbnail_outline Sticker set thumbnail's outline represented as a list of closed vector paths; may be empty. The coordinate system origin is in the upper-left corner +//@thumbnail_outline Sticker set thumbnail's outline; may be null if unknown //@is_owned True, if the sticker set is owned by the current user //@is_installed True, if the sticker set has been installed by the current user //@is_archived True, if the sticker set has been archived. A sticker set can't be installed and archived simultaneously @@ -4518,7 +4570,7 @@ stickerSet#bcf4d158 id:int64 title:string name:string thumbnail:thumbnail thumbn //@is_viewed True for already viewed trending sticker sets //@size Total number of stickers in the set //@covers Up to the first 5 stickers from the set, depending on the context. If the application needs more stickers the full sticker set needs to be requested -stickerSetInfo#3cd2cd82 id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:vector is_owned:Bool is_installed:Bool is_archived:Bool is_official:Bool sticker_type:StickerType needs_repainting:Bool is_allowed_as_chat_emoji_status:Bool is_viewed:Bool size:int32 covers:vector = StickerSetInfo; +stickerSetInfo#58991994 id:int64 title:string name:string thumbnail:thumbnail thumbnail_outline:outline is_owned:Bool is_installed:Bool is_archived:Bool is_official:Bool sticker_type:StickerType needs_repainting:Bool is_allowed_as_chat_emoji_status:Bool is_viewed:Bool size:int32 covers:vector = StickerSetInfo; //@description Represents a list of sticker sets //@total_count Approximate total number of sticker sets found @@ -5367,6 +5419,26 @@ httpUrl#87b775a6 url:string = HttpUrl; //@expires_in Left time for which the link is valid, in seconds; 0 if the link is a public username link userLink#1db0fef8 url:string expires_in:int32 = UserLink; +//@description Describes allowed types for the target chat +//@allow_user_chats True, if private chats with ordinary users are allowed +//@allow_bot_chats True, if private chats with other bots are allowed +//@allow_group_chats True, if basic group and supergroup chats are allowed +//@allow_channel_chats True, if channel chats are allowed +targetChatTypes#5a300e51 allow_user_chats:Bool allow_bot_chats:Bool allow_group_chats:Bool allow_channel_chats:Bool = TargetChatTypes; + +//@class TargetChat @description Describes the target chat to be opened + +//@description The currently opened chat needs to be kept +targetChatCurrent#e729d110 = TargetChat; + +//@description The chat needs to be chosen by the user among chats of the specified types +//@types Allowed types for the chat +targetChatChosen#acf8d5a6 types:targetChatTypes = TargetChat; + +//@description The chat needs to be open with the provided internal link +//@link An internal link pointing to the chat +targetChatInternalLink#dd788fe0 link:InternalLinkType = TargetChat; + //@class InputInlineQueryResult @description Represents a single result of an inline query; for bots only //@description Represents a link to an animated GIF or an animated (i.e., without sound) H.264/MPEG-4 AVC video @@ -5602,6 +5674,17 @@ inlineQueryResultsButton#d0df08ae text:string type:InlineQueryResultsButtonType //@next_offset The offset for the next request. If empty, then there are no more results inlineQueryResults#ffd17579 inline_query_id:int64 button:inlineQueryResultsButton results:vector next_offset:string = InlineQueryResults; +//@description Represents an inline message that can be sent via the bot +//@id Unique identifier for the message +//@expiration_date Point in time (Unix timestamp) when the message can't be used anymore +preparedInlineMessageId#380d9be4 id:string expiration_date:int32 = PreparedInlineMessageId; + +//@description Represents a ready to send inline message. Use sendInlineQueryResultMessage to send the message +//@inline_query_id Unique identifier of the inline query to pass to sendInlineQueryResultMessage +//@result Resulted inline message of the query +//@chat_types Types of the chats to which the message can be sent +preparedInlineMessage#942e7cc2 inline_query_id:int64 result:InlineQueryResult chat_types:targetChatTypes = PreparedInlineMessage; + //@class CallbackQueryPayload @description Represents a payload of a callback query //@description The payload for a general callback button @@ -6825,6 +6908,9 @@ userPrivacySettingRuleAllowAll#8abf1c3f = UserPrivacySettingRule; //@description A rule to allow all contacts of the user to do something userPrivacySettingRuleAllowContacts#8f2f2d10 = UserPrivacySettingRule; +//@description A rule to allow all bots to do something +userPrivacySettingRuleAllowBots#53b2871d = UserPrivacySettingRule; + //@description A rule to allow all Premium Users to do something; currently, allowed only for userPrivacySettingAllowChatInvites userPrivacySettingRuleAllowPremiumUsers#60ce8541 = UserPrivacySettingRule; @@ -6842,6 +6928,9 @@ userPrivacySettingRuleRestrictAll#ac2a9550 = UserPrivacySettingRule; //@description A rule to restrict all contacts of the user from doing something userPrivacySettingRuleRestrictContacts#3c1acd02 = UserPrivacySettingRule; +//@description A rule to restrict all bots from doing something +userPrivacySettingRuleRestrictBots#8e996e5d = UserPrivacySettingRule; + //@description A rule to restrict all specified users from doing something //@user_ids The user identifiers, total number of users in all rules must not exceed 1000 userPrivacySettingRuleRestrictUsers#4d392a91 user_ids:vector = UserPrivacySettingRule; @@ -6889,6 +6978,9 @@ userPrivacySettingAllowFindingByPhoneNumber#91ee6d51 = UserPrivacySetting; //@description A privacy setting for managing whether the user can receive voice and video messages in private chats; for Telegram Premium users only userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages#14272e3c = UserPrivacySetting; +//@description A privacy setting for managing whether received gifts are automatically shown on the user's profile page +userPrivacySettingAutosaveGifts#709a69cd = 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 readDatePrivacySettings#62a2e628 show_read_date:Bool = ReadDatePrivacySettings; @@ -7083,22 +7175,6 @@ reportStoryResultOptionRequired#bf79aa9b title:string options:vector cache_time:int32 next_offset:string = Ok; +//@description Saves an inline message to be sent by the given user; for bots only +//@user_id Identifier of the user +//@result The description of the message +//@chat_types Types of the chats to which the message can be sent +savePreparedInlineMessage#c71468d9 user_id:int53 result:InputInlineQueryResult chat_types:targetChatTypes = PreparedInlineMessageId; + +//@description Saves an inline message to be sent by the given user; for bots only +//@bot_user_id Identifier of the bot that created the message +//@prepared_message_id Identifier of the prepared message +getPreparedInlineMessage#fb0ac74b bot_user_id:int53 prepared_message_id:string = PreparedInlineMessage; + //@description Returns the most grossing Web App bots //@offset Offset of the first entry to return as received from the previous request; use empty string to get the first chunk of results //@limit The maximum number of bots to be returned; up to 100 @@ -10061,30 +10148,31 @@ getGrossingWebAppBots#6522ce1a offset:string limit:int32 = FoundUsers; //@web_app_short_name Short name of the Web App searchWebApp#b5fc8a35 bot_user_id:int53 web_app_short_name:string = FoundWebApp; +//@description Returns a default placeholder for Web Apps of a bot; this is an offline request. Returns a 404 error if the placeholder isn't known +//@bot_user_id Identifier of the target bot +getWebAppPlaceholder#22c70d8f bot_user_id:int53 = Outline; + //@description Returns an HTTPS URL of a Web App to open after a link of the type internalLinkTypeWebApp is clicked //@chat_id Identifier of the chat in which the link was clicked; pass 0 if none //@bot_user_id Identifier of the target bot //@web_app_short_name Short name of the Web App //@start_parameter Start parameter from internalLinkTypeWebApp -//@theme Preferred Web App theme; pass null to use the default theme -//@application_name Short name of the current application; 0-64 English letters, digits, and underscores //@allow_write_access Pass true if the current user allowed the bot to send them messages -getWebAppLinkUrl#4f0ef3cc chat_id:int53 bot_user_id:int53 web_app_short_name:string start_parameter:string theme:themeParameters application_name:string allow_write_access:Bool = HttpUrl; +//@parameters Parameters to use to open the Web App +getWebAppLinkUrl#60fe62c1 chat_id:int53 bot_user_id:int53 web_app_short_name:string start_parameter:string allow_write_access:Bool parameters:webAppOpenParameters = HttpUrl; //@description Returns information needed to open the main Web App of a bot //@chat_id Identifier of the chat in which the Web App is opened; pass 0 if none //@bot_user_id Identifier of the target bot //@start_parameter Start parameter from internalLinkTypeMainWebApp -//@theme Preferred Web App theme; pass null to use the default theme -//@application_name Short name of the current application; 0-64 English letters, digits, and underscores -getMainWebApp#be84329a chat_id:int53 bot_user_id:int53 start_parameter:string theme:themeParameters application_name:string = MainWebApp; +//@parameters Parameters to use to open the Web App +getMainWebApp#23687ca6 chat_id:int53 bot_user_id:int53 start_parameter:string parameters:webAppOpenParameters = MainWebApp; //@description Returns an HTTPS URL of a Web App to open from the side menu, a keyboardButtonTypeWebApp button, or an inlineQueryResultsButtonTypeWebApp button //@bot_user_id Identifier of the target bot //@url The URL from a keyboardButtonTypeWebApp button, inlineQueryResultsButtonTypeWebApp button, or an empty string when the bot is opened from the side menu -//@theme Preferred Web App theme; pass null to use the default theme -//@application_name Short name of the current application; 0-64 English letters, digits, and underscores -getWebAppUrl#64c42cbe bot_user_id:int53 url:string theme:themeParameters application_name:string = HttpUrl; +//@parameters Parameters to use to open the Web App +getWebAppUrl#a4ff1f44 bot_user_id:int53 url:string parameters:webAppOpenParameters = HttpUrl; //@description Sends data received from a keyboardButtonTypeWebApp Web App to a bot //@bot_user_id Identifier of the target bot @@ -10096,11 +10184,10 @@ sendWebAppData#ab1fce0c bot_user_id:int53 button_text:string data:string = Ok; //@chat_id Identifier of the chat in which the Web App is opened. The Web App can't be opened in secret chats //@bot_user_id Identifier of the bot, providing the Web App //@url The URL from an inlineKeyboardButtonTypeWebApp button, a botMenuButton button, an internalLinkTypeAttachmentMenuBot link, or an empty string otherwise -//@theme Preferred Web App theme; pass null to use the default theme -//@application_name Short name of the current application; 0-64 English letters, digits, and underscores //@message_thread_id If not 0, the message thread identifier in which the message will be sent //@reply_to Information about the message or story to be replied in the message sent by the Web App; pass null if none -openWebApp#b02666b0 chat_id:int53 bot_user_id:int53 url:string theme:themeParameters application_name:string message_thread_id:int53 reply_to:InputMessageReplyTo = WebAppInfo; +//@parameters Parameters to use to open the Web App +openWebApp#278173a2 chat_id:int53 bot_user_id:int53 url:string message_thread_id:int53 reply_to:InputMessageReplyTo parameters:webAppOpenParameters = WebAppInfo; //@description Informs TDLib that a previously opened Web App was closed //@web_app_launch_id Identifier of Web App launch, received from openWebApp @@ -10111,6 +10198,12 @@ closeWebApp#68a124c6 web_app_launch_id:int64 = Ok; //@result The result of the query answerWebAppQuery#a0b49cf1 web_app_query_id:string result:InputInlineQueryResult = SentWebAppMessage; +//@description Checks whether a file can be downloaded and saved locally by Web App request +//@bot_user_id Identifier of the bot, providing the Web App +//@file_name Name of the file +//@url URL of the file +checkWebAppFileDownload#e8ca44e2 bot_user_id:int53 file_name:string url:string = Ok; + //@description Sends a callback query to a bot and returns an answer. Returns an error with code 502 if the bot fails to answer the query before the query timeout expires //@chat_id Identifier of the chat with the message //@message_id Identifier of the message from which the query originated. The message must not be scheduled @@ -11130,7 +11223,7 @@ setVideoChatDefaultParticipant#f1a672b3 chat_id:int53 default_participant_id:Mes //@is_rtmp_stream Pass true to create an RTMP stream instead of an ordinary video chat; requires owner privileges createVideoChat#7ea4958d chat_id:int53 title:string start_date:int32 is_rtmp_stream:Bool = GroupCallId; -//@description Returns RTMP URL for streaming to the chat; requires owner privileges +//@description Returns RTMP URL for streaming to the chat; requires can_manage_video_chats administrator right //@chat_id Chat identifier getVideoChatRtmpUrl#482b1b1f chat_id:int53 = RtmpUrl; @@ -11336,6 +11429,16 @@ setUserPersonalProfilePhoto#1baa28f6 user_id:int53 photo:InputChatPhoto = Ok; //@photo Profile photo to suggest; inputChatPhotoPrevious isn't supported in this function suggestUserProfilePhoto#9561f463 user_id:int53 photo:InputChatPhoto = Ok; +//@description Toggles whether the bot can manage emoji status of the current user +//@bot_user_id User identifier of the bot +//@can_manage_emoji_status Pass true if the bot is allowed to change emoji status of the user; pass false otherwise +toggleBotCanManageEmojiStatus#251a881a bot_user_id:int53 can_manage_emoji_status:Bool = Ok; + +//@description Changes the emoji status of a user; for bots only +//@user_id Identifier of the user +//@emoji_status New emoji status; pass null to switch to the default badge +setUserEmojiStatus#e5165bcb user_id:int53 emoji_status:emojiStatus = Ok; + //@description Searches a user by their phone number. Returns a 404 error if the user can't be found //@phone_number Phone number to search for //@only_local Pass true to get only locally available information without sending network requests @@ -11351,6 +11454,12 @@ sharePhoneNumber#4164e055 user_id:int53 = Ok; //@limit The maximum number of photos to be returned; up to 100 getUserProfilePhotos#c9defe42 user_id:int53 offset:int32 limit:int32 = ChatPhotos; +//@description Returns outline of a sticker; this is an offline request. Returns a 404 error if the outline isn't known +//@sticker_file_id File identifier of the sticker +//@for_animated_emoji Pass true to get the outline scaled for animated emoji +//@for_clicked_animated_emoji_message Pass true to get the outline scaled for clicked animated emoji message +getStickerOutline#a3952da5 sticker_file_id:int32 for_animated_emoji:Bool for_clicked_animated_emoji_message:Bool = Outline; + //@description Returns stickers from the installed sticker sets that correspond to any of the given emoji or can be found by sticker-specific keywords. If the query is non-empty, then favorite, recently used or trending stickers may also be returned //@sticker_type Type of the stickers to return //@query Search query; a space-separated list of emojis or a keyword prefix. If empty, returns all known installed stickers @@ -12027,8 +12136,9 @@ toggleGiftIsSaved#91c2f183 sender_user_id:int53 message_id:int53 is_saved:Bool = getUserGifts#b7cdbc7c user_id:int53 offset:string limit:int32 = UserGifts; //@description Creates a link for the given invoice; for bots only +//@business_connection_id Unique identifier of business connection on behalf of which to send the request //@invoice Information about the invoice of the type inputMessageInvoice -createInvoiceLink#cebe921 invoice:InputMessageContent = HttpUrl; +createInvoiceLink#cf70c867 business_connection_id:string invoice:InputMessageContent = HttpUrl; //@description Refunds a previously done payment in Telegram Stars; for bots only //@user_id Identifier of the user that did the payment @@ -12569,12 +12679,18 @@ assignAppStoreTransaction#86f30bb0 receipt:bytes purpose:StorePaymentPurpose = O //@purpose Transaction purpose assignGooglePlayTransaction#8939bca4 package_name:string store_product_id:string purchase_token:string purpose:StorePaymentPurpose = Ok; -//@description Cancels or reenables Telegram Star subscription to a channel +//@description Cancels or re-enables Telegram Star subscription //@subscription_id Identifier of the subscription to change //@is_canceled New value of is_canceled editStarSubscription#7a1a3918 subscription_id:string is_canceled:Bool = Ok; -//@description Reuses an active subscription and joins the subscribed chat again +//@description Cancels or re-enables Telegram Star subscription for a user; for bots only +//@user_id User identifier +//@telegram_payment_charge_id Telegram payment identifier of the subscription +//@is_canceled Pass true to cancel the subscription; pass false to allow the user to enable it +editUserStarSubscription#51b16e89 user_id:int53 telegram_payment_charge_id:string is_canceled:Bool = Ok; + +//@description Reuses an active Telegram Star subscription to a channel chat and joins the chat again //@subscription_id Identifier of the subscription reuseStarSubscription#2e677441 subscription_id:string = Ok; diff --git a/tdapi/tl_bot_info_gen.go b/tdapi/tl_bot_info_gen.go index 93b4c340b..af7c52c43 100644 --- a/tdapi/tl_bot_info_gen.go +++ b/tdapi/tl_bot_info_gen.go @@ -31,7 +31,7 @@ var ( _ = tdjson.Encoder{} ) -// BotInfo represents TL type `botInfo#bfacb6ae`. +// BotInfo represents TL type `botInfo#15e58682`. type BotInfo struct { // The text that is shown on the bot's profile page and is sent together with the link // when users share the bot @@ -56,8 +56,18 @@ type BotInfo struct { DefaultGroupAdministratorRights ChatAdministratorRights // Default administrator rights for adding the bot to channels; may be null DefaultChannelAdministratorRights ChatAdministratorRights - // True, if the bot's revenue statistics are available + // Default light background color for bot Web Apps; -1 if not specified + WebAppBackgroundLightColor int32 + // Default dark background color for bot Web Apps; -1 if not specified + WebAppBackgroundDarkColor int32 + // Default light header color for bot Web Apps; -1 if not specified + WebAppHeaderLightColor int32 + // Default dark header color for bot Web Apps; -1 if not specified + WebAppHeaderDarkColor int32 + // True, if the bot's revenue statistics are available to the current user CanGetRevenueStatistics bool + // True, if the bot can manage emoji status of the current user + CanManageEmojiStatus bool // True, if the bot has media previews HasMediaPreviews bool // The internal link, which can be used to edit bot commands; may be null @@ -72,7 +82,7 @@ type BotInfo struct { } // BotInfoTypeID is TL type id of BotInfo. -const BotInfoTypeID = 0xbfacb6ae +const BotInfoTypeID = 0x15e58682 // Ensuring interfaces in compile-time for BotInfo. var ( @@ -113,9 +123,24 @@ func (b *BotInfo) Zero() bool { if !(b.DefaultChannelAdministratorRights.Zero()) { return false } + if !(b.WebAppBackgroundLightColor == 0) { + return false + } + if !(b.WebAppBackgroundDarkColor == 0) { + return false + } + if !(b.WebAppHeaderLightColor == 0) { + return false + } + if !(b.WebAppHeaderDarkColor == 0) { + return false + } if !(b.CanGetRevenueStatistics == false) { return false } + if !(b.CanManageEmojiStatus == false) { + return false + } if !(b.HasMediaPreviews == false) { return false } @@ -203,10 +228,30 @@ func (b *BotInfo) TypeInfo() tdp.Type { Name: "DefaultChannelAdministratorRights", SchemaName: "default_channel_administrator_rights", }, + { + Name: "WebAppBackgroundLightColor", + SchemaName: "web_app_background_light_color", + }, + { + Name: "WebAppBackgroundDarkColor", + SchemaName: "web_app_background_dark_color", + }, + { + Name: "WebAppHeaderLightColor", + SchemaName: "web_app_header_light_color", + }, + { + Name: "WebAppHeaderDarkColor", + SchemaName: "web_app_header_dark_color", + }, { Name: "CanGetRevenueStatistics", SchemaName: "can_get_revenue_statistics", }, + { + Name: "CanManageEmojiStatus", + SchemaName: "can_manage_emoji_status", + }, { Name: "HasMediaPreviews", SchemaName: "has_media_previews", @@ -234,7 +279,7 @@ func (b *BotInfo) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (b *BotInfo) Encode(buf *bin.Buffer) error { if b == nil { - return fmt.Errorf("can't encode botInfo#bfacb6ae as nil") + return fmt.Errorf("can't encode botInfo#15e58682 as nil") } buf.PutID(BotInfoTypeID) return b.EncodeBare(buf) @@ -243,57 +288,62 @@ func (b *BotInfo) Encode(buf *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (b *BotInfo) EncodeBare(buf *bin.Buffer) error { if b == nil { - return fmt.Errorf("can't encode botInfo#bfacb6ae as nil") + return fmt.Errorf("can't encode botInfo#15e58682 as nil") } buf.PutString(b.ShortDescription) buf.PutString(b.Description) if err := b.Photo.Encode(buf); err != nil { - return fmt.Errorf("unable to encode botInfo#bfacb6ae: field photo: %w", err) + return fmt.Errorf("unable to encode botInfo#15e58682: field photo: %w", err) } if err := b.Animation.Encode(buf); err != nil { - return fmt.Errorf("unable to encode botInfo#bfacb6ae: field animation: %w", err) + return fmt.Errorf("unable to encode botInfo#15e58682: field animation: %w", err) } if err := b.MenuButton.Encode(buf); err != nil { - return fmt.Errorf("unable to encode botInfo#bfacb6ae: field menu_button: %w", err) + return fmt.Errorf("unable to encode botInfo#15e58682: field menu_button: %w", err) } buf.PutInt(len(b.Commands)) for idx, v := range b.Commands { if err := v.EncodeBare(buf); err != nil { - return fmt.Errorf("unable to encode bare botInfo#bfacb6ae: field commands element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode bare botInfo#15e58682: field commands element with index %d: %w", idx, err) } } buf.PutString(b.PrivacyPolicyURL) if err := b.DefaultGroupAdministratorRights.Encode(buf); err != nil { - return fmt.Errorf("unable to encode botInfo#bfacb6ae: field default_group_administrator_rights: %w", err) + return fmt.Errorf("unable to encode botInfo#15e58682: field default_group_administrator_rights: %w", err) } if err := b.DefaultChannelAdministratorRights.Encode(buf); err != nil { - return fmt.Errorf("unable to encode botInfo#bfacb6ae: field default_channel_administrator_rights: %w", err) + return fmt.Errorf("unable to encode botInfo#15e58682: field default_channel_administrator_rights: %w", err) } + buf.PutInt32(b.WebAppBackgroundLightColor) + buf.PutInt32(b.WebAppBackgroundDarkColor) + buf.PutInt32(b.WebAppHeaderLightColor) + buf.PutInt32(b.WebAppHeaderDarkColor) buf.PutBool(b.CanGetRevenueStatistics) + buf.PutBool(b.CanManageEmojiStatus) buf.PutBool(b.HasMediaPreviews) if b.EditCommandsLink == nil { - return fmt.Errorf("unable to encode botInfo#bfacb6ae: field edit_commands_link is nil") + return fmt.Errorf("unable to encode botInfo#15e58682: field edit_commands_link is nil") } if err := b.EditCommandsLink.Encode(buf); err != nil { - return fmt.Errorf("unable to encode botInfo#bfacb6ae: field edit_commands_link: %w", err) + return fmt.Errorf("unable to encode botInfo#15e58682: field edit_commands_link: %w", err) } if b.EditDescriptionLink == nil { - return fmt.Errorf("unable to encode botInfo#bfacb6ae: field edit_description_link is nil") + return fmt.Errorf("unable to encode botInfo#15e58682: field edit_description_link is nil") } if err := b.EditDescriptionLink.Encode(buf); err != nil { - return fmt.Errorf("unable to encode botInfo#bfacb6ae: field edit_description_link: %w", err) + return fmt.Errorf("unable to encode botInfo#15e58682: field edit_description_link: %w", err) } if b.EditDescriptionMediaLink == nil { - return fmt.Errorf("unable to encode botInfo#bfacb6ae: field edit_description_media_link is nil") + return fmt.Errorf("unable to encode botInfo#15e58682: field edit_description_media_link is nil") } if err := b.EditDescriptionMediaLink.Encode(buf); err != nil { - return fmt.Errorf("unable to encode botInfo#bfacb6ae: field edit_description_media_link: %w", err) + return fmt.Errorf("unable to encode botInfo#15e58682: field edit_description_media_link: %w", err) } if b.EditSettingsLink == nil { - return fmt.Errorf("unable to encode botInfo#bfacb6ae: field edit_settings_link is nil") + return fmt.Errorf("unable to encode botInfo#15e58682: field edit_settings_link is nil") } if err := b.EditSettingsLink.Encode(buf); err != nil { - return fmt.Errorf("unable to encode botInfo#bfacb6ae: field edit_settings_link: %w", err) + return fmt.Errorf("unable to encode botInfo#15e58682: field edit_settings_link: %w", err) } return nil } @@ -301,10 +351,10 @@ func (b *BotInfo) EncodeBare(buf *bin.Buffer) error { // Decode implements bin.Decoder. func (b *BotInfo) Decode(buf *bin.Buffer) error { if b == nil { - return fmt.Errorf("can't decode botInfo#bfacb6ae to nil") + return fmt.Errorf("can't decode botInfo#15e58682 to nil") } if err := buf.ConsumeID(BotInfoTypeID); err != nil { - return fmt.Errorf("unable to decode botInfo#bfacb6ae: %w", err) + return fmt.Errorf("unable to decode botInfo#15e58682: %w", err) } return b.DecodeBare(buf) } @@ -312,41 +362,41 @@ func (b *BotInfo) Decode(buf *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (b *BotInfo) DecodeBare(buf *bin.Buffer) error { if b == nil { - return fmt.Errorf("can't decode botInfo#bfacb6ae to nil") + return fmt.Errorf("can't decode botInfo#15e58682 to nil") } { value, err := buf.String() if err != nil { - return fmt.Errorf("unable to decode botInfo#bfacb6ae: field short_description: %w", err) + return fmt.Errorf("unable to decode botInfo#15e58682: field short_description: %w", err) } b.ShortDescription = value } { value, err := buf.String() if err != nil { - return fmt.Errorf("unable to decode botInfo#bfacb6ae: field description: %w", err) + return fmt.Errorf("unable to decode botInfo#15e58682: field description: %w", err) } b.Description = value } { if err := b.Photo.Decode(buf); err != nil { - return fmt.Errorf("unable to decode botInfo#bfacb6ae: field photo: %w", err) + return fmt.Errorf("unable to decode botInfo#15e58682: field photo: %w", err) } } { if err := b.Animation.Decode(buf); err != nil { - return fmt.Errorf("unable to decode botInfo#bfacb6ae: field animation: %w", err) + return fmt.Errorf("unable to decode botInfo#15e58682: field animation: %w", err) } } { if err := b.MenuButton.Decode(buf); err != nil { - return fmt.Errorf("unable to decode botInfo#bfacb6ae: field menu_button: %w", err) + return fmt.Errorf("unable to decode botInfo#15e58682: field menu_button: %w", err) } } { headerLen, err := buf.Int() if err != nil { - return fmt.Errorf("unable to decode botInfo#bfacb6ae: field commands: %w", err) + return fmt.Errorf("unable to decode botInfo#15e58682: field commands: %w", err) } if headerLen > 0 { @@ -355,7 +405,7 @@ func (b *BotInfo) DecodeBare(buf *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { var value BotCommand if err := value.DecodeBare(buf); err != nil { - return fmt.Errorf("unable to decode bare botInfo#bfacb6ae: field commands: %w", err) + return fmt.Errorf("unable to decode bare botInfo#15e58682: field commands: %w", err) } b.Commands = append(b.Commands, value) } @@ -363,59 +413,94 @@ func (b *BotInfo) DecodeBare(buf *bin.Buffer) error { { value, err := buf.String() if err != nil { - return fmt.Errorf("unable to decode botInfo#bfacb6ae: field privacy_policy_url: %w", err) + return fmt.Errorf("unable to decode botInfo#15e58682: field privacy_policy_url: %w", err) } b.PrivacyPolicyURL = value } { if err := b.DefaultGroupAdministratorRights.Decode(buf); err != nil { - return fmt.Errorf("unable to decode botInfo#bfacb6ae: field default_group_administrator_rights: %w", err) + return fmt.Errorf("unable to decode botInfo#15e58682: field default_group_administrator_rights: %w", err) } } { if err := b.DefaultChannelAdministratorRights.Decode(buf); err != nil { - return fmt.Errorf("unable to decode botInfo#bfacb6ae: field default_channel_administrator_rights: %w", err) + return fmt.Errorf("unable to decode botInfo#15e58682: field default_channel_administrator_rights: %w", err) } } + { + value, err := buf.Int32() + if err != nil { + return fmt.Errorf("unable to decode botInfo#15e58682: field web_app_background_light_color: %w", err) + } + b.WebAppBackgroundLightColor = value + } + { + value, err := buf.Int32() + if err != nil { + return fmt.Errorf("unable to decode botInfo#15e58682: field web_app_background_dark_color: %w", err) + } + b.WebAppBackgroundDarkColor = value + } + { + value, err := buf.Int32() + if err != nil { + return fmt.Errorf("unable to decode botInfo#15e58682: field web_app_header_light_color: %w", err) + } + b.WebAppHeaderLightColor = value + } + { + value, err := buf.Int32() + if err != nil { + return fmt.Errorf("unable to decode botInfo#15e58682: field web_app_header_dark_color: %w", err) + } + b.WebAppHeaderDarkColor = value + } { value, err := buf.Bool() if err != nil { - return fmt.Errorf("unable to decode botInfo#bfacb6ae: field can_get_revenue_statistics: %w", err) + return fmt.Errorf("unable to decode botInfo#15e58682: field can_get_revenue_statistics: %w", err) } b.CanGetRevenueStatistics = value } { value, err := buf.Bool() if err != nil { - return fmt.Errorf("unable to decode botInfo#bfacb6ae: field has_media_previews: %w", err) + return fmt.Errorf("unable to decode botInfo#15e58682: field can_manage_emoji_status: %w", err) + } + b.CanManageEmojiStatus = value + } + { + value, err := buf.Bool() + if err != nil { + return fmt.Errorf("unable to decode botInfo#15e58682: field has_media_previews: %w", err) } b.HasMediaPreviews = value } { value, err := DecodeInternalLinkType(buf) if err != nil { - return fmt.Errorf("unable to decode botInfo#bfacb6ae: field edit_commands_link: %w", err) + return fmt.Errorf("unable to decode botInfo#15e58682: field edit_commands_link: %w", err) } b.EditCommandsLink = value } { value, err := DecodeInternalLinkType(buf) if err != nil { - return fmt.Errorf("unable to decode botInfo#bfacb6ae: field edit_description_link: %w", err) + return fmt.Errorf("unable to decode botInfo#15e58682: field edit_description_link: %w", err) } b.EditDescriptionLink = value } { value, err := DecodeInternalLinkType(buf) if err != nil { - return fmt.Errorf("unable to decode botInfo#bfacb6ae: field edit_description_media_link: %w", err) + return fmt.Errorf("unable to decode botInfo#15e58682: field edit_description_media_link: %w", err) } b.EditDescriptionMediaLink = value } { value, err := DecodeInternalLinkType(buf) if err != nil { - return fmt.Errorf("unable to decode botInfo#bfacb6ae: field edit_settings_link: %w", err) + return fmt.Errorf("unable to decode botInfo#15e58682: field edit_settings_link: %w", err) } b.EditSettingsLink = value } @@ -425,7 +510,7 @@ func (b *BotInfo) DecodeBare(buf *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (b *BotInfo) EncodeTDLibJSON(buf tdjson.Encoder) error { if b == nil { - return fmt.Errorf("can't encode botInfo#bfacb6ae as nil") + return fmt.Errorf("can't encode botInfo#15e58682 as nil") } buf.ObjStart() buf.PutID("botInfo") @@ -438,24 +523,24 @@ func (b *BotInfo) EncodeTDLibJSON(buf tdjson.Encoder) error { buf.Comma() buf.FieldStart("photo") if err := b.Photo.EncodeTDLibJSON(buf); err != nil { - return fmt.Errorf("unable to encode botInfo#bfacb6ae: field photo: %w", err) + return fmt.Errorf("unable to encode botInfo#15e58682: field photo: %w", err) } buf.Comma() buf.FieldStart("animation") if err := b.Animation.EncodeTDLibJSON(buf); err != nil { - return fmt.Errorf("unable to encode botInfo#bfacb6ae: field animation: %w", err) + return fmt.Errorf("unable to encode botInfo#15e58682: field animation: %w", err) } buf.Comma() buf.FieldStart("menu_button") if err := b.MenuButton.EncodeTDLibJSON(buf); err != nil { - return fmt.Errorf("unable to encode botInfo#bfacb6ae: field menu_button: %w", err) + return fmt.Errorf("unable to encode botInfo#15e58682: field menu_button: %w", err) } buf.Comma() buf.FieldStart("commands") buf.ArrStart() for idx, v := range b.Commands { if err := v.EncodeTDLibJSON(buf); err != nil { - return fmt.Errorf("unable to encode botInfo#bfacb6ae: field commands element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode botInfo#15e58682: field commands element with index %d: %w", idx, err) } buf.Comma() } @@ -467,50 +552,65 @@ func (b *BotInfo) EncodeTDLibJSON(buf tdjson.Encoder) error { buf.Comma() buf.FieldStart("default_group_administrator_rights") if err := b.DefaultGroupAdministratorRights.EncodeTDLibJSON(buf); err != nil { - return fmt.Errorf("unable to encode botInfo#bfacb6ae: field default_group_administrator_rights: %w", err) + return fmt.Errorf("unable to encode botInfo#15e58682: field default_group_administrator_rights: %w", err) } buf.Comma() buf.FieldStart("default_channel_administrator_rights") if err := b.DefaultChannelAdministratorRights.EncodeTDLibJSON(buf); err != nil { - return fmt.Errorf("unable to encode botInfo#bfacb6ae: field default_channel_administrator_rights: %w", err) + return fmt.Errorf("unable to encode botInfo#15e58682: field default_channel_administrator_rights: %w", err) } buf.Comma() + buf.FieldStart("web_app_background_light_color") + buf.PutInt32(b.WebAppBackgroundLightColor) + buf.Comma() + buf.FieldStart("web_app_background_dark_color") + buf.PutInt32(b.WebAppBackgroundDarkColor) + buf.Comma() + buf.FieldStart("web_app_header_light_color") + buf.PutInt32(b.WebAppHeaderLightColor) + buf.Comma() + buf.FieldStart("web_app_header_dark_color") + buf.PutInt32(b.WebAppHeaderDarkColor) + buf.Comma() buf.FieldStart("can_get_revenue_statistics") buf.PutBool(b.CanGetRevenueStatistics) buf.Comma() + buf.FieldStart("can_manage_emoji_status") + buf.PutBool(b.CanManageEmojiStatus) + buf.Comma() buf.FieldStart("has_media_previews") buf.PutBool(b.HasMediaPreviews) buf.Comma() buf.FieldStart("edit_commands_link") if b.EditCommandsLink == nil { - return fmt.Errorf("unable to encode botInfo#bfacb6ae: field edit_commands_link is nil") + return fmt.Errorf("unable to encode botInfo#15e58682: field edit_commands_link is nil") } if err := b.EditCommandsLink.EncodeTDLibJSON(buf); err != nil { - return fmt.Errorf("unable to encode botInfo#bfacb6ae: field edit_commands_link: %w", err) + return fmt.Errorf("unable to encode botInfo#15e58682: field edit_commands_link: %w", err) } buf.Comma() buf.FieldStart("edit_description_link") if b.EditDescriptionLink == nil { - return fmt.Errorf("unable to encode botInfo#bfacb6ae: field edit_description_link is nil") + return fmt.Errorf("unable to encode botInfo#15e58682: field edit_description_link is nil") } if err := b.EditDescriptionLink.EncodeTDLibJSON(buf); err != nil { - return fmt.Errorf("unable to encode botInfo#bfacb6ae: field edit_description_link: %w", err) + return fmt.Errorf("unable to encode botInfo#15e58682: field edit_description_link: %w", err) } buf.Comma() buf.FieldStart("edit_description_media_link") if b.EditDescriptionMediaLink == nil { - return fmt.Errorf("unable to encode botInfo#bfacb6ae: field edit_description_media_link is nil") + return fmt.Errorf("unable to encode botInfo#15e58682: field edit_description_media_link is nil") } if err := b.EditDescriptionMediaLink.EncodeTDLibJSON(buf); err != nil { - return fmt.Errorf("unable to encode botInfo#bfacb6ae: field edit_description_media_link: %w", err) + return fmt.Errorf("unable to encode botInfo#15e58682: field edit_description_media_link: %w", err) } buf.Comma() buf.FieldStart("edit_settings_link") if b.EditSettingsLink == nil { - return fmt.Errorf("unable to encode botInfo#bfacb6ae: field edit_settings_link is nil") + return fmt.Errorf("unable to encode botInfo#15e58682: field edit_settings_link is nil") } if err := b.EditSettingsLink.EncodeTDLibJSON(buf); err != nil { - return fmt.Errorf("unable to encode botInfo#bfacb6ae: field edit_settings_link: %w", err) + return fmt.Errorf("unable to encode botInfo#15e58682: field edit_settings_link: %w", err) } buf.Comma() buf.StripComma() @@ -521,98 +621,128 @@ func (b *BotInfo) EncodeTDLibJSON(buf tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (b *BotInfo) DecodeTDLibJSON(buf tdjson.Decoder) error { if b == nil { - return fmt.Errorf("can't decode botInfo#bfacb6ae to nil") + return fmt.Errorf("can't decode botInfo#15e58682 to nil") } return buf.Obj(func(buf tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := buf.ConsumeID("botInfo"); err != nil { - return fmt.Errorf("unable to decode botInfo#bfacb6ae: %w", err) + return fmt.Errorf("unable to decode botInfo#15e58682: %w", err) } case "short_description": value, err := buf.String() if err != nil { - return fmt.Errorf("unable to decode botInfo#bfacb6ae: field short_description: %w", err) + return fmt.Errorf("unable to decode botInfo#15e58682: field short_description: %w", err) } b.ShortDescription = value case "description": value, err := buf.String() if err != nil { - return fmt.Errorf("unable to decode botInfo#bfacb6ae: field description: %w", err) + return fmt.Errorf("unable to decode botInfo#15e58682: field description: %w", err) } b.Description = value case "photo": if err := b.Photo.DecodeTDLibJSON(buf); err != nil { - return fmt.Errorf("unable to decode botInfo#bfacb6ae: field photo: %w", err) + return fmt.Errorf("unable to decode botInfo#15e58682: field photo: %w", err) } case "animation": if err := b.Animation.DecodeTDLibJSON(buf); err != nil { - return fmt.Errorf("unable to decode botInfo#bfacb6ae: field animation: %w", err) + return fmt.Errorf("unable to decode botInfo#15e58682: field animation: %w", err) } case "menu_button": if err := b.MenuButton.DecodeTDLibJSON(buf); err != nil { - return fmt.Errorf("unable to decode botInfo#bfacb6ae: field menu_button: %w", err) + return fmt.Errorf("unable to decode botInfo#15e58682: field menu_button: %w", err) } case "commands": if err := buf.Arr(func(buf tdjson.Decoder) error { var value BotCommand if err := value.DecodeTDLibJSON(buf); err != nil { - return fmt.Errorf("unable to decode botInfo#bfacb6ae: field commands: %w", err) + return fmt.Errorf("unable to decode botInfo#15e58682: field commands: %w", err) } b.Commands = append(b.Commands, value) return nil }); err != nil { - return fmt.Errorf("unable to decode botInfo#bfacb6ae: field commands: %w", err) + return fmt.Errorf("unable to decode botInfo#15e58682: field commands: %w", err) } case "privacy_policy_url": value, err := buf.String() if err != nil { - return fmt.Errorf("unable to decode botInfo#bfacb6ae: field privacy_policy_url: %w", err) + return fmt.Errorf("unable to decode botInfo#15e58682: field privacy_policy_url: %w", err) } b.PrivacyPolicyURL = value case "default_group_administrator_rights": if err := b.DefaultGroupAdministratorRights.DecodeTDLibJSON(buf); err != nil { - return fmt.Errorf("unable to decode botInfo#bfacb6ae: field default_group_administrator_rights: %w", err) + return fmt.Errorf("unable to decode botInfo#15e58682: field default_group_administrator_rights: %w", err) } case "default_channel_administrator_rights": if err := b.DefaultChannelAdministratorRights.DecodeTDLibJSON(buf); err != nil { - return fmt.Errorf("unable to decode botInfo#bfacb6ae: field default_channel_administrator_rights: %w", err) + return fmt.Errorf("unable to decode botInfo#15e58682: field default_channel_administrator_rights: %w", err) + } + case "web_app_background_light_color": + value, err := buf.Int32() + if err != nil { + return fmt.Errorf("unable to decode botInfo#15e58682: field web_app_background_light_color: %w", err) + } + b.WebAppBackgroundLightColor = value + case "web_app_background_dark_color": + value, err := buf.Int32() + if err != nil { + return fmt.Errorf("unable to decode botInfo#15e58682: field web_app_background_dark_color: %w", err) + } + b.WebAppBackgroundDarkColor = value + case "web_app_header_light_color": + value, err := buf.Int32() + if err != nil { + return fmt.Errorf("unable to decode botInfo#15e58682: field web_app_header_light_color: %w", err) } + b.WebAppHeaderLightColor = value + case "web_app_header_dark_color": + value, err := buf.Int32() + if err != nil { + return fmt.Errorf("unable to decode botInfo#15e58682: field web_app_header_dark_color: %w", err) + } + b.WebAppHeaderDarkColor = value case "can_get_revenue_statistics": value, err := buf.Bool() if err != nil { - return fmt.Errorf("unable to decode botInfo#bfacb6ae: field can_get_revenue_statistics: %w", err) + return fmt.Errorf("unable to decode botInfo#15e58682: field can_get_revenue_statistics: %w", err) } b.CanGetRevenueStatistics = value + case "can_manage_emoji_status": + value, err := buf.Bool() + if err != nil { + return fmt.Errorf("unable to decode botInfo#15e58682: field can_manage_emoji_status: %w", err) + } + b.CanManageEmojiStatus = value case "has_media_previews": value, err := buf.Bool() if err != nil { - return fmt.Errorf("unable to decode botInfo#bfacb6ae: field has_media_previews: %w", err) + return fmt.Errorf("unable to decode botInfo#15e58682: field has_media_previews: %w", err) } b.HasMediaPreviews = value case "edit_commands_link": value, err := DecodeTDLibJSONInternalLinkType(buf) if err != nil { - return fmt.Errorf("unable to decode botInfo#bfacb6ae: field edit_commands_link: %w", err) + return fmt.Errorf("unable to decode botInfo#15e58682: field edit_commands_link: %w", err) } b.EditCommandsLink = value case "edit_description_link": value, err := DecodeTDLibJSONInternalLinkType(buf) if err != nil { - return fmt.Errorf("unable to decode botInfo#bfacb6ae: field edit_description_link: %w", err) + return fmt.Errorf("unable to decode botInfo#15e58682: field edit_description_link: %w", err) } b.EditDescriptionLink = value case "edit_description_media_link": value, err := DecodeTDLibJSONInternalLinkType(buf) if err != nil { - return fmt.Errorf("unable to decode botInfo#bfacb6ae: field edit_description_media_link: %w", err) + return fmt.Errorf("unable to decode botInfo#15e58682: field edit_description_media_link: %w", err) } b.EditDescriptionMediaLink = value case "edit_settings_link": value, err := DecodeTDLibJSONInternalLinkType(buf) if err != nil { - return fmt.Errorf("unable to decode botInfo#bfacb6ae: field edit_settings_link: %w", err) + return fmt.Errorf("unable to decode botInfo#15e58682: field edit_settings_link: %w", err) } b.EditSettingsLink = value default: @@ -694,6 +824,38 @@ func (b *BotInfo) GetDefaultChannelAdministratorRights() (value ChatAdministrato return b.DefaultChannelAdministratorRights } +// GetWebAppBackgroundLightColor returns value of WebAppBackgroundLightColor field. +func (b *BotInfo) GetWebAppBackgroundLightColor() (value int32) { + if b == nil { + return + } + return b.WebAppBackgroundLightColor +} + +// GetWebAppBackgroundDarkColor returns value of WebAppBackgroundDarkColor field. +func (b *BotInfo) GetWebAppBackgroundDarkColor() (value int32) { + if b == nil { + return + } + return b.WebAppBackgroundDarkColor +} + +// GetWebAppHeaderLightColor returns value of WebAppHeaderLightColor field. +func (b *BotInfo) GetWebAppHeaderLightColor() (value int32) { + if b == nil { + return + } + return b.WebAppHeaderLightColor +} + +// GetWebAppHeaderDarkColor returns value of WebAppHeaderDarkColor field. +func (b *BotInfo) GetWebAppHeaderDarkColor() (value int32) { + if b == nil { + return + } + return b.WebAppHeaderDarkColor +} + // GetCanGetRevenueStatistics returns value of CanGetRevenueStatistics field. func (b *BotInfo) GetCanGetRevenueStatistics() (value bool) { if b == nil { @@ -702,6 +864,14 @@ func (b *BotInfo) GetCanGetRevenueStatistics() (value bool) { return b.CanGetRevenueStatistics } +// GetCanManageEmojiStatus returns value of CanManageEmojiStatus field. +func (b *BotInfo) GetCanManageEmojiStatus() (value bool) { + if b == nil { + return + } + return b.CanManageEmojiStatus +} + // GetHasMediaPreviews returns value of HasMediaPreviews field. func (b *BotInfo) GetHasMediaPreviews() (value bool) { if b == nil { diff --git a/tdapi/tl_bot_transaction_purpose_gen.go b/tdapi/tl_bot_transaction_purpose_gen.go index 4ad2be6ce..4e65981d6 100644 --- a/tdapi/tl_bot_transaction_purpose_gen.go +++ b/tdapi/tl_bot_transaction_purpose_gen.go @@ -465,6 +465,240 @@ func (b *BotTransactionPurposeInvoicePayment) GetInvoicePayload() (value []byte) return b.InvoicePayload } +// BotTransactionPurposeSubscription represents TL type `botTransactionPurposeSubscription#e5796205`. +type BotTransactionPurposeSubscription struct { + // The number of seconds between consecutive Telegram Star debiting + Period int32 + // Information about the bought subscription; may be null if not applicable + ProductInfo ProductInfo + // Invoice payload; for bots only + InvoicePayload []byte +} + +// BotTransactionPurposeSubscriptionTypeID is TL type id of BotTransactionPurposeSubscription. +const BotTransactionPurposeSubscriptionTypeID = 0xe5796205 + +// construct implements constructor of BotTransactionPurposeClass. +func (b BotTransactionPurposeSubscription) construct() BotTransactionPurposeClass { return &b } + +// Ensuring interfaces in compile-time for BotTransactionPurposeSubscription. +var ( + _ bin.Encoder = &BotTransactionPurposeSubscription{} + _ bin.Decoder = &BotTransactionPurposeSubscription{} + _ bin.BareEncoder = &BotTransactionPurposeSubscription{} + _ bin.BareDecoder = &BotTransactionPurposeSubscription{} + + _ BotTransactionPurposeClass = &BotTransactionPurposeSubscription{} +) + +func (b *BotTransactionPurposeSubscription) Zero() bool { + if b == nil { + return true + } + if !(b.Period == 0) { + return false + } + if !(b.ProductInfo.Zero()) { + return false + } + if !(b.InvoicePayload == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (b *BotTransactionPurposeSubscription) String() string { + if b == nil { + return "BotTransactionPurposeSubscription(nil)" + } + type Alias BotTransactionPurposeSubscription + return fmt.Sprintf("BotTransactionPurposeSubscription%+v", Alias(*b)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*BotTransactionPurposeSubscription) TypeID() uint32 { + return BotTransactionPurposeSubscriptionTypeID +} + +// TypeName returns name of type in TL schema. +func (*BotTransactionPurposeSubscription) TypeName() string { + return "botTransactionPurposeSubscription" +} + +// TypeInfo returns info about TL type. +func (b *BotTransactionPurposeSubscription) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "botTransactionPurposeSubscription", + ID: BotTransactionPurposeSubscriptionTypeID, + } + if b == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Period", + SchemaName: "period", + }, + { + Name: "ProductInfo", + SchemaName: "product_info", + }, + { + Name: "InvoicePayload", + SchemaName: "invoice_payload", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (b *BotTransactionPurposeSubscription) Encode(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("can't encode botTransactionPurposeSubscription#e5796205 as nil") + } + buf.PutID(BotTransactionPurposeSubscriptionTypeID) + return b.EncodeBare(buf) +} + +// EncodeBare implements bin.BareEncoder. +func (b *BotTransactionPurposeSubscription) EncodeBare(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("can't encode botTransactionPurposeSubscription#e5796205 as nil") + } + buf.PutInt32(b.Period) + if err := b.ProductInfo.Encode(buf); err != nil { + return fmt.Errorf("unable to encode botTransactionPurposeSubscription#e5796205: field product_info: %w", err) + } + buf.PutBytes(b.InvoicePayload) + return nil +} + +// Decode implements bin.Decoder. +func (b *BotTransactionPurposeSubscription) Decode(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("can't decode botTransactionPurposeSubscription#e5796205 to nil") + } + if err := buf.ConsumeID(BotTransactionPurposeSubscriptionTypeID); err != nil { + return fmt.Errorf("unable to decode botTransactionPurposeSubscription#e5796205: %w", err) + } + return b.DecodeBare(buf) +} + +// DecodeBare implements bin.BareDecoder. +func (b *BotTransactionPurposeSubscription) DecodeBare(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("can't decode botTransactionPurposeSubscription#e5796205 to nil") + } + { + value, err := buf.Int32() + if err != nil { + return fmt.Errorf("unable to decode botTransactionPurposeSubscription#e5796205: field period: %w", err) + } + b.Period = value + } + { + if err := b.ProductInfo.Decode(buf); err != nil { + return fmt.Errorf("unable to decode botTransactionPurposeSubscription#e5796205: field product_info: %w", err) + } + } + { + value, err := buf.Bytes() + if err != nil { + return fmt.Errorf("unable to decode botTransactionPurposeSubscription#e5796205: field invoice_payload: %w", err) + } + b.InvoicePayload = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (b *BotTransactionPurposeSubscription) EncodeTDLibJSON(buf tdjson.Encoder) error { + if b == nil { + return fmt.Errorf("can't encode botTransactionPurposeSubscription#e5796205 as nil") + } + buf.ObjStart() + buf.PutID("botTransactionPurposeSubscription") + buf.Comma() + buf.FieldStart("period") + buf.PutInt32(b.Period) + buf.Comma() + buf.FieldStart("product_info") + if err := b.ProductInfo.EncodeTDLibJSON(buf); err != nil { + return fmt.Errorf("unable to encode botTransactionPurposeSubscription#e5796205: field product_info: %w", err) + } + buf.Comma() + buf.FieldStart("invoice_payload") + buf.PutBytes(b.InvoicePayload) + buf.Comma() + buf.StripComma() + buf.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (b *BotTransactionPurposeSubscription) DecodeTDLibJSON(buf tdjson.Decoder) error { + if b == nil { + return fmt.Errorf("can't decode botTransactionPurposeSubscription#e5796205 to nil") + } + + return buf.Obj(func(buf tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := buf.ConsumeID("botTransactionPurposeSubscription"); err != nil { + return fmt.Errorf("unable to decode botTransactionPurposeSubscription#e5796205: %w", err) + } + case "period": + value, err := buf.Int32() + if err != nil { + return fmt.Errorf("unable to decode botTransactionPurposeSubscription#e5796205: field period: %w", err) + } + b.Period = value + case "product_info": + if err := b.ProductInfo.DecodeTDLibJSON(buf); err != nil { + return fmt.Errorf("unable to decode botTransactionPurposeSubscription#e5796205: field product_info: %w", err) + } + case "invoice_payload": + value, err := buf.Bytes() + if err != nil { + return fmt.Errorf("unable to decode botTransactionPurposeSubscription#e5796205: field invoice_payload: %w", err) + } + b.InvoicePayload = value + default: + return buf.Skip() + } + return nil + }) +} + +// GetPeriod returns value of Period field. +func (b *BotTransactionPurposeSubscription) GetPeriod() (value int32) { + if b == nil { + return + } + return b.Period +} + +// GetProductInfo returns value of ProductInfo field. +func (b *BotTransactionPurposeSubscription) GetProductInfo() (value ProductInfo) { + if b == nil { + return + } + return b.ProductInfo +} + +// GetInvoicePayload returns value of InvoicePayload field. +func (b *BotTransactionPurposeSubscription) GetInvoicePayload() (value []byte) { + if b == nil { + return + } + return b.InvoicePayload +} + // BotTransactionPurposeClassName is schema name of BotTransactionPurposeClass. const BotTransactionPurposeClassName = "BotTransactionPurpose" @@ -479,6 +713,7 @@ const BotTransactionPurposeClassName = "BotTransactionPurpose" // switch v := g.(type) { // case *tdapi.BotTransactionPurposePaidMedia: // botTransactionPurposePaidMedia#62952496 // case *tdapi.BotTransactionPurposeInvoicePayment: // botTransactionPurposeInvoicePayment#699860ac +// case *tdapi.BotTransactionPurposeSubscription: // botTransactionPurposeSubscription#e5796205 // default: panic(v) // } type BotTransactionPurposeClass interface { @@ -524,6 +759,13 @@ func DecodeBotTransactionPurpose(buf *bin.Buffer) (BotTransactionPurposeClass, e return nil, fmt.Errorf("unable to decode BotTransactionPurposeClass: %w", err) } return &v, nil + case BotTransactionPurposeSubscriptionTypeID: + // Decoding botTransactionPurposeSubscription#e5796205. + v := BotTransactionPurposeSubscription{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode BotTransactionPurposeClass: %w", err) + } + return &v, nil default: return nil, fmt.Errorf("unable to decode BotTransactionPurposeClass: %w", bin.NewUnexpectedID(id)) } @@ -550,6 +792,13 @@ func DecodeTDLibJSONBotTransactionPurpose(buf tdjson.Decoder) (BotTransactionPur return nil, fmt.Errorf("unable to decode BotTransactionPurposeClass: %w", err) } return &v, nil + case "botTransactionPurposeSubscription": + // Decoding botTransactionPurposeSubscription#e5796205. + v := BotTransactionPurposeSubscription{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode BotTransactionPurposeClass: %w", err) + } + return &v, nil default: return nil, fmt.Errorf("unable to decode BotTransactionPurposeClass: %w", tdjson.NewUnexpectedID(id)) } diff --git a/tdapi/tl_check_web_app_file_download_gen.go b/tdapi/tl_check_web_app_file_download_gen.go new file mode 100644 index 000000000..a85366561 --- /dev/null +++ b/tdapi/tl_check_web_app_file_download_gen.go @@ -0,0 +1,271 @@ +// 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{} +) + +// CheckWebAppFileDownloadRequest represents TL type `checkWebAppFileDownload#e8ca44e2`. +type CheckWebAppFileDownloadRequest struct { + // Identifier of the bot, providing the Web App + BotUserID int64 + // Name of the file + FileName string + // URL of the file + URL string +} + +// CheckWebAppFileDownloadRequestTypeID is TL type id of CheckWebAppFileDownloadRequest. +const CheckWebAppFileDownloadRequestTypeID = 0xe8ca44e2 + +// Ensuring interfaces in compile-time for CheckWebAppFileDownloadRequest. +var ( + _ bin.Encoder = &CheckWebAppFileDownloadRequest{} + _ bin.Decoder = &CheckWebAppFileDownloadRequest{} + _ bin.BareEncoder = &CheckWebAppFileDownloadRequest{} + _ bin.BareDecoder = &CheckWebAppFileDownloadRequest{} +) + +func (c *CheckWebAppFileDownloadRequest) Zero() bool { + if c == nil { + return true + } + if !(c.BotUserID == 0) { + return false + } + if !(c.FileName == "") { + return false + } + if !(c.URL == "") { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (c *CheckWebAppFileDownloadRequest) String() string { + if c == nil { + return "CheckWebAppFileDownloadRequest(nil)" + } + type Alias CheckWebAppFileDownloadRequest + return fmt.Sprintf("CheckWebAppFileDownloadRequest%+v", Alias(*c)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*CheckWebAppFileDownloadRequest) TypeID() uint32 { + return CheckWebAppFileDownloadRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*CheckWebAppFileDownloadRequest) TypeName() string { + return "checkWebAppFileDownload" +} + +// TypeInfo returns info about TL type. +func (c *CheckWebAppFileDownloadRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "checkWebAppFileDownload", + ID: CheckWebAppFileDownloadRequestTypeID, + } + if c == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "BotUserID", + SchemaName: "bot_user_id", + }, + { + Name: "FileName", + SchemaName: "file_name", + }, + { + Name: "URL", + SchemaName: "url", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (c *CheckWebAppFileDownloadRequest) Encode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode checkWebAppFileDownload#e8ca44e2 as nil") + } + b.PutID(CheckWebAppFileDownloadRequestTypeID) + return c.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (c *CheckWebAppFileDownloadRequest) EncodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't encode checkWebAppFileDownload#e8ca44e2 as nil") + } + b.PutInt53(c.BotUserID) + b.PutString(c.FileName) + b.PutString(c.URL) + return nil +} + +// Decode implements bin.Decoder. +func (c *CheckWebAppFileDownloadRequest) Decode(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode checkWebAppFileDownload#e8ca44e2 to nil") + } + if err := b.ConsumeID(CheckWebAppFileDownloadRequestTypeID); err != nil { + return fmt.Errorf("unable to decode checkWebAppFileDownload#e8ca44e2: %w", err) + } + return c.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (c *CheckWebAppFileDownloadRequest) DecodeBare(b *bin.Buffer) error { + if c == nil { + return fmt.Errorf("can't decode checkWebAppFileDownload#e8ca44e2 to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode checkWebAppFileDownload#e8ca44e2: field bot_user_id: %w", err) + } + c.BotUserID = value + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode checkWebAppFileDownload#e8ca44e2: field file_name: %w", err) + } + c.FileName = value + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode checkWebAppFileDownload#e8ca44e2: field url: %w", err) + } + c.URL = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (c *CheckWebAppFileDownloadRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if c == nil { + return fmt.Errorf("can't encode checkWebAppFileDownload#e8ca44e2 as nil") + } + b.ObjStart() + b.PutID("checkWebAppFileDownload") + b.Comma() + b.FieldStart("bot_user_id") + b.PutInt53(c.BotUserID) + b.Comma() + b.FieldStart("file_name") + b.PutString(c.FileName) + b.Comma() + b.FieldStart("url") + b.PutString(c.URL) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (c *CheckWebAppFileDownloadRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if c == nil { + return fmt.Errorf("can't decode checkWebAppFileDownload#e8ca44e2 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("checkWebAppFileDownload"); err != nil { + return fmt.Errorf("unable to decode checkWebAppFileDownload#e8ca44e2: %w", err) + } + case "bot_user_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode checkWebAppFileDownload#e8ca44e2: field bot_user_id: %w", err) + } + c.BotUserID = value + case "file_name": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode checkWebAppFileDownload#e8ca44e2: field file_name: %w", err) + } + c.FileName = value + case "url": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode checkWebAppFileDownload#e8ca44e2: field url: %w", err) + } + c.URL = value + default: + return b.Skip() + } + return nil + }) +} + +// GetBotUserID returns value of BotUserID field. +func (c *CheckWebAppFileDownloadRequest) GetBotUserID() (value int64) { + if c == nil { + return + } + return c.BotUserID +} + +// GetFileName returns value of FileName field. +func (c *CheckWebAppFileDownloadRequest) GetFileName() (value string) { + if c == nil { + return + } + return c.FileName +} + +// GetURL returns value of URL field. +func (c *CheckWebAppFileDownloadRequest) GetURL() (value string) { + if c == nil { + return + } + return c.URL +} + +// CheckWebAppFileDownload invokes method checkWebAppFileDownload#e8ca44e2 returning error if any. +func (c *Client) CheckWebAppFileDownload(ctx context.Context, request *CheckWebAppFileDownloadRequest) error { + var ok Ok + + if err := c.rpc.Invoke(ctx, request, &ok); err != nil { + return err + } + return nil +} diff --git a/tdapi/tl_create_invoice_link_gen.go b/tdapi/tl_create_invoice_link_gen.go index 47a39c690..ae6fab4c4 100644 --- a/tdapi/tl_create_invoice_link_gen.go +++ b/tdapi/tl_create_invoice_link_gen.go @@ -31,14 +31,16 @@ var ( _ = tdjson.Encoder{} ) -// CreateInvoiceLinkRequest represents TL type `createInvoiceLink#cebe921`. +// CreateInvoiceLinkRequest represents TL type `createInvoiceLink#cf70c867`. type CreateInvoiceLinkRequest struct { + // Unique identifier of business connection on behalf of which to send the request + BusinessConnectionID string // Information about the invoice of the type inputMessageInvoice Invoice InputMessageContentClass } // CreateInvoiceLinkRequestTypeID is TL type id of CreateInvoiceLinkRequest. -const CreateInvoiceLinkRequestTypeID = 0xcebe921 +const CreateInvoiceLinkRequestTypeID = 0xcf70c867 // Ensuring interfaces in compile-time for CreateInvoiceLinkRequest. var ( @@ -52,6 +54,9 @@ func (c *CreateInvoiceLinkRequest) Zero() bool { if c == nil { return true } + if !(c.BusinessConnectionID == "") { + return false + } if !(c.Invoice == nil) { return false } @@ -91,6 +96,10 @@ func (c *CreateInvoiceLinkRequest) TypeInfo() tdp.Type { return typ } typ.Fields = []tdp.Field{ + { + Name: "BusinessConnectionID", + SchemaName: "business_connection_id", + }, { Name: "Invoice", SchemaName: "invoice", @@ -102,7 +111,7 @@ func (c *CreateInvoiceLinkRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (c *CreateInvoiceLinkRequest) Encode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode createInvoiceLink#cebe921 as nil") + return fmt.Errorf("can't encode createInvoiceLink#cf70c867 as nil") } b.PutID(CreateInvoiceLinkRequestTypeID) return c.EncodeBare(b) @@ -111,13 +120,14 @@ func (c *CreateInvoiceLinkRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (c *CreateInvoiceLinkRequest) EncodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't encode createInvoiceLink#cebe921 as nil") + return fmt.Errorf("can't encode createInvoiceLink#cf70c867 as nil") } + b.PutString(c.BusinessConnectionID) if c.Invoice == nil { - return fmt.Errorf("unable to encode createInvoiceLink#cebe921: field invoice is nil") + return fmt.Errorf("unable to encode createInvoiceLink#cf70c867: field invoice is nil") } if err := c.Invoice.Encode(b); err != nil { - return fmt.Errorf("unable to encode createInvoiceLink#cebe921: field invoice: %w", err) + return fmt.Errorf("unable to encode createInvoiceLink#cf70c867: field invoice: %w", err) } return nil } @@ -125,10 +135,10 @@ func (c *CreateInvoiceLinkRequest) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (c *CreateInvoiceLinkRequest) Decode(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode createInvoiceLink#cebe921 to nil") + return fmt.Errorf("can't decode createInvoiceLink#cf70c867 to nil") } if err := b.ConsumeID(CreateInvoiceLinkRequestTypeID); err != nil { - return fmt.Errorf("unable to decode createInvoiceLink#cebe921: %w", err) + return fmt.Errorf("unable to decode createInvoiceLink#cf70c867: %w", err) } return c.DecodeBare(b) } @@ -136,12 +146,19 @@ func (c *CreateInvoiceLinkRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (c *CreateInvoiceLinkRequest) DecodeBare(b *bin.Buffer) error { if c == nil { - return fmt.Errorf("can't decode createInvoiceLink#cebe921 to nil") + return fmt.Errorf("can't decode createInvoiceLink#cf70c867 to nil") + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode createInvoiceLink#cf70c867: field business_connection_id: %w", err) + } + c.BusinessConnectionID = value } { value, err := DecodeInputMessageContent(b) if err != nil { - return fmt.Errorf("unable to decode createInvoiceLink#cebe921: field invoice: %w", err) + return fmt.Errorf("unable to decode createInvoiceLink#cf70c867: field invoice: %w", err) } c.Invoice = value } @@ -151,17 +168,20 @@ func (c *CreateInvoiceLinkRequest) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (c *CreateInvoiceLinkRequest) EncodeTDLibJSON(b tdjson.Encoder) error { if c == nil { - return fmt.Errorf("can't encode createInvoiceLink#cebe921 as nil") + return fmt.Errorf("can't encode createInvoiceLink#cf70c867 as nil") } b.ObjStart() b.PutID("createInvoiceLink") b.Comma() + b.FieldStart("business_connection_id") + b.PutString(c.BusinessConnectionID) + b.Comma() b.FieldStart("invoice") if c.Invoice == nil { - return fmt.Errorf("unable to encode createInvoiceLink#cebe921: field invoice is nil") + return fmt.Errorf("unable to encode createInvoiceLink#cf70c867: field invoice is nil") } if err := c.Invoice.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode createInvoiceLink#cebe921: field invoice: %w", err) + return fmt.Errorf("unable to encode createInvoiceLink#cf70c867: field invoice: %w", err) } b.Comma() b.StripComma() @@ -172,19 +192,25 @@ func (c *CreateInvoiceLinkRequest) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (c *CreateInvoiceLinkRequest) DecodeTDLibJSON(b tdjson.Decoder) error { if c == nil { - return fmt.Errorf("can't decode createInvoiceLink#cebe921 to nil") + return fmt.Errorf("can't decode createInvoiceLink#cf70c867 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("createInvoiceLink"); err != nil { - return fmt.Errorf("unable to decode createInvoiceLink#cebe921: %w", err) + return fmt.Errorf("unable to decode createInvoiceLink#cf70c867: %w", err) } + case "business_connection_id": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode createInvoiceLink#cf70c867: field business_connection_id: %w", err) + } + c.BusinessConnectionID = value case "invoice": value, err := DecodeTDLibJSONInputMessageContent(b) if err != nil { - return fmt.Errorf("unable to decode createInvoiceLink#cebe921: field invoice: %w", err) + return fmt.Errorf("unable to decode createInvoiceLink#cf70c867: field invoice: %w", err) } c.Invoice = value default: @@ -194,6 +220,14 @@ func (c *CreateInvoiceLinkRequest) DecodeTDLibJSON(b tdjson.Decoder) error { }) } +// GetBusinessConnectionID returns value of BusinessConnectionID field. +func (c *CreateInvoiceLinkRequest) GetBusinessConnectionID() (value string) { + if c == nil { + return + } + return c.BusinessConnectionID +} + // GetInvoice returns value of Invoice field. func (c *CreateInvoiceLinkRequest) GetInvoice() (value InputMessageContentClass) { if c == nil { @@ -202,13 +236,10 @@ func (c *CreateInvoiceLinkRequest) GetInvoice() (value InputMessageContentClass) return c.Invoice } -// CreateInvoiceLink invokes method createInvoiceLink#cebe921 returning error if any. -func (c *Client) CreateInvoiceLink(ctx context.Context, invoice InputMessageContentClass) (*HTTPURL, error) { +// CreateInvoiceLink invokes method createInvoiceLink#cf70c867 returning error if any. +func (c *Client) CreateInvoiceLink(ctx context.Context, request *CreateInvoiceLinkRequest) (*HTTPURL, error) { var result HTTPURL - request := &CreateInvoiceLinkRequest{ - Invoice: invoice, - } if err := c.rpc.Invoke(ctx, request, &result); err != nil { return nil, err } diff --git a/tdapi/tl_edit_user_star_subscription_gen.go b/tdapi/tl_edit_user_star_subscription_gen.go new file mode 100644 index 000000000..c4b2eb143 --- /dev/null +++ b/tdapi/tl_edit_user_star_subscription_gen.go @@ -0,0 +1,271 @@ +// 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{} +) + +// EditUserStarSubscriptionRequest represents TL type `editUserStarSubscription#51b16e89`. +type EditUserStarSubscriptionRequest struct { + // User identifier + UserID int64 + // Telegram payment identifier of the subscription + TelegramPaymentChargeID string + // Pass true to cancel the subscription; pass false to allow the user to enable it + IsCanceled bool +} + +// EditUserStarSubscriptionRequestTypeID is TL type id of EditUserStarSubscriptionRequest. +const EditUserStarSubscriptionRequestTypeID = 0x51b16e89 + +// Ensuring interfaces in compile-time for EditUserStarSubscriptionRequest. +var ( + _ bin.Encoder = &EditUserStarSubscriptionRequest{} + _ bin.Decoder = &EditUserStarSubscriptionRequest{} + _ bin.BareEncoder = &EditUserStarSubscriptionRequest{} + _ bin.BareDecoder = &EditUserStarSubscriptionRequest{} +) + +func (e *EditUserStarSubscriptionRequest) Zero() bool { + if e == nil { + return true + } + if !(e.UserID == 0) { + return false + } + if !(e.TelegramPaymentChargeID == "") { + return false + } + if !(e.IsCanceled == false) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (e *EditUserStarSubscriptionRequest) String() string { + if e == nil { + return "EditUserStarSubscriptionRequest(nil)" + } + type Alias EditUserStarSubscriptionRequest + return fmt.Sprintf("EditUserStarSubscriptionRequest%+v", Alias(*e)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*EditUserStarSubscriptionRequest) TypeID() uint32 { + return EditUserStarSubscriptionRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*EditUserStarSubscriptionRequest) TypeName() string { + return "editUserStarSubscription" +} + +// TypeInfo returns info about TL type. +func (e *EditUserStarSubscriptionRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "editUserStarSubscription", + ID: EditUserStarSubscriptionRequestTypeID, + } + if e == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "UserID", + SchemaName: "user_id", + }, + { + Name: "TelegramPaymentChargeID", + SchemaName: "telegram_payment_charge_id", + }, + { + Name: "IsCanceled", + SchemaName: "is_canceled", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (e *EditUserStarSubscriptionRequest) Encode(b *bin.Buffer) error { + if e == nil { + return fmt.Errorf("can't encode editUserStarSubscription#51b16e89 as nil") + } + b.PutID(EditUserStarSubscriptionRequestTypeID) + return e.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (e *EditUserStarSubscriptionRequest) EncodeBare(b *bin.Buffer) error { + if e == nil { + return fmt.Errorf("can't encode editUserStarSubscription#51b16e89 as nil") + } + b.PutInt53(e.UserID) + b.PutString(e.TelegramPaymentChargeID) + b.PutBool(e.IsCanceled) + return nil +} + +// Decode implements bin.Decoder. +func (e *EditUserStarSubscriptionRequest) Decode(b *bin.Buffer) error { + if e == nil { + return fmt.Errorf("can't decode editUserStarSubscription#51b16e89 to nil") + } + if err := b.ConsumeID(EditUserStarSubscriptionRequestTypeID); err != nil { + return fmt.Errorf("unable to decode editUserStarSubscription#51b16e89: %w", err) + } + return e.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (e *EditUserStarSubscriptionRequest) DecodeBare(b *bin.Buffer) error { + if e == nil { + return fmt.Errorf("can't decode editUserStarSubscription#51b16e89 to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode editUserStarSubscription#51b16e89: field user_id: %w", err) + } + e.UserID = value + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode editUserStarSubscription#51b16e89: field telegram_payment_charge_id: %w", err) + } + e.TelegramPaymentChargeID = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode editUserStarSubscription#51b16e89: field is_canceled: %w", err) + } + e.IsCanceled = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (e *EditUserStarSubscriptionRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if e == nil { + return fmt.Errorf("can't encode editUserStarSubscription#51b16e89 as nil") + } + b.ObjStart() + b.PutID("editUserStarSubscription") + b.Comma() + b.FieldStart("user_id") + b.PutInt53(e.UserID) + b.Comma() + b.FieldStart("telegram_payment_charge_id") + b.PutString(e.TelegramPaymentChargeID) + b.Comma() + b.FieldStart("is_canceled") + b.PutBool(e.IsCanceled) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (e *EditUserStarSubscriptionRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if e == nil { + return fmt.Errorf("can't decode editUserStarSubscription#51b16e89 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("editUserStarSubscription"); err != nil { + return fmt.Errorf("unable to decode editUserStarSubscription#51b16e89: %w", err) + } + case "user_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode editUserStarSubscription#51b16e89: field user_id: %w", err) + } + e.UserID = value + case "telegram_payment_charge_id": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode editUserStarSubscription#51b16e89: field telegram_payment_charge_id: %w", err) + } + e.TelegramPaymentChargeID = value + case "is_canceled": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode editUserStarSubscription#51b16e89: field is_canceled: %w", err) + } + e.IsCanceled = value + default: + return b.Skip() + } + return nil + }) +} + +// GetUserID returns value of UserID field. +func (e *EditUserStarSubscriptionRequest) GetUserID() (value int64) { + if e == nil { + return + } + return e.UserID +} + +// GetTelegramPaymentChargeID returns value of TelegramPaymentChargeID field. +func (e *EditUserStarSubscriptionRequest) GetTelegramPaymentChargeID() (value string) { + if e == nil { + return + } + return e.TelegramPaymentChargeID +} + +// GetIsCanceled returns value of IsCanceled field. +func (e *EditUserStarSubscriptionRequest) GetIsCanceled() (value bool) { + if e == nil { + return + } + return e.IsCanceled +} + +// EditUserStarSubscription invokes method editUserStarSubscription#51b16e89 returning error if any. +func (c *Client) EditUserStarSubscription(ctx context.Context, request *EditUserStarSubscriptionRequest) error { + var ok Ok + + if err := c.rpc.Invoke(ctx, request, &ok); err != nil { + return err + } + return nil +} diff --git a/tdapi/tl_get_main_web_app_gen.go b/tdapi/tl_get_main_web_app_gen.go index d3ace8ebe..ffad35b18 100644 --- a/tdapi/tl_get_main_web_app_gen.go +++ b/tdapi/tl_get_main_web_app_gen.go @@ -31,7 +31,7 @@ var ( _ = tdjson.Encoder{} ) -// GetMainWebAppRequest represents TL type `getMainWebApp#be84329a`. +// GetMainWebAppRequest represents TL type `getMainWebApp#23687ca6`. type GetMainWebAppRequest struct { // Identifier of the chat in which the Web App is opened; pass 0 if none ChatID int64 @@ -39,14 +39,12 @@ type GetMainWebAppRequest struct { BotUserID int64 // Start parameter from internalLinkTypeMainWebApp StartParameter string - // Preferred Web App theme; pass null to use the default theme - Theme ThemeParameters - // Short name of the current application; 0-64 English letters, digits, and underscores - ApplicationName string + // Parameters to use to open the Web App + Parameters WebAppOpenParameters } // GetMainWebAppRequestTypeID is TL type id of GetMainWebAppRequest. -const GetMainWebAppRequestTypeID = 0xbe84329a +const GetMainWebAppRequestTypeID = 0x23687ca6 // Ensuring interfaces in compile-time for GetMainWebAppRequest. var ( @@ -69,10 +67,7 @@ func (g *GetMainWebAppRequest) Zero() bool { if !(g.StartParameter == "") { return false } - if !(g.Theme.Zero()) { - return false - } - if !(g.ApplicationName == "") { + if !(g.Parameters.Zero()) { return false } @@ -124,12 +119,8 @@ func (g *GetMainWebAppRequest) TypeInfo() tdp.Type { SchemaName: "start_parameter", }, { - Name: "Theme", - SchemaName: "theme", - }, - { - Name: "ApplicationName", - SchemaName: "application_name", + Name: "Parameters", + SchemaName: "parameters", }, } return typ @@ -138,7 +129,7 @@ func (g *GetMainWebAppRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (g *GetMainWebAppRequest) Encode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode getMainWebApp#be84329a as nil") + return fmt.Errorf("can't encode getMainWebApp#23687ca6 as nil") } b.PutID(GetMainWebAppRequestTypeID) return g.EncodeBare(b) @@ -147,25 +138,24 @@ func (g *GetMainWebAppRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (g *GetMainWebAppRequest) EncodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode getMainWebApp#be84329a as nil") + return fmt.Errorf("can't encode getMainWebApp#23687ca6 as nil") } b.PutInt53(g.ChatID) b.PutInt53(g.BotUserID) b.PutString(g.StartParameter) - if err := g.Theme.Encode(b); err != nil { - return fmt.Errorf("unable to encode getMainWebApp#be84329a: field theme: %w", err) + if err := g.Parameters.Encode(b); err != nil { + return fmt.Errorf("unable to encode getMainWebApp#23687ca6: field parameters: %w", err) } - b.PutString(g.ApplicationName) return nil } // Decode implements bin.Decoder. func (g *GetMainWebAppRequest) Decode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode getMainWebApp#be84329a to nil") + return fmt.Errorf("can't decode getMainWebApp#23687ca6 to nil") } if err := b.ConsumeID(GetMainWebAppRequestTypeID); err != nil { - return fmt.Errorf("unable to decode getMainWebApp#be84329a: %w", err) + return fmt.Errorf("unable to decode getMainWebApp#23687ca6: %w", err) } return g.DecodeBare(b) } @@ -173,40 +163,33 @@ func (g *GetMainWebAppRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (g *GetMainWebAppRequest) DecodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode getMainWebApp#be84329a to nil") + return fmt.Errorf("can't decode getMainWebApp#23687ca6 to nil") } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode getMainWebApp#be84329a: field chat_id: %w", err) + return fmt.Errorf("unable to decode getMainWebApp#23687ca6: field chat_id: %w", err) } g.ChatID = value } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode getMainWebApp#be84329a: field bot_user_id: %w", err) + return fmt.Errorf("unable to decode getMainWebApp#23687ca6: field bot_user_id: %w", err) } g.BotUserID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode getMainWebApp#be84329a: field start_parameter: %w", err) + return fmt.Errorf("unable to decode getMainWebApp#23687ca6: field start_parameter: %w", err) } g.StartParameter = value } { - if err := g.Theme.Decode(b); err != nil { - return fmt.Errorf("unable to decode getMainWebApp#be84329a: field theme: %w", err) - } - } - { - value, err := b.String() - if err != nil { - return fmt.Errorf("unable to decode getMainWebApp#be84329a: field application_name: %w", err) + if err := g.Parameters.Decode(b); err != nil { + return fmt.Errorf("unable to decode getMainWebApp#23687ca6: field parameters: %w", err) } - g.ApplicationName = value } return nil } @@ -214,7 +197,7 @@ func (g *GetMainWebAppRequest) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (g *GetMainWebAppRequest) EncodeTDLibJSON(b tdjson.Encoder) error { if g == nil { - return fmt.Errorf("can't encode getMainWebApp#be84329a as nil") + return fmt.Errorf("can't encode getMainWebApp#23687ca6 as nil") } b.ObjStart() b.PutID("getMainWebApp") @@ -228,14 +211,11 @@ func (g *GetMainWebAppRequest) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("start_parameter") b.PutString(g.StartParameter) b.Comma() - b.FieldStart("theme") - if err := g.Theme.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode getMainWebApp#be84329a: field theme: %w", err) + b.FieldStart("parameters") + if err := g.Parameters.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode getMainWebApp#23687ca6: field parameters: %w", err) } b.Comma() - b.FieldStart("application_name") - b.PutString(g.ApplicationName) - b.Comma() b.StripComma() b.ObjEnd() return nil @@ -244,43 +224,37 @@ func (g *GetMainWebAppRequest) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (g *GetMainWebAppRequest) DecodeTDLibJSON(b tdjson.Decoder) error { if g == nil { - return fmt.Errorf("can't decode getMainWebApp#be84329a to nil") + return fmt.Errorf("can't decode getMainWebApp#23687ca6 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("getMainWebApp"); err != nil { - return fmt.Errorf("unable to decode getMainWebApp#be84329a: %w", err) + return fmt.Errorf("unable to decode getMainWebApp#23687ca6: %w", err) } case "chat_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode getMainWebApp#be84329a: field chat_id: %w", err) + return fmt.Errorf("unable to decode getMainWebApp#23687ca6: field chat_id: %w", err) } g.ChatID = value case "bot_user_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode getMainWebApp#be84329a: field bot_user_id: %w", err) + return fmt.Errorf("unable to decode getMainWebApp#23687ca6: field bot_user_id: %w", err) } g.BotUserID = value case "start_parameter": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode getMainWebApp#be84329a: field start_parameter: %w", err) + return fmt.Errorf("unable to decode getMainWebApp#23687ca6: field start_parameter: %w", err) } g.StartParameter = value - case "theme": - if err := g.Theme.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode getMainWebApp#be84329a: field theme: %w", err) + case "parameters": + if err := g.Parameters.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode getMainWebApp#23687ca6: field parameters: %w", err) } - case "application_name": - value, err := b.String() - if err != nil { - return fmt.Errorf("unable to decode getMainWebApp#be84329a: field application_name: %w", err) - } - g.ApplicationName = value default: return b.Skip() } @@ -312,23 +286,15 @@ func (g *GetMainWebAppRequest) GetStartParameter() (value string) { return g.StartParameter } -// GetTheme returns value of Theme field. -func (g *GetMainWebAppRequest) GetTheme() (value ThemeParameters) { - if g == nil { - return - } - return g.Theme -} - -// GetApplicationName returns value of ApplicationName field. -func (g *GetMainWebAppRequest) GetApplicationName() (value string) { +// GetParameters returns value of Parameters field. +func (g *GetMainWebAppRequest) GetParameters() (value WebAppOpenParameters) { if g == nil { return } - return g.ApplicationName + return g.Parameters } -// GetMainWebApp invokes method getMainWebApp#be84329a returning error if any. +// GetMainWebApp invokes method getMainWebApp#23687ca6 returning error if any. func (c *Client) GetMainWebApp(ctx context.Context, request *GetMainWebAppRequest) (*MainWebApp, error) { var result MainWebApp diff --git a/tdapi/tl_get_prepared_inline_message_gen.go b/tdapi/tl_get_prepared_inline_message_gen.go new file mode 100644 index 000000000..b438d25d5 --- /dev/null +++ b/tdapi/tl_get_prepared_inline_message_gen.go @@ -0,0 +1,237 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tdapi + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// GetPreparedInlineMessageRequest represents TL type `getPreparedInlineMessage#fb0ac74b`. +type GetPreparedInlineMessageRequest struct { + // Identifier of the bot that created the message + BotUserID int64 + // Identifier of the prepared message + PreparedMessageID string +} + +// GetPreparedInlineMessageRequestTypeID is TL type id of GetPreparedInlineMessageRequest. +const GetPreparedInlineMessageRequestTypeID = 0xfb0ac74b + +// Ensuring interfaces in compile-time for GetPreparedInlineMessageRequest. +var ( + _ bin.Encoder = &GetPreparedInlineMessageRequest{} + _ bin.Decoder = &GetPreparedInlineMessageRequest{} + _ bin.BareEncoder = &GetPreparedInlineMessageRequest{} + _ bin.BareDecoder = &GetPreparedInlineMessageRequest{} +) + +func (g *GetPreparedInlineMessageRequest) Zero() bool { + if g == nil { + return true + } + if !(g.BotUserID == 0) { + return false + } + if !(g.PreparedMessageID == "") { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (g *GetPreparedInlineMessageRequest) String() string { + if g == nil { + return "GetPreparedInlineMessageRequest(nil)" + } + type Alias GetPreparedInlineMessageRequest + return fmt.Sprintf("GetPreparedInlineMessageRequest%+v", Alias(*g)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*GetPreparedInlineMessageRequest) TypeID() uint32 { + return GetPreparedInlineMessageRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*GetPreparedInlineMessageRequest) TypeName() string { + return "getPreparedInlineMessage" +} + +// TypeInfo returns info about TL type. +func (g *GetPreparedInlineMessageRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "getPreparedInlineMessage", + ID: GetPreparedInlineMessageRequestTypeID, + } + if g == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "BotUserID", + SchemaName: "bot_user_id", + }, + { + Name: "PreparedMessageID", + SchemaName: "prepared_message_id", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (g *GetPreparedInlineMessageRequest) Encode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getPreparedInlineMessage#fb0ac74b as nil") + } + b.PutID(GetPreparedInlineMessageRequestTypeID) + return g.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (g *GetPreparedInlineMessageRequest) EncodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getPreparedInlineMessage#fb0ac74b as nil") + } + b.PutInt53(g.BotUserID) + b.PutString(g.PreparedMessageID) + return nil +} + +// Decode implements bin.Decoder. +func (g *GetPreparedInlineMessageRequest) Decode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getPreparedInlineMessage#fb0ac74b to nil") + } + if err := b.ConsumeID(GetPreparedInlineMessageRequestTypeID); err != nil { + return fmt.Errorf("unable to decode getPreparedInlineMessage#fb0ac74b: %w", err) + } + return g.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (g *GetPreparedInlineMessageRequest) DecodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getPreparedInlineMessage#fb0ac74b to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode getPreparedInlineMessage#fb0ac74b: field bot_user_id: %w", err) + } + g.BotUserID = value + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode getPreparedInlineMessage#fb0ac74b: field prepared_message_id: %w", err) + } + g.PreparedMessageID = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (g *GetPreparedInlineMessageRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if g == nil { + return fmt.Errorf("can't encode getPreparedInlineMessage#fb0ac74b as nil") + } + b.ObjStart() + b.PutID("getPreparedInlineMessage") + b.Comma() + b.FieldStart("bot_user_id") + b.PutInt53(g.BotUserID) + b.Comma() + b.FieldStart("prepared_message_id") + b.PutString(g.PreparedMessageID) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (g *GetPreparedInlineMessageRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if g == nil { + return fmt.Errorf("can't decode getPreparedInlineMessage#fb0ac74b to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("getPreparedInlineMessage"); err != nil { + return fmt.Errorf("unable to decode getPreparedInlineMessage#fb0ac74b: %w", err) + } + case "bot_user_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode getPreparedInlineMessage#fb0ac74b: field bot_user_id: %w", err) + } + g.BotUserID = value + case "prepared_message_id": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode getPreparedInlineMessage#fb0ac74b: field prepared_message_id: %w", err) + } + g.PreparedMessageID = value + default: + return b.Skip() + } + return nil + }) +} + +// GetBotUserID returns value of BotUserID field. +func (g *GetPreparedInlineMessageRequest) GetBotUserID() (value int64) { + if g == nil { + return + } + return g.BotUserID +} + +// GetPreparedMessageID returns value of PreparedMessageID field. +func (g *GetPreparedInlineMessageRequest) GetPreparedMessageID() (value string) { + if g == nil { + return + } + return g.PreparedMessageID +} + +// GetPreparedInlineMessage invokes method getPreparedInlineMessage#fb0ac74b returning error if any. +func (c *Client) GetPreparedInlineMessage(ctx context.Context, request *GetPreparedInlineMessageRequest) (*PreparedInlineMessage, error) { + var result PreparedInlineMessage + + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return &result, nil +} diff --git a/tdapi/tl_get_sticker_outline_gen.go b/tdapi/tl_get_sticker_outline_gen.go new file mode 100644 index 000000000..f09f65965 --- /dev/null +++ b/tdapi/tl_get_sticker_outline_gen.go @@ -0,0 +1,271 @@ +// 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{} +) + +// GetStickerOutlineRequest represents TL type `getStickerOutline#a3952da5`. +type GetStickerOutlineRequest struct { + // File identifier of the sticker + StickerFileID int32 + // Pass true to get the outline scaled for animated emoji + ForAnimatedEmoji bool + // Pass true to get the outline scaled for clicked animated emoji message + ForClickedAnimatedEmojiMessage bool +} + +// GetStickerOutlineRequestTypeID is TL type id of GetStickerOutlineRequest. +const GetStickerOutlineRequestTypeID = 0xa3952da5 + +// Ensuring interfaces in compile-time for GetStickerOutlineRequest. +var ( + _ bin.Encoder = &GetStickerOutlineRequest{} + _ bin.Decoder = &GetStickerOutlineRequest{} + _ bin.BareEncoder = &GetStickerOutlineRequest{} + _ bin.BareDecoder = &GetStickerOutlineRequest{} +) + +func (g *GetStickerOutlineRequest) Zero() bool { + if g == nil { + return true + } + if !(g.StickerFileID == 0) { + return false + } + if !(g.ForAnimatedEmoji == false) { + return false + } + if !(g.ForClickedAnimatedEmojiMessage == false) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (g *GetStickerOutlineRequest) String() string { + if g == nil { + return "GetStickerOutlineRequest(nil)" + } + type Alias GetStickerOutlineRequest + return fmt.Sprintf("GetStickerOutlineRequest%+v", Alias(*g)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*GetStickerOutlineRequest) TypeID() uint32 { + return GetStickerOutlineRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*GetStickerOutlineRequest) TypeName() string { + return "getStickerOutline" +} + +// TypeInfo returns info about TL type. +func (g *GetStickerOutlineRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "getStickerOutline", + ID: GetStickerOutlineRequestTypeID, + } + if g == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "StickerFileID", + SchemaName: "sticker_file_id", + }, + { + Name: "ForAnimatedEmoji", + SchemaName: "for_animated_emoji", + }, + { + Name: "ForClickedAnimatedEmojiMessage", + SchemaName: "for_clicked_animated_emoji_message", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (g *GetStickerOutlineRequest) Encode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getStickerOutline#a3952da5 as nil") + } + b.PutID(GetStickerOutlineRequestTypeID) + return g.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (g *GetStickerOutlineRequest) EncodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getStickerOutline#a3952da5 as nil") + } + b.PutInt32(g.StickerFileID) + b.PutBool(g.ForAnimatedEmoji) + b.PutBool(g.ForClickedAnimatedEmojiMessage) + return nil +} + +// Decode implements bin.Decoder. +func (g *GetStickerOutlineRequest) Decode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getStickerOutline#a3952da5 to nil") + } + if err := b.ConsumeID(GetStickerOutlineRequestTypeID); err != nil { + return fmt.Errorf("unable to decode getStickerOutline#a3952da5: %w", err) + } + return g.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (g *GetStickerOutlineRequest) DecodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getStickerOutline#a3952da5 to nil") + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode getStickerOutline#a3952da5: field sticker_file_id: %w", err) + } + g.StickerFileID = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode getStickerOutline#a3952da5: field for_animated_emoji: %w", err) + } + g.ForAnimatedEmoji = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode getStickerOutline#a3952da5: field for_clicked_animated_emoji_message: %w", err) + } + g.ForClickedAnimatedEmojiMessage = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (g *GetStickerOutlineRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if g == nil { + return fmt.Errorf("can't encode getStickerOutline#a3952da5 as nil") + } + b.ObjStart() + b.PutID("getStickerOutline") + b.Comma() + b.FieldStart("sticker_file_id") + b.PutInt32(g.StickerFileID) + b.Comma() + b.FieldStart("for_animated_emoji") + b.PutBool(g.ForAnimatedEmoji) + b.Comma() + b.FieldStart("for_clicked_animated_emoji_message") + b.PutBool(g.ForClickedAnimatedEmojiMessage) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (g *GetStickerOutlineRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if g == nil { + return fmt.Errorf("can't decode getStickerOutline#a3952da5 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("getStickerOutline"); err != nil { + return fmt.Errorf("unable to decode getStickerOutline#a3952da5: %w", err) + } + case "sticker_file_id": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode getStickerOutline#a3952da5: field sticker_file_id: %w", err) + } + g.StickerFileID = value + case "for_animated_emoji": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode getStickerOutline#a3952da5: field for_animated_emoji: %w", err) + } + g.ForAnimatedEmoji = value + case "for_clicked_animated_emoji_message": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode getStickerOutline#a3952da5: field for_clicked_animated_emoji_message: %w", err) + } + g.ForClickedAnimatedEmojiMessage = value + default: + return b.Skip() + } + return nil + }) +} + +// GetStickerFileID returns value of StickerFileID field. +func (g *GetStickerOutlineRequest) GetStickerFileID() (value int32) { + if g == nil { + return + } + return g.StickerFileID +} + +// GetForAnimatedEmoji returns value of ForAnimatedEmoji field. +func (g *GetStickerOutlineRequest) GetForAnimatedEmoji() (value bool) { + if g == nil { + return + } + return g.ForAnimatedEmoji +} + +// GetForClickedAnimatedEmojiMessage returns value of ForClickedAnimatedEmojiMessage field. +func (g *GetStickerOutlineRequest) GetForClickedAnimatedEmojiMessage() (value bool) { + if g == nil { + return + } + return g.ForClickedAnimatedEmojiMessage +} + +// GetStickerOutline invokes method getStickerOutline#a3952da5 returning error if any. +func (c *Client) GetStickerOutline(ctx context.Context, request *GetStickerOutlineRequest) (*Outline, error) { + var result Outline + + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return &result, nil +} diff --git a/tdapi/tl_get_web_app_link_url_gen.go b/tdapi/tl_get_web_app_link_url_gen.go index f831af110..56891cb9c 100644 --- a/tdapi/tl_get_web_app_link_url_gen.go +++ b/tdapi/tl_get_web_app_link_url_gen.go @@ -31,7 +31,7 @@ var ( _ = tdjson.Encoder{} ) -// GetWebAppLinkURLRequest represents TL type `getWebAppLinkUrl#4f0ef3cc`. +// GetWebAppLinkURLRequest represents TL type `getWebAppLinkUrl#60fe62c1`. type GetWebAppLinkURLRequest struct { // Identifier of the chat in which the link was clicked; pass 0 if none ChatID int64 @@ -41,16 +41,14 @@ type GetWebAppLinkURLRequest struct { WebAppShortName string // Start parameter from internalLinkTypeWebApp StartParameter string - // Preferred Web App theme; pass null to use the default theme - Theme ThemeParameters - // Short name of the current application; 0-64 English letters, digits, and underscores - ApplicationName string // Pass true if the current user allowed the bot to send them messages AllowWriteAccess bool + // Parameters to use to open the Web App + Parameters WebAppOpenParameters } // GetWebAppLinkURLRequestTypeID is TL type id of GetWebAppLinkURLRequest. -const GetWebAppLinkURLRequestTypeID = 0x4f0ef3cc +const GetWebAppLinkURLRequestTypeID = 0x60fe62c1 // Ensuring interfaces in compile-time for GetWebAppLinkURLRequest. var ( @@ -76,13 +74,10 @@ func (g *GetWebAppLinkURLRequest) Zero() bool { if !(g.StartParameter == "") { return false } - if !(g.Theme.Zero()) { - return false - } - if !(g.ApplicationName == "") { + if !(g.AllowWriteAccess == false) { return false } - if !(g.AllowWriteAccess == false) { + if !(g.Parameters.Zero()) { return false } @@ -137,18 +132,14 @@ func (g *GetWebAppLinkURLRequest) TypeInfo() tdp.Type { Name: "StartParameter", SchemaName: "start_parameter", }, - { - Name: "Theme", - SchemaName: "theme", - }, - { - Name: "ApplicationName", - SchemaName: "application_name", - }, { Name: "AllowWriteAccess", SchemaName: "allow_write_access", }, + { + Name: "Parameters", + SchemaName: "parameters", + }, } return typ } @@ -156,7 +147,7 @@ func (g *GetWebAppLinkURLRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (g *GetWebAppLinkURLRequest) Encode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode getWebAppLinkUrl#4f0ef3cc as nil") + return fmt.Errorf("can't encode getWebAppLinkUrl#60fe62c1 as nil") } b.PutID(GetWebAppLinkURLRequestTypeID) return g.EncodeBare(b) @@ -165,27 +156,26 @@ func (g *GetWebAppLinkURLRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (g *GetWebAppLinkURLRequest) EncodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode getWebAppLinkUrl#4f0ef3cc as nil") + return fmt.Errorf("can't encode getWebAppLinkUrl#60fe62c1 as nil") } b.PutInt53(g.ChatID) b.PutInt53(g.BotUserID) b.PutString(g.WebAppShortName) b.PutString(g.StartParameter) - if err := g.Theme.Encode(b); err != nil { - return fmt.Errorf("unable to encode getWebAppLinkUrl#4f0ef3cc: field theme: %w", err) - } - b.PutString(g.ApplicationName) b.PutBool(g.AllowWriteAccess) + if err := g.Parameters.Encode(b); err != nil { + return fmt.Errorf("unable to encode getWebAppLinkUrl#60fe62c1: field parameters: %w", err) + } return nil } // Decode implements bin.Decoder. func (g *GetWebAppLinkURLRequest) Decode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode getWebAppLinkUrl#4f0ef3cc to nil") + return fmt.Errorf("can't decode getWebAppLinkUrl#60fe62c1 to nil") } if err := b.ConsumeID(GetWebAppLinkURLRequestTypeID); err != nil { - return fmt.Errorf("unable to decode getWebAppLinkUrl#4f0ef3cc: %w", err) + return fmt.Errorf("unable to decode getWebAppLinkUrl#60fe62c1: %w", err) } return g.DecodeBare(b) } @@ -193,54 +183,47 @@ func (g *GetWebAppLinkURLRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (g *GetWebAppLinkURLRequest) DecodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode getWebAppLinkUrl#4f0ef3cc to nil") + return fmt.Errorf("can't decode getWebAppLinkUrl#60fe62c1 to nil") } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode getWebAppLinkUrl#4f0ef3cc: field chat_id: %w", err) + return fmt.Errorf("unable to decode getWebAppLinkUrl#60fe62c1: field chat_id: %w", err) } g.ChatID = value } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode getWebAppLinkUrl#4f0ef3cc: field bot_user_id: %w", err) + return fmt.Errorf("unable to decode getWebAppLinkUrl#60fe62c1: field bot_user_id: %w", err) } g.BotUserID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode getWebAppLinkUrl#4f0ef3cc: field web_app_short_name: %w", err) + return fmt.Errorf("unable to decode getWebAppLinkUrl#60fe62c1: field web_app_short_name: %w", err) } g.WebAppShortName = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode getWebAppLinkUrl#4f0ef3cc: field start_parameter: %w", err) + return fmt.Errorf("unable to decode getWebAppLinkUrl#60fe62c1: field start_parameter: %w", err) } g.StartParameter = value } { - if err := g.Theme.Decode(b); err != nil { - return fmt.Errorf("unable to decode getWebAppLinkUrl#4f0ef3cc: field theme: %w", err) - } - } - { - value, err := b.String() + value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode getWebAppLinkUrl#4f0ef3cc: field application_name: %w", err) + return fmt.Errorf("unable to decode getWebAppLinkUrl#60fe62c1: field allow_write_access: %w", err) } - g.ApplicationName = value + g.AllowWriteAccess = value } { - value, err := b.Bool() - if err != nil { - return fmt.Errorf("unable to decode getWebAppLinkUrl#4f0ef3cc: field allow_write_access: %w", err) + if err := g.Parameters.Decode(b); err != nil { + return fmt.Errorf("unable to decode getWebAppLinkUrl#60fe62c1: field parameters: %w", err) } - g.AllowWriteAccess = value } return nil } @@ -248,7 +231,7 @@ func (g *GetWebAppLinkURLRequest) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (g *GetWebAppLinkURLRequest) EncodeTDLibJSON(b tdjson.Encoder) error { if g == nil { - return fmt.Errorf("can't encode getWebAppLinkUrl#4f0ef3cc as nil") + return fmt.Errorf("can't encode getWebAppLinkUrl#60fe62c1 as nil") } b.ObjStart() b.PutID("getWebAppLinkUrl") @@ -265,17 +248,14 @@ func (g *GetWebAppLinkURLRequest) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("start_parameter") b.PutString(g.StartParameter) b.Comma() - b.FieldStart("theme") - if err := g.Theme.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode getWebAppLinkUrl#4f0ef3cc: field theme: %w", err) - } - b.Comma() - b.FieldStart("application_name") - b.PutString(g.ApplicationName) - b.Comma() b.FieldStart("allow_write_access") b.PutBool(g.AllowWriteAccess) b.Comma() + b.FieldStart("parameters") + if err := g.Parameters.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode getWebAppLinkUrl#60fe62c1: field parameters: %w", err) + } + b.Comma() b.StripComma() b.ObjEnd() return nil @@ -284,55 +264,49 @@ func (g *GetWebAppLinkURLRequest) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (g *GetWebAppLinkURLRequest) DecodeTDLibJSON(b tdjson.Decoder) error { if g == nil { - return fmt.Errorf("can't decode getWebAppLinkUrl#4f0ef3cc to nil") + return fmt.Errorf("can't decode getWebAppLinkUrl#60fe62c1 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("getWebAppLinkUrl"); err != nil { - return fmt.Errorf("unable to decode getWebAppLinkUrl#4f0ef3cc: %w", err) + return fmt.Errorf("unable to decode getWebAppLinkUrl#60fe62c1: %w", err) } case "chat_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode getWebAppLinkUrl#4f0ef3cc: field chat_id: %w", err) + return fmt.Errorf("unable to decode getWebAppLinkUrl#60fe62c1: field chat_id: %w", err) } g.ChatID = value case "bot_user_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode getWebAppLinkUrl#4f0ef3cc: field bot_user_id: %w", err) + return fmt.Errorf("unable to decode getWebAppLinkUrl#60fe62c1: field bot_user_id: %w", err) } g.BotUserID = value case "web_app_short_name": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode getWebAppLinkUrl#4f0ef3cc: field web_app_short_name: %w", err) + return fmt.Errorf("unable to decode getWebAppLinkUrl#60fe62c1: field web_app_short_name: %w", err) } g.WebAppShortName = value case "start_parameter": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode getWebAppLinkUrl#4f0ef3cc: field start_parameter: %w", err) + return fmt.Errorf("unable to decode getWebAppLinkUrl#60fe62c1: field start_parameter: %w", err) } g.StartParameter = value - case "theme": - if err := g.Theme.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode getWebAppLinkUrl#4f0ef3cc: field theme: %w", err) - } - case "application_name": - value, err := b.String() - if err != nil { - return fmt.Errorf("unable to decode getWebAppLinkUrl#4f0ef3cc: field application_name: %w", err) - } - g.ApplicationName = value case "allow_write_access": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode getWebAppLinkUrl#4f0ef3cc: field allow_write_access: %w", err) + return fmt.Errorf("unable to decode getWebAppLinkUrl#60fe62c1: field allow_write_access: %w", err) } g.AllowWriteAccess = value + case "parameters": + if err := g.Parameters.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode getWebAppLinkUrl#60fe62c1: field parameters: %w", err) + } default: return b.Skip() } @@ -372,31 +346,23 @@ func (g *GetWebAppLinkURLRequest) GetStartParameter() (value string) { return g.StartParameter } -// GetTheme returns value of Theme field. -func (g *GetWebAppLinkURLRequest) GetTheme() (value ThemeParameters) { - if g == nil { - return - } - return g.Theme -} - -// GetApplicationName returns value of ApplicationName field. -func (g *GetWebAppLinkURLRequest) GetApplicationName() (value string) { +// GetAllowWriteAccess returns value of AllowWriteAccess field. +func (g *GetWebAppLinkURLRequest) GetAllowWriteAccess() (value bool) { if g == nil { return } - return g.ApplicationName + return g.AllowWriteAccess } -// GetAllowWriteAccess returns value of AllowWriteAccess field. -func (g *GetWebAppLinkURLRequest) GetAllowWriteAccess() (value bool) { +// GetParameters returns value of Parameters field. +func (g *GetWebAppLinkURLRequest) GetParameters() (value WebAppOpenParameters) { if g == nil { return } - return g.AllowWriteAccess + return g.Parameters } -// GetWebAppLinkURL invokes method getWebAppLinkUrl#4f0ef3cc returning error if any. +// GetWebAppLinkURL invokes method getWebAppLinkUrl#60fe62c1 returning error if any. func (c *Client) GetWebAppLinkURL(ctx context.Context, request *GetWebAppLinkURLRequest) (*HTTPURL, error) { var result HTTPURL diff --git a/tdapi/tl_get_web_app_placeholder_gen.go b/tdapi/tl_get_web_app_placeholder_gen.go new file mode 100644 index 000000000..e6af091e1 --- /dev/null +++ b/tdapi/tl_get_web_app_placeholder_gen.go @@ -0,0 +1,206 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tdapi + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// GetWebAppPlaceholderRequest represents TL type `getWebAppPlaceholder#22c70d8f`. +type GetWebAppPlaceholderRequest struct { + // Identifier of the target bot + BotUserID int64 +} + +// GetWebAppPlaceholderRequestTypeID is TL type id of GetWebAppPlaceholderRequest. +const GetWebAppPlaceholderRequestTypeID = 0x22c70d8f + +// Ensuring interfaces in compile-time for GetWebAppPlaceholderRequest. +var ( + _ bin.Encoder = &GetWebAppPlaceholderRequest{} + _ bin.Decoder = &GetWebAppPlaceholderRequest{} + _ bin.BareEncoder = &GetWebAppPlaceholderRequest{} + _ bin.BareDecoder = &GetWebAppPlaceholderRequest{} +) + +func (g *GetWebAppPlaceholderRequest) Zero() bool { + if g == nil { + return true + } + if !(g.BotUserID == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (g *GetWebAppPlaceholderRequest) String() string { + if g == nil { + return "GetWebAppPlaceholderRequest(nil)" + } + type Alias GetWebAppPlaceholderRequest + return fmt.Sprintf("GetWebAppPlaceholderRequest%+v", Alias(*g)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*GetWebAppPlaceholderRequest) TypeID() uint32 { + return GetWebAppPlaceholderRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*GetWebAppPlaceholderRequest) TypeName() string { + return "getWebAppPlaceholder" +} + +// TypeInfo returns info about TL type. +func (g *GetWebAppPlaceholderRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "getWebAppPlaceholder", + ID: GetWebAppPlaceholderRequestTypeID, + } + if g == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "BotUserID", + SchemaName: "bot_user_id", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (g *GetWebAppPlaceholderRequest) Encode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getWebAppPlaceholder#22c70d8f as nil") + } + b.PutID(GetWebAppPlaceholderRequestTypeID) + return g.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (g *GetWebAppPlaceholderRequest) EncodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't encode getWebAppPlaceholder#22c70d8f as nil") + } + b.PutInt53(g.BotUserID) + return nil +} + +// Decode implements bin.Decoder. +func (g *GetWebAppPlaceholderRequest) Decode(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getWebAppPlaceholder#22c70d8f to nil") + } + if err := b.ConsumeID(GetWebAppPlaceholderRequestTypeID); err != nil { + return fmt.Errorf("unable to decode getWebAppPlaceholder#22c70d8f: %w", err) + } + return g.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (g *GetWebAppPlaceholderRequest) DecodeBare(b *bin.Buffer) error { + if g == nil { + return fmt.Errorf("can't decode getWebAppPlaceholder#22c70d8f to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode getWebAppPlaceholder#22c70d8f: field bot_user_id: %w", err) + } + g.BotUserID = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (g *GetWebAppPlaceholderRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if g == nil { + return fmt.Errorf("can't encode getWebAppPlaceholder#22c70d8f as nil") + } + b.ObjStart() + b.PutID("getWebAppPlaceholder") + b.Comma() + b.FieldStart("bot_user_id") + b.PutInt53(g.BotUserID) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (g *GetWebAppPlaceholderRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if g == nil { + return fmt.Errorf("can't decode getWebAppPlaceholder#22c70d8f to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("getWebAppPlaceholder"); err != nil { + return fmt.Errorf("unable to decode getWebAppPlaceholder#22c70d8f: %w", err) + } + case "bot_user_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode getWebAppPlaceholder#22c70d8f: field bot_user_id: %w", err) + } + g.BotUserID = value + default: + return b.Skip() + } + return nil + }) +} + +// GetBotUserID returns value of BotUserID field. +func (g *GetWebAppPlaceholderRequest) GetBotUserID() (value int64) { + if g == nil { + return + } + return g.BotUserID +} + +// GetWebAppPlaceholder invokes method getWebAppPlaceholder#22c70d8f returning error if any. +func (c *Client) GetWebAppPlaceholder(ctx context.Context, botuserid int64) (*Outline, error) { + var result Outline + + request := &GetWebAppPlaceholderRequest{ + BotUserID: botuserid, + } + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return &result, nil +} diff --git a/tdapi/tl_get_web_app_url_gen.go b/tdapi/tl_get_web_app_url_gen.go index 2d497c6ef..72f4980cd 100644 --- a/tdapi/tl_get_web_app_url_gen.go +++ b/tdapi/tl_get_web_app_url_gen.go @@ -31,21 +31,19 @@ var ( _ = tdjson.Encoder{} ) -// GetWebAppURLRequest represents TL type `getWebAppUrl#64c42cbe`. +// GetWebAppURLRequest represents TL type `getWebAppUrl#a4ff1f44`. type GetWebAppURLRequest struct { // Identifier of the target bot BotUserID int64 // The URL from a keyboardButtonTypeWebApp button, inlineQueryResultsButtonTypeWebApp // button, or an empty string when the bot is opened from the side menu URL string - // Preferred Web App theme; pass null to use the default theme - Theme ThemeParameters - // Short name of the current application; 0-64 English letters, digits, and underscores - ApplicationName string + // Parameters to use to open the Web App + Parameters WebAppOpenParameters } // GetWebAppURLRequestTypeID is TL type id of GetWebAppURLRequest. -const GetWebAppURLRequestTypeID = 0x64c42cbe +const GetWebAppURLRequestTypeID = 0xa4ff1f44 // Ensuring interfaces in compile-time for GetWebAppURLRequest. var ( @@ -65,10 +63,7 @@ func (g *GetWebAppURLRequest) Zero() bool { if !(g.URL == "") { return false } - if !(g.Theme.Zero()) { - return false - } - if !(g.ApplicationName == "") { + if !(g.Parameters.Zero()) { return false } @@ -116,12 +111,8 @@ func (g *GetWebAppURLRequest) TypeInfo() tdp.Type { SchemaName: "url", }, { - Name: "Theme", - SchemaName: "theme", - }, - { - Name: "ApplicationName", - SchemaName: "application_name", + Name: "Parameters", + SchemaName: "parameters", }, } return typ @@ -130,7 +121,7 @@ func (g *GetWebAppURLRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (g *GetWebAppURLRequest) Encode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode getWebAppUrl#64c42cbe as nil") + return fmt.Errorf("can't encode getWebAppUrl#a4ff1f44 as nil") } b.PutID(GetWebAppURLRequestTypeID) return g.EncodeBare(b) @@ -139,24 +130,23 @@ func (g *GetWebAppURLRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (g *GetWebAppURLRequest) EncodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode getWebAppUrl#64c42cbe as nil") + return fmt.Errorf("can't encode getWebAppUrl#a4ff1f44 as nil") } b.PutInt53(g.BotUserID) b.PutString(g.URL) - if err := g.Theme.Encode(b); err != nil { - return fmt.Errorf("unable to encode getWebAppUrl#64c42cbe: field theme: %w", err) + if err := g.Parameters.Encode(b); err != nil { + return fmt.Errorf("unable to encode getWebAppUrl#a4ff1f44: field parameters: %w", err) } - b.PutString(g.ApplicationName) return nil } // Decode implements bin.Decoder. func (g *GetWebAppURLRequest) Decode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode getWebAppUrl#64c42cbe to nil") + return fmt.Errorf("can't decode getWebAppUrl#a4ff1f44 to nil") } if err := b.ConsumeID(GetWebAppURLRequestTypeID); err != nil { - return fmt.Errorf("unable to decode getWebAppUrl#64c42cbe: %w", err) + return fmt.Errorf("unable to decode getWebAppUrl#a4ff1f44: %w", err) } return g.DecodeBare(b) } @@ -164,33 +154,26 @@ func (g *GetWebAppURLRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (g *GetWebAppURLRequest) DecodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode getWebAppUrl#64c42cbe to nil") + return fmt.Errorf("can't decode getWebAppUrl#a4ff1f44 to nil") } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode getWebAppUrl#64c42cbe: field bot_user_id: %w", err) + return fmt.Errorf("unable to decode getWebAppUrl#a4ff1f44: field bot_user_id: %w", err) } g.BotUserID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode getWebAppUrl#64c42cbe: field url: %w", err) + return fmt.Errorf("unable to decode getWebAppUrl#a4ff1f44: field url: %w", err) } g.URL = value } { - if err := g.Theme.Decode(b); err != nil { - return fmt.Errorf("unable to decode getWebAppUrl#64c42cbe: field theme: %w", err) - } - } - { - value, err := b.String() - if err != nil { - return fmt.Errorf("unable to decode getWebAppUrl#64c42cbe: field application_name: %w", err) + if err := g.Parameters.Decode(b); err != nil { + return fmt.Errorf("unable to decode getWebAppUrl#a4ff1f44: field parameters: %w", err) } - g.ApplicationName = value } return nil } @@ -198,7 +181,7 @@ func (g *GetWebAppURLRequest) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (g *GetWebAppURLRequest) EncodeTDLibJSON(b tdjson.Encoder) error { if g == nil { - return fmt.Errorf("can't encode getWebAppUrl#64c42cbe as nil") + return fmt.Errorf("can't encode getWebAppUrl#a4ff1f44 as nil") } b.ObjStart() b.PutID("getWebAppUrl") @@ -209,14 +192,11 @@ func (g *GetWebAppURLRequest) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("url") b.PutString(g.URL) b.Comma() - b.FieldStart("theme") - if err := g.Theme.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode getWebAppUrl#64c42cbe: field theme: %w", err) + b.FieldStart("parameters") + if err := g.Parameters.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode getWebAppUrl#a4ff1f44: field parameters: %w", err) } b.Comma() - b.FieldStart("application_name") - b.PutString(g.ApplicationName) - b.Comma() b.StripComma() b.ObjEnd() return nil @@ -225,37 +205,31 @@ func (g *GetWebAppURLRequest) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (g *GetWebAppURLRequest) DecodeTDLibJSON(b tdjson.Decoder) error { if g == nil { - return fmt.Errorf("can't decode getWebAppUrl#64c42cbe to nil") + return fmt.Errorf("can't decode getWebAppUrl#a4ff1f44 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("getWebAppUrl"); err != nil { - return fmt.Errorf("unable to decode getWebAppUrl#64c42cbe: %w", err) + return fmt.Errorf("unable to decode getWebAppUrl#a4ff1f44: %w", err) } case "bot_user_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode getWebAppUrl#64c42cbe: field bot_user_id: %w", err) + return fmt.Errorf("unable to decode getWebAppUrl#a4ff1f44: field bot_user_id: %w", err) } g.BotUserID = value case "url": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode getWebAppUrl#64c42cbe: field url: %w", err) + return fmt.Errorf("unable to decode getWebAppUrl#a4ff1f44: field url: %w", err) } g.URL = value - case "theme": - if err := g.Theme.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode getWebAppUrl#64c42cbe: field theme: %w", err) + case "parameters": + if err := g.Parameters.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode getWebAppUrl#a4ff1f44: field parameters: %w", err) } - case "application_name": - value, err := b.String() - if err != nil { - return fmt.Errorf("unable to decode getWebAppUrl#64c42cbe: field application_name: %w", err) - } - g.ApplicationName = value default: return b.Skip() } @@ -279,23 +253,15 @@ func (g *GetWebAppURLRequest) GetURL() (value string) { return g.URL } -// GetTheme returns value of Theme field. -func (g *GetWebAppURLRequest) GetTheme() (value ThemeParameters) { - if g == nil { - return - } - return g.Theme -} - -// GetApplicationName returns value of ApplicationName field. -func (g *GetWebAppURLRequest) GetApplicationName() (value string) { +// GetParameters returns value of Parameters field. +func (g *GetWebAppURLRequest) GetParameters() (value WebAppOpenParameters) { if g == nil { return } - return g.ApplicationName + return g.Parameters } -// GetWebAppURL invokes method getWebAppUrl#64c42cbe returning error if any. +// GetWebAppURL invokes method getWebAppUrl#a4ff1f44 returning error if any. func (c *Client) GetWebAppURL(ctx context.Context, request *GetWebAppURLRequest) (*HTTPURL, error) { var result HTTPURL diff --git a/tdapi/tl_gift_gen.go b/tdapi/tl_gift_gen.go index f4dfc71d4..a6f4d7b91 100644 --- a/tdapi/tl_gift_gen.go +++ b/tdapi/tl_gift_gen.go @@ -31,7 +31,7 @@ var ( _ = tdjson.Encoder{} ) -// Gift represents TL type `gift#9dc9b8a1`. +// Gift represents TL type `gift#d3284cce`. type Gift struct { // Unique identifier of the gift ID int64 @@ -43,6 +43,8 @@ type Gift struct { // default. If the gift was paid with just bought Telegram Stars, then full value can be // claimed DefaultSellStarCount int64 + // True, if the gift is a birthday gift + IsForBirthday bool // Number of remaining times the gift can be purchased by all users; 0 if not limited or // the gift was sold out RemainingCount int32 @@ -57,7 +59,7 @@ type Gift struct { } // GiftTypeID is TL type id of Gift. -const GiftTypeID = 0x9dc9b8a1 +const GiftTypeID = 0xd3284cce // Ensuring interfaces in compile-time for Gift. var ( @@ -83,6 +85,9 @@ func (g *Gift) Zero() bool { if !(g.DefaultSellStarCount == 0) { return false } + if !(g.IsForBirthday == false) { + return false + } if !(g.RemainingCount == 0) { return false } @@ -147,6 +152,10 @@ func (g *Gift) TypeInfo() tdp.Type { Name: "DefaultSellStarCount", SchemaName: "default_sell_star_count", }, + { + Name: "IsForBirthday", + SchemaName: "is_for_birthday", + }, { Name: "RemainingCount", SchemaName: "remaining_count", @@ -170,7 +179,7 @@ func (g *Gift) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (g *Gift) Encode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode gift#9dc9b8a1 as nil") + return fmt.Errorf("can't encode gift#d3284cce as nil") } b.PutID(GiftTypeID) return g.EncodeBare(b) @@ -179,14 +188,15 @@ func (g *Gift) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (g *Gift) EncodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't encode gift#9dc9b8a1 as nil") + return fmt.Errorf("can't encode gift#d3284cce as nil") } b.PutLong(g.ID) if err := g.Sticker.Encode(b); err != nil { - return fmt.Errorf("unable to encode gift#9dc9b8a1: field sticker: %w", err) + return fmt.Errorf("unable to encode gift#d3284cce: field sticker: %w", err) } b.PutInt53(g.StarCount) b.PutInt53(g.DefaultSellStarCount) + b.PutBool(g.IsForBirthday) b.PutInt32(g.RemainingCount) b.PutInt32(g.TotalCount) b.PutInt32(g.FirstSendDate) @@ -197,10 +207,10 @@ func (g *Gift) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (g *Gift) Decode(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode gift#9dc9b8a1 to nil") + return fmt.Errorf("can't decode gift#d3284cce to nil") } if err := b.ConsumeID(GiftTypeID); err != nil { - return fmt.Errorf("unable to decode gift#9dc9b8a1: %w", err) + return fmt.Errorf("unable to decode gift#d3284cce: %w", err) } return g.DecodeBare(b) } @@ -208,59 +218,66 @@ func (g *Gift) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (g *Gift) DecodeBare(b *bin.Buffer) error { if g == nil { - return fmt.Errorf("can't decode gift#9dc9b8a1 to nil") + return fmt.Errorf("can't decode gift#d3284cce to nil") } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode gift#9dc9b8a1: field id: %w", err) + return fmt.Errorf("unable to decode gift#d3284cce: field id: %w", err) } g.ID = value } { if err := g.Sticker.Decode(b); err != nil { - return fmt.Errorf("unable to decode gift#9dc9b8a1: field sticker: %w", err) + return fmt.Errorf("unable to decode gift#d3284cce: field sticker: %w", err) } } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode gift#9dc9b8a1: field star_count: %w", err) + return fmt.Errorf("unable to decode gift#d3284cce: field star_count: %w", err) } g.StarCount = value } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode gift#9dc9b8a1: field default_sell_star_count: %w", err) + return fmt.Errorf("unable to decode gift#d3284cce: field default_sell_star_count: %w", err) } g.DefaultSellStarCount = value } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode gift#d3284cce: field is_for_birthday: %w", err) + } + g.IsForBirthday = value + } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode gift#9dc9b8a1: field remaining_count: %w", err) + return fmt.Errorf("unable to decode gift#d3284cce: field remaining_count: %w", err) } g.RemainingCount = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode gift#9dc9b8a1: field total_count: %w", err) + return fmt.Errorf("unable to decode gift#d3284cce: field total_count: %w", err) } g.TotalCount = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode gift#9dc9b8a1: field first_send_date: %w", err) + return fmt.Errorf("unable to decode gift#d3284cce: field first_send_date: %w", err) } g.FirstSendDate = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode gift#9dc9b8a1: field last_send_date: %w", err) + return fmt.Errorf("unable to decode gift#d3284cce: field last_send_date: %w", err) } g.LastSendDate = value } @@ -270,7 +287,7 @@ func (g *Gift) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (g *Gift) EncodeTDLibJSON(b tdjson.Encoder) error { if g == nil { - return fmt.Errorf("can't encode gift#9dc9b8a1 as nil") + return fmt.Errorf("can't encode gift#d3284cce as nil") } b.ObjStart() b.PutID("gift") @@ -280,7 +297,7 @@ func (g *Gift) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("sticker") if err := g.Sticker.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode gift#9dc9b8a1: field sticker: %w", err) + return fmt.Errorf("unable to encode gift#d3284cce: field sticker: %w", err) } b.Comma() b.FieldStart("star_count") @@ -289,6 +306,9 @@ func (g *Gift) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("default_sell_star_count") b.PutInt53(g.DefaultSellStarCount) b.Comma() + b.FieldStart("is_for_birthday") + b.PutBool(g.IsForBirthday) + b.Comma() b.FieldStart("remaining_count") b.PutInt32(g.RemainingCount) b.Comma() @@ -309,59 +329,65 @@ func (g *Gift) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (g *Gift) DecodeTDLibJSON(b tdjson.Decoder) error { if g == nil { - return fmt.Errorf("can't decode gift#9dc9b8a1 to nil") + return fmt.Errorf("can't decode gift#d3284cce to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("gift"); err != nil { - return fmt.Errorf("unable to decode gift#9dc9b8a1: %w", err) + return fmt.Errorf("unable to decode gift#d3284cce: %w", err) } case "id": value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode gift#9dc9b8a1: field id: %w", err) + return fmt.Errorf("unable to decode gift#d3284cce: field id: %w", err) } g.ID = value case "sticker": if err := g.Sticker.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode gift#9dc9b8a1: field sticker: %w", err) + return fmt.Errorf("unable to decode gift#d3284cce: field sticker: %w", err) } case "star_count": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode gift#9dc9b8a1: field star_count: %w", err) + return fmt.Errorf("unable to decode gift#d3284cce: field star_count: %w", err) } g.StarCount = value case "default_sell_star_count": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode gift#9dc9b8a1: field default_sell_star_count: %w", err) + return fmt.Errorf("unable to decode gift#d3284cce: field default_sell_star_count: %w", err) } g.DefaultSellStarCount = value + case "is_for_birthday": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode gift#d3284cce: field is_for_birthday: %w", err) + } + g.IsForBirthday = value case "remaining_count": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode gift#9dc9b8a1: field remaining_count: %w", err) + return fmt.Errorf("unable to decode gift#d3284cce: field remaining_count: %w", err) } g.RemainingCount = value case "total_count": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode gift#9dc9b8a1: field total_count: %w", err) + return fmt.Errorf("unable to decode gift#d3284cce: field total_count: %w", err) } g.TotalCount = value case "first_send_date": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode gift#9dc9b8a1: field first_send_date: %w", err) + return fmt.Errorf("unable to decode gift#d3284cce: field first_send_date: %w", err) } g.FirstSendDate = value case "last_send_date": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode gift#9dc9b8a1: field last_send_date: %w", err) + return fmt.Errorf("unable to decode gift#d3284cce: field last_send_date: %w", err) } g.LastSendDate = value default: @@ -403,6 +429,14 @@ func (g *Gift) GetDefaultSellStarCount() (value int64) { return g.DefaultSellStarCount } +// GetIsForBirthday returns value of IsForBirthday field. +func (g *Gift) GetIsForBirthday() (value bool) { + if g == nil { + return + } + return g.IsForBirthday +} + // GetRemainingCount returns value of RemainingCount field. func (g *Gift) GetRemainingCount() (value int32) { if g == nil { diff --git a/tdapi/tl_input_message_content_gen.go b/tdapi/tl_input_message_content_gen.go index e1acdc09b..49b6e01b8 100644 --- a/tdapi/tl_input_message_content_gen.go +++ b/tdapi/tl_input_message_content_gen.go @@ -2504,7 +2504,7 @@ func (i *InputMessageSticker) GetEmoji() (value string) { // InputMessageVideo represents TL type `inputMessageVideo#1a64cc26`. type InputMessageVideo struct { - // Video to be sent. The video is expected to be reencoded to MPEG4 format with H.264 + // Video to be sent. The video is expected to be re-encoded to MPEG4 format with H.264 // codec by the sender Video InputFileClass // Video thumbnail; pass null to skip thumbnail uploading diff --git a/tdapi/tl_internal_link_type_gen.go b/tdapi/tl_internal_link_type_gen.go index d0671e91b..b4502d979 100644 --- a/tdapi/tl_internal_link_type_gen.go +++ b/tdapi/tl_internal_link_type_gen.go @@ -3661,18 +3661,18 @@ func (i *InternalLinkTypeLanguageSettings) DecodeTDLibJSON(b tdjson.Decoder) err }) } -// InternalLinkTypeMainWebApp represents TL type `internalLinkTypeMainWebApp#9c942666`. +// InternalLinkTypeMainWebApp represents TL type `internalLinkTypeMainWebApp#5ddf72e9`. type InternalLinkTypeMainWebApp struct { // Username of the bot BotUsername string // Start parameter to be passed to getMainWebApp StartParameter string - // True, if the Web App must be opened in the compact mode instead of the full-size mode - IsCompact bool + // The mode to be passed to getMainWebApp + Mode WebAppOpenModeClass } // InternalLinkTypeMainWebAppTypeID is TL type id of InternalLinkTypeMainWebApp. -const InternalLinkTypeMainWebAppTypeID = 0x9c942666 +const InternalLinkTypeMainWebAppTypeID = 0x5ddf72e9 // construct implements constructor of InternalLinkTypeClass. func (i InternalLinkTypeMainWebApp) construct() InternalLinkTypeClass { return &i } @@ -3697,7 +3697,7 @@ func (i *InternalLinkTypeMainWebApp) Zero() bool { if !(i.StartParameter == "") { return false } - if !(i.IsCompact == false) { + if !(i.Mode == nil) { return false } @@ -3745,8 +3745,8 @@ func (i *InternalLinkTypeMainWebApp) TypeInfo() tdp.Type { SchemaName: "start_parameter", }, { - Name: "IsCompact", - SchemaName: "is_compact", + Name: "Mode", + SchemaName: "mode", }, } return typ @@ -3755,7 +3755,7 @@ func (i *InternalLinkTypeMainWebApp) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (i *InternalLinkTypeMainWebApp) Encode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode internalLinkTypeMainWebApp#9c942666 as nil") + return fmt.Errorf("can't encode internalLinkTypeMainWebApp#5ddf72e9 as nil") } b.PutID(InternalLinkTypeMainWebAppTypeID) return i.EncodeBare(b) @@ -3764,21 +3764,26 @@ func (i *InternalLinkTypeMainWebApp) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (i *InternalLinkTypeMainWebApp) EncodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode internalLinkTypeMainWebApp#9c942666 as nil") + return fmt.Errorf("can't encode internalLinkTypeMainWebApp#5ddf72e9 as nil") } b.PutString(i.BotUsername) b.PutString(i.StartParameter) - b.PutBool(i.IsCompact) + if i.Mode == nil { + return fmt.Errorf("unable to encode internalLinkTypeMainWebApp#5ddf72e9: field mode is nil") + } + if err := i.Mode.Encode(b); err != nil { + return fmt.Errorf("unable to encode internalLinkTypeMainWebApp#5ddf72e9: field mode: %w", err) + } return nil } // Decode implements bin.Decoder. func (i *InternalLinkTypeMainWebApp) Decode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode internalLinkTypeMainWebApp#9c942666 to nil") + return fmt.Errorf("can't decode internalLinkTypeMainWebApp#5ddf72e9 to nil") } if err := b.ConsumeID(InternalLinkTypeMainWebAppTypeID); err != nil { - return fmt.Errorf("unable to decode internalLinkTypeMainWebApp#9c942666: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeMainWebApp#5ddf72e9: %w", err) } return i.DecodeBare(b) } @@ -3786,28 +3791,28 @@ func (i *InternalLinkTypeMainWebApp) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (i *InternalLinkTypeMainWebApp) DecodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode internalLinkTypeMainWebApp#9c942666 to nil") + return fmt.Errorf("can't decode internalLinkTypeMainWebApp#5ddf72e9 to nil") } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode internalLinkTypeMainWebApp#9c942666: field bot_username: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeMainWebApp#5ddf72e9: field bot_username: %w", err) } i.BotUsername = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode internalLinkTypeMainWebApp#9c942666: field start_parameter: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeMainWebApp#5ddf72e9: field start_parameter: %w", err) } i.StartParameter = value } { - value, err := b.Bool() + value, err := DecodeWebAppOpenMode(b) if err != nil { - return fmt.Errorf("unable to decode internalLinkTypeMainWebApp#9c942666: field is_compact: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeMainWebApp#5ddf72e9: field mode: %w", err) } - i.IsCompact = value + i.Mode = value } return nil } @@ -3815,7 +3820,7 @@ func (i *InternalLinkTypeMainWebApp) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (i *InternalLinkTypeMainWebApp) EncodeTDLibJSON(b tdjson.Encoder) error { if i == nil { - return fmt.Errorf("can't encode internalLinkTypeMainWebApp#9c942666 as nil") + return fmt.Errorf("can't encode internalLinkTypeMainWebApp#5ddf72e9 as nil") } b.ObjStart() b.PutID("internalLinkTypeMainWebApp") @@ -3826,8 +3831,13 @@ func (i *InternalLinkTypeMainWebApp) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("start_parameter") b.PutString(i.StartParameter) b.Comma() - b.FieldStart("is_compact") - b.PutBool(i.IsCompact) + b.FieldStart("mode") + if i.Mode == nil { + return fmt.Errorf("unable to encode internalLinkTypeMainWebApp#5ddf72e9: field mode is nil") + } + if err := i.Mode.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode internalLinkTypeMainWebApp#5ddf72e9: field mode: %w", err) + } b.Comma() b.StripComma() b.ObjEnd() @@ -3837,33 +3847,33 @@ func (i *InternalLinkTypeMainWebApp) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (i *InternalLinkTypeMainWebApp) DecodeTDLibJSON(b tdjson.Decoder) error { if i == nil { - return fmt.Errorf("can't decode internalLinkTypeMainWebApp#9c942666 to nil") + return fmt.Errorf("can't decode internalLinkTypeMainWebApp#5ddf72e9 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("internalLinkTypeMainWebApp"); err != nil { - return fmt.Errorf("unable to decode internalLinkTypeMainWebApp#9c942666: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeMainWebApp#5ddf72e9: %w", err) } case "bot_username": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode internalLinkTypeMainWebApp#9c942666: field bot_username: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeMainWebApp#5ddf72e9: field bot_username: %w", err) } i.BotUsername = value case "start_parameter": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode internalLinkTypeMainWebApp#9c942666: field start_parameter: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeMainWebApp#5ddf72e9: field start_parameter: %w", err) } i.StartParameter = value - case "is_compact": - value, err := b.Bool() + case "mode": + value, err := DecodeTDLibJSONWebAppOpenMode(b) if err != nil { - return fmt.Errorf("unable to decode internalLinkTypeMainWebApp#9c942666: field is_compact: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeMainWebApp#5ddf72e9: field mode: %w", err) } - i.IsCompact = value + i.Mode = value default: return b.Skip() } @@ -3887,12 +3897,12 @@ func (i *InternalLinkTypeMainWebApp) GetStartParameter() (value string) { return i.StartParameter } -// GetIsCompact returns value of IsCompact field. -func (i *InternalLinkTypeMainWebApp) GetIsCompact() (value bool) { +// GetMode returns value of Mode field. +func (i *InternalLinkTypeMainWebApp) GetMode() (value WebAppOpenModeClass) { if i == nil { return } - return i.IsCompact + return i.Mode } // InternalLinkTypeMessage represents TL type `internalLinkTypeMessage#3a535c52`. @@ -7898,7 +7908,7 @@ func (i *InternalLinkTypeVideoChat) GetIsLiveStream() (value bool) { return i.IsLiveStream } -// InternalLinkTypeWebApp represents TL type `internalLinkTypeWebApp#4c68bb0d`. +// InternalLinkTypeWebApp represents TL type `internalLinkTypeWebApp#7ae9552d`. type InternalLinkTypeWebApp struct { // Username of the bot that owns the Web App BotUsername string @@ -7906,12 +7916,12 @@ type InternalLinkTypeWebApp struct { WebAppShortName string // Start parameter to be passed to getWebAppLinkUrl StartParameter string - // True, if the Web App must be opened in the compact mode instead of the full-size mode - IsCompact bool + // The mode in which the Web App must be opened + Mode WebAppOpenModeClass } // InternalLinkTypeWebAppTypeID is TL type id of InternalLinkTypeWebApp. -const InternalLinkTypeWebAppTypeID = 0x4c68bb0d +const InternalLinkTypeWebAppTypeID = 0x7ae9552d // construct implements constructor of InternalLinkTypeClass. func (i InternalLinkTypeWebApp) construct() InternalLinkTypeClass { return &i } @@ -7939,7 +7949,7 @@ func (i *InternalLinkTypeWebApp) Zero() bool { if !(i.StartParameter == "") { return false } - if !(i.IsCompact == false) { + if !(i.Mode == nil) { return false } @@ -7991,8 +8001,8 @@ func (i *InternalLinkTypeWebApp) TypeInfo() tdp.Type { SchemaName: "start_parameter", }, { - Name: "IsCompact", - SchemaName: "is_compact", + Name: "Mode", + SchemaName: "mode", }, } return typ @@ -8001,7 +8011,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#4c68bb0d as nil") + return fmt.Errorf("can't encode internalLinkTypeWebApp#7ae9552d as nil") } b.PutID(InternalLinkTypeWebAppTypeID) return i.EncodeBare(b) @@ -8010,22 +8020,27 @@ 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#4c68bb0d as nil") + return fmt.Errorf("can't encode internalLinkTypeWebApp#7ae9552d as nil") } b.PutString(i.BotUsername) b.PutString(i.WebAppShortName) b.PutString(i.StartParameter) - b.PutBool(i.IsCompact) + if i.Mode == nil { + return fmt.Errorf("unable to encode internalLinkTypeWebApp#7ae9552d: field mode is nil") + } + if err := i.Mode.Encode(b); err != nil { + return fmt.Errorf("unable to encode internalLinkTypeWebApp#7ae9552d: field mode: %w", err) + } return nil } // Decode implements bin.Decoder. func (i *InternalLinkTypeWebApp) Decode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode internalLinkTypeWebApp#4c68bb0d to nil") + return fmt.Errorf("can't decode internalLinkTypeWebApp#7ae9552d to nil") } if err := b.ConsumeID(InternalLinkTypeWebAppTypeID); err != nil { - return fmt.Errorf("unable to decode internalLinkTypeWebApp#4c68bb0d: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeWebApp#7ae9552d: %w", err) } return i.DecodeBare(b) } @@ -8033,35 +8048,35 @@ 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#4c68bb0d to nil") + return fmt.Errorf("can't decode internalLinkTypeWebApp#7ae9552d to nil") } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode internalLinkTypeWebApp#4c68bb0d: field bot_username: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeWebApp#7ae9552d: field bot_username: %w", err) } i.BotUsername = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode internalLinkTypeWebApp#4c68bb0d: field web_app_short_name: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeWebApp#7ae9552d: field web_app_short_name: %w", err) } i.WebAppShortName = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode internalLinkTypeWebApp#4c68bb0d: field start_parameter: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeWebApp#7ae9552d: field start_parameter: %w", err) } i.StartParameter = value } { - value, err := b.Bool() + value, err := DecodeWebAppOpenMode(b) if err != nil { - return fmt.Errorf("unable to decode internalLinkTypeWebApp#4c68bb0d: field is_compact: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeWebApp#7ae9552d: field mode: %w", err) } - i.IsCompact = value + i.Mode = value } return nil } @@ -8069,7 +8084,7 @@ func (i *InternalLinkTypeWebApp) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (i *InternalLinkTypeWebApp) EncodeTDLibJSON(b tdjson.Encoder) error { if i == nil { - return fmt.Errorf("can't encode internalLinkTypeWebApp#4c68bb0d as nil") + return fmt.Errorf("can't encode internalLinkTypeWebApp#7ae9552d as nil") } b.ObjStart() b.PutID("internalLinkTypeWebApp") @@ -8083,8 +8098,13 @@ 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.FieldStart("mode") + if i.Mode == nil { + return fmt.Errorf("unable to encode internalLinkTypeWebApp#7ae9552d: field mode is nil") + } + if err := i.Mode.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode internalLinkTypeWebApp#7ae9552d: field mode: %w", err) + } b.Comma() b.StripComma() b.ObjEnd() @@ -8094,39 +8114,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#4c68bb0d to nil") + return fmt.Errorf("can't decode internalLinkTypeWebApp#7ae9552d 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#4c68bb0d: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeWebApp#7ae9552d: %w", err) } case "bot_username": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode internalLinkTypeWebApp#4c68bb0d: field bot_username: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeWebApp#7ae9552d: 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#4c68bb0d: field web_app_short_name: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeWebApp#7ae9552d: 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#4c68bb0d: field start_parameter: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeWebApp#7ae9552d: field start_parameter: %w", err) } i.StartParameter = value - case "is_compact": - value, err := b.Bool() + case "mode": + value, err := DecodeTDLibJSONWebAppOpenMode(b) if err != nil { - return fmt.Errorf("unable to decode internalLinkTypeWebApp#4c68bb0d: field is_compact: %w", err) + return fmt.Errorf("unable to decode internalLinkTypeWebApp#7ae9552d: field mode: %w", err) } - i.IsCompact = value + i.Mode = value default: return b.Skip() } @@ -8158,12 +8178,12 @@ func (i *InternalLinkTypeWebApp) GetStartParameter() (value string) { return i.StartParameter } -// GetIsCompact returns value of IsCompact field. -func (i *InternalLinkTypeWebApp) GetIsCompact() (value bool) { +// GetMode returns value of Mode field. +func (i *InternalLinkTypeWebApp) GetMode() (value WebAppOpenModeClass) { if i == nil { return } - return i.IsCompact + return i.Mode } // InternalLinkTypeClassName is schema name of InternalLinkTypeClass. @@ -8199,7 +8219,7 @@ const InternalLinkTypeClassName = "InternalLinkType" // case *tdapi.InternalLinkTypeInvoice: // internalLinkTypeInvoice#f34c6dac // case *tdapi.InternalLinkTypeLanguagePack: // internalLinkTypeLanguagePack#a9870d6c // case *tdapi.InternalLinkTypeLanguageSettings: // internalLinkTypeLanguageSettings#b019e6e6 -// case *tdapi.InternalLinkTypeMainWebApp: // internalLinkTypeMainWebApp#9c942666 +// case *tdapi.InternalLinkTypeMainWebApp: // internalLinkTypeMainWebApp#5ddf72e9 // case *tdapi.InternalLinkTypeMessage: // internalLinkTypeMessage#3a535c52 // case *tdapi.InternalLinkTypeMessageDraft: // internalLinkTypeMessageDraft#276fbad5 // case *tdapi.InternalLinkTypePassportDataRequest: // internalLinkTypePassportDataRequest#c50fce81 @@ -8222,7 +8242,7 @@ const InternalLinkTypeClassName = "InternalLinkType" // case *tdapi.InternalLinkTypeUserPhoneNumber: // internalLinkTypeUserPhoneNumber#104bbb08 // case *tdapi.InternalLinkTypeUserToken: // internalLinkTypeUserToken#a8d7db59 // case *tdapi.InternalLinkTypeVideoChat: // internalLinkTypeVideoChat#8796f8b4 -// case *tdapi.InternalLinkTypeWebApp: // internalLinkTypeWebApp#4c68bb0d +// case *tdapi.InternalLinkTypeWebApp: // internalLinkTypeWebApp#7ae9552d // default: panic(v) // } type InternalLinkTypeClass interface { @@ -8402,7 +8422,7 @@ func DecodeInternalLinkType(buf *bin.Buffer) (InternalLinkTypeClass, error) { } return &v, nil case InternalLinkTypeMainWebAppTypeID: - // Decoding internalLinkTypeMainWebApp#9c942666. + // Decoding internalLinkTypeMainWebApp#5ddf72e9. v := InternalLinkTypeMainWebApp{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode InternalLinkTypeClass: %w", err) @@ -8563,7 +8583,7 @@ func DecodeInternalLinkType(buf *bin.Buffer) (InternalLinkTypeClass, error) { } return &v, nil case InternalLinkTypeWebAppTypeID: - // Decoding internalLinkTypeWebApp#4c68bb0d. + // Decoding internalLinkTypeWebApp#7ae9552d. v := InternalLinkTypeWebApp{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode InternalLinkTypeClass: %w", err) @@ -8729,7 +8749,7 @@ func DecodeTDLibJSONInternalLinkType(buf tdjson.Decoder) (InternalLinkTypeClass, } return &v, nil case "internalLinkTypeMainWebApp": - // Decoding internalLinkTypeMainWebApp#9c942666. + // Decoding internalLinkTypeMainWebApp#5ddf72e9. v := InternalLinkTypeMainWebApp{} if err := v.DecodeTDLibJSON(buf); err != nil { return nil, fmt.Errorf("unable to decode InternalLinkTypeClass: %w", err) @@ -8890,7 +8910,7 @@ func DecodeTDLibJSONInternalLinkType(buf tdjson.Decoder) (InternalLinkTypeClass, } return &v, nil case "internalLinkTypeWebApp": - // Decoding internalLinkTypeWebApp#4c68bb0d. + // Decoding internalLinkTypeWebApp#7ae9552d. v := InternalLinkTypeWebApp{} if err := v.DecodeTDLibJSON(buf); err != nil { return nil, fmt.Errorf("unable to decode InternalLinkTypeClass: %w", err) diff --git a/tdapi/tl_invoice_gen.go b/tdapi/tl_invoice_gen.go index 42a230b29..b79853f40 100644 --- a/tdapi/tl_invoice_gen.go +++ b/tdapi/tl_invoice_gen.go @@ -31,12 +31,15 @@ var ( _ = tdjson.Encoder{} ) -// Invoice represents TL type `invoice#c19b2377`. +// Invoice represents TL type `invoice#67dc0e89`. type Invoice struct { // ISO 4217 currency code Currency string // A list of objects used to calculate the total price of the product PriceParts []LabeledPricePart + // The number of seconds between consecutive Telegram Star debiting for subscription + // invoices; 0 if the invoice doesn't create subscription + SubscriptionPeriod int32 // The maximum allowed amount of tip in the smallest units of the currency MaxTipAmount int64 // Suggested amounts of tip in the smallest units of the currency @@ -67,7 +70,7 @@ type Invoice struct { } // InvoiceTypeID is TL type id of Invoice. -const InvoiceTypeID = 0xc19b2377 +const InvoiceTypeID = 0x67dc0e89 // Ensuring interfaces in compile-time for Invoice. var ( @@ -87,6 +90,9 @@ func (i *Invoice) Zero() bool { if !(i.PriceParts == nil) { return false } + if !(i.SubscriptionPeriod == 0) { + return false + } if !(i.MaxTipAmount == 0) { return false } @@ -167,6 +173,10 @@ func (i *Invoice) TypeInfo() tdp.Type { Name: "PriceParts", SchemaName: "price_parts", }, + { + Name: "SubscriptionPeriod", + SchemaName: "subscription_period", + }, { Name: "MaxTipAmount", SchemaName: "max_tip_amount", @@ -222,7 +232,7 @@ func (i *Invoice) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (i *Invoice) Encode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode invoice#c19b2377 as nil") + return fmt.Errorf("can't encode invoice#67dc0e89 as nil") } b.PutID(InvoiceTypeID) return i.EncodeBare(b) @@ -231,15 +241,16 @@ func (i *Invoice) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (i *Invoice) EncodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't encode invoice#c19b2377 as nil") + return fmt.Errorf("can't encode invoice#67dc0e89 as nil") } b.PutString(i.Currency) b.PutInt(len(i.PriceParts)) for idx, v := range i.PriceParts { if err := v.EncodeBare(b); err != nil { - return fmt.Errorf("unable to encode bare invoice#c19b2377: field price_parts element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode bare invoice#67dc0e89: field price_parts element with index %d: %w", idx, err) } } + b.PutInt32(i.SubscriptionPeriod) b.PutInt53(i.MaxTipAmount) b.PutInt(len(i.SuggestedTipAmounts)) for _, v := range i.SuggestedTipAmounts { @@ -261,10 +272,10 @@ func (i *Invoice) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (i *Invoice) Decode(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode invoice#c19b2377 to nil") + return fmt.Errorf("can't decode invoice#67dc0e89 to nil") } if err := b.ConsumeID(InvoiceTypeID); err != nil { - return fmt.Errorf("unable to decode invoice#c19b2377: %w", err) + return fmt.Errorf("unable to decode invoice#67dc0e89: %w", err) } return i.DecodeBare(b) } @@ -272,19 +283,19 @@ func (i *Invoice) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (i *Invoice) DecodeBare(b *bin.Buffer) error { if i == nil { - return fmt.Errorf("can't decode invoice#c19b2377 to nil") + return fmt.Errorf("can't decode invoice#67dc0e89 to nil") } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode invoice#c19b2377: field currency: %w", err) + return fmt.Errorf("unable to decode invoice#67dc0e89: field currency: %w", err) } i.Currency = value } { headerLen, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode invoice#c19b2377: field price_parts: %w", err) + return fmt.Errorf("unable to decode invoice#67dc0e89: field price_parts: %w", err) } if headerLen > 0 { @@ -293,22 +304,29 @@ func (i *Invoice) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { var value LabeledPricePart if err := value.DecodeBare(b); err != nil { - return fmt.Errorf("unable to decode bare invoice#c19b2377: field price_parts: %w", err) + return fmt.Errorf("unable to decode bare invoice#67dc0e89: field price_parts: %w", err) } i.PriceParts = append(i.PriceParts, value) } } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode invoice#67dc0e89: field subscription_period: %w", err) + } + i.SubscriptionPeriod = value + } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode invoice#c19b2377: field max_tip_amount: %w", err) + return fmt.Errorf("unable to decode invoice#67dc0e89: field max_tip_amount: %w", err) } i.MaxTipAmount = value } { headerLen, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode invoice#c19b2377: field suggested_tip_amounts: %w", err) + return fmt.Errorf("unable to decode invoice#67dc0e89: field suggested_tip_amounts: %w", err) } if headerLen > 0 { @@ -317,7 +335,7 @@ func (i *Invoice) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode invoice#c19b2377: field suggested_tip_amounts: %w", err) + return fmt.Errorf("unable to decode invoice#67dc0e89: field suggested_tip_amounts: %w", err) } i.SuggestedTipAmounts = append(i.SuggestedTipAmounts, value) } @@ -325,70 +343,70 @@ func (i *Invoice) DecodeBare(b *bin.Buffer) error { { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode invoice#c19b2377: field recurring_payment_terms_of_service_url: %w", err) + return fmt.Errorf("unable to decode invoice#67dc0e89: field recurring_payment_terms_of_service_url: %w", err) } i.RecurringPaymentTermsOfServiceURL = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode invoice#c19b2377: field terms_of_service_url: %w", err) + return fmt.Errorf("unable to decode invoice#67dc0e89: field terms_of_service_url: %w", err) } i.TermsOfServiceURL = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode invoice#c19b2377: field is_test: %w", err) + return fmt.Errorf("unable to decode invoice#67dc0e89: field is_test: %w", err) } i.IsTest = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode invoice#c19b2377: field need_name: %w", err) + return fmt.Errorf("unable to decode invoice#67dc0e89: field need_name: %w", err) } i.NeedName = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode invoice#c19b2377: field need_phone_number: %w", err) + return fmt.Errorf("unable to decode invoice#67dc0e89: field need_phone_number: %w", err) } i.NeedPhoneNumber = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode invoice#c19b2377: field need_email_address: %w", err) + return fmt.Errorf("unable to decode invoice#67dc0e89: field need_email_address: %w", err) } i.NeedEmailAddress = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode invoice#c19b2377: field need_shipping_address: %w", err) + return fmt.Errorf("unable to decode invoice#67dc0e89: field need_shipping_address: %w", err) } i.NeedShippingAddress = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode invoice#c19b2377: field send_phone_number_to_provider: %w", err) + return fmt.Errorf("unable to decode invoice#67dc0e89: field send_phone_number_to_provider: %w", err) } i.SendPhoneNumberToProvider = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode invoice#c19b2377: field send_email_address_to_provider: %w", err) + return fmt.Errorf("unable to decode invoice#67dc0e89: field send_email_address_to_provider: %w", err) } i.SendEmailAddressToProvider = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode invoice#c19b2377: field is_flexible: %w", err) + return fmt.Errorf("unable to decode invoice#67dc0e89: field is_flexible: %w", err) } i.IsFlexible = value } @@ -398,7 +416,7 @@ func (i *Invoice) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (i *Invoice) EncodeTDLibJSON(b tdjson.Encoder) error { if i == nil { - return fmt.Errorf("can't encode invoice#c19b2377 as nil") + return fmt.Errorf("can't encode invoice#67dc0e89 as nil") } b.ObjStart() b.PutID("invoice") @@ -410,13 +428,16 @@ func (i *Invoice) EncodeTDLibJSON(b tdjson.Encoder) error { b.ArrStart() for idx, v := range i.PriceParts { if err := v.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode invoice#c19b2377: field price_parts element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode invoice#67dc0e89: field price_parts element with index %d: %w", idx, err) } b.Comma() } b.StripComma() b.ArrEnd() b.Comma() + b.FieldStart("subscription_period") + b.PutInt32(i.SubscriptionPeriod) + b.Comma() b.FieldStart("max_tip_amount") b.PutInt53(i.MaxTipAmount) b.Comma() @@ -467,107 +488,113 @@ func (i *Invoice) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (i *Invoice) DecodeTDLibJSON(b tdjson.Decoder) error { if i == nil { - return fmt.Errorf("can't decode invoice#c19b2377 to nil") + return fmt.Errorf("can't decode invoice#67dc0e89 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("invoice"); err != nil { - return fmt.Errorf("unable to decode invoice#c19b2377: %w", err) + return fmt.Errorf("unable to decode invoice#67dc0e89: %w", err) } case "currency": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode invoice#c19b2377: field currency: %w", err) + return fmt.Errorf("unable to decode invoice#67dc0e89: field currency: %w", err) } i.Currency = value case "price_parts": if err := b.Arr(func(b tdjson.Decoder) error { var value LabeledPricePart if err := value.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode invoice#c19b2377: field price_parts: %w", err) + return fmt.Errorf("unable to decode invoice#67dc0e89: field price_parts: %w", err) } i.PriceParts = append(i.PriceParts, value) return nil }); err != nil { - return fmt.Errorf("unable to decode invoice#c19b2377: field price_parts: %w", err) + return fmt.Errorf("unable to decode invoice#67dc0e89: field price_parts: %w", err) + } + case "subscription_period": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode invoice#67dc0e89: field subscription_period: %w", err) } + i.SubscriptionPeriod = value case "max_tip_amount": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode invoice#c19b2377: field max_tip_amount: %w", err) + return fmt.Errorf("unable to decode invoice#67dc0e89: field max_tip_amount: %w", err) } i.MaxTipAmount = value case "suggested_tip_amounts": if err := b.Arr(func(b tdjson.Decoder) error { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode invoice#c19b2377: field suggested_tip_amounts: %w", err) + return fmt.Errorf("unable to decode invoice#67dc0e89: field suggested_tip_amounts: %w", err) } i.SuggestedTipAmounts = append(i.SuggestedTipAmounts, value) return nil }); err != nil { - return fmt.Errorf("unable to decode invoice#c19b2377: field suggested_tip_amounts: %w", err) + return fmt.Errorf("unable to decode invoice#67dc0e89: field suggested_tip_amounts: %w", err) } case "recurring_payment_terms_of_service_url": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode invoice#c19b2377: field recurring_payment_terms_of_service_url: %w", err) + return fmt.Errorf("unable to decode invoice#67dc0e89: field recurring_payment_terms_of_service_url: %w", err) } i.RecurringPaymentTermsOfServiceURL = value case "terms_of_service_url": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode invoice#c19b2377: field terms_of_service_url: %w", err) + return fmt.Errorf("unable to decode invoice#67dc0e89: field terms_of_service_url: %w", err) } i.TermsOfServiceURL = value case "is_test": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode invoice#c19b2377: field is_test: %w", err) + return fmt.Errorf("unable to decode invoice#67dc0e89: field is_test: %w", err) } i.IsTest = value case "need_name": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode invoice#c19b2377: field need_name: %w", err) + return fmt.Errorf("unable to decode invoice#67dc0e89: field need_name: %w", err) } i.NeedName = value case "need_phone_number": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode invoice#c19b2377: field need_phone_number: %w", err) + return fmt.Errorf("unable to decode invoice#67dc0e89: field need_phone_number: %w", err) } i.NeedPhoneNumber = value case "need_email_address": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode invoice#c19b2377: field need_email_address: %w", err) + return fmt.Errorf("unable to decode invoice#67dc0e89: field need_email_address: %w", err) } i.NeedEmailAddress = value case "need_shipping_address": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode invoice#c19b2377: field need_shipping_address: %w", err) + return fmt.Errorf("unable to decode invoice#67dc0e89: field need_shipping_address: %w", err) } i.NeedShippingAddress = value case "send_phone_number_to_provider": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode invoice#c19b2377: field send_phone_number_to_provider: %w", err) + return fmt.Errorf("unable to decode invoice#67dc0e89: field send_phone_number_to_provider: %w", err) } i.SendPhoneNumberToProvider = value case "send_email_address_to_provider": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode invoice#c19b2377: field send_email_address_to_provider: %w", err) + return fmt.Errorf("unable to decode invoice#67dc0e89: field send_email_address_to_provider: %w", err) } i.SendEmailAddressToProvider = value case "is_flexible": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode invoice#c19b2377: field is_flexible: %w", err) + return fmt.Errorf("unable to decode invoice#67dc0e89: field is_flexible: %w", err) } i.IsFlexible = value default: @@ -593,6 +620,14 @@ func (i *Invoice) GetPriceParts() (value []LabeledPricePart) { return i.PriceParts } +// GetSubscriptionPeriod returns value of SubscriptionPeriod field. +func (i *Invoice) GetSubscriptionPeriod() (value int32) { + if i == nil { + return + } + return i.SubscriptionPeriod +} + // GetMaxTipAmount returns value of MaxTipAmount field. func (i *Invoice) GetMaxTipAmount() (value int64) { if i == nil { diff --git a/tdapi/tl_main_web_app_gen.go b/tdapi/tl_main_web_app_gen.go index 83d1ff457..414a737a5 100644 --- a/tdapi/tl_main_web_app_gen.go +++ b/tdapi/tl_main_web_app_gen.go @@ -31,17 +31,16 @@ var ( _ = tdjson.Encoder{} ) -// MainWebApp represents TL type `mainWebApp#4fb068f1`. +// MainWebApp represents TL type `mainWebApp#73a7ac7a`. type MainWebApp struct { // URL of the Web App to open URL string - // True, if the Web App must always be opened in the compact mode instead of the - // full-size mode - IsCompact bool + // The mode in which the Web App must be opened + Mode WebAppOpenModeClass } // MainWebAppTypeID is TL type id of MainWebApp. -const MainWebAppTypeID = 0x4fb068f1 +const MainWebAppTypeID = 0x73a7ac7a // Ensuring interfaces in compile-time for MainWebApp. var ( @@ -58,7 +57,7 @@ func (m *MainWebApp) Zero() bool { if !(m.URL == "") { return false } - if !(m.IsCompact == false) { + if !(m.Mode == nil) { return false } @@ -102,8 +101,8 @@ func (m *MainWebApp) TypeInfo() tdp.Type { SchemaName: "url", }, { - Name: "IsCompact", - SchemaName: "is_compact", + Name: "Mode", + SchemaName: "mode", }, } return typ @@ -112,7 +111,7 @@ func (m *MainWebApp) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (m *MainWebApp) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode mainWebApp#4fb068f1 as nil") + return fmt.Errorf("can't encode mainWebApp#73a7ac7a as nil") } b.PutID(MainWebAppTypeID) return m.EncodeBare(b) @@ -121,20 +120,25 @@ func (m *MainWebApp) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (m *MainWebApp) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode mainWebApp#4fb068f1 as nil") + return fmt.Errorf("can't encode mainWebApp#73a7ac7a as nil") } b.PutString(m.URL) - b.PutBool(m.IsCompact) + if m.Mode == nil { + return fmt.Errorf("unable to encode mainWebApp#73a7ac7a: field mode is nil") + } + if err := m.Mode.Encode(b); err != nil { + return fmt.Errorf("unable to encode mainWebApp#73a7ac7a: field mode: %w", err) + } return nil } // Decode implements bin.Decoder. func (m *MainWebApp) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode mainWebApp#4fb068f1 to nil") + return fmt.Errorf("can't decode mainWebApp#73a7ac7a to nil") } if err := b.ConsumeID(MainWebAppTypeID); err != nil { - return fmt.Errorf("unable to decode mainWebApp#4fb068f1: %w", err) + return fmt.Errorf("unable to decode mainWebApp#73a7ac7a: %w", err) } return m.DecodeBare(b) } @@ -142,21 +146,21 @@ func (m *MainWebApp) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (m *MainWebApp) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode mainWebApp#4fb068f1 to nil") + return fmt.Errorf("can't decode mainWebApp#73a7ac7a to nil") } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode mainWebApp#4fb068f1: field url: %w", err) + return fmt.Errorf("unable to decode mainWebApp#73a7ac7a: field url: %w", err) } m.URL = value } { - value, err := b.Bool() + value, err := DecodeWebAppOpenMode(b) if err != nil { - return fmt.Errorf("unable to decode mainWebApp#4fb068f1: field is_compact: %w", err) + return fmt.Errorf("unable to decode mainWebApp#73a7ac7a: field mode: %w", err) } - m.IsCompact = value + m.Mode = value } return nil } @@ -164,7 +168,7 @@ func (m *MainWebApp) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (m *MainWebApp) EncodeTDLibJSON(b tdjson.Encoder) error { if m == nil { - return fmt.Errorf("can't encode mainWebApp#4fb068f1 as nil") + return fmt.Errorf("can't encode mainWebApp#73a7ac7a as nil") } b.ObjStart() b.PutID("mainWebApp") @@ -172,8 +176,13 @@ func (m *MainWebApp) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("url") b.PutString(m.URL) b.Comma() - b.FieldStart("is_compact") - b.PutBool(m.IsCompact) + b.FieldStart("mode") + if m.Mode == nil { + return fmt.Errorf("unable to encode mainWebApp#73a7ac7a: field mode is nil") + } + if err := m.Mode.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode mainWebApp#73a7ac7a: field mode: %w", err) + } b.Comma() b.StripComma() b.ObjEnd() @@ -183,27 +192,27 @@ func (m *MainWebApp) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (m *MainWebApp) DecodeTDLibJSON(b tdjson.Decoder) error { if m == nil { - return fmt.Errorf("can't decode mainWebApp#4fb068f1 to nil") + return fmt.Errorf("can't decode mainWebApp#73a7ac7a to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("mainWebApp"); err != nil { - return fmt.Errorf("unable to decode mainWebApp#4fb068f1: %w", err) + return fmt.Errorf("unable to decode mainWebApp#73a7ac7a: %w", err) } case "url": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode mainWebApp#4fb068f1: field url: %w", err) + return fmt.Errorf("unable to decode mainWebApp#73a7ac7a: field url: %w", err) } m.URL = value - case "is_compact": - value, err := b.Bool() + case "mode": + value, err := DecodeTDLibJSONWebAppOpenMode(b) if err != nil { - return fmt.Errorf("unable to decode mainWebApp#4fb068f1: field is_compact: %w", err) + return fmt.Errorf("unable to decode mainWebApp#73a7ac7a: field mode: %w", err) } - m.IsCompact = value + m.Mode = value default: return b.Skip() } @@ -219,10 +228,10 @@ func (m *MainWebApp) GetURL() (value string) { return m.URL } -// GetIsCompact returns value of IsCompact field. -func (m *MainWebApp) GetIsCompact() (value bool) { +// GetMode returns value of Mode field. +func (m *MainWebApp) GetMode() (value WebAppOpenModeClass) { if m == nil { return } - return m.IsCompact + return m.Mode } diff --git a/tdapi/tl_message_content_gen.go b/tdapi/tl_message_content_gen.go index 9c2e67b57..e7e8d17fa 100644 --- a/tdapi/tl_message_content_gen.go +++ b/tdapi/tl_message_content_gen.go @@ -10555,7 +10555,7 @@ func (m *MessageGameScore) GetScore() (value int32) { return m.Score } -// MessagePaymentSuccessful represents TL type `messagePaymentSuccessful#53d93cdc`. +// MessagePaymentSuccessful represents TL type `messagePaymentSuccessful#3e661911`. type MessagePaymentSuccessful struct { // Identifier of the chat, containing the corresponding invoice message InvoiceChatID int64 @@ -10566,6 +10566,9 @@ type MessagePaymentSuccessful struct { Currency string // Total price for the product, in the smallest units of the currency TotalAmount int64 + // Point in time (Unix timestamp) when the subscription will expire; 0 if unknown or the + // payment isn't recurring + SubscriptionUntilDate int32 // True, if this is a recurring payment IsRecurring bool // True, if this is the first recurring payment @@ -10575,7 +10578,7 @@ type MessagePaymentSuccessful struct { } // MessagePaymentSuccessfulTypeID is TL type id of MessagePaymentSuccessful. -const MessagePaymentSuccessfulTypeID = 0x53d93cdc +const MessagePaymentSuccessfulTypeID = 0x3e661911 // construct implements constructor of MessageContentClass. func (m MessagePaymentSuccessful) construct() MessageContentClass { return &m } @@ -10606,6 +10609,9 @@ func (m *MessagePaymentSuccessful) Zero() bool { if !(m.TotalAmount == 0) { return false } + if !(m.SubscriptionUntilDate == 0) { + return false + } if !(m.IsRecurring == false) { return false } @@ -10667,6 +10673,10 @@ func (m *MessagePaymentSuccessful) TypeInfo() tdp.Type { Name: "TotalAmount", SchemaName: "total_amount", }, + { + Name: "SubscriptionUntilDate", + SchemaName: "subscription_until_date", + }, { Name: "IsRecurring", SchemaName: "is_recurring", @@ -10686,7 +10696,7 @@ func (m *MessagePaymentSuccessful) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (m *MessagePaymentSuccessful) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messagePaymentSuccessful#53d93cdc as nil") + return fmt.Errorf("can't encode messagePaymentSuccessful#3e661911 as nil") } b.PutID(MessagePaymentSuccessfulTypeID) return m.EncodeBare(b) @@ -10695,12 +10705,13 @@ func (m *MessagePaymentSuccessful) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (m *MessagePaymentSuccessful) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messagePaymentSuccessful#53d93cdc as nil") + return fmt.Errorf("can't encode messagePaymentSuccessful#3e661911 as nil") } b.PutInt53(m.InvoiceChatID) b.PutInt53(m.InvoiceMessageID) b.PutString(m.Currency) b.PutInt53(m.TotalAmount) + b.PutInt32(m.SubscriptionUntilDate) b.PutBool(m.IsRecurring) b.PutBool(m.IsFirstRecurring) b.PutString(m.InvoiceName) @@ -10710,10 +10721,10 @@ func (m *MessagePaymentSuccessful) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (m *MessagePaymentSuccessful) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messagePaymentSuccessful#53d93cdc to nil") + return fmt.Errorf("can't decode messagePaymentSuccessful#3e661911 to nil") } if err := b.ConsumeID(MessagePaymentSuccessfulTypeID); err != nil { - return fmt.Errorf("unable to decode messagePaymentSuccessful#53d93cdc: %w", err) + return fmt.Errorf("unable to decode messagePaymentSuccessful#3e661911: %w", err) } return m.DecodeBare(b) } @@ -10721,54 +10732,61 @@ func (m *MessagePaymentSuccessful) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (m *MessagePaymentSuccessful) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messagePaymentSuccessful#53d93cdc to nil") + return fmt.Errorf("can't decode messagePaymentSuccessful#3e661911 to nil") } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode messagePaymentSuccessful#53d93cdc: field invoice_chat_id: %w", err) + return fmt.Errorf("unable to decode messagePaymentSuccessful#3e661911: field invoice_chat_id: %w", err) } m.InvoiceChatID = value } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode messagePaymentSuccessful#53d93cdc: field invoice_message_id: %w", err) + return fmt.Errorf("unable to decode messagePaymentSuccessful#3e661911: field invoice_message_id: %w", err) } m.InvoiceMessageID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode messagePaymentSuccessful#53d93cdc: field currency: %w", err) + return fmt.Errorf("unable to decode messagePaymentSuccessful#3e661911: field currency: %w", err) } m.Currency = value } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode messagePaymentSuccessful#53d93cdc: field total_amount: %w", err) + return fmt.Errorf("unable to decode messagePaymentSuccessful#3e661911: field total_amount: %w", err) } m.TotalAmount = value } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode messagePaymentSuccessful#3e661911: field subscription_until_date: %w", err) + } + m.SubscriptionUntilDate = value + } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode messagePaymentSuccessful#53d93cdc: field is_recurring: %w", err) + return fmt.Errorf("unable to decode messagePaymentSuccessful#3e661911: field is_recurring: %w", err) } m.IsRecurring = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode messagePaymentSuccessful#53d93cdc: field is_first_recurring: %w", err) + return fmt.Errorf("unable to decode messagePaymentSuccessful#3e661911: field is_first_recurring: %w", err) } m.IsFirstRecurring = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode messagePaymentSuccessful#53d93cdc: field invoice_name: %w", err) + return fmt.Errorf("unable to decode messagePaymentSuccessful#3e661911: field invoice_name: %w", err) } m.InvoiceName = value } @@ -10778,7 +10796,7 @@ func (m *MessagePaymentSuccessful) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (m *MessagePaymentSuccessful) EncodeTDLibJSON(b tdjson.Encoder) error { if m == nil { - return fmt.Errorf("can't encode messagePaymentSuccessful#53d93cdc as nil") + return fmt.Errorf("can't encode messagePaymentSuccessful#3e661911 as nil") } b.ObjStart() b.PutID("messagePaymentSuccessful") @@ -10795,6 +10813,9 @@ func (m *MessagePaymentSuccessful) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("total_amount") b.PutInt53(m.TotalAmount) b.Comma() + b.FieldStart("subscription_until_date") + b.PutInt32(m.SubscriptionUntilDate) + b.Comma() b.FieldStart("is_recurring") b.PutBool(m.IsRecurring) b.Comma() @@ -10812,55 +10833,61 @@ func (m *MessagePaymentSuccessful) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (m *MessagePaymentSuccessful) DecodeTDLibJSON(b tdjson.Decoder) error { if m == nil { - return fmt.Errorf("can't decode messagePaymentSuccessful#53d93cdc to nil") + return fmt.Errorf("can't decode messagePaymentSuccessful#3e661911 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("messagePaymentSuccessful"); err != nil { - return fmt.Errorf("unable to decode messagePaymentSuccessful#53d93cdc: %w", err) + return fmt.Errorf("unable to decode messagePaymentSuccessful#3e661911: %w", err) } case "invoice_chat_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode messagePaymentSuccessful#53d93cdc: field invoice_chat_id: %w", err) + return fmt.Errorf("unable to decode messagePaymentSuccessful#3e661911: field invoice_chat_id: %w", err) } m.InvoiceChatID = value case "invoice_message_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode messagePaymentSuccessful#53d93cdc: field invoice_message_id: %w", err) + return fmt.Errorf("unable to decode messagePaymentSuccessful#3e661911: field invoice_message_id: %w", err) } m.InvoiceMessageID = value case "currency": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode messagePaymentSuccessful#53d93cdc: field currency: %w", err) + return fmt.Errorf("unable to decode messagePaymentSuccessful#3e661911: field currency: %w", err) } m.Currency = value case "total_amount": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode messagePaymentSuccessful#53d93cdc: field total_amount: %w", err) + return fmt.Errorf("unable to decode messagePaymentSuccessful#3e661911: field total_amount: %w", err) } m.TotalAmount = value + case "subscription_until_date": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode messagePaymentSuccessful#3e661911: field subscription_until_date: %w", err) + } + m.SubscriptionUntilDate = value case "is_recurring": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode messagePaymentSuccessful#53d93cdc: field is_recurring: %w", err) + return fmt.Errorf("unable to decode messagePaymentSuccessful#3e661911: field is_recurring: %w", err) } m.IsRecurring = value case "is_first_recurring": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode messagePaymentSuccessful#53d93cdc: field is_first_recurring: %w", err) + return fmt.Errorf("unable to decode messagePaymentSuccessful#3e661911: field is_first_recurring: %w", err) } m.IsFirstRecurring = value case "invoice_name": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode messagePaymentSuccessful#53d93cdc: field invoice_name: %w", err) + return fmt.Errorf("unable to decode messagePaymentSuccessful#3e661911: field invoice_name: %w", err) } m.InvoiceName = value default: @@ -10902,6 +10929,14 @@ func (m *MessagePaymentSuccessful) GetTotalAmount() (value int64) { return m.TotalAmount } +// GetSubscriptionUntilDate returns value of SubscriptionUntilDate field. +func (m *MessagePaymentSuccessful) GetSubscriptionUntilDate() (value int32) { + if m == nil { + return + } + return m.SubscriptionUntilDate +} + // GetIsRecurring returns value of IsRecurring field. func (m *MessagePaymentSuccessful) GetIsRecurring() (value bool) { if m == nil { @@ -10926,21 +10961,25 @@ func (m *MessagePaymentSuccessful) GetInvoiceName() (value string) { return m.InvoiceName } -// MessagePaymentSuccessfulBot represents TL type `messagePaymentSuccessfulBot#68e13eb9`. +// MessagePaymentSuccessfulBot represents TL type `messagePaymentSuccessfulBot#c7664dbf`. type MessagePaymentSuccessfulBot struct { // Currency for price of the product Currency string // Total price for the product, in the smallest units of the currency TotalAmount int64 + // Point in time (Unix timestamp) when the subscription will expire; 0 if unknown or the + // payment isn't recurring + SubscriptionUntilDate int32 // True, if this is a recurring payment IsRecurring bool // True, if this is the first recurring payment IsFirstRecurring bool // Invoice payload InvoicePayload []byte - // Identifier of the shipping option chosen by the user; may be empty if not applicable + // Identifier of the shipping option chosen by the user; may be empty if not applicable; + // for bots only ShippingOptionID string - // Information about the order; may be null + // Information about the order; may be null; for bots only OrderInfo OrderInfo // Telegram payment identifier TelegramPaymentChargeID string @@ -10949,7 +10988,7 @@ type MessagePaymentSuccessfulBot struct { } // MessagePaymentSuccessfulBotTypeID is TL type id of MessagePaymentSuccessfulBot. -const MessagePaymentSuccessfulBotTypeID = 0x68e13eb9 +const MessagePaymentSuccessfulBotTypeID = 0xc7664dbf // construct implements constructor of MessageContentClass. func (m MessagePaymentSuccessfulBot) construct() MessageContentClass { return &m } @@ -10974,6 +11013,9 @@ func (m *MessagePaymentSuccessfulBot) Zero() bool { if !(m.TotalAmount == 0) { return false } + if !(m.SubscriptionUntilDate == 0) { + return false + } if !(m.IsRecurring == false) { return false } @@ -11039,6 +11081,10 @@ func (m *MessagePaymentSuccessfulBot) TypeInfo() tdp.Type { Name: "TotalAmount", SchemaName: "total_amount", }, + { + Name: "SubscriptionUntilDate", + SchemaName: "subscription_until_date", + }, { Name: "IsRecurring", SchemaName: "is_recurring", @@ -11074,7 +11120,7 @@ func (m *MessagePaymentSuccessfulBot) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (m *MessagePaymentSuccessfulBot) Encode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messagePaymentSuccessfulBot#68e13eb9 as nil") + return fmt.Errorf("can't encode messagePaymentSuccessfulBot#c7664dbf as nil") } b.PutID(MessagePaymentSuccessfulBotTypeID) return m.EncodeBare(b) @@ -11083,16 +11129,17 @@ func (m *MessagePaymentSuccessfulBot) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (m *MessagePaymentSuccessfulBot) EncodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't encode messagePaymentSuccessfulBot#68e13eb9 as nil") + return fmt.Errorf("can't encode messagePaymentSuccessfulBot#c7664dbf as nil") } b.PutString(m.Currency) b.PutInt53(m.TotalAmount) + b.PutInt32(m.SubscriptionUntilDate) b.PutBool(m.IsRecurring) b.PutBool(m.IsFirstRecurring) b.PutBytes(m.InvoicePayload) b.PutString(m.ShippingOptionID) if err := m.OrderInfo.Encode(b); err != nil { - return fmt.Errorf("unable to encode messagePaymentSuccessfulBot#68e13eb9: field order_info: %w", err) + return fmt.Errorf("unable to encode messagePaymentSuccessfulBot#c7664dbf: field order_info: %w", err) } b.PutString(m.TelegramPaymentChargeID) b.PutString(m.ProviderPaymentChargeID) @@ -11102,10 +11149,10 @@ func (m *MessagePaymentSuccessfulBot) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (m *MessagePaymentSuccessfulBot) Decode(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messagePaymentSuccessfulBot#68e13eb9 to nil") + return fmt.Errorf("can't decode messagePaymentSuccessfulBot#c7664dbf to nil") } if err := b.ConsumeID(MessagePaymentSuccessfulBotTypeID); err != nil { - return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#68e13eb9: %w", err) + return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#c7664dbf: %w", err) } return m.DecodeBare(b) } @@ -11113,66 +11160,73 @@ func (m *MessagePaymentSuccessfulBot) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (m *MessagePaymentSuccessfulBot) DecodeBare(b *bin.Buffer) error { if m == nil { - return fmt.Errorf("can't decode messagePaymentSuccessfulBot#68e13eb9 to nil") + return fmt.Errorf("can't decode messagePaymentSuccessfulBot#c7664dbf to nil") } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#68e13eb9: field currency: %w", err) + return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#c7664dbf: field currency: %w", err) } m.Currency = value } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#68e13eb9: field total_amount: %w", err) + return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#c7664dbf: field total_amount: %w", err) } m.TotalAmount = value } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#c7664dbf: field subscription_until_date: %w", err) + } + m.SubscriptionUntilDate = value + } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#68e13eb9: field is_recurring: %w", err) + return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#c7664dbf: field is_recurring: %w", err) } m.IsRecurring = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#68e13eb9: field is_first_recurring: %w", err) + return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#c7664dbf: field is_first_recurring: %w", err) } m.IsFirstRecurring = value } { value, err := b.Bytes() if err != nil { - return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#68e13eb9: field invoice_payload: %w", err) + return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#c7664dbf: field invoice_payload: %w", err) } m.InvoicePayload = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#68e13eb9: field shipping_option_id: %w", err) + return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#c7664dbf: field shipping_option_id: %w", err) } m.ShippingOptionID = value } { if err := m.OrderInfo.Decode(b); err != nil { - return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#68e13eb9: field order_info: %w", err) + return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#c7664dbf: field order_info: %w", err) } } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#68e13eb9: field telegram_payment_charge_id: %w", err) + return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#c7664dbf: field telegram_payment_charge_id: %w", err) } m.TelegramPaymentChargeID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#68e13eb9: field provider_payment_charge_id: %w", err) + return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#c7664dbf: field provider_payment_charge_id: %w", err) } m.ProviderPaymentChargeID = value } @@ -11182,7 +11236,7 @@ func (m *MessagePaymentSuccessfulBot) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (m *MessagePaymentSuccessfulBot) EncodeTDLibJSON(b tdjson.Encoder) error { if m == nil { - return fmt.Errorf("can't encode messagePaymentSuccessfulBot#68e13eb9 as nil") + return fmt.Errorf("can't encode messagePaymentSuccessfulBot#c7664dbf as nil") } b.ObjStart() b.PutID("messagePaymentSuccessfulBot") @@ -11193,6 +11247,9 @@ func (m *MessagePaymentSuccessfulBot) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("total_amount") b.PutInt53(m.TotalAmount) b.Comma() + b.FieldStart("subscription_until_date") + b.PutInt32(m.SubscriptionUntilDate) + b.Comma() b.FieldStart("is_recurring") b.PutBool(m.IsRecurring) b.Comma() @@ -11207,7 +11264,7 @@ func (m *MessagePaymentSuccessfulBot) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("order_info") if err := m.OrderInfo.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode messagePaymentSuccessfulBot#68e13eb9: field order_info: %w", err) + return fmt.Errorf("unable to encode messagePaymentSuccessfulBot#c7664dbf: field order_info: %w", err) } b.Comma() b.FieldStart("telegram_payment_charge_id") @@ -11224,65 +11281,71 @@ func (m *MessagePaymentSuccessfulBot) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (m *MessagePaymentSuccessfulBot) DecodeTDLibJSON(b tdjson.Decoder) error { if m == nil { - return fmt.Errorf("can't decode messagePaymentSuccessfulBot#68e13eb9 to nil") + return fmt.Errorf("can't decode messagePaymentSuccessfulBot#c7664dbf to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("messagePaymentSuccessfulBot"); err != nil { - return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#68e13eb9: %w", err) + return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#c7664dbf: %w", err) } case "currency": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#68e13eb9: field currency: %w", err) + return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#c7664dbf: field currency: %w", err) } m.Currency = value case "total_amount": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#68e13eb9: field total_amount: %w", err) + return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#c7664dbf: field total_amount: %w", err) } m.TotalAmount = value + case "subscription_until_date": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#c7664dbf: field subscription_until_date: %w", err) + } + m.SubscriptionUntilDate = value case "is_recurring": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#68e13eb9: field is_recurring: %w", err) + return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#c7664dbf: field is_recurring: %w", err) } m.IsRecurring = value case "is_first_recurring": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#68e13eb9: field is_first_recurring: %w", err) + return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#c7664dbf: field is_first_recurring: %w", err) } m.IsFirstRecurring = value case "invoice_payload": value, err := b.Bytes() if err != nil { - return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#68e13eb9: field invoice_payload: %w", err) + return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#c7664dbf: field invoice_payload: %w", err) } m.InvoicePayload = value case "shipping_option_id": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#68e13eb9: field shipping_option_id: %w", err) + return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#c7664dbf: field shipping_option_id: %w", err) } m.ShippingOptionID = value case "order_info": if err := m.OrderInfo.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#68e13eb9: field order_info: %w", err) + return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#c7664dbf: field order_info: %w", err) } case "telegram_payment_charge_id": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#68e13eb9: field telegram_payment_charge_id: %w", err) + return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#c7664dbf: field telegram_payment_charge_id: %w", err) } m.TelegramPaymentChargeID = value case "provider_payment_charge_id": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#68e13eb9: field provider_payment_charge_id: %w", err) + return fmt.Errorf("unable to decode messagePaymentSuccessfulBot#c7664dbf: field provider_payment_charge_id: %w", err) } m.ProviderPaymentChargeID = value default: @@ -11308,6 +11371,14 @@ func (m *MessagePaymentSuccessfulBot) GetTotalAmount() (value int64) { return m.TotalAmount } +// GetSubscriptionUntilDate returns value of SubscriptionUntilDate field. +func (m *MessagePaymentSuccessfulBot) GetSubscriptionUntilDate() (value int32) { + if m == nil { + return + } + return m.SubscriptionUntilDate +} + // GetIsRecurring returns value of IsRecurring field. func (m *MessagePaymentSuccessfulBot) GetIsRecurring() (value bool) { if m == nil { @@ -14705,7 +14776,8 @@ type MessageGift struct { Gift Gift // Message added to the gift Text FormattedText - // Number of Telegram Stars that can be claimed by the receiver instead of the gift + // Number of Telegram Stars that can be claimed by the receiver instead of the gift; 0 if + // the gift can't be sold by the receiver SellStarCount int64 // True, if the sender and gift text are shown only to the gift receiver; otherwise, // everyone will be able to see them @@ -17015,8 +17087,8 @@ const MessageContentClassName = "MessageContent" // case *tdapi.MessageSuggestProfilePhoto: // messageSuggestProfilePhoto#b5611ee7 // case *tdapi.MessageCustomServiceAction: // messageCustomServiceAction#5595c772 // case *tdapi.MessageGameScore: // messageGameScore#50299d7f -// case *tdapi.MessagePaymentSuccessful: // messagePaymentSuccessful#53d93cdc -// case *tdapi.MessagePaymentSuccessfulBot: // messagePaymentSuccessfulBot#68e13eb9 +// case *tdapi.MessagePaymentSuccessful: // messagePaymentSuccessful#3e661911 +// case *tdapi.MessagePaymentSuccessfulBot: // messagePaymentSuccessfulBot#c7664dbf // case *tdapi.MessagePaymentRefunded: // messagePaymentRefunded#11bcb8f3 // case *tdapi.MessageGiftedPremium: // messageGiftedPremium#e4d0e07a // case *tdapi.MessagePremiumGiftCode: // messagePremiumGiftCode#29d22e4e @@ -17433,14 +17505,14 @@ func DecodeMessageContent(buf *bin.Buffer) (MessageContentClass, error) { } return &v, nil case MessagePaymentSuccessfulTypeID: - // Decoding messagePaymentSuccessful#53d93cdc. + // Decoding messagePaymentSuccessful#3e661911. v := MessagePaymentSuccessful{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode MessageContentClass: %w", err) } return &v, nil case MessagePaymentSuccessfulBotTypeID: - // Decoding messagePaymentSuccessfulBot#68e13eb9. + // Decoding messagePaymentSuccessfulBot#c7664dbf. v := MessagePaymentSuccessfulBot{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode MessageContentClass: %w", err) @@ -17963,14 +18035,14 @@ func DecodeTDLibJSONMessageContent(buf tdjson.Decoder) (MessageContentClass, err } return &v, nil case "messagePaymentSuccessful": - // Decoding messagePaymentSuccessful#53d93cdc. + // Decoding messagePaymentSuccessful#3e661911. v := MessagePaymentSuccessful{} if err := v.DecodeTDLibJSON(buf); err != nil { return nil, fmt.Errorf("unable to decode MessageContentClass: %w", err) } return &v, nil case "messagePaymentSuccessfulBot": - // Decoding messagePaymentSuccessfulBot#68e13eb9. + // Decoding messagePaymentSuccessfulBot#c7664dbf. v := MessagePaymentSuccessfulBot{} if err := v.DecodeTDLibJSON(buf); err != nil { return nil, fmt.Errorf("unable to decode MessageContentClass: %w", err) diff --git a/tdapi/tl_open_web_app_gen.go b/tdapi/tl_open_web_app_gen.go index 3834ab8ba..f69b6d308 100644 --- a/tdapi/tl_open_web_app_gen.go +++ b/tdapi/tl_open_web_app_gen.go @@ -31,7 +31,7 @@ var ( _ = tdjson.Encoder{} ) -// OpenWebAppRequest represents TL type `openWebApp#b02666b0`. +// OpenWebAppRequest represents TL type `openWebApp#278173a2`. type OpenWebAppRequest struct { // Identifier of the chat in which the Web App is opened. The Web App can't be opened in // secret chats @@ -41,19 +41,17 @@ type OpenWebAppRequest struct { // The URL from an inlineKeyboardButtonTypeWebApp button, a botMenuButton button, an // internalLinkTypeAttachmentMenuBot link, or an empty string otherwise URL string - // Preferred Web App theme; pass null to use the default theme - Theme ThemeParameters - // Short name of the current application; 0-64 English letters, digits, and underscores - ApplicationName string // If not 0, the message thread identifier in which the message will be sent MessageThreadID int64 // Information about the message or story to be replied in the message sent by the Web // App; pass null if none ReplyTo InputMessageReplyToClass + // Parameters to use to open the Web App + Parameters WebAppOpenParameters } // OpenWebAppRequestTypeID is TL type id of OpenWebAppRequest. -const OpenWebAppRequestTypeID = 0xb02666b0 +const OpenWebAppRequestTypeID = 0x278173a2 // Ensuring interfaces in compile-time for OpenWebAppRequest. var ( @@ -76,18 +74,15 @@ func (o *OpenWebAppRequest) Zero() bool { if !(o.URL == "") { return false } - if !(o.Theme.Zero()) { - return false - } - if !(o.ApplicationName == "") { - return false - } if !(o.MessageThreadID == 0) { return false } if !(o.ReplyTo == nil) { return false } + if !(o.Parameters.Zero()) { + return false + } return true } @@ -136,14 +131,6 @@ func (o *OpenWebAppRequest) TypeInfo() tdp.Type { Name: "URL", SchemaName: "url", }, - { - Name: "Theme", - SchemaName: "theme", - }, - { - Name: "ApplicationName", - SchemaName: "application_name", - }, { Name: "MessageThreadID", SchemaName: "message_thread_id", @@ -152,6 +139,10 @@ func (o *OpenWebAppRequest) TypeInfo() tdp.Type { Name: "ReplyTo", SchemaName: "reply_to", }, + { + Name: "Parameters", + SchemaName: "parameters", + }, } return typ } @@ -159,7 +150,7 @@ func (o *OpenWebAppRequest) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (o *OpenWebAppRequest) Encode(b *bin.Buffer) error { if o == nil { - return fmt.Errorf("can't encode openWebApp#b02666b0 as nil") + return fmt.Errorf("can't encode openWebApp#278173a2 as nil") } b.PutID(OpenWebAppRequestTypeID) return o.EncodeBare(b) @@ -168,21 +159,20 @@ func (o *OpenWebAppRequest) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (o *OpenWebAppRequest) EncodeBare(b *bin.Buffer) error { if o == nil { - return fmt.Errorf("can't encode openWebApp#b02666b0 as nil") + return fmt.Errorf("can't encode openWebApp#278173a2 as nil") } b.PutInt53(o.ChatID) b.PutInt53(o.BotUserID) b.PutString(o.URL) - if err := o.Theme.Encode(b); err != nil { - return fmt.Errorf("unable to encode openWebApp#b02666b0: field theme: %w", err) - } - b.PutString(o.ApplicationName) b.PutInt53(o.MessageThreadID) if o.ReplyTo == nil { - return fmt.Errorf("unable to encode openWebApp#b02666b0: field reply_to is nil") + return fmt.Errorf("unable to encode openWebApp#278173a2: field reply_to is nil") } if err := o.ReplyTo.Encode(b); err != nil { - return fmt.Errorf("unable to encode openWebApp#b02666b0: field reply_to: %w", err) + return fmt.Errorf("unable to encode openWebApp#278173a2: field reply_to: %w", err) + } + if err := o.Parameters.Encode(b); err != nil { + return fmt.Errorf("unable to encode openWebApp#278173a2: field parameters: %w", err) } return nil } @@ -190,10 +180,10 @@ func (o *OpenWebAppRequest) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (o *OpenWebAppRequest) Decode(b *bin.Buffer) error { if o == nil { - return fmt.Errorf("can't decode openWebApp#b02666b0 to nil") + return fmt.Errorf("can't decode openWebApp#278173a2 to nil") } if err := b.ConsumeID(OpenWebAppRequestTypeID); err != nil { - return fmt.Errorf("unable to decode openWebApp#b02666b0: %w", err) + return fmt.Errorf("unable to decode openWebApp#278173a2: %w", err) } return o.DecodeBare(b) } @@ -201,62 +191,55 @@ func (o *OpenWebAppRequest) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (o *OpenWebAppRequest) DecodeBare(b *bin.Buffer) error { if o == nil { - return fmt.Errorf("can't decode openWebApp#b02666b0 to nil") + return fmt.Errorf("can't decode openWebApp#278173a2 to nil") } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode openWebApp#b02666b0: field chat_id: %w", err) + return fmt.Errorf("unable to decode openWebApp#278173a2: field chat_id: %w", err) } o.ChatID = value } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode openWebApp#b02666b0: field bot_user_id: %w", err) + return fmt.Errorf("unable to decode openWebApp#278173a2: field bot_user_id: %w", err) } o.BotUserID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode openWebApp#b02666b0: field url: %w", err) + return fmt.Errorf("unable to decode openWebApp#278173a2: field url: %w", err) } o.URL = value } - { - if err := o.Theme.Decode(b); err != nil { - return fmt.Errorf("unable to decode openWebApp#b02666b0: field theme: %w", err) - } - } - { - value, err := b.String() - if err != nil { - return fmt.Errorf("unable to decode openWebApp#b02666b0: field application_name: %w", err) - } - o.ApplicationName = value - } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode openWebApp#b02666b0: field message_thread_id: %w", err) + return fmt.Errorf("unable to decode openWebApp#278173a2: field message_thread_id: %w", err) } o.MessageThreadID = value } { value, err := DecodeInputMessageReplyTo(b) if err != nil { - return fmt.Errorf("unable to decode openWebApp#b02666b0: field reply_to: %w", err) + return fmt.Errorf("unable to decode openWebApp#278173a2: field reply_to: %w", err) } o.ReplyTo = value } + { + if err := o.Parameters.Decode(b); err != nil { + return fmt.Errorf("unable to decode openWebApp#278173a2: field parameters: %w", err) + } + } return nil } // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (o *OpenWebAppRequest) EncodeTDLibJSON(b tdjson.Encoder) error { if o == nil { - return fmt.Errorf("can't encode openWebApp#b02666b0 as nil") + return fmt.Errorf("can't encode openWebApp#278173a2 as nil") } b.ObjStart() b.PutID("openWebApp") @@ -270,23 +253,20 @@ func (o *OpenWebAppRequest) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("url") b.PutString(o.URL) b.Comma() - b.FieldStart("theme") - if err := o.Theme.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode openWebApp#b02666b0: field theme: %w", err) - } - b.Comma() - b.FieldStart("application_name") - b.PutString(o.ApplicationName) - b.Comma() b.FieldStart("message_thread_id") b.PutInt53(o.MessageThreadID) b.Comma() b.FieldStart("reply_to") if o.ReplyTo == nil { - return fmt.Errorf("unable to encode openWebApp#b02666b0: field reply_to is nil") + return fmt.Errorf("unable to encode openWebApp#278173a2: field reply_to is nil") } if err := o.ReplyTo.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode openWebApp#b02666b0: field reply_to: %w", err) + return fmt.Errorf("unable to encode openWebApp#278173a2: field reply_to: %w", err) + } + b.Comma() + b.FieldStart("parameters") + if err := o.Parameters.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode openWebApp#278173a2: field parameters: %w", err) } b.Comma() b.StripComma() @@ -297,55 +277,49 @@ func (o *OpenWebAppRequest) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (o *OpenWebAppRequest) DecodeTDLibJSON(b tdjson.Decoder) error { if o == nil { - return fmt.Errorf("can't decode openWebApp#b02666b0 to nil") + return fmt.Errorf("can't decode openWebApp#278173a2 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("openWebApp"); err != nil { - return fmt.Errorf("unable to decode openWebApp#b02666b0: %w", err) + return fmt.Errorf("unable to decode openWebApp#278173a2: %w", err) } case "chat_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode openWebApp#b02666b0: field chat_id: %w", err) + return fmt.Errorf("unable to decode openWebApp#278173a2: field chat_id: %w", err) } o.ChatID = value case "bot_user_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode openWebApp#b02666b0: field bot_user_id: %w", err) + return fmt.Errorf("unable to decode openWebApp#278173a2: field bot_user_id: %w", err) } o.BotUserID = value case "url": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode openWebApp#b02666b0: field url: %w", err) + return fmt.Errorf("unable to decode openWebApp#278173a2: field url: %w", err) } o.URL = value - case "theme": - if err := o.Theme.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode openWebApp#b02666b0: field theme: %w", err) - } - case "application_name": - value, err := b.String() - if err != nil { - return fmt.Errorf("unable to decode openWebApp#b02666b0: field application_name: %w", err) - } - o.ApplicationName = value case "message_thread_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode openWebApp#b02666b0: field message_thread_id: %w", err) + return fmt.Errorf("unable to decode openWebApp#278173a2: field message_thread_id: %w", err) } o.MessageThreadID = value case "reply_to": value, err := DecodeTDLibJSONInputMessageReplyTo(b) if err != nil { - return fmt.Errorf("unable to decode openWebApp#b02666b0: field reply_to: %w", err) + return fmt.Errorf("unable to decode openWebApp#278173a2: field reply_to: %w", err) } o.ReplyTo = value + case "parameters": + if err := o.Parameters.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode openWebApp#278173a2: field parameters: %w", err) + } default: return b.Skip() } @@ -377,22 +351,6 @@ func (o *OpenWebAppRequest) GetURL() (value string) { return o.URL } -// GetTheme returns value of Theme field. -func (o *OpenWebAppRequest) GetTheme() (value ThemeParameters) { - if o == nil { - return - } - return o.Theme -} - -// GetApplicationName returns value of ApplicationName field. -func (o *OpenWebAppRequest) GetApplicationName() (value string) { - if o == nil { - return - } - return o.ApplicationName -} - // GetMessageThreadID returns value of MessageThreadID field. func (o *OpenWebAppRequest) GetMessageThreadID() (value int64) { if o == nil { @@ -409,7 +367,15 @@ func (o *OpenWebAppRequest) GetReplyTo() (value InputMessageReplyToClass) { return o.ReplyTo } -// OpenWebApp invokes method openWebApp#b02666b0 returning error if any. +// GetParameters returns value of Parameters field. +func (o *OpenWebAppRequest) GetParameters() (value WebAppOpenParameters) { + if o == nil { + return + } + return o.Parameters +} + +// OpenWebApp invokes method openWebApp#278173a2 returning error if any. func (c *Client) OpenWebApp(ctx context.Context, request *OpenWebAppRequest) (*WebAppInfo, error) { var result WebAppInfo diff --git a/tdapi/tl_outline_gen.go b/tdapi/tl_outline_gen.go new file mode 100644 index 000000000..81fd8e260 --- /dev/null +++ b/tdapi/tl_outline_gen.go @@ -0,0 +1,221 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tdapi + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// Outline represents TL type `outline#7d2ec0be`. +type Outline struct { + // The list of closed vector paths + Paths []ClosedVectorPath +} + +// OutlineTypeID is TL type id of Outline. +const OutlineTypeID = 0x7d2ec0be + +// Ensuring interfaces in compile-time for Outline. +var ( + _ bin.Encoder = &Outline{} + _ bin.Decoder = &Outline{} + _ bin.BareEncoder = &Outline{} + _ bin.BareDecoder = &Outline{} +) + +func (o *Outline) Zero() bool { + if o == nil { + return true + } + if !(o.Paths == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (o *Outline) String() string { + if o == nil { + return "Outline(nil)" + } + type Alias Outline + return fmt.Sprintf("Outline%+v", Alias(*o)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*Outline) TypeID() uint32 { + return OutlineTypeID +} + +// TypeName returns name of type in TL schema. +func (*Outline) TypeName() string { + return "outline" +} + +// TypeInfo returns info about TL type. +func (o *Outline) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "outline", + ID: OutlineTypeID, + } + if o == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Paths", + SchemaName: "paths", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (o *Outline) Encode(b *bin.Buffer) error { + if o == nil { + return fmt.Errorf("can't encode outline#7d2ec0be as nil") + } + b.PutID(OutlineTypeID) + return o.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (o *Outline) EncodeBare(b *bin.Buffer) error { + if o == nil { + return fmt.Errorf("can't encode outline#7d2ec0be as nil") + } + b.PutInt(len(o.Paths)) + for idx, v := range o.Paths { + if err := v.EncodeBare(b); err != nil { + return fmt.Errorf("unable to encode bare outline#7d2ec0be: field paths element with index %d: %w", idx, err) + } + } + return nil +} + +// Decode implements bin.Decoder. +func (o *Outline) Decode(b *bin.Buffer) error { + if o == nil { + return fmt.Errorf("can't decode outline#7d2ec0be to nil") + } + if err := b.ConsumeID(OutlineTypeID); err != nil { + return fmt.Errorf("unable to decode outline#7d2ec0be: %w", err) + } + return o.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (o *Outline) DecodeBare(b *bin.Buffer) error { + if o == nil { + return fmt.Errorf("can't decode outline#7d2ec0be to nil") + } + { + headerLen, err := b.Int() + if err != nil { + return fmt.Errorf("unable to decode outline#7d2ec0be: field paths: %w", err) + } + + if headerLen > 0 { + o.Paths = make([]ClosedVectorPath, 0, headerLen%bin.PreallocateLimit) + } + for idx := 0; idx < headerLen; idx++ { + var value ClosedVectorPath + if err := value.DecodeBare(b); err != nil { + return fmt.Errorf("unable to decode bare outline#7d2ec0be: field paths: %w", err) + } + o.Paths = append(o.Paths, value) + } + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (o *Outline) EncodeTDLibJSON(b tdjson.Encoder) error { + if o == nil { + return fmt.Errorf("can't encode outline#7d2ec0be as nil") + } + b.ObjStart() + b.PutID("outline") + b.Comma() + b.FieldStart("paths") + b.ArrStart() + for idx, v := range o.Paths { + if err := v.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode outline#7d2ec0be: field paths element with index %d: %w", idx, err) + } + b.Comma() + } + b.StripComma() + b.ArrEnd() + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (o *Outline) DecodeTDLibJSON(b tdjson.Decoder) error { + if o == nil { + return fmt.Errorf("can't decode outline#7d2ec0be to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("outline"); err != nil { + return fmt.Errorf("unable to decode outline#7d2ec0be: %w", err) + } + case "paths": + if err := b.Arr(func(b tdjson.Decoder) error { + var value ClosedVectorPath + if err := value.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode outline#7d2ec0be: field paths: %w", err) + } + o.Paths = append(o.Paths, value) + return nil + }); err != nil { + return fmt.Errorf("unable to decode outline#7d2ec0be: field paths: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetPaths returns value of Paths field. +func (o *Outline) GetPaths() (value []ClosedVectorPath) { + if o == nil { + return + } + return o.Paths +} diff --git a/tdapi/tl_payment_form_type_gen.go b/tdapi/tl_payment_form_type_gen.go index a102a3c87..49cf65b23 100644 --- a/tdapi/tl_payment_form_type_gen.go +++ b/tdapi/tl_payment_form_type_gen.go @@ -668,6 +668,172 @@ func (p *PaymentFormTypeStars) GetStarCount() (value int64) { return p.StarCount } +// PaymentFormTypeStarSubscription represents TL type `paymentFormTypeStarSubscription#102deb5b`. +type PaymentFormTypeStarSubscription struct { + // Information about subscription plan + Pricing StarSubscriptionPricing +} + +// PaymentFormTypeStarSubscriptionTypeID is TL type id of PaymentFormTypeStarSubscription. +const PaymentFormTypeStarSubscriptionTypeID = 0x102deb5b + +// construct implements constructor of PaymentFormTypeClass. +func (p PaymentFormTypeStarSubscription) construct() PaymentFormTypeClass { return &p } + +// Ensuring interfaces in compile-time for PaymentFormTypeStarSubscription. +var ( + _ bin.Encoder = &PaymentFormTypeStarSubscription{} + _ bin.Decoder = &PaymentFormTypeStarSubscription{} + _ bin.BareEncoder = &PaymentFormTypeStarSubscription{} + _ bin.BareDecoder = &PaymentFormTypeStarSubscription{} + + _ PaymentFormTypeClass = &PaymentFormTypeStarSubscription{} +) + +func (p *PaymentFormTypeStarSubscription) Zero() bool { + if p == nil { + return true + } + if !(p.Pricing.Zero()) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (p *PaymentFormTypeStarSubscription) String() string { + if p == nil { + return "PaymentFormTypeStarSubscription(nil)" + } + type Alias PaymentFormTypeStarSubscription + return fmt.Sprintf("PaymentFormTypeStarSubscription%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PaymentFormTypeStarSubscription) TypeID() uint32 { + return PaymentFormTypeStarSubscriptionTypeID +} + +// TypeName returns name of type in TL schema. +func (*PaymentFormTypeStarSubscription) TypeName() string { + return "paymentFormTypeStarSubscription" +} + +// TypeInfo returns info about TL type. +func (p *PaymentFormTypeStarSubscription) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "paymentFormTypeStarSubscription", + ID: PaymentFormTypeStarSubscriptionTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Pricing", + SchemaName: "pricing", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (p *PaymentFormTypeStarSubscription) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode paymentFormTypeStarSubscription#102deb5b as nil") + } + b.PutID(PaymentFormTypeStarSubscriptionTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PaymentFormTypeStarSubscription) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode paymentFormTypeStarSubscription#102deb5b as nil") + } + if err := p.Pricing.Encode(b); err != nil { + return fmt.Errorf("unable to encode paymentFormTypeStarSubscription#102deb5b: field pricing: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (p *PaymentFormTypeStarSubscription) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode paymentFormTypeStarSubscription#102deb5b to nil") + } + if err := b.ConsumeID(PaymentFormTypeStarSubscriptionTypeID); err != nil { + return fmt.Errorf("unable to decode paymentFormTypeStarSubscription#102deb5b: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PaymentFormTypeStarSubscription) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode paymentFormTypeStarSubscription#102deb5b to nil") + } + { + if err := p.Pricing.Decode(b); err != nil { + return fmt.Errorf("unable to decode paymentFormTypeStarSubscription#102deb5b: field pricing: %w", err) + } + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PaymentFormTypeStarSubscription) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode paymentFormTypeStarSubscription#102deb5b as nil") + } + b.ObjStart() + b.PutID("paymentFormTypeStarSubscription") + b.Comma() + b.FieldStart("pricing") + if err := p.Pricing.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode paymentFormTypeStarSubscription#102deb5b: field pricing: %w", err) + } + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PaymentFormTypeStarSubscription) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode paymentFormTypeStarSubscription#102deb5b to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("paymentFormTypeStarSubscription"); err != nil { + return fmt.Errorf("unable to decode paymentFormTypeStarSubscription#102deb5b: %w", err) + } + case "pricing": + if err := p.Pricing.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode paymentFormTypeStarSubscription#102deb5b: field pricing: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetPricing returns value of Pricing field. +func (p *PaymentFormTypeStarSubscription) GetPricing() (value StarSubscriptionPricing) { + if p == nil { + return + } + return p.Pricing +} + // PaymentFormTypeClassName is schema name of PaymentFormTypeClass. const PaymentFormTypeClassName = "PaymentFormType" @@ -682,6 +848,7 @@ const PaymentFormTypeClassName = "PaymentFormType" // switch v := g.(type) { // case *tdapi.PaymentFormTypeRegular: // paymentFormTypeRegular#ba6d2f0f // case *tdapi.PaymentFormTypeStars: // paymentFormTypeStars#56b9d3d +// case *tdapi.PaymentFormTypeStarSubscription: // paymentFormTypeStarSubscription#102deb5b // default: panic(v) // } type PaymentFormTypeClass interface { @@ -727,6 +894,13 @@ func DecodePaymentFormType(buf *bin.Buffer) (PaymentFormTypeClass, error) { return nil, fmt.Errorf("unable to decode PaymentFormTypeClass: %w", err) } return &v, nil + case PaymentFormTypeStarSubscriptionTypeID: + // Decoding paymentFormTypeStarSubscription#102deb5b. + v := PaymentFormTypeStarSubscription{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode PaymentFormTypeClass: %w", err) + } + return &v, nil default: return nil, fmt.Errorf("unable to decode PaymentFormTypeClass: %w", bin.NewUnexpectedID(id)) } @@ -753,6 +927,13 @@ func DecodeTDLibJSONPaymentFormType(buf tdjson.Decoder) (PaymentFormTypeClass, e return nil, fmt.Errorf("unable to decode PaymentFormTypeClass: %w", err) } return &v, nil + case "paymentFormTypeStarSubscription": + // Decoding paymentFormTypeStarSubscription#102deb5b. + v := PaymentFormTypeStarSubscription{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode PaymentFormTypeClass: %w", err) + } + return &v, nil default: return nil, fmt.Errorf("unable to decode PaymentFormTypeClass: %w", tdjson.NewUnexpectedID(id)) } diff --git a/tdapi/tl_prepared_inline_message_gen.go b/tdapi/tl_prepared_inline_message_gen.go new file mode 100644 index 000000000..4f4911143 --- /dev/null +++ b/tdapi/tl_prepared_inline_message_gen.go @@ -0,0 +1,271 @@ +// 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{} +) + +// PreparedInlineMessage represents TL type `preparedInlineMessage#942e7cc2`. +type PreparedInlineMessage struct { + // Unique identifier of the inline query to pass to sendInlineQueryResultMessage + InlineQueryID int64 + // Resulted inline message of the query + Result InlineQueryResultClass + // Types of the chats to which the message can be sent + ChatTypes TargetChatTypes +} + +// PreparedInlineMessageTypeID is TL type id of PreparedInlineMessage. +const PreparedInlineMessageTypeID = 0x942e7cc2 + +// Ensuring interfaces in compile-time for PreparedInlineMessage. +var ( + _ bin.Encoder = &PreparedInlineMessage{} + _ bin.Decoder = &PreparedInlineMessage{} + _ bin.BareEncoder = &PreparedInlineMessage{} + _ bin.BareDecoder = &PreparedInlineMessage{} +) + +func (p *PreparedInlineMessage) Zero() bool { + if p == nil { + return true + } + if !(p.InlineQueryID == 0) { + return false + } + if !(p.Result == nil) { + return false + } + if !(p.ChatTypes.Zero()) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (p *PreparedInlineMessage) String() string { + if p == nil { + return "PreparedInlineMessage(nil)" + } + type Alias PreparedInlineMessage + return fmt.Sprintf("PreparedInlineMessage%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PreparedInlineMessage) TypeID() uint32 { + return PreparedInlineMessageTypeID +} + +// TypeName returns name of type in TL schema. +func (*PreparedInlineMessage) TypeName() string { + return "preparedInlineMessage" +} + +// TypeInfo returns info about TL type. +func (p *PreparedInlineMessage) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "preparedInlineMessage", + ID: PreparedInlineMessageTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "InlineQueryID", + SchemaName: "inline_query_id", + }, + { + Name: "Result", + SchemaName: "result", + }, + { + Name: "ChatTypes", + SchemaName: "chat_types", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (p *PreparedInlineMessage) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode preparedInlineMessage#942e7cc2 as nil") + } + b.PutID(PreparedInlineMessageTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PreparedInlineMessage) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode preparedInlineMessage#942e7cc2 as nil") + } + b.PutLong(p.InlineQueryID) + if p.Result == nil { + return fmt.Errorf("unable to encode preparedInlineMessage#942e7cc2: field result is nil") + } + if err := p.Result.Encode(b); err != nil { + return fmt.Errorf("unable to encode preparedInlineMessage#942e7cc2: field result: %w", err) + } + if err := p.ChatTypes.Encode(b); err != nil { + return fmt.Errorf("unable to encode preparedInlineMessage#942e7cc2: field chat_types: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (p *PreparedInlineMessage) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode preparedInlineMessage#942e7cc2 to nil") + } + if err := b.ConsumeID(PreparedInlineMessageTypeID); err != nil { + return fmt.Errorf("unable to decode preparedInlineMessage#942e7cc2: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PreparedInlineMessage) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode preparedInlineMessage#942e7cc2 to nil") + } + { + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode preparedInlineMessage#942e7cc2: field inline_query_id: %w", err) + } + p.InlineQueryID = value + } + { + value, err := DecodeInlineQueryResult(b) + if err != nil { + return fmt.Errorf("unable to decode preparedInlineMessage#942e7cc2: field result: %w", err) + } + p.Result = value + } + { + if err := p.ChatTypes.Decode(b); err != nil { + return fmt.Errorf("unable to decode preparedInlineMessage#942e7cc2: field chat_types: %w", err) + } + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PreparedInlineMessage) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode preparedInlineMessage#942e7cc2 as nil") + } + b.ObjStart() + b.PutID("preparedInlineMessage") + b.Comma() + b.FieldStart("inline_query_id") + b.PutLong(p.InlineQueryID) + b.Comma() + b.FieldStart("result") + if p.Result == nil { + return fmt.Errorf("unable to encode preparedInlineMessage#942e7cc2: field result is nil") + } + if err := p.Result.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode preparedInlineMessage#942e7cc2: field result: %w", err) + } + b.Comma() + b.FieldStart("chat_types") + if err := p.ChatTypes.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode preparedInlineMessage#942e7cc2: field chat_types: %w", err) + } + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PreparedInlineMessage) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode preparedInlineMessage#942e7cc2 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("preparedInlineMessage"); err != nil { + return fmt.Errorf("unable to decode preparedInlineMessage#942e7cc2: %w", err) + } + case "inline_query_id": + value, err := b.Long() + if err != nil { + return fmt.Errorf("unable to decode preparedInlineMessage#942e7cc2: field inline_query_id: %w", err) + } + p.InlineQueryID = value + case "result": + value, err := DecodeTDLibJSONInlineQueryResult(b) + if err != nil { + return fmt.Errorf("unable to decode preparedInlineMessage#942e7cc2: field result: %w", err) + } + p.Result = value + case "chat_types": + if err := p.ChatTypes.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode preparedInlineMessage#942e7cc2: field chat_types: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetInlineQueryID returns value of InlineQueryID field. +func (p *PreparedInlineMessage) GetInlineQueryID() (value int64) { + if p == nil { + return + } + return p.InlineQueryID +} + +// GetResult returns value of Result field. +func (p *PreparedInlineMessage) GetResult() (value InlineQueryResultClass) { + if p == nil { + return + } + return p.Result +} + +// GetChatTypes returns value of ChatTypes field. +func (p *PreparedInlineMessage) GetChatTypes() (value TargetChatTypes) { + if p == nil { + return + } + return p.ChatTypes +} diff --git a/tdapi/tl_prepared_inline_message_id_gen.go b/tdapi/tl_prepared_inline_message_id_gen.go new file mode 100644 index 000000000..478c281af --- /dev/null +++ b/tdapi/tl_prepared_inline_message_id_gen.go @@ -0,0 +1,227 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tdapi + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// PreparedInlineMessageID represents TL type `preparedInlineMessageId#380d9be4`. +type PreparedInlineMessageID struct { + // Unique identifier for the message + ID string + // Point in time (Unix timestamp) when the message can't be used anymore + ExpirationDate int32 +} + +// PreparedInlineMessageIDTypeID is TL type id of PreparedInlineMessageID. +const PreparedInlineMessageIDTypeID = 0x380d9be4 + +// Ensuring interfaces in compile-time for PreparedInlineMessageID. +var ( + _ bin.Encoder = &PreparedInlineMessageID{} + _ bin.Decoder = &PreparedInlineMessageID{} + _ bin.BareEncoder = &PreparedInlineMessageID{} + _ bin.BareDecoder = &PreparedInlineMessageID{} +) + +func (p *PreparedInlineMessageID) Zero() bool { + if p == nil { + return true + } + if !(p.ID == "") { + return false + } + if !(p.ExpirationDate == 0) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (p *PreparedInlineMessageID) String() string { + if p == nil { + return "PreparedInlineMessageID(nil)" + } + type Alias PreparedInlineMessageID + return fmt.Sprintf("PreparedInlineMessageID%+v", Alias(*p)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*PreparedInlineMessageID) TypeID() uint32 { + return PreparedInlineMessageIDTypeID +} + +// TypeName returns name of type in TL schema. +func (*PreparedInlineMessageID) TypeName() string { + return "preparedInlineMessageId" +} + +// TypeInfo returns info about TL type. +func (p *PreparedInlineMessageID) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "preparedInlineMessageId", + ID: PreparedInlineMessageIDTypeID, + } + if p == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "ID", + SchemaName: "id", + }, + { + Name: "ExpirationDate", + SchemaName: "expiration_date", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (p *PreparedInlineMessageID) Encode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode preparedInlineMessageId#380d9be4 as nil") + } + b.PutID(PreparedInlineMessageIDTypeID) + return p.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (p *PreparedInlineMessageID) EncodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't encode preparedInlineMessageId#380d9be4 as nil") + } + b.PutString(p.ID) + b.PutInt32(p.ExpirationDate) + return nil +} + +// Decode implements bin.Decoder. +func (p *PreparedInlineMessageID) Decode(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode preparedInlineMessageId#380d9be4 to nil") + } + if err := b.ConsumeID(PreparedInlineMessageIDTypeID); err != nil { + return fmt.Errorf("unable to decode preparedInlineMessageId#380d9be4: %w", err) + } + return p.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (p *PreparedInlineMessageID) DecodeBare(b *bin.Buffer) error { + if p == nil { + return fmt.Errorf("can't decode preparedInlineMessageId#380d9be4 to nil") + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode preparedInlineMessageId#380d9be4: field id: %w", err) + } + p.ID = value + } + { + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode preparedInlineMessageId#380d9be4: field expiration_date: %w", err) + } + p.ExpirationDate = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (p *PreparedInlineMessageID) EncodeTDLibJSON(b tdjson.Encoder) error { + if p == nil { + return fmt.Errorf("can't encode preparedInlineMessageId#380d9be4 as nil") + } + b.ObjStart() + b.PutID("preparedInlineMessageId") + b.Comma() + b.FieldStart("id") + b.PutString(p.ID) + b.Comma() + b.FieldStart("expiration_date") + b.PutInt32(p.ExpirationDate) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (p *PreparedInlineMessageID) DecodeTDLibJSON(b tdjson.Decoder) error { + if p == nil { + return fmt.Errorf("can't decode preparedInlineMessageId#380d9be4 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("preparedInlineMessageId"); err != nil { + return fmt.Errorf("unable to decode preparedInlineMessageId#380d9be4: %w", err) + } + case "id": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode preparedInlineMessageId#380d9be4: field id: %w", err) + } + p.ID = value + case "expiration_date": + value, err := b.Int32() + if err != nil { + return fmt.Errorf("unable to decode preparedInlineMessageId#380d9be4: field expiration_date: %w", err) + } + p.ExpirationDate = value + default: + return b.Skip() + } + return nil + }) +} + +// GetID returns value of ID field. +func (p *PreparedInlineMessageID) GetID() (value string) { + if p == nil { + return + } + return p.ID +} + +// GetExpirationDate returns value of ExpirationDate field. +func (p *PreparedInlineMessageID) GetExpirationDate() (value int32) { + if p == nil { + return + } + return p.ExpirationDate +} diff --git a/tdapi/tl_registry_gen.go b/tdapi/tl_registry_gen.go index 391ce1f48..77ed71d5b 100644 --- a/tdapi/tl_registry_gen.go +++ b/tdapi/tl_registry_gen.go @@ -114,6 +114,7 @@ func TypesMap() map[uint32]string { StickerFullTypeMaskTypeID: "stickerFullTypeMask#26dfbf37", StickerFullTypeCustomEmojiTypeID: "stickerFullTypeCustomEmoji#c37f05ab", ClosedVectorPathTypeID: "closedVectorPath#2f9276b9", + OutlineTypeID: "outline#7d2ec0be", PollOptionTypeID: "pollOption#63e97090", PollTypeRegularTypeID: "pollTypeRegular#2638f022", PollTypeQuizTypeID: "pollTypeQuiz#27293c99", @@ -121,7 +122,7 @@ func TypesMap() map[uint32]string { AudioTypeID: "audio#a3769600", DocumentTypeID: "document#af19afd8", PhotoTypeID: "photo#105a0689", - StickerTypeID: "sticker#849ad6a1", + StickerTypeID: "sticker#d96f5d3f", VideoTypeID: "video#31a460cc", VideoNoteTypeID: "videoNote#7ae918c5", VoiceNoteTypeID: "voiceNote#b9f24cf5", @@ -177,8 +178,10 @@ func TypesMap() map[uint32]string { InputChatPhotoStickerTypeID: "inputChatPhotoSticker#4e6e735d", ChatPermissionsTypeID: "chatPermissions#f8f25a79", ChatAdministratorRightsTypeID: "chatAdministratorRights#5f4f9044", + StarSubscriptionTypeChannelTypeID: "starSubscriptionTypeChannel#c29ab6f5", + StarSubscriptionTypeBotTypeID: "starSubscriptionTypeBot#d78ddd2", StarSubscriptionPricingTypeID: "starSubscriptionPricing#96a28856", - StarSubscriptionTypeID: "starSubscription#6caf0ade", + StarSubscriptionTypeID: "starSubscription#3a3811f5", StarSubscriptionsTypeID: "starSubscriptions#f7a7ae44", ProductInfoTypeID: "productInfo#87e47ca4", PremiumPaymentOptionTypeID: "premiumPaymentOption#8c0c5fb2", @@ -191,7 +194,7 @@ func TypesMap() map[uint32]string { StarGiveawayWinnerOptionTypeID: "starGiveawayWinnerOption#cc639607", StarGiveawayPaymentOptionTypeID: "starGiveawayPaymentOption#bca2d5e5", StarGiveawayPaymentOptionsTypeID: "starGiveawayPaymentOptions#909fbf18", - GiftTypeID: "gift#9dc9b8a1", + GiftTypeID: "gift#d3284cce", GiftsTypeID: "gifts#7ea494b8", UserGiftTypeID: "userGift#494eb721", UserGiftsTypeID: "userGifts#e274219f", @@ -199,6 +202,7 @@ func TypesMap() map[uint32]string { StarTransactionDirectionOutgoingTypeID: "starTransactionDirectionOutgoing#6e83b5a0", BotTransactionPurposePaidMediaTypeID: "botTransactionPurposePaidMedia#62952496", BotTransactionPurposeInvoicePaymentTypeID: "botTransactionPurposeInvoicePayment#699860ac", + BotTransactionPurposeSubscriptionTypeID: "botTransactionPurposeSubscription#e5796205", ChatTransactionPurposePaidMediaTypeID: "chatTransactionPurposePaidMedia#d35febb", ChatTransactionPurposeJoinTypeID: "chatTransactionPurposeJoin#5b31327a", ChatTransactionPurposeReactionTypeID: "chatTransactionPurposeReaction#7a5f9888", @@ -235,7 +239,7 @@ func TypesMap() map[uint32]string { EmojiStatusesTypeID: "emojiStatuses#eaeb9bdc", UsernamesTypeID: "usernames#bf343063", UserTypeID: "user#18552c62", - BotInfoTypeID: "botInfo#bfacb6ae", + BotInfoTypeID: "botInfo#15e58682", UserFullInfoTypeID: "userFullInfo#85d0c905", UsersTypeID: "users#9d955a12", FoundUsersTypeID: "foundUsers#c531e854", @@ -433,9 +437,14 @@ func TypesMap() map[uint32]string { ReplyMarkupInlineKeyboardTypeID: "replyMarkupInlineKeyboard#92ac0efb", LoginURLInfoOpenTypeID: "loginUrlInfoOpen#31e7ea02", LoginURLInfoRequestConfirmationTypeID: "loginUrlInfoRequestConfirmation#7edb242f", + ThemeParametersTypeID: "themeParameters#ef8395af", + WebAppOpenModeCompactTypeID: "webAppOpenModeCompact#6604ffdb", + WebAppOpenModeFullSizeTypeID: "webAppOpenModeFullSize#b48cd41", + WebAppOpenModeFullScreenTypeID: "webAppOpenModeFullScreen#6f8a019d", FoundWebAppTypeID: "foundWebApp#eea8d01e", WebAppInfoTypeID: "webAppInfo#2efdb2e8", - MainWebAppTypeID: "mainWebApp#4fb068f1", + MainWebAppTypeID: "mainWebApp#73a7ac7a", + WebAppOpenParametersTypeID: "webAppOpenParameters#51fa466f", MessageThreadInfoTypeID: "messageThreadInfo#683fd5ad", SavedMessagesTopicTypeMyNotesTypeID: "savedMessagesTopicTypeMyNotes#b38a41f5", SavedMessagesTopicTypeAuthorHiddenTypeID: "savedMessagesTopicTypeAuthorHidden#703c4195", @@ -550,9 +559,8 @@ func TypesMap() map[uint32]string { BankCardInfoTypeID: "bankCardInfo#2bc7da9f", AddressTypeID: "address#86304f3a", LocationAddressTypeID: "locationAddress#a3dad322", - ThemeParametersTypeID: "themeParameters#ef8395af", LabeledPricePartTypeID: "labeledPricePart#20f2e726", - InvoiceTypeID: "invoice#c19b2377", + InvoiceTypeID: "invoice#67dc0e89", OrderInfoTypeID: "orderInfo#2ebad96e", ShippingOptionTypeID: "shippingOption#731bffce", SavedCredentialsTypeID: "savedCredentials#e9ee14dc", @@ -566,6 +574,7 @@ func TypesMap() map[uint32]string { PaymentOptionTypeID: "paymentOption#ee79989b", PaymentFormTypeRegularTypeID: "paymentFormTypeRegular#ba6d2f0f", PaymentFormTypeStarsTypeID: "paymentFormTypeStars#56b9d3d", + PaymentFormTypeStarSubscriptionTypeID: "paymentFormTypeStarSubscription#102deb5b", PaymentFormTypeID: "paymentForm#7720ffb3", ValidatedOrderInfoTypeID: "validatedOrderInfo#ac585f14", PaymentResultTypeID: "paymentResult#d00fe85d", @@ -705,8 +714,8 @@ func TypesMap() map[uint32]string { MessageSuggestProfilePhotoTypeID: "messageSuggestProfilePhoto#b5611ee7", MessageCustomServiceActionTypeID: "messageCustomServiceAction#5595c772", MessageGameScoreTypeID: "messageGameScore#50299d7f", - MessagePaymentSuccessfulTypeID: "messagePaymentSuccessful#53d93cdc", - MessagePaymentSuccessfulBotTypeID: "messagePaymentSuccessfulBot#68e13eb9", + MessagePaymentSuccessfulTypeID: "messagePaymentSuccessful#3e661911", + MessagePaymentSuccessfulBotTypeID: "messagePaymentSuccessfulBot#c7664dbf", MessagePaymentRefundedTypeID: "messagePaymentRefunded#11bcb8f3", MessageGiftedPremiumTypeID: "messageGiftedPremium#e4d0e07a", MessagePremiumGiftCodeTypeID: "messagePremiumGiftCode#29d22e4e", @@ -822,8 +831,8 @@ func TypesMap() map[uint32]string { EmojiKeywordsTypeID: "emojiKeywords#de023f4", StickersTypeID: "stickers#83491d00", EmojisTypeID: "emojis#77274a16", - StickerSetTypeID: "stickerSet#bcf4d158", - StickerSetInfoTypeID: "stickerSetInfo#3cd2cd82", + StickerSetTypeID: "stickerSet#e3b8a114", + StickerSetInfoTypeID: "stickerSetInfo#58991994", StickerSetsTypeID: "stickerSets#b8a6490d", TrendingStickerSetsTypeID: "trendingStickerSets#298f12cc", EmojiCategorySourceSearchTypeID: "emojiCategorySourceSearch#5e126d32", @@ -962,6 +971,10 @@ func TypesMap() map[uint32]string { BotWriteAccessAllowReasonAcceptedRequestTypeID: "botWriteAccessAllowReasonAcceptedRequest#89c63bfc", HTTPURLTypeID: "httpUrl#87b775a6", UserLinkTypeID: "userLink#1db0fef8", + TargetChatTypesTypeID: "targetChatTypes#5a300e51", + TargetChatCurrentTypeID: "targetChatCurrent#e729d110", + TargetChatChosenTypeID: "targetChatChosen#acf8d5a6", + TargetChatInternalLinkTypeID: "targetChatInternalLink#dd788fe0", InputInlineQueryResultAnimationTypeID: "inputInlineQueryResultAnimation#a7335216", InputInlineQueryResultArticleTypeID: "inputInlineQueryResultArticle#75a3d10c", InputInlineQueryResultAudioTypeID: "inputInlineQueryResultAudio#4b1c35d4", @@ -990,6 +1003,8 @@ func TypesMap() map[uint32]string { InlineQueryResultsButtonTypeWebAppTypeID: "inlineQueryResultsButtonTypeWebApp#b8a16362", InlineQueryResultsButtonTypeID: "inlineQueryResultsButton#d0df08ae", InlineQueryResultsTypeID: "inlineQueryResults#ffd17579", + PreparedInlineMessageIDTypeID: "preparedInlineMessageId#380d9be4", + PreparedInlineMessageTypeID: "preparedInlineMessage#942e7cc2", CallbackQueryPayloadDataTypeID: "callbackQueryPayloadData#8a1e3c66", CallbackQueryPayloadDataWithPasswordTypeID: "callbackQueryPayloadDataWithPassword#4fe2d8f2", CallbackQueryPayloadGameTypeID: "callbackQueryPayloadGame#4db2ec38", @@ -1260,11 +1275,13 @@ func TypesMap() map[uint32]string { StoryPrivacySettingsSelectedUsersTypeID: "storyPrivacySettingsSelectedUsers#84d7d27b", UserPrivacySettingRuleAllowAllTypeID: "userPrivacySettingRuleAllowAll#8abf1c3f", UserPrivacySettingRuleAllowContactsTypeID: "userPrivacySettingRuleAllowContacts#8f2f2d10", + UserPrivacySettingRuleAllowBotsTypeID: "userPrivacySettingRuleAllowBots#53b2871d", UserPrivacySettingRuleAllowPremiumUsersTypeID: "userPrivacySettingRuleAllowPremiumUsers#60ce8541", UserPrivacySettingRuleAllowUsersTypeID: "userPrivacySettingRuleAllowUsers#d1570b70", UserPrivacySettingRuleAllowChatMembersTypeID: "userPrivacySettingRuleAllowChatMembers#f249b617", UserPrivacySettingRuleRestrictAllTypeID: "userPrivacySettingRuleRestrictAll#ac2a9550", UserPrivacySettingRuleRestrictContactsTypeID: "userPrivacySettingRuleRestrictContacts#3c1acd02", + UserPrivacySettingRuleRestrictBotsTypeID: "userPrivacySettingRuleRestrictBots#8e996e5d", UserPrivacySettingRuleRestrictUsersTypeID: "userPrivacySettingRuleRestrictUsers#4d392a91", UserPrivacySettingRuleRestrictChatMembersTypeID: "userPrivacySettingRuleRestrictChatMembers#fc00b920", UserPrivacySettingRulesTypeID: "userPrivacySettingRules#425e6b37", @@ -1279,6 +1296,7 @@ func TypesMap() map[uint32]string { UserPrivacySettingAllowPeerToPeerCallsTypeID: "userPrivacySettingAllowPeerToPeerCalls#1502b940", UserPrivacySettingAllowFindingByPhoneNumberTypeID: "userPrivacySettingAllowFindingByPhoneNumber#91ee6d51", UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessagesTypeID: "userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages#14272e3c", + UserPrivacySettingAutosaveGiftsTypeID: "userPrivacySettingAutosaveGifts#709a69cd", ReadDatePrivacySettingsTypeID: "readDatePrivacySettings#62a2e628", NewChatPrivacySettingsTypeID: "newChatPrivacySettings#5b15ca46", CanSendMessageToUserResultOkTypeID: "canSendMessageToUserResultOk#5b3ad802", @@ -1325,9 +1343,6 @@ func TypesMap() map[uint32]string { ReportStoryResultOkTypeID: "reportStoryResultOk#ac3c63b3", ReportStoryResultOptionRequiredTypeID: "reportStoryResultOptionRequired#bf79aa9b", ReportStoryResultTextRequiredTypeID: "reportStoryResultTextRequired#13ed9d91", - TargetChatCurrentTypeID: "targetChatCurrent#e729d110", - TargetChatChosenTypeID: "targetChatChosen#edaccad2", - TargetChatInternalLinkTypeID: "targetChatInternalLink#dd788fe0", InternalLinkTypeActiveSessionsTypeID: "internalLinkTypeActiveSessions#706bbbad", InternalLinkTypeAttachmentMenuBotTypeID: "internalLinkTypeAttachmentMenuBot#644c4225", InternalLinkTypeAuthenticationCodeTypeID: "internalLinkTypeAuthenticationCode#f3874ff2", @@ -1349,7 +1364,7 @@ func TypesMap() map[uint32]string { InternalLinkTypeInvoiceTypeID: "internalLinkTypeInvoice#f34c6dac", InternalLinkTypeLanguagePackTypeID: "internalLinkTypeLanguagePack#a9870d6c", InternalLinkTypeLanguageSettingsTypeID: "internalLinkTypeLanguageSettings#b019e6e6", - InternalLinkTypeMainWebAppTypeID: "internalLinkTypeMainWebApp#9c942666", + InternalLinkTypeMainWebAppTypeID: "internalLinkTypeMainWebApp#5ddf72e9", InternalLinkTypeMessageTypeID: "internalLinkTypeMessage#3a535c52", InternalLinkTypeMessageDraftTypeID: "internalLinkTypeMessageDraft#276fbad5", InternalLinkTypePassportDataRequestTypeID: "internalLinkTypePassportDataRequest#c50fce81", @@ -1372,7 +1387,7 @@ func TypesMap() map[uint32]string { InternalLinkTypeUserPhoneNumberTypeID: "internalLinkTypeUserPhoneNumber#104bbb08", InternalLinkTypeUserTokenTypeID: "internalLinkTypeUserToken#a8d7db59", InternalLinkTypeVideoChatTypeID: "internalLinkTypeVideoChat#8796f8b4", - InternalLinkTypeWebAppTypeID: "internalLinkTypeWebApp#4c68bb0d", + InternalLinkTypeWebAppTypeID: "internalLinkTypeWebApp#7ae9552d", MessageLinkTypeID: "messageLink#af4a3aa6", MessageLinkInfoTypeID: "messageLinkInfo#2b96fb50", ChatBoostLinkTypeID: "chatBoostLink#b5417c71", @@ -1901,15 +1916,19 @@ func TypesMap() map[uint32]string { ShareChatWithBotRequestTypeID: "shareChatWithBot#a6530ae2", GetInlineQueryResultsRequestTypeID: "getInlineQueryResults#79dcf86c", AnswerInlineQueryRequestTypeID: "answerInlineQuery#ac7cc5e6", + SavePreparedInlineMessageRequestTypeID: "savePreparedInlineMessage#c71468d9", + GetPreparedInlineMessageRequestTypeID: "getPreparedInlineMessage#fb0ac74b", GetGrossingWebAppBotsRequestTypeID: "getGrossingWebAppBots#6522ce1a", SearchWebAppRequestTypeID: "searchWebApp#b5fc8a35", - GetWebAppLinkURLRequestTypeID: "getWebAppLinkUrl#4f0ef3cc", - GetMainWebAppRequestTypeID: "getMainWebApp#be84329a", - GetWebAppURLRequestTypeID: "getWebAppUrl#64c42cbe", + GetWebAppPlaceholderRequestTypeID: "getWebAppPlaceholder#22c70d8f", + GetWebAppLinkURLRequestTypeID: "getWebAppLinkUrl#60fe62c1", + GetMainWebAppRequestTypeID: "getMainWebApp#23687ca6", + GetWebAppURLRequestTypeID: "getWebAppUrl#a4ff1f44", SendWebAppDataRequestTypeID: "sendWebAppData#ab1fce0c", - OpenWebAppRequestTypeID: "openWebApp#b02666b0", + OpenWebAppRequestTypeID: "openWebApp#278173a2", CloseWebAppRequestTypeID: "closeWebApp#68a124c6", AnswerWebAppQueryRequestTypeID: "answerWebAppQuery#a0b49cf1", + CheckWebAppFileDownloadRequestTypeID: "checkWebAppFileDownload#e8ca44e2", GetCallbackQueryAnswerRequestTypeID: "getCallbackQueryAnswer#6ef7a5f", AnswerCallbackQueryRequestTypeID: "answerCallbackQuery#bb462e76", AnswerShippingQueryRequestTypeID: "answerShippingQuery#7a3c2432", @@ -2149,9 +2168,12 @@ func TypesMap() map[uint32]string { GetCloseFriendsRequestTypeID: "getCloseFriends#a9d574ce", SetUserPersonalProfilePhotoRequestTypeID: "setUserPersonalProfilePhoto#1baa28f6", SuggestUserProfilePhotoRequestTypeID: "suggestUserProfilePhoto#9561f463", + ToggleBotCanManageEmojiStatusRequestTypeID: "toggleBotCanManageEmojiStatus#251a881a", + SetUserEmojiStatusRequestTypeID: "setUserEmojiStatus#e5165bcb", SearchUserByPhoneNumberRequestTypeID: "searchUserByPhoneNumber#eb82adc8", SharePhoneNumberRequestTypeID: "sharePhoneNumber#4164e055", GetUserProfilePhotosRequestTypeID: "getUserProfilePhotos#c9defe42", + GetStickerOutlineRequestTypeID: "getStickerOutline#a3952da5", GetStickersRequestTypeID: "getStickers#45069343", GetAllStickerEmojisRequestTypeID: "getAllStickerEmojis#11ad2e30", SearchStickersRequestTypeID: "searchStickers#9a19e90b", @@ -2298,7 +2320,7 @@ func TypesMap() map[uint32]string { SellGiftRequestTypeID: "sellGift#671b88b4", ToggleGiftIsSavedRequestTypeID: "toggleGiftIsSaved#91c2f183", GetUserGiftsRequestTypeID: "getUserGifts#b7cdbc7c", - CreateInvoiceLinkRequestTypeID: "createInvoiceLink#cebe921", + CreateInvoiceLinkRequestTypeID: "createInvoiceLink#cf70c867", RefundStarPaymentRequestTypeID: "refundStarPayment#9476a055", GetSupportUserRequestTypeID: "getSupportUser#98acec9c", GetBackgroundURLRequestTypeID: "getBackgroundUrl#2bbc6fd2", @@ -2415,6 +2437,7 @@ func TypesMap() map[uint32]string { AssignAppStoreTransactionRequestTypeID: "assignAppStoreTransaction#86f30bb0", AssignGooglePlayTransactionRequestTypeID: "assignGooglePlayTransaction#8939bca4", EditStarSubscriptionRequestTypeID: "editStarSubscription#7a1a3918", + EditUserStarSubscriptionRequestTypeID: "editUserStarSubscription#51b16e89", ReuseStarSubscriptionRequestTypeID: "reuseStarSubscription#2e677441", GetBusinessFeaturesRequestTypeID: "getBusinessFeatures#c4906001", AcceptTermsOfServiceRequestTypeID: "acceptTermsOfService#7efe03e4", @@ -2549,6 +2572,7 @@ func NamesMap() map[string]uint32 { "stickerFullTypeMask": StickerFullTypeMaskTypeID, "stickerFullTypeCustomEmoji": StickerFullTypeCustomEmojiTypeID, "closedVectorPath": ClosedVectorPathTypeID, + "outline": OutlineTypeID, "pollOption": PollOptionTypeID, "pollTypeRegular": PollTypeRegularTypeID, "pollTypeQuiz": PollTypeQuizTypeID, @@ -2584,819 +2608,831 @@ func NamesMap() map[string]uint32 { "birthdate": BirthdateTypeID, "closeBirthdayUser": CloseBirthdayUserTypeID, "businessAwayMessageScheduleAlways": BusinessAwayMessageScheduleAlwaysTypeID, - "businessAwayMessageScheduleOutsideOfOpeningHours": BusinessAwayMessageScheduleOutsideOfOpeningHoursTypeID, - "businessAwayMessageScheduleCustom": BusinessAwayMessageScheduleCustomTypeID, - "businessLocation": BusinessLocationTypeID, - "businessRecipients": BusinessRecipientsTypeID, - "businessAwayMessageSettings": BusinessAwayMessageSettingsTypeID, - "businessGreetingMessageSettings": BusinessGreetingMessageSettingsTypeID, - "businessConnectedBot": BusinessConnectedBotTypeID, - "businessStartPage": BusinessStartPageTypeID, - "inputBusinessStartPage": InputBusinessStartPageTypeID, - "businessOpeningHoursInterval": BusinessOpeningHoursIntervalTypeID, - "businessOpeningHours": BusinessOpeningHoursTypeID, - "businessInfo": BusinessInfoTypeID, - "businessChatLink": BusinessChatLinkTypeID, - "businessChatLinks": BusinessChatLinksTypeID, - "inputBusinessChatLink": InputBusinessChatLinkTypeID, - "businessChatLinkInfo": BusinessChatLinkInfoTypeID, - "chatPhotoStickerTypeRegularOrMask": ChatPhotoStickerTypeRegularOrMaskTypeID, - "chatPhotoStickerTypeCustomEmoji": ChatPhotoStickerTypeCustomEmojiTypeID, - "chatPhotoSticker": ChatPhotoStickerTypeID, - "animatedChatPhoto": AnimatedChatPhotoTypeID, - "chatPhoto": ChatPhotoTypeID, - "chatPhotos": ChatPhotosTypeID, - "inputChatPhotoPrevious": InputChatPhotoPreviousTypeID, - "inputChatPhotoStatic": InputChatPhotoStaticTypeID, - "inputChatPhotoAnimation": InputChatPhotoAnimationTypeID, - "inputChatPhotoSticker": InputChatPhotoStickerTypeID, - "chatPermissions": ChatPermissionsTypeID, - "chatAdministratorRights": ChatAdministratorRightsTypeID, - "starSubscriptionPricing": StarSubscriptionPricingTypeID, - "starSubscription": StarSubscriptionTypeID, - "starSubscriptions": StarSubscriptionsTypeID, - "productInfo": ProductInfoTypeID, - "premiumPaymentOption": PremiumPaymentOptionTypeID, - "premiumStatePaymentOption": PremiumStatePaymentOptionTypeID, - "premiumGiftCodePaymentOption": PremiumGiftCodePaymentOptionTypeID, - "premiumGiftCodePaymentOptions": PremiumGiftCodePaymentOptionsTypeID, - "premiumGiftCodeInfo": PremiumGiftCodeInfoTypeID, - "starPaymentOption": StarPaymentOptionTypeID, - "starPaymentOptions": StarPaymentOptionsTypeID, - "starGiveawayWinnerOption": StarGiveawayWinnerOptionTypeID, - "starGiveawayPaymentOption": StarGiveawayPaymentOptionTypeID, - "starGiveawayPaymentOptions": StarGiveawayPaymentOptionsTypeID, - "gift": GiftTypeID, - "gifts": GiftsTypeID, - "userGift": UserGiftTypeID, - "userGifts": UserGiftsTypeID, - "starTransactionDirectionIncoming": StarTransactionDirectionIncomingTypeID, - "starTransactionDirectionOutgoing": StarTransactionDirectionOutgoingTypeID, - "botTransactionPurposePaidMedia": BotTransactionPurposePaidMediaTypeID, - "botTransactionPurposeInvoicePayment": BotTransactionPurposeInvoicePaymentTypeID, - "chatTransactionPurposePaidMedia": ChatTransactionPurposePaidMediaTypeID, - "chatTransactionPurposeJoin": ChatTransactionPurposeJoinTypeID, - "chatTransactionPurposeReaction": ChatTransactionPurposeReactionTypeID, - "chatTransactionPurposeGiveaway": ChatTransactionPurposeGiveawayTypeID, - "userTransactionPurposeGiftedStars": UserTransactionPurposeGiftedStarsTypeID, - "userTransactionPurposeGiftSell": UserTransactionPurposeGiftSellTypeID, - "userTransactionPurposeGiftSend": UserTransactionPurposeGiftSendTypeID, - "starTransactionPartnerTelegram": StarTransactionPartnerTelegramTypeID, - "starTransactionPartnerAppStore": StarTransactionPartnerAppStoreTypeID, - "starTransactionPartnerGooglePlay": StarTransactionPartnerGooglePlayTypeID, - "starTransactionPartnerFragment": StarTransactionPartnerFragmentTypeID, - "starTransactionPartnerTelegramAds": StarTransactionPartnerTelegramAdsTypeID, - "starTransactionPartnerTelegramApi": StarTransactionPartnerTelegramAPITypeID, - "starTransactionPartnerBot": StarTransactionPartnerBotTypeID, - "starTransactionPartnerBusiness": StarTransactionPartnerBusinessTypeID, - "starTransactionPartnerChat": StarTransactionPartnerChatTypeID, - "starTransactionPartnerUser": StarTransactionPartnerUserTypeID, - "starTransactionPartnerUnsupported": StarTransactionPartnerUnsupportedTypeID, - "starTransaction": StarTransactionTypeID, - "starTransactions": StarTransactionsTypeID, - "giveawayParticipantStatusEligible": GiveawayParticipantStatusEligibleTypeID, - "giveawayParticipantStatusParticipating": GiveawayParticipantStatusParticipatingTypeID, - "giveawayParticipantStatusAlreadyWasMember": GiveawayParticipantStatusAlreadyWasMemberTypeID, - "giveawayParticipantStatusAdministrator": GiveawayParticipantStatusAdministratorTypeID, - "giveawayParticipantStatusDisallowedCountry": GiveawayParticipantStatusDisallowedCountryTypeID, - "giveawayInfoOngoing": GiveawayInfoOngoingTypeID, - "giveawayInfoCompleted": GiveawayInfoCompletedTypeID, - "giveawayPrizePremium": GiveawayPrizePremiumTypeID, - "giveawayPrizeStars": GiveawayPrizeStarsTypeID, - "accentColor": AccentColorTypeID, - "profileAccentColors": ProfileAccentColorsTypeID, - "profileAccentColor": ProfileAccentColorTypeID, - "emojiStatus": EmojiStatusTypeID, - "emojiStatuses": EmojiStatusesTypeID, - "usernames": UsernamesTypeID, - "user": UserTypeID, - "botInfo": BotInfoTypeID, - "userFullInfo": UserFullInfoTypeID, - "users": UsersTypeID, - "foundUsers": FoundUsersTypeID, - "chatAdministrator": ChatAdministratorTypeID, - "chatAdministrators": ChatAdministratorsTypeID, - "chatMemberStatusCreator": ChatMemberStatusCreatorTypeID, - "chatMemberStatusAdministrator": ChatMemberStatusAdministratorTypeID, - "chatMemberStatusMember": ChatMemberStatusMemberTypeID, - "chatMemberStatusRestricted": ChatMemberStatusRestrictedTypeID, - "chatMemberStatusLeft": ChatMemberStatusLeftTypeID, - "chatMemberStatusBanned": ChatMemberStatusBannedTypeID, - "chatMember": ChatMemberTypeID, - "chatMembers": ChatMembersTypeID, - "chatMembersFilterContacts": ChatMembersFilterContactsTypeID, - "chatMembersFilterAdministrators": ChatMembersFilterAdministratorsTypeID, - "chatMembersFilterMembers": ChatMembersFilterMembersTypeID, - "chatMembersFilterMention": ChatMembersFilterMentionTypeID, - "chatMembersFilterRestricted": ChatMembersFilterRestrictedTypeID, - "chatMembersFilterBanned": ChatMembersFilterBannedTypeID, - "chatMembersFilterBots": ChatMembersFilterBotsTypeID, - "supergroupMembersFilterRecent": SupergroupMembersFilterRecentTypeID, - "supergroupMembersFilterContacts": SupergroupMembersFilterContactsTypeID, - "supergroupMembersFilterAdministrators": SupergroupMembersFilterAdministratorsTypeID, - "supergroupMembersFilterSearch": SupergroupMembersFilterSearchTypeID, - "supergroupMembersFilterRestricted": SupergroupMembersFilterRestrictedTypeID, - "supergroupMembersFilterBanned": SupergroupMembersFilterBannedTypeID, - "supergroupMembersFilterMention": SupergroupMembersFilterMentionTypeID, - "supergroupMembersFilterBots": SupergroupMembersFilterBotsTypeID, - "chatInviteLink": ChatInviteLinkTypeID, - "chatInviteLinks": ChatInviteLinksTypeID, - "chatInviteLinkCount": ChatInviteLinkCountTypeID, - "chatInviteLinkCounts": ChatInviteLinkCountsTypeID, - "chatInviteLinkMember": ChatInviteLinkMemberTypeID, - "chatInviteLinkMembers": ChatInviteLinkMembersTypeID, - "inviteLinkChatTypeBasicGroup": InviteLinkChatTypeBasicGroupTypeID, - "inviteLinkChatTypeSupergroup": InviteLinkChatTypeSupergroupTypeID, - "inviteLinkChatTypeChannel": InviteLinkChatTypeChannelTypeID, - "chatInviteLinkSubscriptionInfo": ChatInviteLinkSubscriptionInfoTypeID, - "chatInviteLinkInfo": ChatInviteLinkInfoTypeID, - "chatJoinRequest": ChatJoinRequestTypeID, - "chatJoinRequests": ChatJoinRequestsTypeID, - "chatJoinRequestsInfo": ChatJoinRequestsInfoTypeID, - "basicGroup": BasicGroupTypeID, - "basicGroupFullInfo": BasicGroupFullInfoTypeID, - "supergroup": SupergroupTypeID, - "supergroupFullInfo": SupergroupFullInfoTypeID, - "secretChatStatePending": SecretChatStatePendingTypeID, - "secretChatStateReady": SecretChatStateReadyTypeID, - "secretChatStateClosed": SecretChatStateClosedTypeID, - "secretChat": SecretChatTypeID, - "messageSenderUser": MessageSenderUserTypeID, - "messageSenderChat": MessageSenderChatTypeID, - "messageSenders": MessageSendersTypeID, - "chatMessageSender": ChatMessageSenderTypeID, - "chatMessageSenders": ChatMessageSendersTypeID, - "messageReadDateRead": MessageReadDateReadTypeID, - "messageReadDateUnread": MessageReadDateUnreadTypeID, - "messageReadDateTooOld": MessageReadDateTooOldTypeID, - "messageReadDateUserPrivacyRestricted": MessageReadDateUserPrivacyRestrictedTypeID, - "messageReadDateMyPrivacyRestricted": MessageReadDateMyPrivacyRestrictedTypeID, - "messageViewer": MessageViewerTypeID, - "messageViewers": MessageViewersTypeID, - "messageOriginUser": MessageOriginUserTypeID, - "messageOriginHiddenUser": MessageOriginHiddenUserTypeID, - "messageOriginChat": MessageOriginChatTypeID, - "messageOriginChannel": MessageOriginChannelTypeID, - "forwardSource": ForwardSourceTypeID, - "reactionTypeEmoji": ReactionTypeEmojiTypeID, - "reactionTypeCustomEmoji": ReactionTypeCustomEmojiTypeID, - "reactionTypePaid": ReactionTypePaidTypeID, - "paidReactor": PaidReactorTypeID, - "messageForwardInfo": MessageForwardInfoTypeID, - "messageImportInfo": MessageImportInfoTypeID, - "messageReplyInfo": MessageReplyInfoTypeID, - "messageReaction": MessageReactionTypeID, - "messageReactions": MessageReactionsTypeID, - "messageInteractionInfo": MessageInteractionInfoTypeID, - "unreadReaction": UnreadReactionTypeID, - "messageEffectTypeEmojiReaction": MessageEffectTypeEmojiReactionTypeID, - "messageEffectTypePremiumSticker": MessageEffectTypePremiumStickerTypeID, - "messageEffect": MessageEffectTypeID, - "messageSendingStatePending": MessageSendingStatePendingTypeID, - "messageSendingStateFailed": MessageSendingStateFailedTypeID, - "textQuote": TextQuoteTypeID, - "inputTextQuote": InputTextQuoteTypeID, - "messageReplyToMessage": MessageReplyToMessageTypeID, - "messageReplyToStory": MessageReplyToStoryTypeID, - "inputMessageReplyToMessage": InputMessageReplyToMessageTypeID, - "inputMessageReplyToExternalMessage": InputMessageReplyToExternalMessageTypeID, - "inputMessageReplyToStory": InputMessageReplyToStoryTypeID, - "factCheck": FactCheckTypeID, - "message": MessageTypeID, - "messages": MessagesTypeID, - "foundMessages": FoundMessagesTypeID, - "foundChatMessages": FoundChatMessagesTypeID, - "messagePosition": MessagePositionTypeID, - "messagePositions": MessagePositionsTypeID, - "messageCalendarDay": MessageCalendarDayTypeID, - "messageCalendar": MessageCalendarTypeID, - "businessMessage": BusinessMessageTypeID, - "businessMessages": BusinessMessagesTypeID, - "messageSourceChatHistory": MessageSourceChatHistoryTypeID, - "messageSourceMessageThreadHistory": MessageSourceMessageThreadHistoryTypeID, - "messageSourceForumTopicHistory": MessageSourceForumTopicHistoryTypeID, - "messageSourceHistoryPreview": MessageSourceHistoryPreviewTypeID, - "messageSourceChatList": MessageSourceChatListTypeID, - "messageSourceSearch": MessageSourceSearchTypeID, - "messageSourceChatEventLog": MessageSourceChatEventLogTypeID, - "messageSourceNotification": MessageSourceNotificationTypeID, - "messageSourceScreenshot": MessageSourceScreenshotTypeID, - "messageSourceOther": MessageSourceOtherTypeID, - "messageSponsor": MessageSponsorTypeID, - "sponsoredMessage": SponsoredMessageTypeID, - "sponsoredMessages": SponsoredMessagesTypeID, - "reportOption": ReportOptionTypeID, - "reportChatSponsoredMessageResultOk": ReportChatSponsoredMessageResultOkTypeID, - "reportChatSponsoredMessageResultFailed": ReportChatSponsoredMessageResultFailedTypeID, - "reportChatSponsoredMessageResultOptionRequired": ReportChatSponsoredMessageResultOptionRequiredTypeID, - "reportChatSponsoredMessageResultAdsHidden": ReportChatSponsoredMessageResultAdsHiddenTypeID, - "reportChatSponsoredMessageResultPremiumRequired": ReportChatSponsoredMessageResultPremiumRequiredTypeID, - "fileDownload": FileDownloadTypeID, - "downloadedFileCounts": DownloadedFileCountsTypeID, - "foundFileDownloads": FoundFileDownloadsTypeID, - "notificationSettingsScopePrivateChats": NotificationSettingsScopePrivateChatsTypeID, - "notificationSettingsScopeGroupChats": NotificationSettingsScopeGroupChatsTypeID, - "notificationSettingsScopeChannelChats": NotificationSettingsScopeChannelChatsTypeID, - "chatNotificationSettings": ChatNotificationSettingsTypeID, - "scopeNotificationSettings": ScopeNotificationSettingsTypeID, - "reactionNotificationSourceNone": ReactionNotificationSourceNoneTypeID, - "reactionNotificationSourceContacts": ReactionNotificationSourceContactsTypeID, - "reactionNotificationSourceAll": ReactionNotificationSourceAllTypeID, - "reactionNotificationSettings": ReactionNotificationSettingsTypeID, - "draftMessage": DraftMessageTypeID, - "chatTypePrivate": ChatTypePrivateTypeID, - "chatTypeBasicGroup": ChatTypeBasicGroupTypeID, - "chatTypeSupergroup": ChatTypeSupergroupTypeID, - "chatTypeSecret": ChatTypeSecretTypeID, - "chatFolderIcon": ChatFolderIconTypeID, - "chatFolder": ChatFolderTypeID, - "chatFolderInfo": ChatFolderInfoTypeID, - "chatFolderInviteLink": ChatFolderInviteLinkTypeID, - "chatFolderInviteLinks": ChatFolderInviteLinksTypeID, - "chatFolderInviteLinkInfo": ChatFolderInviteLinkInfoTypeID, - "recommendedChatFolder": RecommendedChatFolderTypeID, - "recommendedChatFolders": RecommendedChatFoldersTypeID, - "archiveChatListSettings": ArchiveChatListSettingsTypeID, - "chatListMain": ChatListMainTypeID, - "chatListArchive": ChatListArchiveTypeID, - "chatListFolder": ChatListFolderTypeID, - "chatLists": ChatListsTypeID, - "chatSourceMtprotoProxy": ChatSourceMtprotoProxyTypeID, - "chatSourcePublicServiceAnnouncement": ChatSourcePublicServiceAnnouncementTypeID, - "chatPosition": ChatPositionTypeID, - "chatAvailableReactionsAll": ChatAvailableReactionsAllTypeID, - "chatAvailableReactionsSome": ChatAvailableReactionsSomeTypeID, - "savedMessagesTag": SavedMessagesTagTypeID, - "savedMessagesTags": SavedMessagesTagsTypeID, - "businessBotManageBar": BusinessBotManageBarTypeID, - "videoChat": VideoChatTypeID, - "chat": ChatTypeID, - "chats": ChatsTypeID, - "failedToAddMember": FailedToAddMemberTypeID, - "failedToAddMembers": FailedToAddMembersTypeID, - "createdBasicGroupChat": CreatedBasicGroupChatTypeID, - "publicChatTypeHasUsername": PublicChatTypeHasUsernameTypeID, - "publicChatTypeIsLocationBased": PublicChatTypeIsLocationBasedTypeID, - "chatActionBarReportSpam": ChatActionBarReportSpamTypeID, - "chatActionBarInviteMembers": ChatActionBarInviteMembersTypeID, - "chatActionBarReportAddBlock": ChatActionBarReportAddBlockTypeID, - "chatActionBarAddContact": ChatActionBarAddContactTypeID, - "chatActionBarSharePhoneNumber": ChatActionBarSharePhoneNumberTypeID, - "chatActionBarJoinRequest": ChatActionBarJoinRequestTypeID, - "keyboardButtonTypeText": KeyboardButtonTypeTextTypeID, - "keyboardButtonTypeRequestPhoneNumber": KeyboardButtonTypeRequestPhoneNumberTypeID, - "keyboardButtonTypeRequestLocation": KeyboardButtonTypeRequestLocationTypeID, - "keyboardButtonTypeRequestPoll": KeyboardButtonTypeRequestPollTypeID, - "keyboardButtonTypeRequestUsers": KeyboardButtonTypeRequestUsersTypeID, - "keyboardButtonTypeRequestChat": KeyboardButtonTypeRequestChatTypeID, - "keyboardButtonTypeWebApp": KeyboardButtonTypeWebAppTypeID, - "keyboardButton": KeyboardButtonTypeID, - "inlineKeyboardButtonTypeUrl": InlineKeyboardButtonTypeURLTypeID, - "inlineKeyboardButtonTypeLoginUrl": InlineKeyboardButtonTypeLoginURLTypeID, - "inlineKeyboardButtonTypeWebApp": InlineKeyboardButtonTypeWebAppTypeID, - "inlineKeyboardButtonTypeCallback": InlineKeyboardButtonTypeCallbackTypeID, - "inlineKeyboardButtonTypeCallbackWithPassword": InlineKeyboardButtonTypeCallbackWithPasswordTypeID, - "inlineKeyboardButtonTypeCallbackGame": InlineKeyboardButtonTypeCallbackGameTypeID, - "inlineKeyboardButtonTypeSwitchInline": InlineKeyboardButtonTypeSwitchInlineTypeID, - "inlineKeyboardButtonTypeBuy": InlineKeyboardButtonTypeBuyTypeID, - "inlineKeyboardButtonTypeUser": InlineKeyboardButtonTypeUserTypeID, - "inlineKeyboardButtonTypeCopyText": InlineKeyboardButtonTypeCopyTextTypeID, - "inlineKeyboardButton": InlineKeyboardButtonTypeID, - "replyMarkupRemoveKeyboard": ReplyMarkupRemoveKeyboardTypeID, - "replyMarkupForceReply": ReplyMarkupForceReplyTypeID, - "replyMarkupShowKeyboard": ReplyMarkupShowKeyboardTypeID, - "replyMarkupInlineKeyboard": ReplyMarkupInlineKeyboardTypeID, - "loginUrlInfoOpen": LoginURLInfoOpenTypeID, - "loginUrlInfoRequestConfirmation": LoginURLInfoRequestConfirmationTypeID, - "foundWebApp": FoundWebAppTypeID, - "webAppInfo": WebAppInfoTypeID, - "mainWebApp": MainWebAppTypeID, - "messageThreadInfo": MessageThreadInfoTypeID, - "savedMessagesTopicTypeMyNotes": SavedMessagesTopicTypeMyNotesTypeID, - "savedMessagesTopicTypeAuthorHidden": SavedMessagesTopicTypeAuthorHiddenTypeID, - "savedMessagesTopicTypeSavedFromChat": SavedMessagesTopicTypeSavedFromChatTypeID, - "savedMessagesTopic": SavedMessagesTopicTypeID, - "forumTopicIcon": ForumTopicIconTypeID, - "forumTopicInfo": ForumTopicInfoTypeID, - "forumTopic": ForumTopicTypeID, - "forumTopics": ForumTopicsTypeID, - "linkPreviewOptions": LinkPreviewOptionsTypeID, - "sharedUser": SharedUserTypeID, - "sharedChat": SharedChatTypeID, - "themeSettings": ThemeSettingsTypeID, - "richTextPlain": RichTextPlainTypeID, - "richTextBold": RichTextBoldTypeID, - "richTextItalic": RichTextItalicTypeID, - "richTextUnderline": RichTextUnderlineTypeID, - "richTextStrikethrough": RichTextStrikethroughTypeID, - "richTextFixed": RichTextFixedTypeID, - "richTextUrl": RichTextURLTypeID, - "richTextEmailAddress": RichTextEmailAddressTypeID, - "richTextSubscript": RichTextSubscriptTypeID, - "richTextSuperscript": RichTextSuperscriptTypeID, - "richTextMarked": RichTextMarkedTypeID, - "richTextPhoneNumber": RichTextPhoneNumberTypeID, - "richTextIcon": RichTextIconTypeID, - "richTextReference": RichTextReferenceTypeID, - "richTextAnchor": RichTextAnchorTypeID, - "richTextAnchorLink": RichTextAnchorLinkTypeID, - "richTexts": RichTextsTypeID, - "pageBlockCaption": PageBlockCaptionTypeID, - "pageBlockListItem": PageBlockListItemTypeID, - "pageBlockHorizontalAlignmentLeft": PageBlockHorizontalAlignmentLeftTypeID, - "pageBlockHorizontalAlignmentCenter": PageBlockHorizontalAlignmentCenterTypeID, - "pageBlockHorizontalAlignmentRight": PageBlockHorizontalAlignmentRightTypeID, - "pageBlockVerticalAlignmentTop": PageBlockVerticalAlignmentTopTypeID, - "pageBlockVerticalAlignmentMiddle": PageBlockVerticalAlignmentMiddleTypeID, - "pageBlockVerticalAlignmentBottom": PageBlockVerticalAlignmentBottomTypeID, - "pageBlockTableCell": PageBlockTableCellTypeID, - "pageBlockRelatedArticle": PageBlockRelatedArticleTypeID, - "pageBlockTitle": PageBlockTitleTypeID, - "pageBlockSubtitle": PageBlockSubtitleTypeID, - "pageBlockAuthorDate": PageBlockAuthorDateTypeID, - "pageBlockHeader": PageBlockHeaderTypeID, - "pageBlockSubheader": PageBlockSubheaderTypeID, - "pageBlockKicker": PageBlockKickerTypeID, - "pageBlockParagraph": PageBlockParagraphTypeID, - "pageBlockPreformatted": PageBlockPreformattedTypeID, - "pageBlockFooter": PageBlockFooterTypeID, - "pageBlockDivider": PageBlockDividerTypeID, - "pageBlockAnchor": PageBlockAnchorTypeID, - "pageBlockList": PageBlockListTypeID, - "pageBlockBlockQuote": PageBlockBlockQuoteTypeID, - "pageBlockPullQuote": PageBlockPullQuoteTypeID, - "pageBlockAnimation": PageBlockAnimationTypeID, - "pageBlockAudio": PageBlockAudioTypeID, - "pageBlockPhoto": PageBlockPhotoTypeID, - "pageBlockVideo": PageBlockVideoTypeID, - "pageBlockVoiceNote": PageBlockVoiceNoteTypeID, - "pageBlockCover": PageBlockCoverTypeID, - "pageBlockEmbedded": PageBlockEmbeddedTypeID, - "pageBlockEmbeddedPost": PageBlockEmbeddedPostTypeID, - "pageBlockCollage": PageBlockCollageTypeID, - "pageBlockSlideshow": PageBlockSlideshowTypeID, - "pageBlockChatLink": PageBlockChatLinkTypeID, - "pageBlockTable": PageBlockTableTypeID, - "pageBlockDetails": PageBlockDetailsTypeID, - "pageBlockRelatedArticles": PageBlockRelatedArticlesTypeID, - "pageBlockMap": PageBlockMapTypeID, - "webPageInstantView": WebPageInstantViewTypeID, - "linkPreviewAlbumMediaPhoto": LinkPreviewAlbumMediaPhotoTypeID, - "linkPreviewAlbumMediaVideo": LinkPreviewAlbumMediaVideoTypeID, - "linkPreviewTypeAlbum": LinkPreviewTypeAlbumTypeID, - "linkPreviewTypeAnimation": LinkPreviewTypeAnimationTypeID, - "linkPreviewTypeApp": LinkPreviewTypeAppTypeID, - "linkPreviewTypeArticle": LinkPreviewTypeArticleTypeID, - "linkPreviewTypeAudio": LinkPreviewTypeAudioTypeID, - "linkPreviewTypeBackground": LinkPreviewTypeBackgroundTypeID, - "linkPreviewTypeChannelBoost": LinkPreviewTypeChannelBoostTypeID, - "linkPreviewTypeChat": LinkPreviewTypeChatTypeID, - "linkPreviewTypeDocument": LinkPreviewTypeDocumentTypeID, - "linkPreviewTypeEmbeddedAnimationPlayer": LinkPreviewTypeEmbeddedAnimationPlayerTypeID, - "linkPreviewTypeEmbeddedAudioPlayer": LinkPreviewTypeEmbeddedAudioPlayerTypeID, - "linkPreviewTypeEmbeddedVideoPlayer": LinkPreviewTypeEmbeddedVideoPlayerTypeID, - "linkPreviewTypeExternalAudio": LinkPreviewTypeExternalAudioTypeID, - "linkPreviewTypeExternalVideo": LinkPreviewTypeExternalVideoTypeID, - "linkPreviewTypeInvoice": LinkPreviewTypeInvoiceTypeID, - "linkPreviewTypeMessage": LinkPreviewTypeMessageTypeID, - "linkPreviewTypePhoto": LinkPreviewTypePhotoTypeID, - "linkPreviewTypePremiumGiftCode": LinkPreviewTypePremiumGiftCodeTypeID, - "linkPreviewTypeShareableChatFolder": LinkPreviewTypeShareableChatFolderTypeID, - "linkPreviewTypeSticker": LinkPreviewTypeStickerTypeID, - "linkPreviewTypeStickerSet": LinkPreviewTypeStickerSetTypeID, - "linkPreviewTypeStory": LinkPreviewTypeStoryTypeID, - "linkPreviewTypeSupergroupBoost": LinkPreviewTypeSupergroupBoostTypeID, - "linkPreviewTypeTheme": LinkPreviewTypeThemeTypeID, - "linkPreviewTypeUnsupported": LinkPreviewTypeUnsupportedTypeID, - "linkPreviewTypeUser": LinkPreviewTypeUserTypeID, - "linkPreviewTypeVideo": LinkPreviewTypeVideoTypeID, - "linkPreviewTypeVideoChat": LinkPreviewTypeVideoChatTypeID, - "linkPreviewTypeVideoNote": LinkPreviewTypeVideoNoteTypeID, - "linkPreviewTypeVoiceNote": LinkPreviewTypeVoiceNoteTypeID, - "linkPreviewTypeWebApp": LinkPreviewTypeWebAppTypeID, - "linkPreview": LinkPreviewTypeID, - "countryInfo": CountryInfoTypeID, - "countries": CountriesTypeID, - "phoneNumberInfo": PhoneNumberInfoTypeID, - "collectibleItemTypeUsername": CollectibleItemTypeUsernameTypeID, - "collectibleItemTypePhoneNumber": CollectibleItemTypePhoneNumberTypeID, - "collectibleItemInfo": CollectibleItemInfoTypeID, - "bankCardActionOpenUrl": BankCardActionOpenURLTypeID, - "bankCardInfo": BankCardInfoTypeID, - "address": AddressTypeID, - "locationAddress": LocationAddressTypeID, - "themeParameters": ThemeParametersTypeID, - "labeledPricePart": LabeledPricePartTypeID, - "invoice": InvoiceTypeID, - "orderInfo": OrderInfoTypeID, - "shippingOption": ShippingOptionTypeID, - "savedCredentials": SavedCredentialsTypeID, - "inputCredentialsSaved": InputCredentialsSavedTypeID, - "inputCredentialsNew": InputCredentialsNewTypeID, - "inputCredentialsApplePay": InputCredentialsApplePayTypeID, - "inputCredentialsGooglePay": InputCredentialsGooglePayTypeID, - "paymentProviderSmartGlocal": PaymentProviderSmartGlocalTypeID, - "paymentProviderStripe": PaymentProviderStripeTypeID, - "paymentProviderOther": PaymentProviderOtherTypeID, - "paymentOption": PaymentOptionTypeID, - "paymentFormTypeRegular": PaymentFormTypeRegularTypeID, - "paymentFormTypeStars": PaymentFormTypeStarsTypeID, - "paymentForm": PaymentFormTypeID, - "validatedOrderInfo": ValidatedOrderInfoTypeID, - "paymentResult": PaymentResultTypeID, - "paymentReceiptTypeRegular": PaymentReceiptTypeRegularTypeID, - "paymentReceiptTypeStars": PaymentReceiptTypeStarsTypeID, - "paymentReceipt": PaymentReceiptTypeID, - "inputInvoiceMessage": InputInvoiceMessageTypeID, - "inputInvoiceName": InputInvoiceNameTypeID, - "inputInvoiceTelegram": InputInvoiceTelegramTypeID, - "paidMediaPreview": PaidMediaPreviewTypeID, - "paidMediaPhoto": PaidMediaPhotoTypeID, - "paidMediaVideo": PaidMediaVideoTypeID, - "paidMediaUnsupported": PaidMediaUnsupportedTypeID, - "giveawayParameters": GiveawayParametersTypeID, - "datedFile": DatedFileTypeID, - "passportElementTypePersonalDetails": PassportElementTypePersonalDetailsTypeID, - "passportElementTypePassport": PassportElementTypePassportTypeID, - "passportElementTypeDriverLicense": PassportElementTypeDriverLicenseTypeID, - "passportElementTypeIdentityCard": PassportElementTypeIdentityCardTypeID, - "passportElementTypeInternalPassport": PassportElementTypeInternalPassportTypeID, - "passportElementTypeAddress": PassportElementTypeAddressTypeID, - "passportElementTypeUtilityBill": PassportElementTypeUtilityBillTypeID, - "passportElementTypeBankStatement": PassportElementTypeBankStatementTypeID, - "passportElementTypeRentalAgreement": PassportElementTypeRentalAgreementTypeID, - "passportElementTypePassportRegistration": PassportElementTypePassportRegistrationTypeID, - "passportElementTypeTemporaryRegistration": PassportElementTypeTemporaryRegistrationTypeID, - "passportElementTypePhoneNumber": PassportElementTypePhoneNumberTypeID, - "passportElementTypeEmailAddress": PassportElementTypeEmailAddressTypeID, - "date": DateTypeID, - "personalDetails": PersonalDetailsTypeID, - "identityDocument": IdentityDocumentTypeID, - "inputIdentityDocument": InputIdentityDocumentTypeID, - "personalDocument": PersonalDocumentTypeID, - "inputPersonalDocument": InputPersonalDocumentTypeID, - "passportElementPersonalDetails": PassportElementPersonalDetailsTypeID, - "passportElementPassport": PassportElementPassportTypeID, - "passportElementDriverLicense": PassportElementDriverLicenseTypeID, - "passportElementIdentityCard": PassportElementIdentityCardTypeID, - "passportElementInternalPassport": PassportElementInternalPassportTypeID, - "passportElementAddress": PassportElementAddressTypeID, - "passportElementUtilityBill": PassportElementUtilityBillTypeID, - "passportElementBankStatement": PassportElementBankStatementTypeID, - "passportElementRentalAgreement": PassportElementRentalAgreementTypeID, - "passportElementPassportRegistration": PassportElementPassportRegistrationTypeID, - "passportElementTemporaryRegistration": PassportElementTemporaryRegistrationTypeID, - "passportElementPhoneNumber": PassportElementPhoneNumberTypeID, - "passportElementEmailAddress": PassportElementEmailAddressTypeID, - "inputPassportElementPersonalDetails": InputPassportElementPersonalDetailsTypeID, - "inputPassportElementPassport": InputPassportElementPassportTypeID, - "inputPassportElementDriverLicense": InputPassportElementDriverLicenseTypeID, - "inputPassportElementIdentityCard": InputPassportElementIdentityCardTypeID, - "inputPassportElementInternalPassport": InputPassportElementInternalPassportTypeID, - "inputPassportElementAddress": InputPassportElementAddressTypeID, - "inputPassportElementUtilityBill": InputPassportElementUtilityBillTypeID, - "inputPassportElementBankStatement": InputPassportElementBankStatementTypeID, - "inputPassportElementRentalAgreement": InputPassportElementRentalAgreementTypeID, - "inputPassportElementPassportRegistration": InputPassportElementPassportRegistrationTypeID, - "inputPassportElementTemporaryRegistration": InputPassportElementTemporaryRegistrationTypeID, - "inputPassportElementPhoneNumber": InputPassportElementPhoneNumberTypeID, - "inputPassportElementEmailAddress": InputPassportElementEmailAddressTypeID, - "passportElements": PassportElementsTypeID, - "passportElementErrorSourceUnspecified": PassportElementErrorSourceUnspecifiedTypeID, - "passportElementErrorSourceDataField": PassportElementErrorSourceDataFieldTypeID, - "passportElementErrorSourceFrontSide": PassportElementErrorSourceFrontSideTypeID, - "passportElementErrorSourceReverseSide": PassportElementErrorSourceReverseSideTypeID, - "passportElementErrorSourceSelfie": PassportElementErrorSourceSelfieTypeID, - "passportElementErrorSourceTranslationFile": PassportElementErrorSourceTranslationFileTypeID, - "passportElementErrorSourceTranslationFiles": PassportElementErrorSourceTranslationFilesTypeID, - "passportElementErrorSourceFile": PassportElementErrorSourceFileTypeID, - "passportElementErrorSourceFiles": PassportElementErrorSourceFilesTypeID, - "passportElementError": PassportElementErrorTypeID, - "passportSuitableElement": PassportSuitableElementTypeID, - "passportRequiredElement": PassportRequiredElementTypeID, - "passportAuthorizationForm": PassportAuthorizationFormTypeID, - "passportElementsWithErrors": PassportElementsWithErrorsTypeID, - "encryptedCredentials": EncryptedCredentialsTypeID, - "encryptedPassportElement": EncryptedPassportElementTypeID, - "inputPassportElementErrorSourceUnspecified": InputPassportElementErrorSourceUnspecifiedTypeID, - "inputPassportElementErrorSourceDataField": InputPassportElementErrorSourceDataFieldTypeID, - "inputPassportElementErrorSourceFrontSide": InputPassportElementErrorSourceFrontSideTypeID, - "inputPassportElementErrorSourceReverseSide": InputPassportElementErrorSourceReverseSideTypeID, - "inputPassportElementErrorSourceSelfie": InputPassportElementErrorSourceSelfieTypeID, - "inputPassportElementErrorSourceTranslationFile": InputPassportElementErrorSourceTranslationFileTypeID, - "inputPassportElementErrorSourceTranslationFiles": InputPassportElementErrorSourceTranslationFilesTypeID, - "inputPassportElementErrorSourceFile": InputPassportElementErrorSourceFileTypeID, - "inputPassportElementErrorSourceFiles": InputPassportElementErrorSourceFilesTypeID, - "inputPassportElementError": InputPassportElementErrorTypeID, - "messageText": MessageTextTypeID, - "messageAnimation": MessageAnimationTypeID, - "messageAudio": MessageAudioTypeID, - "messageDocument": MessageDocumentTypeID, - "messagePaidMedia": MessagePaidMediaTypeID, - "messagePhoto": MessagePhotoTypeID, - "messageSticker": MessageStickerTypeID, - "messageVideo": MessageVideoTypeID, - "messageVideoNote": MessageVideoNoteTypeID, - "messageVoiceNote": MessageVoiceNoteTypeID, - "messageExpiredPhoto": MessageExpiredPhotoTypeID, - "messageExpiredVideo": MessageExpiredVideoTypeID, - "messageExpiredVideoNote": MessageExpiredVideoNoteTypeID, - "messageExpiredVoiceNote": MessageExpiredVoiceNoteTypeID, - "messageLocation": MessageLocationTypeID, - "messageVenue": MessageVenueTypeID, - "messageContact": MessageContactTypeID, - "messageAnimatedEmoji": MessageAnimatedEmojiTypeID, - "messageDice": MessageDiceTypeID, - "messageGame": MessageGameTypeID, - "messagePoll": MessagePollTypeID, - "messageStory": MessageStoryTypeID, - "messageInvoice": MessageInvoiceTypeID, - "messageCall": MessageCallTypeID, - "messageVideoChatScheduled": MessageVideoChatScheduledTypeID, - "messageVideoChatStarted": MessageVideoChatStartedTypeID, - "messageVideoChatEnded": MessageVideoChatEndedTypeID, - "messageInviteVideoChatParticipants": MessageInviteVideoChatParticipantsTypeID, - "messageBasicGroupChatCreate": MessageBasicGroupChatCreateTypeID, - "messageSupergroupChatCreate": MessageSupergroupChatCreateTypeID, - "messageChatChangeTitle": MessageChatChangeTitleTypeID, - "messageChatChangePhoto": MessageChatChangePhotoTypeID, - "messageChatDeletePhoto": MessageChatDeletePhotoTypeID, - "messageChatAddMembers": MessageChatAddMembersTypeID, - "messageChatJoinByLink": MessageChatJoinByLinkTypeID, - "messageChatJoinByRequest": MessageChatJoinByRequestTypeID, - "messageChatDeleteMember": MessageChatDeleteMemberTypeID, - "messageChatUpgradeTo": MessageChatUpgradeToTypeID, - "messageChatUpgradeFrom": MessageChatUpgradeFromTypeID, - "messagePinMessage": MessagePinMessageTypeID, - "messageScreenshotTaken": MessageScreenshotTakenTypeID, - "messageChatSetBackground": MessageChatSetBackgroundTypeID, - "messageChatSetTheme": MessageChatSetThemeTypeID, - "messageChatSetMessageAutoDeleteTime": MessageChatSetMessageAutoDeleteTimeTypeID, - "messageChatBoost": MessageChatBoostTypeID, - "messageForumTopicCreated": MessageForumTopicCreatedTypeID, - "messageForumTopicEdited": MessageForumTopicEditedTypeID, - "messageForumTopicIsClosedToggled": MessageForumTopicIsClosedToggledTypeID, - "messageForumTopicIsHiddenToggled": MessageForumTopicIsHiddenToggledTypeID, - "messageSuggestProfilePhoto": MessageSuggestProfilePhotoTypeID, - "messageCustomServiceAction": MessageCustomServiceActionTypeID, - "messageGameScore": MessageGameScoreTypeID, - "messagePaymentSuccessful": MessagePaymentSuccessfulTypeID, - "messagePaymentSuccessfulBot": MessagePaymentSuccessfulBotTypeID, - "messagePaymentRefunded": MessagePaymentRefundedTypeID, - "messageGiftedPremium": MessageGiftedPremiumTypeID, - "messagePremiumGiftCode": MessagePremiumGiftCodeTypeID, - "messageGiveawayCreated": MessageGiveawayCreatedTypeID, - "messageGiveaway": MessageGiveawayTypeID, - "messageGiveawayCompleted": MessageGiveawayCompletedTypeID, - "messageGiveawayWinners": MessageGiveawayWinnersTypeID, - "messageGiftedStars": MessageGiftedStarsTypeID, - "messageGiveawayPrizeStars": MessageGiveawayPrizeStarsTypeID, - "messageGift": MessageGiftTypeID, - "messageContactRegistered": MessageContactRegisteredTypeID, - "messageUsersShared": MessageUsersSharedTypeID, - "messageChatShared": MessageChatSharedTypeID, - "messageBotWriteAccessAllowed": MessageBotWriteAccessAllowedTypeID, - "messageWebAppDataSent": MessageWebAppDataSentTypeID, - "messageWebAppDataReceived": MessageWebAppDataReceivedTypeID, - "messagePassportDataSent": MessagePassportDataSentTypeID, - "messagePassportDataReceived": MessagePassportDataReceivedTypeID, - "messageProximityAlertTriggered": MessageProximityAlertTriggeredTypeID, - "messageUnsupported": MessageUnsupportedTypeID, - "textEntityTypeMention": TextEntityTypeMentionTypeID, - "textEntityTypeHashtag": TextEntityTypeHashtagTypeID, - "textEntityTypeCashtag": TextEntityTypeCashtagTypeID, - "textEntityTypeBotCommand": TextEntityTypeBotCommandTypeID, - "textEntityTypeUrl": TextEntityTypeURLTypeID, - "textEntityTypeEmailAddress": TextEntityTypeEmailAddressTypeID, - "textEntityTypePhoneNumber": TextEntityTypePhoneNumberTypeID, - "textEntityTypeBankCardNumber": TextEntityTypeBankCardNumberTypeID, - "textEntityTypeBold": TextEntityTypeBoldTypeID, - "textEntityTypeItalic": TextEntityTypeItalicTypeID, - "textEntityTypeUnderline": TextEntityTypeUnderlineTypeID, - "textEntityTypeStrikethrough": TextEntityTypeStrikethroughTypeID, - "textEntityTypeSpoiler": TextEntityTypeSpoilerTypeID, - "textEntityTypeCode": TextEntityTypeCodeTypeID, - "textEntityTypePre": TextEntityTypePreTypeID, - "textEntityTypePreCode": TextEntityTypePreCodeTypeID, - "textEntityTypeBlockQuote": TextEntityTypeBlockQuoteTypeID, - "textEntityTypeExpandableBlockQuote": TextEntityTypeExpandableBlockQuoteTypeID, - "textEntityTypeTextUrl": TextEntityTypeTextURLTypeID, - "textEntityTypeMentionName": TextEntityTypeMentionNameTypeID, - "textEntityTypeCustomEmoji": TextEntityTypeCustomEmojiTypeID, - "textEntityTypeMediaTimestamp": TextEntityTypeMediaTimestampTypeID, - "inputThumbnail": InputThumbnailTypeID, - "inputPaidMediaTypePhoto": InputPaidMediaTypePhotoTypeID, - "inputPaidMediaTypeVideo": InputPaidMediaTypeVideoTypeID, - "inputPaidMedia": InputPaidMediaTypeID, - "messageSchedulingStateSendAtDate": MessageSchedulingStateSendAtDateTypeID, - "messageSchedulingStateSendWhenOnline": MessageSchedulingStateSendWhenOnlineTypeID, - "messageSchedulingStateSendWhenVideoProcessed": MessageSchedulingStateSendWhenVideoProcessedTypeID, - "messageSelfDestructTypeTimer": MessageSelfDestructTypeTimerTypeID, - "messageSelfDestructTypeImmediately": MessageSelfDestructTypeImmediatelyTypeID, - "messageSendOptions": MessageSendOptionsTypeID, - "messageCopyOptions": MessageCopyOptionsTypeID, - "inputMessageText": InputMessageTextTypeID, - "inputMessageAnimation": InputMessageAnimationTypeID, - "inputMessageAudio": InputMessageAudioTypeID, - "inputMessageDocument": InputMessageDocumentTypeID, - "inputMessagePaidMedia": InputMessagePaidMediaTypeID, - "inputMessagePhoto": InputMessagePhotoTypeID, - "inputMessageSticker": InputMessageStickerTypeID, - "inputMessageVideo": InputMessageVideoTypeID, - "inputMessageVideoNote": InputMessageVideoNoteTypeID, - "inputMessageVoiceNote": InputMessageVoiceNoteTypeID, - "inputMessageLocation": InputMessageLocationTypeID, - "inputMessageVenue": InputMessageVenueTypeID, - "inputMessageContact": InputMessageContactTypeID, - "inputMessageDice": InputMessageDiceTypeID, - "inputMessageGame": InputMessageGameTypeID, - "inputMessageInvoice": InputMessageInvoiceTypeID, - "inputMessagePoll": InputMessagePollTypeID, - "inputMessageStory": InputMessageStoryTypeID, - "inputMessageForwarded": InputMessageForwardedTypeID, - "messageProperties": MessagePropertiesTypeID, - "searchMessagesFilterEmpty": SearchMessagesFilterEmptyTypeID, - "searchMessagesFilterAnimation": SearchMessagesFilterAnimationTypeID, - "searchMessagesFilterAudio": SearchMessagesFilterAudioTypeID, - "searchMessagesFilterDocument": SearchMessagesFilterDocumentTypeID, - "searchMessagesFilterPhoto": SearchMessagesFilterPhotoTypeID, - "searchMessagesFilterVideo": SearchMessagesFilterVideoTypeID, - "searchMessagesFilterVoiceNote": SearchMessagesFilterVoiceNoteTypeID, - "searchMessagesFilterPhotoAndVideo": SearchMessagesFilterPhotoAndVideoTypeID, - "searchMessagesFilterUrl": SearchMessagesFilterURLTypeID, - "searchMessagesFilterChatPhoto": SearchMessagesFilterChatPhotoTypeID, - "searchMessagesFilterVideoNote": SearchMessagesFilterVideoNoteTypeID, - "searchMessagesFilterVoiceAndVideoNote": SearchMessagesFilterVoiceAndVideoNoteTypeID, - "searchMessagesFilterMention": SearchMessagesFilterMentionTypeID, - "searchMessagesFilterUnreadMention": SearchMessagesFilterUnreadMentionTypeID, - "searchMessagesFilterUnreadReaction": SearchMessagesFilterUnreadReactionTypeID, - "searchMessagesFilterFailedToSend": SearchMessagesFilterFailedToSendTypeID, - "searchMessagesFilterPinned": SearchMessagesFilterPinnedTypeID, - "chatActionTyping": ChatActionTypingTypeID, - "chatActionRecordingVideo": ChatActionRecordingVideoTypeID, - "chatActionUploadingVideo": ChatActionUploadingVideoTypeID, - "chatActionRecordingVoiceNote": ChatActionRecordingVoiceNoteTypeID, - "chatActionUploadingVoiceNote": ChatActionUploadingVoiceNoteTypeID, - "chatActionUploadingPhoto": ChatActionUploadingPhotoTypeID, - "chatActionUploadingDocument": ChatActionUploadingDocumentTypeID, - "chatActionChoosingSticker": ChatActionChoosingStickerTypeID, - "chatActionChoosingLocation": ChatActionChoosingLocationTypeID, - "chatActionChoosingContact": ChatActionChoosingContactTypeID, - "chatActionStartPlayingGame": ChatActionStartPlayingGameTypeID, - "chatActionRecordingVideoNote": ChatActionRecordingVideoNoteTypeID, - "chatActionUploadingVideoNote": ChatActionUploadingVideoNoteTypeID, - "chatActionWatchingAnimations": ChatActionWatchingAnimationsTypeID, - "chatActionCancel": ChatActionCancelTypeID, - "userStatusEmpty": UserStatusEmptyTypeID, - "userStatusOnline": UserStatusOnlineTypeID, - "userStatusOffline": UserStatusOfflineTypeID, - "userStatusRecently": UserStatusRecentlyTypeID, - "userStatusLastWeek": UserStatusLastWeekTypeID, - "userStatusLastMonth": UserStatusLastMonthTypeID, - "emojiKeyword": EmojiKeywordTypeID, - "emojiKeywords": EmojiKeywordsTypeID, - "stickers": StickersTypeID, - "emojis": EmojisTypeID, - "stickerSet": StickerSetTypeID, - "stickerSetInfo": StickerSetInfoTypeID, - "stickerSets": StickerSetsTypeID, - "trendingStickerSets": TrendingStickerSetsTypeID, - "emojiCategorySourceSearch": EmojiCategorySourceSearchTypeID, - "emojiCategorySourcePremium": EmojiCategorySourcePremiumTypeID, - "emojiCategory": EmojiCategoryTypeID, - "emojiCategories": EmojiCategoriesTypeID, - "emojiCategoryTypeDefault": EmojiCategoryTypeDefaultTypeID, - "emojiCategoryTypeRegularStickers": EmojiCategoryTypeRegularStickersTypeID, - "emojiCategoryTypeEmojiStatus": EmojiCategoryTypeEmojiStatusTypeID, - "emojiCategoryTypeChatPhoto": EmojiCategoryTypeChatPhotoTypeID, - "currentWeather": CurrentWeatherTypeID, - "storyAreaPosition": StoryAreaPositionTypeID, - "storyAreaTypeLocation": StoryAreaTypeLocationTypeID, - "storyAreaTypeVenue": StoryAreaTypeVenueTypeID, - "storyAreaTypeSuggestedReaction": StoryAreaTypeSuggestedReactionTypeID, - "storyAreaTypeMessage": StoryAreaTypeMessageTypeID, - "storyAreaTypeLink": StoryAreaTypeLinkTypeID, - "storyAreaTypeWeather": StoryAreaTypeWeatherTypeID, - "storyArea": StoryAreaTypeID, - "inputStoryAreaTypeLocation": InputStoryAreaTypeLocationTypeID, - "inputStoryAreaTypeFoundVenue": InputStoryAreaTypeFoundVenueTypeID, - "inputStoryAreaTypePreviousVenue": InputStoryAreaTypePreviousVenueTypeID, - "inputStoryAreaTypeSuggestedReaction": InputStoryAreaTypeSuggestedReactionTypeID, - "inputStoryAreaTypeMessage": InputStoryAreaTypeMessageTypeID, - "inputStoryAreaTypeLink": InputStoryAreaTypeLinkTypeID, - "inputStoryAreaTypeWeather": InputStoryAreaTypeWeatherTypeID, - "inputStoryArea": InputStoryAreaTypeID, - "inputStoryAreas": InputStoryAreasTypeID, - "storyVideo": StoryVideoTypeID, - "storyContentPhoto": StoryContentPhotoTypeID, - "storyContentVideo": StoryContentVideoTypeID, - "storyContentUnsupported": StoryContentUnsupportedTypeID, - "inputStoryContentPhoto": InputStoryContentPhotoTypeID, - "inputStoryContentVideo": InputStoryContentVideoTypeID, - "storyListMain": StoryListMainTypeID, - "storyListArchive": StoryListArchiveTypeID, - "storyOriginPublicStory": StoryOriginPublicStoryTypeID, - "storyOriginHiddenUser": StoryOriginHiddenUserTypeID, - "storyRepostInfo": StoryRepostInfoTypeID, - "storyInteractionInfo": StoryInteractionInfoTypeID, - "story": StoryTypeID, - "stories": StoriesTypeID, - "foundStories": FoundStoriesTypeID, - "storyFullId": StoryFullIDTypeID, - "storyInfo": StoryInfoTypeID, - "chatActiveStories": ChatActiveStoriesTypeID, - "storyInteractionTypeView": StoryInteractionTypeViewTypeID, - "storyInteractionTypeForward": StoryInteractionTypeForwardTypeID, - "storyInteractionTypeRepost": StoryInteractionTypeRepostTypeID, - "storyInteraction": StoryInteractionTypeID, - "storyInteractions": StoryInteractionsTypeID, - "quickReplyMessage": QuickReplyMessageTypeID, - "quickReplyMessages": QuickReplyMessagesTypeID, - "quickReplyShortcut": QuickReplyShortcutTypeID, - "publicForwardMessage": PublicForwardMessageTypeID, - "publicForwardStory": PublicForwardStoryTypeID, - "publicForwards": PublicForwardsTypeID, - "botMediaPreview": BotMediaPreviewTypeID, - "botMediaPreviews": BotMediaPreviewsTypeID, - "botMediaPreviewInfo": BotMediaPreviewInfoTypeID, - "chatBoostLevelFeatures": ChatBoostLevelFeaturesTypeID, - "chatBoostFeatures": ChatBoostFeaturesTypeID, - "chatBoostSourceGiftCode": ChatBoostSourceGiftCodeTypeID, - "chatBoostSourceGiveaway": ChatBoostSourceGiveawayTypeID, - "chatBoostSourcePremium": ChatBoostSourcePremiumTypeID, - "prepaidGiveaway": PrepaidGiveawayTypeID, - "chatBoostStatus": ChatBoostStatusTypeID, - "chatBoost": ChatBoostTypeID, - "foundChatBoosts": FoundChatBoostsTypeID, - "chatBoostSlot": ChatBoostSlotTypeID, - "chatBoostSlots": ChatBoostSlotsTypeID, - "resendCodeReasonUserRequest": ResendCodeReasonUserRequestTypeID, - "resendCodeReasonVerificationFailed": ResendCodeReasonVerificationFailedTypeID, - "callDiscardReasonEmpty": CallDiscardReasonEmptyTypeID, - "callDiscardReasonMissed": CallDiscardReasonMissedTypeID, - "callDiscardReasonDeclined": CallDiscardReasonDeclinedTypeID, - "callDiscardReasonDisconnected": CallDiscardReasonDisconnectedTypeID, - "callDiscardReasonHungUp": CallDiscardReasonHungUpTypeID, - "callProtocol": CallProtocolTypeID, - "callServerTypeTelegramReflector": CallServerTypeTelegramReflectorTypeID, - "callServerTypeWebrtc": CallServerTypeWebrtcTypeID, - "callServer": CallServerTypeID, - "callId": CallIDTypeID, - "groupCallId": GroupCallIDTypeID, - "callStatePending": CallStatePendingTypeID, - "callStateExchangingKeys": CallStateExchangingKeysTypeID, - "callStateReady": CallStateReadyTypeID, - "callStateHangingUp": CallStateHangingUpTypeID, - "callStateDiscarded": CallStateDiscardedTypeID, - "callStateError": CallStateErrorTypeID, - "groupCallVideoQualityThumbnail": GroupCallVideoQualityThumbnailTypeID, - "groupCallVideoQualityMedium": GroupCallVideoQualityMediumTypeID, - "groupCallVideoQualityFull": GroupCallVideoQualityFullTypeID, - "groupCallStream": GroupCallStreamTypeID, - "groupCallStreams": GroupCallStreamsTypeID, - "rtmpUrl": RtmpURLTypeID, - "groupCallRecentSpeaker": GroupCallRecentSpeakerTypeID, - "groupCall": GroupCallTypeID, - "groupCallVideoSourceGroup": GroupCallVideoSourceGroupTypeID, - "groupCallParticipantVideoInfo": GroupCallParticipantVideoInfoTypeID, - "groupCallParticipant": GroupCallParticipantTypeID, - "callProblemEcho": CallProblemEchoTypeID, - "callProblemNoise": CallProblemNoiseTypeID, - "callProblemInterruptions": CallProblemInterruptionsTypeID, - "callProblemDistortedSpeech": CallProblemDistortedSpeechTypeID, - "callProblemSilentLocal": CallProblemSilentLocalTypeID, - "callProblemSilentRemote": CallProblemSilentRemoteTypeID, - "callProblemDropped": CallProblemDroppedTypeID, - "callProblemDistortedVideo": CallProblemDistortedVideoTypeID, - "callProblemPixelatedVideo": CallProblemPixelatedVideoTypeID, - "call": CallTypeID, - "firebaseAuthenticationSettingsAndroid": FirebaseAuthenticationSettingsAndroidTypeID, - "firebaseAuthenticationSettingsIos": FirebaseAuthenticationSettingsIosTypeID, - "phoneNumberAuthenticationSettings": PhoneNumberAuthenticationSettingsTypeID, - "addedReaction": AddedReactionTypeID, - "addedReactions": AddedReactionsTypeID, - "availableReaction": AvailableReactionTypeID, - "availableReactions": AvailableReactionsTypeID, - "emojiReaction": EmojiReactionTypeID, - "reactionUnavailabilityReasonAnonymousAdministrator": ReactionUnavailabilityReasonAnonymousAdministratorTypeID, - "reactionUnavailabilityReasonGuest": ReactionUnavailabilityReasonGuestTypeID, - "animations": AnimationsTypeID, - "diceStickersRegular": DiceStickersRegularTypeID, - "diceStickersSlotMachine": DiceStickersSlotMachineTypeID, - "importedContacts": ImportedContactsTypeID, - "speechRecognitionResultPending": SpeechRecognitionResultPendingTypeID, - "speechRecognitionResultText": SpeechRecognitionResultTextTypeID, - "speechRecognitionResultError": SpeechRecognitionResultErrorTypeID, - "businessConnection": BusinessConnectionTypeID, - "attachmentMenuBotColor": AttachmentMenuBotColorTypeID, - "attachmentMenuBot": AttachmentMenuBotTypeID, - "sentWebAppMessage": SentWebAppMessageTypeID, - "botWriteAccessAllowReasonConnectedWebsite": BotWriteAccessAllowReasonConnectedWebsiteTypeID, - "botWriteAccessAllowReasonAddedToAttachmentMenu": BotWriteAccessAllowReasonAddedToAttachmentMenuTypeID, - "botWriteAccessAllowReasonLaunchedWebApp": BotWriteAccessAllowReasonLaunchedWebAppTypeID, - "botWriteAccessAllowReasonAcceptedRequest": BotWriteAccessAllowReasonAcceptedRequestTypeID, + "businessAwayMessageScheduleOutsideOfOpeningHours": BusinessAwayMessageScheduleOutsideOfOpeningHoursTypeID, + "businessAwayMessageScheduleCustom": BusinessAwayMessageScheduleCustomTypeID, + "businessLocation": BusinessLocationTypeID, + "businessRecipients": BusinessRecipientsTypeID, + "businessAwayMessageSettings": BusinessAwayMessageSettingsTypeID, + "businessGreetingMessageSettings": BusinessGreetingMessageSettingsTypeID, + "businessConnectedBot": BusinessConnectedBotTypeID, + "businessStartPage": BusinessStartPageTypeID, + "inputBusinessStartPage": InputBusinessStartPageTypeID, + "businessOpeningHoursInterval": BusinessOpeningHoursIntervalTypeID, + "businessOpeningHours": BusinessOpeningHoursTypeID, + "businessInfo": BusinessInfoTypeID, + "businessChatLink": BusinessChatLinkTypeID, + "businessChatLinks": BusinessChatLinksTypeID, + "inputBusinessChatLink": InputBusinessChatLinkTypeID, + "businessChatLinkInfo": BusinessChatLinkInfoTypeID, + "chatPhotoStickerTypeRegularOrMask": ChatPhotoStickerTypeRegularOrMaskTypeID, + "chatPhotoStickerTypeCustomEmoji": ChatPhotoStickerTypeCustomEmojiTypeID, + "chatPhotoSticker": ChatPhotoStickerTypeID, + "animatedChatPhoto": AnimatedChatPhotoTypeID, + "chatPhoto": ChatPhotoTypeID, + "chatPhotos": ChatPhotosTypeID, + "inputChatPhotoPrevious": InputChatPhotoPreviousTypeID, + "inputChatPhotoStatic": InputChatPhotoStaticTypeID, + "inputChatPhotoAnimation": InputChatPhotoAnimationTypeID, + "inputChatPhotoSticker": InputChatPhotoStickerTypeID, + "chatPermissions": ChatPermissionsTypeID, + "chatAdministratorRights": ChatAdministratorRightsTypeID, + "starSubscriptionTypeChannel": StarSubscriptionTypeChannelTypeID, + "starSubscriptionTypeBot": StarSubscriptionTypeBotTypeID, + "starSubscriptionPricing": StarSubscriptionPricingTypeID, + "starSubscription": StarSubscriptionTypeID, + "starSubscriptions": StarSubscriptionsTypeID, + "productInfo": ProductInfoTypeID, + "premiumPaymentOption": PremiumPaymentOptionTypeID, + "premiumStatePaymentOption": PremiumStatePaymentOptionTypeID, + "premiumGiftCodePaymentOption": PremiumGiftCodePaymentOptionTypeID, + "premiumGiftCodePaymentOptions": PremiumGiftCodePaymentOptionsTypeID, + "premiumGiftCodeInfo": PremiumGiftCodeInfoTypeID, + "starPaymentOption": StarPaymentOptionTypeID, + "starPaymentOptions": StarPaymentOptionsTypeID, + "starGiveawayWinnerOption": StarGiveawayWinnerOptionTypeID, + "starGiveawayPaymentOption": StarGiveawayPaymentOptionTypeID, + "starGiveawayPaymentOptions": StarGiveawayPaymentOptionsTypeID, + "gift": GiftTypeID, + "gifts": GiftsTypeID, + "userGift": UserGiftTypeID, + "userGifts": UserGiftsTypeID, + "starTransactionDirectionIncoming": StarTransactionDirectionIncomingTypeID, + "starTransactionDirectionOutgoing": StarTransactionDirectionOutgoingTypeID, + "botTransactionPurposePaidMedia": BotTransactionPurposePaidMediaTypeID, + "botTransactionPurposeInvoicePayment": BotTransactionPurposeInvoicePaymentTypeID, + "botTransactionPurposeSubscription": BotTransactionPurposeSubscriptionTypeID, + "chatTransactionPurposePaidMedia": ChatTransactionPurposePaidMediaTypeID, + "chatTransactionPurposeJoin": ChatTransactionPurposeJoinTypeID, + "chatTransactionPurposeReaction": ChatTransactionPurposeReactionTypeID, + "chatTransactionPurposeGiveaway": ChatTransactionPurposeGiveawayTypeID, + "userTransactionPurposeGiftedStars": UserTransactionPurposeGiftedStarsTypeID, + "userTransactionPurposeGiftSell": UserTransactionPurposeGiftSellTypeID, + "userTransactionPurposeGiftSend": UserTransactionPurposeGiftSendTypeID, + "starTransactionPartnerTelegram": StarTransactionPartnerTelegramTypeID, + "starTransactionPartnerAppStore": StarTransactionPartnerAppStoreTypeID, + "starTransactionPartnerGooglePlay": StarTransactionPartnerGooglePlayTypeID, + "starTransactionPartnerFragment": StarTransactionPartnerFragmentTypeID, + "starTransactionPartnerTelegramAds": StarTransactionPartnerTelegramAdsTypeID, + "starTransactionPartnerTelegramApi": StarTransactionPartnerTelegramAPITypeID, + "starTransactionPartnerBot": StarTransactionPartnerBotTypeID, + "starTransactionPartnerBusiness": StarTransactionPartnerBusinessTypeID, + "starTransactionPartnerChat": StarTransactionPartnerChatTypeID, + "starTransactionPartnerUser": StarTransactionPartnerUserTypeID, + "starTransactionPartnerUnsupported": StarTransactionPartnerUnsupportedTypeID, + "starTransaction": StarTransactionTypeID, + "starTransactions": StarTransactionsTypeID, + "giveawayParticipantStatusEligible": GiveawayParticipantStatusEligibleTypeID, + "giveawayParticipantStatusParticipating": GiveawayParticipantStatusParticipatingTypeID, + "giveawayParticipantStatusAlreadyWasMember": GiveawayParticipantStatusAlreadyWasMemberTypeID, + "giveawayParticipantStatusAdministrator": GiveawayParticipantStatusAdministratorTypeID, + "giveawayParticipantStatusDisallowedCountry": GiveawayParticipantStatusDisallowedCountryTypeID, + "giveawayInfoOngoing": GiveawayInfoOngoingTypeID, + "giveawayInfoCompleted": GiveawayInfoCompletedTypeID, + "giveawayPrizePremium": GiveawayPrizePremiumTypeID, + "giveawayPrizeStars": GiveawayPrizeStarsTypeID, + "accentColor": AccentColorTypeID, + "profileAccentColors": ProfileAccentColorsTypeID, + "profileAccentColor": ProfileAccentColorTypeID, + "emojiStatus": EmojiStatusTypeID, + "emojiStatuses": EmojiStatusesTypeID, + "usernames": UsernamesTypeID, + "user": UserTypeID, + "botInfo": BotInfoTypeID, + "userFullInfo": UserFullInfoTypeID, + "users": UsersTypeID, + "foundUsers": FoundUsersTypeID, + "chatAdministrator": ChatAdministratorTypeID, + "chatAdministrators": ChatAdministratorsTypeID, + "chatMemberStatusCreator": ChatMemberStatusCreatorTypeID, + "chatMemberStatusAdministrator": ChatMemberStatusAdministratorTypeID, + "chatMemberStatusMember": ChatMemberStatusMemberTypeID, + "chatMemberStatusRestricted": ChatMemberStatusRestrictedTypeID, + "chatMemberStatusLeft": ChatMemberStatusLeftTypeID, + "chatMemberStatusBanned": ChatMemberStatusBannedTypeID, + "chatMember": ChatMemberTypeID, + "chatMembers": ChatMembersTypeID, + "chatMembersFilterContacts": ChatMembersFilterContactsTypeID, + "chatMembersFilterAdministrators": ChatMembersFilterAdministratorsTypeID, + "chatMembersFilterMembers": ChatMembersFilterMembersTypeID, + "chatMembersFilterMention": ChatMembersFilterMentionTypeID, + "chatMembersFilterRestricted": ChatMembersFilterRestrictedTypeID, + "chatMembersFilterBanned": ChatMembersFilterBannedTypeID, + "chatMembersFilterBots": ChatMembersFilterBotsTypeID, + "supergroupMembersFilterRecent": SupergroupMembersFilterRecentTypeID, + "supergroupMembersFilterContacts": SupergroupMembersFilterContactsTypeID, + "supergroupMembersFilterAdministrators": SupergroupMembersFilterAdministratorsTypeID, + "supergroupMembersFilterSearch": SupergroupMembersFilterSearchTypeID, + "supergroupMembersFilterRestricted": SupergroupMembersFilterRestrictedTypeID, + "supergroupMembersFilterBanned": SupergroupMembersFilterBannedTypeID, + "supergroupMembersFilterMention": SupergroupMembersFilterMentionTypeID, + "supergroupMembersFilterBots": SupergroupMembersFilterBotsTypeID, + "chatInviteLink": ChatInviteLinkTypeID, + "chatInviteLinks": ChatInviteLinksTypeID, + "chatInviteLinkCount": ChatInviteLinkCountTypeID, + "chatInviteLinkCounts": ChatInviteLinkCountsTypeID, + "chatInviteLinkMember": ChatInviteLinkMemberTypeID, + "chatInviteLinkMembers": ChatInviteLinkMembersTypeID, + "inviteLinkChatTypeBasicGroup": InviteLinkChatTypeBasicGroupTypeID, + "inviteLinkChatTypeSupergroup": InviteLinkChatTypeSupergroupTypeID, + "inviteLinkChatTypeChannel": InviteLinkChatTypeChannelTypeID, + "chatInviteLinkSubscriptionInfo": ChatInviteLinkSubscriptionInfoTypeID, + "chatInviteLinkInfo": ChatInviteLinkInfoTypeID, + "chatJoinRequest": ChatJoinRequestTypeID, + "chatJoinRequests": ChatJoinRequestsTypeID, + "chatJoinRequestsInfo": ChatJoinRequestsInfoTypeID, + "basicGroup": BasicGroupTypeID, + "basicGroupFullInfo": BasicGroupFullInfoTypeID, + "supergroup": SupergroupTypeID, + "supergroupFullInfo": SupergroupFullInfoTypeID, + "secretChatStatePending": SecretChatStatePendingTypeID, + "secretChatStateReady": SecretChatStateReadyTypeID, + "secretChatStateClosed": SecretChatStateClosedTypeID, + "secretChat": SecretChatTypeID, + "messageSenderUser": MessageSenderUserTypeID, + "messageSenderChat": MessageSenderChatTypeID, + "messageSenders": MessageSendersTypeID, + "chatMessageSender": ChatMessageSenderTypeID, + "chatMessageSenders": ChatMessageSendersTypeID, + "messageReadDateRead": MessageReadDateReadTypeID, + "messageReadDateUnread": MessageReadDateUnreadTypeID, + "messageReadDateTooOld": MessageReadDateTooOldTypeID, + "messageReadDateUserPrivacyRestricted": MessageReadDateUserPrivacyRestrictedTypeID, + "messageReadDateMyPrivacyRestricted": MessageReadDateMyPrivacyRestrictedTypeID, + "messageViewer": MessageViewerTypeID, + "messageViewers": MessageViewersTypeID, + "messageOriginUser": MessageOriginUserTypeID, + "messageOriginHiddenUser": MessageOriginHiddenUserTypeID, + "messageOriginChat": MessageOriginChatTypeID, + "messageOriginChannel": MessageOriginChannelTypeID, + "forwardSource": ForwardSourceTypeID, + "reactionTypeEmoji": ReactionTypeEmojiTypeID, + "reactionTypeCustomEmoji": ReactionTypeCustomEmojiTypeID, + "reactionTypePaid": ReactionTypePaidTypeID, + "paidReactor": PaidReactorTypeID, + "messageForwardInfo": MessageForwardInfoTypeID, + "messageImportInfo": MessageImportInfoTypeID, + "messageReplyInfo": MessageReplyInfoTypeID, + "messageReaction": MessageReactionTypeID, + "messageReactions": MessageReactionsTypeID, + "messageInteractionInfo": MessageInteractionInfoTypeID, + "unreadReaction": UnreadReactionTypeID, + "messageEffectTypeEmojiReaction": MessageEffectTypeEmojiReactionTypeID, + "messageEffectTypePremiumSticker": MessageEffectTypePremiumStickerTypeID, + "messageEffect": MessageEffectTypeID, + "messageSendingStatePending": MessageSendingStatePendingTypeID, + "messageSendingStateFailed": MessageSendingStateFailedTypeID, + "textQuote": TextQuoteTypeID, + "inputTextQuote": InputTextQuoteTypeID, + "messageReplyToMessage": MessageReplyToMessageTypeID, + "messageReplyToStory": MessageReplyToStoryTypeID, + "inputMessageReplyToMessage": InputMessageReplyToMessageTypeID, + "inputMessageReplyToExternalMessage": InputMessageReplyToExternalMessageTypeID, + "inputMessageReplyToStory": InputMessageReplyToStoryTypeID, + "factCheck": FactCheckTypeID, + "message": MessageTypeID, + "messages": MessagesTypeID, + "foundMessages": FoundMessagesTypeID, + "foundChatMessages": FoundChatMessagesTypeID, + "messagePosition": MessagePositionTypeID, + "messagePositions": MessagePositionsTypeID, + "messageCalendarDay": MessageCalendarDayTypeID, + "messageCalendar": MessageCalendarTypeID, + "businessMessage": BusinessMessageTypeID, + "businessMessages": BusinessMessagesTypeID, + "messageSourceChatHistory": MessageSourceChatHistoryTypeID, + "messageSourceMessageThreadHistory": MessageSourceMessageThreadHistoryTypeID, + "messageSourceForumTopicHistory": MessageSourceForumTopicHistoryTypeID, + "messageSourceHistoryPreview": MessageSourceHistoryPreviewTypeID, + "messageSourceChatList": MessageSourceChatListTypeID, + "messageSourceSearch": MessageSourceSearchTypeID, + "messageSourceChatEventLog": MessageSourceChatEventLogTypeID, + "messageSourceNotification": MessageSourceNotificationTypeID, + "messageSourceScreenshot": MessageSourceScreenshotTypeID, + "messageSourceOther": MessageSourceOtherTypeID, + "messageSponsor": MessageSponsorTypeID, + "sponsoredMessage": SponsoredMessageTypeID, + "sponsoredMessages": SponsoredMessagesTypeID, + "reportOption": ReportOptionTypeID, + "reportChatSponsoredMessageResultOk": ReportChatSponsoredMessageResultOkTypeID, + "reportChatSponsoredMessageResultFailed": ReportChatSponsoredMessageResultFailedTypeID, + "reportChatSponsoredMessageResultOptionRequired": ReportChatSponsoredMessageResultOptionRequiredTypeID, + "reportChatSponsoredMessageResultAdsHidden": ReportChatSponsoredMessageResultAdsHiddenTypeID, + "reportChatSponsoredMessageResultPremiumRequired": ReportChatSponsoredMessageResultPremiumRequiredTypeID, + "fileDownload": FileDownloadTypeID, + "downloadedFileCounts": DownloadedFileCountsTypeID, + "foundFileDownloads": FoundFileDownloadsTypeID, + "notificationSettingsScopePrivateChats": NotificationSettingsScopePrivateChatsTypeID, + "notificationSettingsScopeGroupChats": NotificationSettingsScopeGroupChatsTypeID, + "notificationSettingsScopeChannelChats": NotificationSettingsScopeChannelChatsTypeID, + "chatNotificationSettings": ChatNotificationSettingsTypeID, + "scopeNotificationSettings": ScopeNotificationSettingsTypeID, + "reactionNotificationSourceNone": ReactionNotificationSourceNoneTypeID, + "reactionNotificationSourceContacts": ReactionNotificationSourceContactsTypeID, + "reactionNotificationSourceAll": ReactionNotificationSourceAllTypeID, + "reactionNotificationSettings": ReactionNotificationSettingsTypeID, + "draftMessage": DraftMessageTypeID, + "chatTypePrivate": ChatTypePrivateTypeID, + "chatTypeBasicGroup": ChatTypeBasicGroupTypeID, + "chatTypeSupergroup": ChatTypeSupergroupTypeID, + "chatTypeSecret": ChatTypeSecretTypeID, + "chatFolderIcon": ChatFolderIconTypeID, + "chatFolder": ChatFolderTypeID, + "chatFolderInfo": ChatFolderInfoTypeID, + "chatFolderInviteLink": ChatFolderInviteLinkTypeID, + "chatFolderInviteLinks": ChatFolderInviteLinksTypeID, + "chatFolderInviteLinkInfo": ChatFolderInviteLinkInfoTypeID, + "recommendedChatFolder": RecommendedChatFolderTypeID, + "recommendedChatFolders": RecommendedChatFoldersTypeID, + "archiveChatListSettings": ArchiveChatListSettingsTypeID, + "chatListMain": ChatListMainTypeID, + "chatListArchive": ChatListArchiveTypeID, + "chatListFolder": ChatListFolderTypeID, + "chatLists": ChatListsTypeID, + "chatSourceMtprotoProxy": ChatSourceMtprotoProxyTypeID, + "chatSourcePublicServiceAnnouncement": ChatSourcePublicServiceAnnouncementTypeID, + "chatPosition": ChatPositionTypeID, + "chatAvailableReactionsAll": ChatAvailableReactionsAllTypeID, + "chatAvailableReactionsSome": ChatAvailableReactionsSomeTypeID, + "savedMessagesTag": SavedMessagesTagTypeID, + "savedMessagesTags": SavedMessagesTagsTypeID, + "businessBotManageBar": BusinessBotManageBarTypeID, + "videoChat": VideoChatTypeID, + "chat": ChatTypeID, + "chats": ChatsTypeID, + "failedToAddMember": FailedToAddMemberTypeID, + "failedToAddMembers": FailedToAddMembersTypeID, + "createdBasicGroupChat": CreatedBasicGroupChatTypeID, + "publicChatTypeHasUsername": PublicChatTypeHasUsernameTypeID, + "publicChatTypeIsLocationBased": PublicChatTypeIsLocationBasedTypeID, + "chatActionBarReportSpam": ChatActionBarReportSpamTypeID, + "chatActionBarInviteMembers": ChatActionBarInviteMembersTypeID, + "chatActionBarReportAddBlock": ChatActionBarReportAddBlockTypeID, + "chatActionBarAddContact": ChatActionBarAddContactTypeID, + "chatActionBarSharePhoneNumber": ChatActionBarSharePhoneNumberTypeID, + "chatActionBarJoinRequest": ChatActionBarJoinRequestTypeID, + "keyboardButtonTypeText": KeyboardButtonTypeTextTypeID, + "keyboardButtonTypeRequestPhoneNumber": KeyboardButtonTypeRequestPhoneNumberTypeID, + "keyboardButtonTypeRequestLocation": KeyboardButtonTypeRequestLocationTypeID, + "keyboardButtonTypeRequestPoll": KeyboardButtonTypeRequestPollTypeID, + "keyboardButtonTypeRequestUsers": KeyboardButtonTypeRequestUsersTypeID, + "keyboardButtonTypeRequestChat": KeyboardButtonTypeRequestChatTypeID, + "keyboardButtonTypeWebApp": KeyboardButtonTypeWebAppTypeID, + "keyboardButton": KeyboardButtonTypeID, + "inlineKeyboardButtonTypeUrl": InlineKeyboardButtonTypeURLTypeID, + "inlineKeyboardButtonTypeLoginUrl": InlineKeyboardButtonTypeLoginURLTypeID, + "inlineKeyboardButtonTypeWebApp": InlineKeyboardButtonTypeWebAppTypeID, + "inlineKeyboardButtonTypeCallback": InlineKeyboardButtonTypeCallbackTypeID, + "inlineKeyboardButtonTypeCallbackWithPassword": InlineKeyboardButtonTypeCallbackWithPasswordTypeID, + "inlineKeyboardButtonTypeCallbackGame": InlineKeyboardButtonTypeCallbackGameTypeID, + "inlineKeyboardButtonTypeSwitchInline": InlineKeyboardButtonTypeSwitchInlineTypeID, + "inlineKeyboardButtonTypeBuy": InlineKeyboardButtonTypeBuyTypeID, + "inlineKeyboardButtonTypeUser": InlineKeyboardButtonTypeUserTypeID, + "inlineKeyboardButtonTypeCopyText": InlineKeyboardButtonTypeCopyTextTypeID, + "inlineKeyboardButton": InlineKeyboardButtonTypeID, + "replyMarkupRemoveKeyboard": ReplyMarkupRemoveKeyboardTypeID, + "replyMarkupForceReply": ReplyMarkupForceReplyTypeID, + "replyMarkupShowKeyboard": ReplyMarkupShowKeyboardTypeID, + "replyMarkupInlineKeyboard": ReplyMarkupInlineKeyboardTypeID, + "loginUrlInfoOpen": LoginURLInfoOpenTypeID, + "loginUrlInfoRequestConfirmation": LoginURLInfoRequestConfirmationTypeID, + "themeParameters": ThemeParametersTypeID, + "webAppOpenModeCompact": WebAppOpenModeCompactTypeID, + "webAppOpenModeFullSize": WebAppOpenModeFullSizeTypeID, + "webAppOpenModeFullScreen": WebAppOpenModeFullScreenTypeID, + "foundWebApp": FoundWebAppTypeID, + "webAppInfo": WebAppInfoTypeID, + "mainWebApp": MainWebAppTypeID, + "webAppOpenParameters": WebAppOpenParametersTypeID, + "messageThreadInfo": MessageThreadInfoTypeID, + "savedMessagesTopicTypeMyNotes": SavedMessagesTopicTypeMyNotesTypeID, + "savedMessagesTopicTypeAuthorHidden": SavedMessagesTopicTypeAuthorHiddenTypeID, + "savedMessagesTopicTypeSavedFromChat": SavedMessagesTopicTypeSavedFromChatTypeID, + "savedMessagesTopic": SavedMessagesTopicTypeID, + "forumTopicIcon": ForumTopicIconTypeID, + "forumTopicInfo": ForumTopicInfoTypeID, + "forumTopic": ForumTopicTypeID, + "forumTopics": ForumTopicsTypeID, + "linkPreviewOptions": LinkPreviewOptionsTypeID, + "sharedUser": SharedUserTypeID, + "sharedChat": SharedChatTypeID, + "themeSettings": ThemeSettingsTypeID, + "richTextPlain": RichTextPlainTypeID, + "richTextBold": RichTextBoldTypeID, + "richTextItalic": RichTextItalicTypeID, + "richTextUnderline": RichTextUnderlineTypeID, + "richTextStrikethrough": RichTextStrikethroughTypeID, + "richTextFixed": RichTextFixedTypeID, + "richTextUrl": RichTextURLTypeID, + "richTextEmailAddress": RichTextEmailAddressTypeID, + "richTextSubscript": RichTextSubscriptTypeID, + "richTextSuperscript": RichTextSuperscriptTypeID, + "richTextMarked": RichTextMarkedTypeID, + "richTextPhoneNumber": RichTextPhoneNumberTypeID, + "richTextIcon": RichTextIconTypeID, + "richTextReference": RichTextReferenceTypeID, + "richTextAnchor": RichTextAnchorTypeID, + "richTextAnchorLink": RichTextAnchorLinkTypeID, + "richTexts": RichTextsTypeID, + "pageBlockCaption": PageBlockCaptionTypeID, + "pageBlockListItem": PageBlockListItemTypeID, + "pageBlockHorizontalAlignmentLeft": PageBlockHorizontalAlignmentLeftTypeID, + "pageBlockHorizontalAlignmentCenter": PageBlockHorizontalAlignmentCenterTypeID, + "pageBlockHorizontalAlignmentRight": PageBlockHorizontalAlignmentRightTypeID, + "pageBlockVerticalAlignmentTop": PageBlockVerticalAlignmentTopTypeID, + "pageBlockVerticalAlignmentMiddle": PageBlockVerticalAlignmentMiddleTypeID, + "pageBlockVerticalAlignmentBottom": PageBlockVerticalAlignmentBottomTypeID, + "pageBlockTableCell": PageBlockTableCellTypeID, + "pageBlockRelatedArticle": PageBlockRelatedArticleTypeID, + "pageBlockTitle": PageBlockTitleTypeID, + "pageBlockSubtitle": PageBlockSubtitleTypeID, + "pageBlockAuthorDate": PageBlockAuthorDateTypeID, + "pageBlockHeader": PageBlockHeaderTypeID, + "pageBlockSubheader": PageBlockSubheaderTypeID, + "pageBlockKicker": PageBlockKickerTypeID, + "pageBlockParagraph": PageBlockParagraphTypeID, + "pageBlockPreformatted": PageBlockPreformattedTypeID, + "pageBlockFooter": PageBlockFooterTypeID, + "pageBlockDivider": PageBlockDividerTypeID, + "pageBlockAnchor": PageBlockAnchorTypeID, + "pageBlockList": PageBlockListTypeID, + "pageBlockBlockQuote": PageBlockBlockQuoteTypeID, + "pageBlockPullQuote": PageBlockPullQuoteTypeID, + "pageBlockAnimation": PageBlockAnimationTypeID, + "pageBlockAudio": PageBlockAudioTypeID, + "pageBlockPhoto": PageBlockPhotoTypeID, + "pageBlockVideo": PageBlockVideoTypeID, + "pageBlockVoiceNote": PageBlockVoiceNoteTypeID, + "pageBlockCover": PageBlockCoverTypeID, + "pageBlockEmbedded": PageBlockEmbeddedTypeID, + "pageBlockEmbeddedPost": PageBlockEmbeddedPostTypeID, + "pageBlockCollage": PageBlockCollageTypeID, + "pageBlockSlideshow": PageBlockSlideshowTypeID, + "pageBlockChatLink": PageBlockChatLinkTypeID, + "pageBlockTable": PageBlockTableTypeID, + "pageBlockDetails": PageBlockDetailsTypeID, + "pageBlockRelatedArticles": PageBlockRelatedArticlesTypeID, + "pageBlockMap": PageBlockMapTypeID, + "webPageInstantView": WebPageInstantViewTypeID, + "linkPreviewAlbumMediaPhoto": LinkPreviewAlbumMediaPhotoTypeID, + "linkPreviewAlbumMediaVideo": LinkPreviewAlbumMediaVideoTypeID, + "linkPreviewTypeAlbum": LinkPreviewTypeAlbumTypeID, + "linkPreviewTypeAnimation": LinkPreviewTypeAnimationTypeID, + "linkPreviewTypeApp": LinkPreviewTypeAppTypeID, + "linkPreviewTypeArticle": LinkPreviewTypeArticleTypeID, + "linkPreviewTypeAudio": LinkPreviewTypeAudioTypeID, + "linkPreviewTypeBackground": LinkPreviewTypeBackgroundTypeID, + "linkPreviewTypeChannelBoost": LinkPreviewTypeChannelBoostTypeID, + "linkPreviewTypeChat": LinkPreviewTypeChatTypeID, + "linkPreviewTypeDocument": LinkPreviewTypeDocumentTypeID, + "linkPreviewTypeEmbeddedAnimationPlayer": LinkPreviewTypeEmbeddedAnimationPlayerTypeID, + "linkPreviewTypeEmbeddedAudioPlayer": LinkPreviewTypeEmbeddedAudioPlayerTypeID, + "linkPreviewTypeEmbeddedVideoPlayer": LinkPreviewTypeEmbeddedVideoPlayerTypeID, + "linkPreviewTypeExternalAudio": LinkPreviewTypeExternalAudioTypeID, + "linkPreviewTypeExternalVideo": LinkPreviewTypeExternalVideoTypeID, + "linkPreviewTypeInvoice": LinkPreviewTypeInvoiceTypeID, + "linkPreviewTypeMessage": LinkPreviewTypeMessageTypeID, + "linkPreviewTypePhoto": LinkPreviewTypePhotoTypeID, + "linkPreviewTypePremiumGiftCode": LinkPreviewTypePremiumGiftCodeTypeID, + "linkPreviewTypeShareableChatFolder": LinkPreviewTypeShareableChatFolderTypeID, + "linkPreviewTypeSticker": LinkPreviewTypeStickerTypeID, + "linkPreviewTypeStickerSet": LinkPreviewTypeStickerSetTypeID, + "linkPreviewTypeStory": LinkPreviewTypeStoryTypeID, + "linkPreviewTypeSupergroupBoost": LinkPreviewTypeSupergroupBoostTypeID, + "linkPreviewTypeTheme": LinkPreviewTypeThemeTypeID, + "linkPreviewTypeUnsupported": LinkPreviewTypeUnsupportedTypeID, + "linkPreviewTypeUser": LinkPreviewTypeUserTypeID, + "linkPreviewTypeVideo": LinkPreviewTypeVideoTypeID, + "linkPreviewTypeVideoChat": LinkPreviewTypeVideoChatTypeID, + "linkPreviewTypeVideoNote": LinkPreviewTypeVideoNoteTypeID, + "linkPreviewTypeVoiceNote": LinkPreviewTypeVoiceNoteTypeID, + "linkPreviewTypeWebApp": LinkPreviewTypeWebAppTypeID, + "linkPreview": LinkPreviewTypeID, + "countryInfo": CountryInfoTypeID, + "countries": CountriesTypeID, + "phoneNumberInfo": PhoneNumberInfoTypeID, + "collectibleItemTypeUsername": CollectibleItemTypeUsernameTypeID, + "collectibleItemTypePhoneNumber": CollectibleItemTypePhoneNumberTypeID, + "collectibleItemInfo": CollectibleItemInfoTypeID, + "bankCardActionOpenUrl": BankCardActionOpenURLTypeID, + "bankCardInfo": BankCardInfoTypeID, + "address": AddressTypeID, + "locationAddress": LocationAddressTypeID, + "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, + "paymentFormTypeStarSubscription": PaymentFormTypeStarSubscriptionTypeID, + "paymentForm": PaymentFormTypeID, + "validatedOrderInfo": ValidatedOrderInfoTypeID, + "paymentResult": PaymentResultTypeID, + "paymentReceiptTypeRegular": PaymentReceiptTypeRegularTypeID, + "paymentReceiptTypeStars": PaymentReceiptTypeStarsTypeID, + "paymentReceipt": PaymentReceiptTypeID, + "inputInvoiceMessage": InputInvoiceMessageTypeID, + "inputInvoiceName": InputInvoiceNameTypeID, + "inputInvoiceTelegram": InputInvoiceTelegramTypeID, + "paidMediaPreview": PaidMediaPreviewTypeID, + "paidMediaPhoto": PaidMediaPhotoTypeID, + "paidMediaVideo": PaidMediaVideoTypeID, + "paidMediaUnsupported": PaidMediaUnsupportedTypeID, + "giveawayParameters": GiveawayParametersTypeID, + "datedFile": DatedFileTypeID, + "passportElementTypePersonalDetails": PassportElementTypePersonalDetailsTypeID, + "passportElementTypePassport": PassportElementTypePassportTypeID, + "passportElementTypeDriverLicense": PassportElementTypeDriverLicenseTypeID, + "passportElementTypeIdentityCard": PassportElementTypeIdentityCardTypeID, + "passportElementTypeInternalPassport": PassportElementTypeInternalPassportTypeID, + "passportElementTypeAddress": PassportElementTypeAddressTypeID, + "passportElementTypeUtilityBill": PassportElementTypeUtilityBillTypeID, + "passportElementTypeBankStatement": PassportElementTypeBankStatementTypeID, + "passportElementTypeRentalAgreement": PassportElementTypeRentalAgreementTypeID, + "passportElementTypePassportRegistration": PassportElementTypePassportRegistrationTypeID, + "passportElementTypeTemporaryRegistration": PassportElementTypeTemporaryRegistrationTypeID, + "passportElementTypePhoneNumber": PassportElementTypePhoneNumberTypeID, + "passportElementTypeEmailAddress": PassportElementTypeEmailAddressTypeID, + "date": DateTypeID, + "personalDetails": PersonalDetailsTypeID, + "identityDocument": IdentityDocumentTypeID, + "inputIdentityDocument": InputIdentityDocumentTypeID, + "personalDocument": PersonalDocumentTypeID, + "inputPersonalDocument": InputPersonalDocumentTypeID, + "passportElementPersonalDetails": PassportElementPersonalDetailsTypeID, + "passportElementPassport": PassportElementPassportTypeID, + "passportElementDriverLicense": PassportElementDriverLicenseTypeID, + "passportElementIdentityCard": PassportElementIdentityCardTypeID, + "passportElementInternalPassport": PassportElementInternalPassportTypeID, + "passportElementAddress": PassportElementAddressTypeID, + "passportElementUtilityBill": PassportElementUtilityBillTypeID, + "passportElementBankStatement": PassportElementBankStatementTypeID, + "passportElementRentalAgreement": PassportElementRentalAgreementTypeID, + "passportElementPassportRegistration": PassportElementPassportRegistrationTypeID, + "passportElementTemporaryRegistration": PassportElementTemporaryRegistrationTypeID, + "passportElementPhoneNumber": PassportElementPhoneNumberTypeID, + "passportElementEmailAddress": PassportElementEmailAddressTypeID, + "inputPassportElementPersonalDetails": InputPassportElementPersonalDetailsTypeID, + "inputPassportElementPassport": InputPassportElementPassportTypeID, + "inputPassportElementDriverLicense": InputPassportElementDriverLicenseTypeID, + "inputPassportElementIdentityCard": InputPassportElementIdentityCardTypeID, + "inputPassportElementInternalPassport": InputPassportElementInternalPassportTypeID, + "inputPassportElementAddress": InputPassportElementAddressTypeID, + "inputPassportElementUtilityBill": InputPassportElementUtilityBillTypeID, + "inputPassportElementBankStatement": InputPassportElementBankStatementTypeID, + "inputPassportElementRentalAgreement": InputPassportElementRentalAgreementTypeID, + "inputPassportElementPassportRegistration": InputPassportElementPassportRegistrationTypeID, + "inputPassportElementTemporaryRegistration": InputPassportElementTemporaryRegistrationTypeID, + "inputPassportElementPhoneNumber": InputPassportElementPhoneNumberTypeID, + "inputPassportElementEmailAddress": InputPassportElementEmailAddressTypeID, + "passportElements": PassportElementsTypeID, + "passportElementErrorSourceUnspecified": PassportElementErrorSourceUnspecifiedTypeID, + "passportElementErrorSourceDataField": PassportElementErrorSourceDataFieldTypeID, + "passportElementErrorSourceFrontSide": PassportElementErrorSourceFrontSideTypeID, + "passportElementErrorSourceReverseSide": PassportElementErrorSourceReverseSideTypeID, + "passportElementErrorSourceSelfie": PassportElementErrorSourceSelfieTypeID, + "passportElementErrorSourceTranslationFile": PassportElementErrorSourceTranslationFileTypeID, + "passportElementErrorSourceTranslationFiles": PassportElementErrorSourceTranslationFilesTypeID, + "passportElementErrorSourceFile": PassportElementErrorSourceFileTypeID, + "passportElementErrorSourceFiles": PassportElementErrorSourceFilesTypeID, + "passportElementError": PassportElementErrorTypeID, + "passportSuitableElement": PassportSuitableElementTypeID, + "passportRequiredElement": PassportRequiredElementTypeID, + "passportAuthorizationForm": PassportAuthorizationFormTypeID, + "passportElementsWithErrors": PassportElementsWithErrorsTypeID, + "encryptedCredentials": EncryptedCredentialsTypeID, + "encryptedPassportElement": EncryptedPassportElementTypeID, + "inputPassportElementErrorSourceUnspecified": InputPassportElementErrorSourceUnspecifiedTypeID, + "inputPassportElementErrorSourceDataField": InputPassportElementErrorSourceDataFieldTypeID, + "inputPassportElementErrorSourceFrontSide": InputPassportElementErrorSourceFrontSideTypeID, + "inputPassportElementErrorSourceReverseSide": InputPassportElementErrorSourceReverseSideTypeID, + "inputPassportElementErrorSourceSelfie": InputPassportElementErrorSourceSelfieTypeID, + "inputPassportElementErrorSourceTranslationFile": InputPassportElementErrorSourceTranslationFileTypeID, + "inputPassportElementErrorSourceTranslationFiles": InputPassportElementErrorSourceTranslationFilesTypeID, + "inputPassportElementErrorSourceFile": InputPassportElementErrorSourceFileTypeID, + "inputPassportElementErrorSourceFiles": InputPassportElementErrorSourceFilesTypeID, + "inputPassportElementError": InputPassportElementErrorTypeID, + "messageText": MessageTextTypeID, + "messageAnimation": MessageAnimationTypeID, + "messageAudio": MessageAudioTypeID, + "messageDocument": MessageDocumentTypeID, + "messagePaidMedia": MessagePaidMediaTypeID, + "messagePhoto": MessagePhotoTypeID, + "messageSticker": MessageStickerTypeID, + "messageVideo": MessageVideoTypeID, + "messageVideoNote": MessageVideoNoteTypeID, + "messageVoiceNote": MessageVoiceNoteTypeID, + "messageExpiredPhoto": MessageExpiredPhotoTypeID, + "messageExpiredVideo": MessageExpiredVideoTypeID, + "messageExpiredVideoNote": MessageExpiredVideoNoteTypeID, + "messageExpiredVoiceNote": MessageExpiredVoiceNoteTypeID, + "messageLocation": MessageLocationTypeID, + "messageVenue": MessageVenueTypeID, + "messageContact": MessageContactTypeID, + "messageAnimatedEmoji": MessageAnimatedEmojiTypeID, + "messageDice": MessageDiceTypeID, + "messageGame": MessageGameTypeID, + "messagePoll": MessagePollTypeID, + "messageStory": MessageStoryTypeID, + "messageInvoice": MessageInvoiceTypeID, + "messageCall": MessageCallTypeID, + "messageVideoChatScheduled": MessageVideoChatScheduledTypeID, + "messageVideoChatStarted": MessageVideoChatStartedTypeID, + "messageVideoChatEnded": MessageVideoChatEndedTypeID, + "messageInviteVideoChatParticipants": MessageInviteVideoChatParticipantsTypeID, + "messageBasicGroupChatCreate": MessageBasicGroupChatCreateTypeID, + "messageSupergroupChatCreate": MessageSupergroupChatCreateTypeID, + "messageChatChangeTitle": MessageChatChangeTitleTypeID, + "messageChatChangePhoto": MessageChatChangePhotoTypeID, + "messageChatDeletePhoto": MessageChatDeletePhotoTypeID, + "messageChatAddMembers": MessageChatAddMembersTypeID, + "messageChatJoinByLink": MessageChatJoinByLinkTypeID, + "messageChatJoinByRequest": MessageChatJoinByRequestTypeID, + "messageChatDeleteMember": MessageChatDeleteMemberTypeID, + "messageChatUpgradeTo": MessageChatUpgradeToTypeID, + "messageChatUpgradeFrom": MessageChatUpgradeFromTypeID, + "messagePinMessage": MessagePinMessageTypeID, + "messageScreenshotTaken": MessageScreenshotTakenTypeID, + "messageChatSetBackground": MessageChatSetBackgroundTypeID, + "messageChatSetTheme": MessageChatSetThemeTypeID, + "messageChatSetMessageAutoDeleteTime": MessageChatSetMessageAutoDeleteTimeTypeID, + "messageChatBoost": MessageChatBoostTypeID, + "messageForumTopicCreated": MessageForumTopicCreatedTypeID, + "messageForumTopicEdited": MessageForumTopicEditedTypeID, + "messageForumTopicIsClosedToggled": MessageForumTopicIsClosedToggledTypeID, + "messageForumTopicIsHiddenToggled": MessageForumTopicIsHiddenToggledTypeID, + "messageSuggestProfilePhoto": MessageSuggestProfilePhotoTypeID, + "messageCustomServiceAction": MessageCustomServiceActionTypeID, + "messageGameScore": MessageGameScoreTypeID, + "messagePaymentSuccessful": MessagePaymentSuccessfulTypeID, + "messagePaymentSuccessfulBot": MessagePaymentSuccessfulBotTypeID, + "messagePaymentRefunded": MessagePaymentRefundedTypeID, + "messageGiftedPremium": MessageGiftedPremiumTypeID, + "messagePremiumGiftCode": MessagePremiumGiftCodeTypeID, + "messageGiveawayCreated": MessageGiveawayCreatedTypeID, + "messageGiveaway": MessageGiveawayTypeID, + "messageGiveawayCompleted": MessageGiveawayCompletedTypeID, + "messageGiveawayWinners": MessageGiveawayWinnersTypeID, + "messageGiftedStars": MessageGiftedStarsTypeID, + "messageGiveawayPrizeStars": MessageGiveawayPrizeStarsTypeID, + "messageGift": MessageGiftTypeID, + "messageContactRegistered": MessageContactRegisteredTypeID, + "messageUsersShared": MessageUsersSharedTypeID, + "messageChatShared": MessageChatSharedTypeID, + "messageBotWriteAccessAllowed": MessageBotWriteAccessAllowedTypeID, + "messageWebAppDataSent": MessageWebAppDataSentTypeID, + "messageWebAppDataReceived": MessageWebAppDataReceivedTypeID, + "messagePassportDataSent": MessagePassportDataSentTypeID, + "messagePassportDataReceived": MessagePassportDataReceivedTypeID, + "messageProximityAlertTriggered": MessageProximityAlertTriggeredTypeID, + "messageUnsupported": MessageUnsupportedTypeID, + "textEntityTypeMention": TextEntityTypeMentionTypeID, + "textEntityTypeHashtag": TextEntityTypeHashtagTypeID, + "textEntityTypeCashtag": TextEntityTypeCashtagTypeID, + "textEntityTypeBotCommand": TextEntityTypeBotCommandTypeID, + "textEntityTypeUrl": TextEntityTypeURLTypeID, + "textEntityTypeEmailAddress": TextEntityTypeEmailAddressTypeID, + "textEntityTypePhoneNumber": TextEntityTypePhoneNumberTypeID, + "textEntityTypeBankCardNumber": TextEntityTypeBankCardNumberTypeID, + "textEntityTypeBold": TextEntityTypeBoldTypeID, + "textEntityTypeItalic": TextEntityTypeItalicTypeID, + "textEntityTypeUnderline": TextEntityTypeUnderlineTypeID, + "textEntityTypeStrikethrough": TextEntityTypeStrikethroughTypeID, + "textEntityTypeSpoiler": TextEntityTypeSpoilerTypeID, + "textEntityTypeCode": TextEntityTypeCodeTypeID, + "textEntityTypePre": TextEntityTypePreTypeID, + "textEntityTypePreCode": TextEntityTypePreCodeTypeID, + "textEntityTypeBlockQuote": TextEntityTypeBlockQuoteTypeID, + "textEntityTypeExpandableBlockQuote": TextEntityTypeExpandableBlockQuoteTypeID, + "textEntityTypeTextUrl": TextEntityTypeTextURLTypeID, + "textEntityTypeMentionName": TextEntityTypeMentionNameTypeID, + "textEntityTypeCustomEmoji": TextEntityTypeCustomEmojiTypeID, + "textEntityTypeMediaTimestamp": TextEntityTypeMediaTimestampTypeID, + "inputThumbnail": InputThumbnailTypeID, + "inputPaidMediaTypePhoto": InputPaidMediaTypePhotoTypeID, + "inputPaidMediaTypeVideo": InputPaidMediaTypeVideoTypeID, + "inputPaidMedia": InputPaidMediaTypeID, + "messageSchedulingStateSendAtDate": MessageSchedulingStateSendAtDateTypeID, + "messageSchedulingStateSendWhenOnline": MessageSchedulingStateSendWhenOnlineTypeID, + "messageSchedulingStateSendWhenVideoProcessed": MessageSchedulingStateSendWhenVideoProcessedTypeID, + "messageSelfDestructTypeTimer": MessageSelfDestructTypeTimerTypeID, + "messageSelfDestructTypeImmediately": MessageSelfDestructTypeImmediatelyTypeID, + "messageSendOptions": MessageSendOptionsTypeID, + "messageCopyOptions": MessageCopyOptionsTypeID, + "inputMessageText": InputMessageTextTypeID, + "inputMessageAnimation": InputMessageAnimationTypeID, + "inputMessageAudio": InputMessageAudioTypeID, + "inputMessageDocument": InputMessageDocumentTypeID, + "inputMessagePaidMedia": InputMessagePaidMediaTypeID, + "inputMessagePhoto": InputMessagePhotoTypeID, + "inputMessageSticker": InputMessageStickerTypeID, + "inputMessageVideo": InputMessageVideoTypeID, + "inputMessageVideoNote": InputMessageVideoNoteTypeID, + "inputMessageVoiceNote": InputMessageVoiceNoteTypeID, + "inputMessageLocation": InputMessageLocationTypeID, + "inputMessageVenue": InputMessageVenueTypeID, + "inputMessageContact": InputMessageContactTypeID, + "inputMessageDice": InputMessageDiceTypeID, + "inputMessageGame": InputMessageGameTypeID, + "inputMessageInvoice": InputMessageInvoiceTypeID, + "inputMessagePoll": InputMessagePollTypeID, + "inputMessageStory": InputMessageStoryTypeID, + "inputMessageForwarded": InputMessageForwardedTypeID, + "messageProperties": MessagePropertiesTypeID, + "searchMessagesFilterEmpty": SearchMessagesFilterEmptyTypeID, + "searchMessagesFilterAnimation": SearchMessagesFilterAnimationTypeID, + "searchMessagesFilterAudio": SearchMessagesFilterAudioTypeID, + "searchMessagesFilterDocument": SearchMessagesFilterDocumentTypeID, + "searchMessagesFilterPhoto": SearchMessagesFilterPhotoTypeID, + "searchMessagesFilterVideo": SearchMessagesFilterVideoTypeID, + "searchMessagesFilterVoiceNote": SearchMessagesFilterVoiceNoteTypeID, + "searchMessagesFilterPhotoAndVideo": SearchMessagesFilterPhotoAndVideoTypeID, + "searchMessagesFilterUrl": SearchMessagesFilterURLTypeID, + "searchMessagesFilterChatPhoto": SearchMessagesFilterChatPhotoTypeID, + "searchMessagesFilterVideoNote": SearchMessagesFilterVideoNoteTypeID, + "searchMessagesFilterVoiceAndVideoNote": SearchMessagesFilterVoiceAndVideoNoteTypeID, + "searchMessagesFilterMention": SearchMessagesFilterMentionTypeID, + "searchMessagesFilterUnreadMention": SearchMessagesFilterUnreadMentionTypeID, + "searchMessagesFilterUnreadReaction": SearchMessagesFilterUnreadReactionTypeID, + "searchMessagesFilterFailedToSend": SearchMessagesFilterFailedToSendTypeID, + "searchMessagesFilterPinned": SearchMessagesFilterPinnedTypeID, + "chatActionTyping": ChatActionTypingTypeID, + "chatActionRecordingVideo": ChatActionRecordingVideoTypeID, + "chatActionUploadingVideo": ChatActionUploadingVideoTypeID, + "chatActionRecordingVoiceNote": ChatActionRecordingVoiceNoteTypeID, + "chatActionUploadingVoiceNote": ChatActionUploadingVoiceNoteTypeID, + "chatActionUploadingPhoto": ChatActionUploadingPhotoTypeID, + "chatActionUploadingDocument": ChatActionUploadingDocumentTypeID, + "chatActionChoosingSticker": ChatActionChoosingStickerTypeID, + "chatActionChoosingLocation": ChatActionChoosingLocationTypeID, + "chatActionChoosingContact": ChatActionChoosingContactTypeID, + "chatActionStartPlayingGame": ChatActionStartPlayingGameTypeID, + "chatActionRecordingVideoNote": ChatActionRecordingVideoNoteTypeID, + "chatActionUploadingVideoNote": ChatActionUploadingVideoNoteTypeID, + "chatActionWatchingAnimations": ChatActionWatchingAnimationsTypeID, + "chatActionCancel": ChatActionCancelTypeID, + "userStatusEmpty": UserStatusEmptyTypeID, + "userStatusOnline": UserStatusOnlineTypeID, + "userStatusOffline": UserStatusOfflineTypeID, + "userStatusRecently": UserStatusRecentlyTypeID, + "userStatusLastWeek": UserStatusLastWeekTypeID, + "userStatusLastMonth": UserStatusLastMonthTypeID, + "emojiKeyword": EmojiKeywordTypeID, + "emojiKeywords": EmojiKeywordsTypeID, + "stickers": StickersTypeID, + "emojis": EmojisTypeID, + "stickerSet": StickerSetTypeID, + "stickerSetInfo": StickerSetInfoTypeID, + "stickerSets": StickerSetsTypeID, + "trendingStickerSets": TrendingStickerSetsTypeID, + "emojiCategorySourceSearch": EmojiCategorySourceSearchTypeID, + "emojiCategorySourcePremium": EmojiCategorySourcePremiumTypeID, + "emojiCategory": EmojiCategoryTypeID, + "emojiCategories": EmojiCategoriesTypeID, + "emojiCategoryTypeDefault": EmojiCategoryTypeDefaultTypeID, + "emojiCategoryTypeRegularStickers": EmojiCategoryTypeRegularStickersTypeID, + "emojiCategoryTypeEmojiStatus": EmojiCategoryTypeEmojiStatusTypeID, + "emojiCategoryTypeChatPhoto": EmojiCategoryTypeChatPhotoTypeID, + "currentWeather": CurrentWeatherTypeID, + "storyAreaPosition": StoryAreaPositionTypeID, + "storyAreaTypeLocation": StoryAreaTypeLocationTypeID, + "storyAreaTypeVenue": StoryAreaTypeVenueTypeID, + "storyAreaTypeSuggestedReaction": StoryAreaTypeSuggestedReactionTypeID, + "storyAreaTypeMessage": StoryAreaTypeMessageTypeID, + "storyAreaTypeLink": StoryAreaTypeLinkTypeID, + "storyAreaTypeWeather": StoryAreaTypeWeatherTypeID, + "storyArea": StoryAreaTypeID, + "inputStoryAreaTypeLocation": InputStoryAreaTypeLocationTypeID, + "inputStoryAreaTypeFoundVenue": InputStoryAreaTypeFoundVenueTypeID, + "inputStoryAreaTypePreviousVenue": InputStoryAreaTypePreviousVenueTypeID, + "inputStoryAreaTypeSuggestedReaction": InputStoryAreaTypeSuggestedReactionTypeID, + "inputStoryAreaTypeMessage": InputStoryAreaTypeMessageTypeID, + "inputStoryAreaTypeLink": InputStoryAreaTypeLinkTypeID, + "inputStoryAreaTypeWeather": InputStoryAreaTypeWeatherTypeID, + "inputStoryArea": InputStoryAreaTypeID, + "inputStoryAreas": InputStoryAreasTypeID, + "storyVideo": StoryVideoTypeID, + "storyContentPhoto": StoryContentPhotoTypeID, + "storyContentVideo": StoryContentVideoTypeID, + "storyContentUnsupported": StoryContentUnsupportedTypeID, + "inputStoryContentPhoto": InputStoryContentPhotoTypeID, + "inputStoryContentVideo": InputStoryContentVideoTypeID, + "storyListMain": StoryListMainTypeID, + "storyListArchive": StoryListArchiveTypeID, + "storyOriginPublicStory": StoryOriginPublicStoryTypeID, + "storyOriginHiddenUser": StoryOriginHiddenUserTypeID, + "storyRepostInfo": StoryRepostInfoTypeID, + "storyInteractionInfo": StoryInteractionInfoTypeID, + "story": StoryTypeID, + "stories": StoriesTypeID, + "foundStories": FoundStoriesTypeID, + "storyFullId": StoryFullIDTypeID, + "storyInfo": StoryInfoTypeID, + "chatActiveStories": ChatActiveStoriesTypeID, + "storyInteractionTypeView": StoryInteractionTypeViewTypeID, + "storyInteractionTypeForward": StoryInteractionTypeForwardTypeID, + "storyInteractionTypeRepost": StoryInteractionTypeRepostTypeID, + "storyInteraction": StoryInteractionTypeID, + "storyInteractions": StoryInteractionsTypeID, + "quickReplyMessage": QuickReplyMessageTypeID, + "quickReplyMessages": QuickReplyMessagesTypeID, + "quickReplyShortcut": QuickReplyShortcutTypeID, + "publicForwardMessage": PublicForwardMessageTypeID, + "publicForwardStory": PublicForwardStoryTypeID, + "publicForwards": PublicForwardsTypeID, + "botMediaPreview": BotMediaPreviewTypeID, + "botMediaPreviews": BotMediaPreviewsTypeID, + "botMediaPreviewInfo": BotMediaPreviewInfoTypeID, + "chatBoostLevelFeatures": ChatBoostLevelFeaturesTypeID, + "chatBoostFeatures": ChatBoostFeaturesTypeID, + "chatBoostSourceGiftCode": ChatBoostSourceGiftCodeTypeID, + "chatBoostSourceGiveaway": ChatBoostSourceGiveawayTypeID, + "chatBoostSourcePremium": ChatBoostSourcePremiumTypeID, + "prepaidGiveaway": PrepaidGiveawayTypeID, + "chatBoostStatus": ChatBoostStatusTypeID, + "chatBoost": ChatBoostTypeID, + "foundChatBoosts": FoundChatBoostsTypeID, + "chatBoostSlot": ChatBoostSlotTypeID, + "chatBoostSlots": ChatBoostSlotsTypeID, + "resendCodeReasonUserRequest": ResendCodeReasonUserRequestTypeID, + "resendCodeReasonVerificationFailed": ResendCodeReasonVerificationFailedTypeID, + "callDiscardReasonEmpty": CallDiscardReasonEmptyTypeID, + "callDiscardReasonMissed": CallDiscardReasonMissedTypeID, + "callDiscardReasonDeclined": CallDiscardReasonDeclinedTypeID, + "callDiscardReasonDisconnected": CallDiscardReasonDisconnectedTypeID, + "callDiscardReasonHungUp": CallDiscardReasonHungUpTypeID, + "callProtocol": CallProtocolTypeID, + "callServerTypeTelegramReflector": CallServerTypeTelegramReflectorTypeID, + "callServerTypeWebrtc": CallServerTypeWebrtcTypeID, + "callServer": CallServerTypeID, + "callId": CallIDTypeID, + "groupCallId": GroupCallIDTypeID, + "callStatePending": CallStatePendingTypeID, + "callStateExchangingKeys": CallStateExchangingKeysTypeID, + "callStateReady": CallStateReadyTypeID, + "callStateHangingUp": CallStateHangingUpTypeID, + "callStateDiscarded": CallStateDiscardedTypeID, + "callStateError": CallStateErrorTypeID, + "groupCallVideoQualityThumbnail": GroupCallVideoQualityThumbnailTypeID, + "groupCallVideoQualityMedium": GroupCallVideoQualityMediumTypeID, + "groupCallVideoQualityFull": GroupCallVideoQualityFullTypeID, + "groupCallStream": GroupCallStreamTypeID, + "groupCallStreams": GroupCallStreamsTypeID, + "rtmpUrl": RtmpURLTypeID, + "groupCallRecentSpeaker": GroupCallRecentSpeakerTypeID, + "groupCall": GroupCallTypeID, + "groupCallVideoSourceGroup": GroupCallVideoSourceGroupTypeID, + "groupCallParticipantVideoInfo": GroupCallParticipantVideoInfoTypeID, + "groupCallParticipant": GroupCallParticipantTypeID, + "callProblemEcho": CallProblemEchoTypeID, + "callProblemNoise": CallProblemNoiseTypeID, + "callProblemInterruptions": CallProblemInterruptionsTypeID, + "callProblemDistortedSpeech": CallProblemDistortedSpeechTypeID, + "callProblemSilentLocal": CallProblemSilentLocalTypeID, + "callProblemSilentRemote": CallProblemSilentRemoteTypeID, + "callProblemDropped": CallProblemDroppedTypeID, + "callProblemDistortedVideo": CallProblemDistortedVideoTypeID, + "callProblemPixelatedVideo": CallProblemPixelatedVideoTypeID, + "call": CallTypeID, + "firebaseAuthenticationSettingsAndroid": FirebaseAuthenticationSettingsAndroidTypeID, + "firebaseAuthenticationSettingsIos": FirebaseAuthenticationSettingsIosTypeID, + "phoneNumberAuthenticationSettings": PhoneNumberAuthenticationSettingsTypeID, + "addedReaction": AddedReactionTypeID, + "addedReactions": AddedReactionsTypeID, + "availableReaction": AvailableReactionTypeID, + "availableReactions": AvailableReactionsTypeID, + "emojiReaction": EmojiReactionTypeID, + "reactionUnavailabilityReasonAnonymousAdministrator": ReactionUnavailabilityReasonAnonymousAdministratorTypeID, + "reactionUnavailabilityReasonGuest": ReactionUnavailabilityReasonGuestTypeID, + "animations": AnimationsTypeID, + "diceStickersRegular": DiceStickersRegularTypeID, + "diceStickersSlotMachine": DiceStickersSlotMachineTypeID, + "importedContacts": ImportedContactsTypeID, + "speechRecognitionResultPending": SpeechRecognitionResultPendingTypeID, + "speechRecognitionResultText": SpeechRecognitionResultTextTypeID, + "speechRecognitionResultError": SpeechRecognitionResultErrorTypeID, + "businessConnection": BusinessConnectionTypeID, + "attachmentMenuBotColor": AttachmentMenuBotColorTypeID, + "attachmentMenuBot": AttachmentMenuBotTypeID, + "sentWebAppMessage": SentWebAppMessageTypeID, + "botWriteAccessAllowReasonConnectedWebsite": BotWriteAccessAllowReasonConnectedWebsiteTypeID, + "botWriteAccessAllowReasonAddedToAttachmentMenu": BotWriteAccessAllowReasonAddedToAttachmentMenuTypeID, + "botWriteAccessAllowReasonLaunchedWebApp": BotWriteAccessAllowReasonLaunchedWebAppTypeID, + "botWriteAccessAllowReasonAcceptedRequest": BotWriteAccessAllowReasonAcceptedRequestTypeID, "httpUrl": HTTPURLTypeID, "userLink": UserLinkTypeID, + "targetChatTypes": TargetChatTypesTypeID, + "targetChatCurrent": TargetChatCurrentTypeID, + "targetChatChosen": TargetChatChosenTypeID, + "targetChatInternalLink": TargetChatInternalLinkTypeID, "inputInlineQueryResultAnimation": InputInlineQueryResultAnimationTypeID, "inputInlineQueryResultArticle": InputInlineQueryResultArticleTypeID, "inputInlineQueryResultAudio": InputInlineQueryResultAudioTypeID, @@ -3425,6 +3461,8 @@ func NamesMap() map[string]uint32 { "inlineQueryResultsButtonTypeWebApp": InlineQueryResultsButtonTypeWebAppTypeID, "inlineQueryResultsButton": InlineQueryResultsButtonTypeID, "inlineQueryResults": InlineQueryResultsTypeID, + "preparedInlineMessageId": PreparedInlineMessageIDTypeID, + "preparedInlineMessage": PreparedInlineMessageTypeID, "callbackQueryPayloadData": CallbackQueryPayloadDataTypeID, "callbackQueryPayloadDataWithPassword": CallbackQueryPayloadDataWithPasswordTypeID, "callbackQueryPayloadGame": CallbackQueryPayloadGameTypeID, @@ -3695,11 +3733,13 @@ func NamesMap() map[string]uint32 { "storyPrivacySettingsSelectedUsers": StoryPrivacySettingsSelectedUsersTypeID, "userPrivacySettingRuleAllowAll": UserPrivacySettingRuleAllowAllTypeID, "userPrivacySettingRuleAllowContacts": UserPrivacySettingRuleAllowContactsTypeID, + "userPrivacySettingRuleAllowBots": UserPrivacySettingRuleAllowBotsTypeID, "userPrivacySettingRuleAllowPremiumUsers": UserPrivacySettingRuleAllowPremiumUsersTypeID, "userPrivacySettingRuleAllowUsers": UserPrivacySettingRuleAllowUsersTypeID, "userPrivacySettingRuleAllowChatMembers": UserPrivacySettingRuleAllowChatMembersTypeID, "userPrivacySettingRuleRestrictAll": UserPrivacySettingRuleRestrictAllTypeID, "userPrivacySettingRuleRestrictContacts": UserPrivacySettingRuleRestrictContactsTypeID, + "userPrivacySettingRuleRestrictBots": UserPrivacySettingRuleRestrictBotsTypeID, "userPrivacySettingRuleRestrictUsers": UserPrivacySettingRuleRestrictUsersTypeID, "userPrivacySettingRuleRestrictChatMembers": UserPrivacySettingRuleRestrictChatMembersTypeID, "userPrivacySettingRules": UserPrivacySettingRulesTypeID, @@ -3714,6 +3754,7 @@ func NamesMap() map[string]uint32 { "userPrivacySettingAllowPeerToPeerCalls": UserPrivacySettingAllowPeerToPeerCallsTypeID, "userPrivacySettingAllowFindingByPhoneNumber": UserPrivacySettingAllowFindingByPhoneNumberTypeID, "userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages": UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessagesTypeID, + "userPrivacySettingAutosaveGifts": UserPrivacySettingAutosaveGiftsTypeID, "readDatePrivacySettings": ReadDatePrivacySettingsTypeID, "newChatPrivacySettings": NewChatPrivacySettingsTypeID, "canSendMessageToUserResultOk": CanSendMessageToUserResultOkTypeID, @@ -3760,9 +3801,6 @@ func NamesMap() map[string]uint32 { "reportStoryResultOk": ReportStoryResultOkTypeID, "reportStoryResultOptionRequired": ReportStoryResultOptionRequiredTypeID, "reportStoryResultTextRequired": ReportStoryResultTextRequiredTypeID, - "targetChatCurrent": TargetChatCurrentTypeID, - "targetChatChosen": TargetChatChosenTypeID, - "targetChatInternalLink": TargetChatInternalLinkTypeID, "internalLinkTypeActiveSessions": InternalLinkTypeActiveSessionsTypeID, "internalLinkTypeAttachmentMenuBot": InternalLinkTypeAttachmentMenuBotTypeID, "internalLinkTypeAuthenticationCode": InternalLinkTypeAuthenticationCodeTypeID, @@ -4336,8 +4374,11 @@ func NamesMap() map[string]uint32 { "shareChatWithBot": ShareChatWithBotRequestTypeID, "getInlineQueryResults": GetInlineQueryResultsRequestTypeID, "answerInlineQuery": AnswerInlineQueryRequestTypeID, + "savePreparedInlineMessage": SavePreparedInlineMessageRequestTypeID, + "getPreparedInlineMessage": GetPreparedInlineMessageRequestTypeID, "getGrossingWebAppBots": GetGrossingWebAppBotsRequestTypeID, "searchWebApp": SearchWebAppRequestTypeID, + "getWebAppPlaceholder": GetWebAppPlaceholderRequestTypeID, "getWebAppLinkUrl": GetWebAppLinkURLRequestTypeID, "getMainWebApp": GetMainWebAppRequestTypeID, "getWebAppUrl": GetWebAppURLRequestTypeID, @@ -4345,6 +4386,7 @@ func NamesMap() map[string]uint32 { "openWebApp": OpenWebAppRequestTypeID, "closeWebApp": CloseWebAppRequestTypeID, "answerWebAppQuery": AnswerWebAppQueryRequestTypeID, + "checkWebAppFileDownload": CheckWebAppFileDownloadRequestTypeID, "getCallbackQueryAnswer": GetCallbackQueryAnswerRequestTypeID, "answerCallbackQuery": AnswerCallbackQueryRequestTypeID, "answerShippingQuery": AnswerShippingQueryRequestTypeID, @@ -4584,9 +4626,12 @@ func NamesMap() map[string]uint32 { "getCloseFriends": GetCloseFriendsRequestTypeID, "setUserPersonalProfilePhoto": SetUserPersonalProfilePhotoRequestTypeID, "suggestUserProfilePhoto": SuggestUserProfilePhotoRequestTypeID, + "toggleBotCanManageEmojiStatus": ToggleBotCanManageEmojiStatusRequestTypeID, + "setUserEmojiStatus": SetUserEmojiStatusRequestTypeID, "searchUserByPhoneNumber": SearchUserByPhoneNumberRequestTypeID, "sharePhoneNumber": SharePhoneNumberRequestTypeID, "getUserProfilePhotos": GetUserProfilePhotosRequestTypeID, + "getStickerOutline": GetStickerOutlineRequestTypeID, "getStickers": GetStickersRequestTypeID, "getAllStickerEmojis": GetAllStickerEmojisRequestTypeID, "searchStickers": SearchStickersRequestTypeID, @@ -4850,6 +4895,7 @@ func NamesMap() map[string]uint32 { "assignAppStoreTransaction": AssignAppStoreTransactionRequestTypeID, "assignGooglePlayTransaction": AssignGooglePlayTransactionRequestTypeID, "editStarSubscription": EditStarSubscriptionRequestTypeID, + "editUserStarSubscription": EditUserStarSubscriptionRequestTypeID, "reuseStarSubscription": ReuseStarSubscriptionRequestTypeID, "getBusinessFeatures": GetBusinessFeaturesRequestTypeID, "acceptTermsOfService": AcceptTermsOfServiceRequestTypeID, @@ -4984,6 +5030,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { StickerFullTypeMaskTypeID: func() bin.Object { return &StickerFullTypeMask{} }, StickerFullTypeCustomEmojiTypeID: func() bin.Object { return &StickerFullTypeCustomEmoji{} }, ClosedVectorPathTypeID: func() bin.Object { return &ClosedVectorPath{} }, + OutlineTypeID: func() bin.Object { return &Outline{} }, PollOptionTypeID: func() bin.Object { return &PollOption{} }, PollTypeRegularTypeID: func() bin.Object { return &PollTypeRegular{} }, PollTypeQuizTypeID: func() bin.Object { return &PollTypeQuiz{} }, @@ -5047,6 +5094,8 @@ func TypesConstructorMap() map[uint32]func() bin.Object { InputChatPhotoStickerTypeID: func() bin.Object { return &InputChatPhotoSticker{} }, ChatPermissionsTypeID: func() bin.Object { return &ChatPermissions{} }, ChatAdministratorRightsTypeID: func() bin.Object { return &ChatAdministratorRights{} }, + StarSubscriptionTypeChannelTypeID: func() bin.Object { return &StarSubscriptionTypeChannel{} }, + StarSubscriptionTypeBotTypeID: func() bin.Object { return &StarSubscriptionTypeBot{} }, StarSubscriptionPricingTypeID: func() bin.Object { return &StarSubscriptionPricing{} }, StarSubscriptionTypeID: func() bin.Object { return &StarSubscription{} }, StarSubscriptionsTypeID: func() bin.Object { return &StarSubscriptions{} }, @@ -5069,6 +5118,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { StarTransactionDirectionOutgoingTypeID: func() bin.Object { return &StarTransactionDirectionOutgoing{} }, BotTransactionPurposePaidMediaTypeID: func() bin.Object { return &BotTransactionPurposePaidMedia{} }, BotTransactionPurposeInvoicePaymentTypeID: func() bin.Object { return &BotTransactionPurposeInvoicePayment{} }, + BotTransactionPurposeSubscriptionTypeID: func() bin.Object { return &BotTransactionPurposeSubscription{} }, ChatTransactionPurposePaidMediaTypeID: func() bin.Object { return &ChatTransactionPurposePaidMedia{} }, ChatTransactionPurposeJoinTypeID: func() bin.Object { return &ChatTransactionPurposeJoin{} }, ChatTransactionPurposeReactionTypeID: func() bin.Object { return &ChatTransactionPurposeReaction{} }, @@ -5303,9 +5353,14 @@ func TypesConstructorMap() map[uint32]func() bin.Object { ReplyMarkupInlineKeyboardTypeID: func() bin.Object { return &ReplyMarkupInlineKeyboard{} }, LoginURLInfoOpenTypeID: func() bin.Object { return &LoginURLInfoOpen{} }, LoginURLInfoRequestConfirmationTypeID: func() bin.Object { return &LoginURLInfoRequestConfirmation{} }, + ThemeParametersTypeID: func() bin.Object { return &ThemeParameters{} }, + WebAppOpenModeCompactTypeID: func() bin.Object { return &WebAppOpenModeCompact{} }, + WebAppOpenModeFullSizeTypeID: func() bin.Object { return &WebAppOpenModeFullSize{} }, + WebAppOpenModeFullScreenTypeID: func() bin.Object { return &WebAppOpenModeFullScreen{} }, FoundWebAppTypeID: func() bin.Object { return &FoundWebApp{} }, WebAppInfoTypeID: func() bin.Object { return &WebAppInfo{} }, MainWebAppTypeID: func() bin.Object { return &MainWebApp{} }, + WebAppOpenParametersTypeID: func() bin.Object { return &WebAppOpenParameters{} }, MessageThreadInfoTypeID: func() bin.Object { return &MessageThreadInfo{} }, SavedMessagesTopicTypeMyNotesTypeID: func() bin.Object { return &SavedMessagesTopicTypeMyNotes{} }, SavedMessagesTopicTypeAuthorHiddenTypeID: func() bin.Object { return &SavedMessagesTopicTypeAuthorHidden{} }, @@ -5420,7 +5475,6 @@ func TypesConstructorMap() map[uint32]func() bin.Object { BankCardInfoTypeID: func() bin.Object { return &BankCardInfo{} }, AddressTypeID: func() bin.Object { return &Address{} }, LocationAddressTypeID: func() bin.Object { return &LocationAddress{} }, - ThemeParametersTypeID: func() bin.Object { return &ThemeParameters{} }, LabeledPricePartTypeID: func() bin.Object { return &LabeledPricePart{} }, InvoiceTypeID: func() bin.Object { return &Invoice{} }, OrderInfoTypeID: func() bin.Object { return &OrderInfo{} }, @@ -5436,6 +5490,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { PaymentOptionTypeID: func() bin.Object { return &PaymentOption{} }, PaymentFormTypeRegularTypeID: func() bin.Object { return &PaymentFormTypeRegular{} }, PaymentFormTypeStarsTypeID: func() bin.Object { return &PaymentFormTypeStars{} }, + PaymentFormTypeStarSubscriptionTypeID: func() bin.Object { return &PaymentFormTypeStarSubscription{} }, PaymentFormTypeID: func() bin.Object { return &PaymentForm{} }, ValidatedOrderInfoTypeID: func() bin.Object { return &ValidatedOrderInfo{} }, PaymentResultTypeID: func() bin.Object { return &PaymentResult{} }, @@ -5832,6 +5887,10 @@ func TypesConstructorMap() map[uint32]func() bin.Object { BotWriteAccessAllowReasonAcceptedRequestTypeID: func() bin.Object { return &BotWriteAccessAllowReasonAcceptedRequest{} }, HTTPURLTypeID: func() bin.Object { return &HTTPURL{} }, UserLinkTypeID: func() bin.Object { return &UserLink{} }, + TargetChatTypesTypeID: func() bin.Object { return &TargetChatTypes{} }, + TargetChatCurrentTypeID: func() bin.Object { return &TargetChatCurrent{} }, + TargetChatChosenTypeID: func() bin.Object { return &TargetChatChosen{} }, + TargetChatInternalLinkTypeID: func() bin.Object { return &TargetChatInternalLink{} }, InputInlineQueryResultAnimationTypeID: func() bin.Object { return &InputInlineQueryResultAnimation{} }, InputInlineQueryResultArticleTypeID: func() bin.Object { return &InputInlineQueryResultArticle{} }, InputInlineQueryResultAudioTypeID: func() bin.Object { return &InputInlineQueryResultAudio{} }, @@ -5860,6 +5919,8 @@ func TypesConstructorMap() map[uint32]func() bin.Object { InlineQueryResultsButtonTypeWebAppTypeID: func() bin.Object { return &InlineQueryResultsButtonTypeWebApp{} }, InlineQueryResultsButtonTypeID: func() bin.Object { return &InlineQueryResultsButton{} }, InlineQueryResultsTypeID: func() bin.Object { return &InlineQueryResults{} }, + PreparedInlineMessageIDTypeID: func() bin.Object { return &PreparedInlineMessageID{} }, + PreparedInlineMessageTypeID: func() bin.Object { return &PreparedInlineMessage{} }, CallbackQueryPayloadDataTypeID: func() bin.Object { return &CallbackQueryPayloadData{} }, CallbackQueryPayloadDataWithPasswordTypeID: func() bin.Object { return &CallbackQueryPayloadDataWithPassword{} }, CallbackQueryPayloadGameTypeID: func() bin.Object { return &CallbackQueryPayloadGame{} }, @@ -6130,11 +6191,13 @@ func TypesConstructorMap() map[uint32]func() bin.Object { StoryPrivacySettingsSelectedUsersTypeID: func() bin.Object { return &StoryPrivacySettingsSelectedUsers{} }, UserPrivacySettingRuleAllowAllTypeID: func() bin.Object { return &UserPrivacySettingRuleAllowAll{} }, UserPrivacySettingRuleAllowContactsTypeID: func() bin.Object { return &UserPrivacySettingRuleAllowContacts{} }, + UserPrivacySettingRuleAllowBotsTypeID: func() bin.Object { return &UserPrivacySettingRuleAllowBots{} }, UserPrivacySettingRuleAllowPremiumUsersTypeID: func() bin.Object { return &UserPrivacySettingRuleAllowPremiumUsers{} }, UserPrivacySettingRuleAllowUsersTypeID: func() bin.Object { return &UserPrivacySettingRuleAllowUsers{} }, UserPrivacySettingRuleAllowChatMembersTypeID: func() bin.Object { return &UserPrivacySettingRuleAllowChatMembers{} }, UserPrivacySettingRuleRestrictAllTypeID: func() bin.Object { return &UserPrivacySettingRuleRestrictAll{} }, UserPrivacySettingRuleRestrictContactsTypeID: func() bin.Object { return &UserPrivacySettingRuleRestrictContacts{} }, + UserPrivacySettingRuleRestrictBotsTypeID: func() bin.Object { return &UserPrivacySettingRuleRestrictBots{} }, UserPrivacySettingRuleRestrictUsersTypeID: func() bin.Object { return &UserPrivacySettingRuleRestrictUsers{} }, UserPrivacySettingRuleRestrictChatMembersTypeID: func() bin.Object { return &UserPrivacySettingRuleRestrictChatMembers{} }, UserPrivacySettingRulesTypeID: func() bin.Object { return &UserPrivacySettingRules{} }, @@ -6149,6 +6212,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { UserPrivacySettingAllowPeerToPeerCallsTypeID: func() bin.Object { return &UserPrivacySettingAllowPeerToPeerCalls{} }, UserPrivacySettingAllowFindingByPhoneNumberTypeID: func() bin.Object { return &UserPrivacySettingAllowFindingByPhoneNumber{} }, UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessagesTypeID: func() bin.Object { return &UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages{} }, + UserPrivacySettingAutosaveGiftsTypeID: func() bin.Object { return &UserPrivacySettingAutosaveGifts{} }, ReadDatePrivacySettingsTypeID: func() bin.Object { return &ReadDatePrivacySettings{} }, NewChatPrivacySettingsTypeID: func() bin.Object { return &NewChatPrivacySettings{} }, CanSendMessageToUserResultOkTypeID: func() bin.Object { return &CanSendMessageToUserResultOk{} }, @@ -6195,9 +6259,6 @@ func TypesConstructorMap() map[uint32]func() bin.Object { ReportStoryResultOkTypeID: func() bin.Object { return &ReportStoryResultOk{} }, ReportStoryResultOptionRequiredTypeID: func() bin.Object { return &ReportStoryResultOptionRequired{} }, ReportStoryResultTextRequiredTypeID: func() bin.Object { return &ReportStoryResultTextRequired{} }, - TargetChatCurrentTypeID: func() bin.Object { return &TargetChatCurrent{} }, - TargetChatChosenTypeID: func() bin.Object { return &TargetChatChosen{} }, - TargetChatInternalLinkTypeID: func() bin.Object { return &TargetChatInternalLink{} }, InternalLinkTypeActiveSessionsTypeID: func() bin.Object { return &InternalLinkTypeActiveSessions{} }, InternalLinkTypeAttachmentMenuBotTypeID: func() bin.Object { return &InternalLinkTypeAttachmentMenuBot{} }, InternalLinkTypeAuthenticationCodeTypeID: func() bin.Object { return &InternalLinkTypeAuthenticationCode{} }, @@ -6771,8 +6832,11 @@ func TypesConstructorMap() map[uint32]func() bin.Object { ShareChatWithBotRequestTypeID: func() bin.Object { return &ShareChatWithBotRequest{} }, GetInlineQueryResultsRequestTypeID: func() bin.Object { return &GetInlineQueryResultsRequest{} }, AnswerInlineQueryRequestTypeID: func() bin.Object { return &AnswerInlineQueryRequest{} }, + SavePreparedInlineMessageRequestTypeID: func() bin.Object { return &SavePreparedInlineMessageRequest{} }, + GetPreparedInlineMessageRequestTypeID: func() bin.Object { return &GetPreparedInlineMessageRequest{} }, GetGrossingWebAppBotsRequestTypeID: func() bin.Object { return &GetGrossingWebAppBotsRequest{} }, SearchWebAppRequestTypeID: func() bin.Object { return &SearchWebAppRequest{} }, + GetWebAppPlaceholderRequestTypeID: func() bin.Object { return &GetWebAppPlaceholderRequest{} }, GetWebAppLinkURLRequestTypeID: func() bin.Object { return &GetWebAppLinkURLRequest{} }, GetMainWebAppRequestTypeID: func() bin.Object { return &GetMainWebAppRequest{} }, GetWebAppURLRequestTypeID: func() bin.Object { return &GetWebAppURLRequest{} }, @@ -6780,6 +6844,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { OpenWebAppRequestTypeID: func() bin.Object { return &OpenWebAppRequest{} }, CloseWebAppRequestTypeID: func() bin.Object { return &CloseWebAppRequest{} }, AnswerWebAppQueryRequestTypeID: func() bin.Object { return &AnswerWebAppQueryRequest{} }, + CheckWebAppFileDownloadRequestTypeID: func() bin.Object { return &CheckWebAppFileDownloadRequest{} }, GetCallbackQueryAnswerRequestTypeID: func() bin.Object { return &GetCallbackQueryAnswerRequest{} }, AnswerCallbackQueryRequestTypeID: func() bin.Object { return &AnswerCallbackQueryRequest{} }, AnswerShippingQueryRequestTypeID: func() bin.Object { return &AnswerShippingQueryRequest{} }, @@ -7019,9 +7084,12 @@ func TypesConstructorMap() map[uint32]func() bin.Object { GetCloseFriendsRequestTypeID: func() bin.Object { return &GetCloseFriendsRequest{} }, SetUserPersonalProfilePhotoRequestTypeID: func() bin.Object { return &SetUserPersonalProfilePhotoRequest{} }, SuggestUserProfilePhotoRequestTypeID: func() bin.Object { return &SuggestUserProfilePhotoRequest{} }, + ToggleBotCanManageEmojiStatusRequestTypeID: func() bin.Object { return &ToggleBotCanManageEmojiStatusRequest{} }, + SetUserEmojiStatusRequestTypeID: func() bin.Object { return &SetUserEmojiStatusRequest{} }, SearchUserByPhoneNumberRequestTypeID: func() bin.Object { return &SearchUserByPhoneNumberRequest{} }, SharePhoneNumberRequestTypeID: func() bin.Object { return &SharePhoneNumberRequest{} }, GetUserProfilePhotosRequestTypeID: func() bin.Object { return &GetUserProfilePhotosRequest{} }, + GetStickerOutlineRequestTypeID: func() bin.Object { return &GetStickerOutlineRequest{} }, GetStickersRequestTypeID: func() bin.Object { return &GetStickersRequest{} }, GetAllStickerEmojisRequestTypeID: func() bin.Object { return &GetAllStickerEmojisRequest{} }, SearchStickersRequestTypeID: func() bin.Object { return &SearchStickersRequest{} }, @@ -7285,6 +7353,7 @@ func TypesConstructorMap() map[uint32]func() bin.Object { AssignAppStoreTransactionRequestTypeID: func() bin.Object { return &AssignAppStoreTransactionRequest{} }, AssignGooglePlayTransactionRequestTypeID: func() bin.Object { return &AssignGooglePlayTransactionRequest{} }, EditStarSubscriptionRequestTypeID: func() bin.Object { return &EditStarSubscriptionRequest{} }, + EditUserStarSubscriptionRequestTypeID: func() bin.Object { return &EditUserStarSubscriptionRequest{} }, ReuseStarSubscriptionRequestTypeID: func() bin.Object { return &ReuseStarSubscriptionRequest{} }, GetBusinessFeaturesRequestTypeID: func() bin.Object { return &GetBusinessFeaturesRequest{} }, AcceptTermsOfServiceRequestTypeID: func() bin.Object { return &AcceptTermsOfServiceRequest{} }, @@ -7402,6 +7471,7 @@ func ClassConstructorsMap() map[string][]uint32 { BotTransactionPurposeClassName: { BotTransactionPurposePaidMediaTypeID, BotTransactionPurposeInvoicePaymentTypeID, + BotTransactionPurposeSubscriptionTypeID, }, BotWriteAccessAllowReasonClassName: { BotWriteAccessAllowReasonConnectedWebsiteTypeID, @@ -8256,6 +8326,7 @@ func ClassConstructorsMap() map[string][]uint32 { PaymentFormTypeClassName: { PaymentFormTypeRegularTypeID, PaymentFormTypeStarsTypeID, + PaymentFormTypeStarSubscriptionTypeID, }, PaymentProviderClassName: { PaymentProviderSmartGlocalTypeID, @@ -8526,6 +8597,10 @@ func ClassConstructorsMap() map[string][]uint32 { SpeechRecognitionResultTextTypeID, SpeechRecognitionResultErrorTypeID, }, + StarSubscriptionTypeClassName: { + StarSubscriptionTypeChannelTypeID, + StarSubscriptionTypeBotTypeID, + }, StarTransactionDirectionClassName: { StarTransactionDirectionIncomingTypeID, StarTransactionDirectionOutgoingTypeID, @@ -8859,15 +8934,18 @@ func ClassConstructorsMap() map[string][]uint32 { UserPrivacySettingAllowPeerToPeerCallsTypeID, UserPrivacySettingAllowFindingByPhoneNumberTypeID, UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessagesTypeID, + UserPrivacySettingAutosaveGiftsTypeID, }, UserPrivacySettingRuleClassName: { UserPrivacySettingRuleAllowAllTypeID, UserPrivacySettingRuleAllowContactsTypeID, + UserPrivacySettingRuleAllowBotsTypeID, UserPrivacySettingRuleAllowPremiumUsersTypeID, UserPrivacySettingRuleAllowUsersTypeID, UserPrivacySettingRuleAllowChatMembersTypeID, UserPrivacySettingRuleRestrictAllTypeID, UserPrivacySettingRuleRestrictContactsTypeID, + UserPrivacySettingRuleRestrictBotsTypeID, UserPrivacySettingRuleRestrictUsersTypeID, UserPrivacySettingRuleRestrictChatMembersTypeID, }, @@ -8894,5 +8972,10 @@ func ClassConstructorsMap() map[string][]uint32 { VectorPathCommandLineTypeID, VectorPathCommandCubicBezierCurveTypeID, }, + WebAppOpenModeClassName: { + WebAppOpenModeCompactTypeID, + WebAppOpenModeFullSizeTypeID, + WebAppOpenModeFullScreenTypeID, + }, } } diff --git a/tdapi/tl_save_prepared_inline_message_gen.go b/tdapi/tl_save_prepared_inline_message_gen.go new file mode 100644 index 000000000..714c4d989 --- /dev/null +++ b/tdapi/tl_save_prepared_inline_message_gen.go @@ -0,0 +1,281 @@ +// 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{} +) + +// SavePreparedInlineMessageRequest represents TL type `savePreparedInlineMessage#c71468d9`. +type SavePreparedInlineMessageRequest struct { + // Identifier of the user + UserID int64 + // The description of the message + Result InputInlineQueryResultClass + // Types of the chats to which the message can be sent + ChatTypes TargetChatTypes +} + +// SavePreparedInlineMessageRequestTypeID is TL type id of SavePreparedInlineMessageRequest. +const SavePreparedInlineMessageRequestTypeID = 0xc71468d9 + +// Ensuring interfaces in compile-time for SavePreparedInlineMessageRequest. +var ( + _ bin.Encoder = &SavePreparedInlineMessageRequest{} + _ bin.Decoder = &SavePreparedInlineMessageRequest{} + _ bin.BareEncoder = &SavePreparedInlineMessageRequest{} + _ bin.BareDecoder = &SavePreparedInlineMessageRequest{} +) + +func (s *SavePreparedInlineMessageRequest) Zero() bool { + if s == nil { + return true + } + if !(s.UserID == 0) { + return false + } + if !(s.Result == nil) { + return false + } + if !(s.ChatTypes.Zero()) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *SavePreparedInlineMessageRequest) String() string { + if s == nil { + return "SavePreparedInlineMessageRequest(nil)" + } + type Alias SavePreparedInlineMessageRequest + return fmt.Sprintf("SavePreparedInlineMessageRequest%+v", Alias(*s)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*SavePreparedInlineMessageRequest) TypeID() uint32 { + return SavePreparedInlineMessageRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*SavePreparedInlineMessageRequest) TypeName() string { + return "savePreparedInlineMessage" +} + +// TypeInfo returns info about TL type. +func (s *SavePreparedInlineMessageRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "savePreparedInlineMessage", + ID: SavePreparedInlineMessageRequestTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "UserID", + SchemaName: "user_id", + }, + { + Name: "Result", + SchemaName: "result", + }, + { + Name: "ChatTypes", + SchemaName: "chat_types", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (s *SavePreparedInlineMessageRequest) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode savePreparedInlineMessage#c71468d9 as nil") + } + b.PutID(SavePreparedInlineMessageRequestTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *SavePreparedInlineMessageRequest) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode savePreparedInlineMessage#c71468d9 as nil") + } + b.PutInt53(s.UserID) + if s.Result == nil { + return fmt.Errorf("unable to encode savePreparedInlineMessage#c71468d9: field result is nil") + } + if err := s.Result.Encode(b); err != nil { + return fmt.Errorf("unable to encode savePreparedInlineMessage#c71468d9: field result: %w", err) + } + if err := s.ChatTypes.Encode(b); err != nil { + return fmt.Errorf("unable to encode savePreparedInlineMessage#c71468d9: field chat_types: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (s *SavePreparedInlineMessageRequest) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode savePreparedInlineMessage#c71468d9 to nil") + } + if err := b.ConsumeID(SavePreparedInlineMessageRequestTypeID); err != nil { + return fmt.Errorf("unable to decode savePreparedInlineMessage#c71468d9: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *SavePreparedInlineMessageRequest) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode savePreparedInlineMessage#c71468d9 to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode savePreparedInlineMessage#c71468d9: field user_id: %w", err) + } + s.UserID = value + } + { + value, err := DecodeInputInlineQueryResult(b) + if err != nil { + return fmt.Errorf("unable to decode savePreparedInlineMessage#c71468d9: field result: %w", err) + } + s.Result = value + } + { + if err := s.ChatTypes.Decode(b); err != nil { + return fmt.Errorf("unable to decode savePreparedInlineMessage#c71468d9: field chat_types: %w", err) + } + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (s *SavePreparedInlineMessageRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if s == nil { + return fmt.Errorf("can't encode savePreparedInlineMessage#c71468d9 as nil") + } + b.ObjStart() + b.PutID("savePreparedInlineMessage") + b.Comma() + b.FieldStart("user_id") + b.PutInt53(s.UserID) + b.Comma() + b.FieldStart("result") + if s.Result == nil { + return fmt.Errorf("unable to encode savePreparedInlineMessage#c71468d9: field result is nil") + } + if err := s.Result.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode savePreparedInlineMessage#c71468d9: field result: %w", err) + } + b.Comma() + b.FieldStart("chat_types") + if err := s.ChatTypes.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode savePreparedInlineMessage#c71468d9: field chat_types: %w", err) + } + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (s *SavePreparedInlineMessageRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if s == nil { + return fmt.Errorf("can't decode savePreparedInlineMessage#c71468d9 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("savePreparedInlineMessage"); err != nil { + return fmt.Errorf("unable to decode savePreparedInlineMessage#c71468d9: %w", err) + } + case "user_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode savePreparedInlineMessage#c71468d9: field user_id: %w", err) + } + s.UserID = value + case "result": + value, err := DecodeTDLibJSONInputInlineQueryResult(b) + if err != nil { + return fmt.Errorf("unable to decode savePreparedInlineMessage#c71468d9: field result: %w", err) + } + s.Result = value + case "chat_types": + if err := s.ChatTypes.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode savePreparedInlineMessage#c71468d9: field chat_types: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetUserID returns value of UserID field. +func (s *SavePreparedInlineMessageRequest) GetUserID() (value int64) { + if s == nil { + return + } + return s.UserID +} + +// GetResult returns value of Result field. +func (s *SavePreparedInlineMessageRequest) GetResult() (value InputInlineQueryResultClass) { + if s == nil { + return + } + return s.Result +} + +// GetChatTypes returns value of ChatTypes field. +func (s *SavePreparedInlineMessageRequest) GetChatTypes() (value TargetChatTypes) { + if s == nil { + return + } + return s.ChatTypes +} + +// SavePreparedInlineMessage invokes method savePreparedInlineMessage#c71468d9 returning error if any. +func (c *Client) SavePreparedInlineMessage(ctx context.Context, request *SavePreparedInlineMessageRequest) (*PreparedInlineMessageID, error) { + var result PreparedInlineMessageID + + if err := c.rpc.Invoke(ctx, request, &result); err != nil { + return nil, err + } + return &result, nil +} diff --git a/tdapi/tl_set_user_emoji_status_gen.go b/tdapi/tl_set_user_emoji_status_gen.go new file mode 100644 index 000000000..a433d92a3 --- /dev/null +++ b/tdapi/tl_set_user_emoji_status_gen.go @@ -0,0 +1,237 @@ +// Code generated by gotdgen, DO NOT EDIT. + +package tdapi + +import ( + "context" + "errors" + "fmt" + "sort" + "strings" + + "go.uber.org/multierr" + + "github.com/gotd/td/bin" + "github.com/gotd/td/tdjson" + "github.com/gotd/td/tdp" + "github.com/gotd/td/tgerr" +) + +// No-op definition for keeping imports. +var ( + _ = bin.Buffer{} + _ = context.Background() + _ = fmt.Stringer(nil) + _ = strings.Builder{} + _ = errors.Is + _ = multierr.AppendInto + _ = sort.Ints + _ = tdp.Format + _ = tgerr.Error{} + _ = tdjson.Encoder{} +) + +// SetUserEmojiStatusRequest represents TL type `setUserEmojiStatus#e5165bcb`. +type SetUserEmojiStatusRequest struct { + // Identifier of the user + UserID int64 + // New emoji status; pass null to switch to the default badge + EmojiStatus EmojiStatus +} + +// SetUserEmojiStatusRequestTypeID is TL type id of SetUserEmojiStatusRequest. +const SetUserEmojiStatusRequestTypeID = 0xe5165bcb + +// Ensuring interfaces in compile-time for SetUserEmojiStatusRequest. +var ( + _ bin.Encoder = &SetUserEmojiStatusRequest{} + _ bin.Decoder = &SetUserEmojiStatusRequest{} + _ bin.BareEncoder = &SetUserEmojiStatusRequest{} + _ bin.BareDecoder = &SetUserEmojiStatusRequest{} +) + +func (s *SetUserEmojiStatusRequest) Zero() bool { + if s == nil { + return true + } + if !(s.UserID == 0) { + return false + } + if !(s.EmojiStatus.Zero()) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *SetUserEmojiStatusRequest) String() string { + if s == nil { + return "SetUserEmojiStatusRequest(nil)" + } + type Alias SetUserEmojiStatusRequest + return fmt.Sprintf("SetUserEmojiStatusRequest%+v", Alias(*s)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*SetUserEmojiStatusRequest) TypeID() uint32 { + return SetUserEmojiStatusRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*SetUserEmojiStatusRequest) TypeName() string { + return "setUserEmojiStatus" +} + +// TypeInfo returns info about TL type. +func (s *SetUserEmojiStatusRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "setUserEmojiStatus", + ID: SetUserEmojiStatusRequestTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "UserID", + SchemaName: "user_id", + }, + { + Name: "EmojiStatus", + SchemaName: "emoji_status", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (s *SetUserEmojiStatusRequest) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode setUserEmojiStatus#e5165bcb as nil") + } + b.PutID(SetUserEmojiStatusRequestTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *SetUserEmojiStatusRequest) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode setUserEmojiStatus#e5165bcb as nil") + } + b.PutInt53(s.UserID) + if err := s.EmojiStatus.Encode(b); err != nil { + return fmt.Errorf("unable to encode setUserEmojiStatus#e5165bcb: field emoji_status: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (s *SetUserEmojiStatusRequest) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode setUserEmojiStatus#e5165bcb to nil") + } + if err := b.ConsumeID(SetUserEmojiStatusRequestTypeID); err != nil { + return fmt.Errorf("unable to decode setUserEmojiStatus#e5165bcb: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *SetUserEmojiStatusRequest) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode setUserEmojiStatus#e5165bcb to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode setUserEmojiStatus#e5165bcb: field user_id: %w", err) + } + s.UserID = value + } + { + if err := s.EmojiStatus.Decode(b); err != nil { + return fmt.Errorf("unable to decode setUserEmojiStatus#e5165bcb: field emoji_status: %w", err) + } + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (s *SetUserEmojiStatusRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if s == nil { + return fmt.Errorf("can't encode setUserEmojiStatus#e5165bcb as nil") + } + b.ObjStart() + b.PutID("setUserEmojiStatus") + b.Comma() + b.FieldStart("user_id") + b.PutInt53(s.UserID) + b.Comma() + b.FieldStart("emoji_status") + if err := s.EmojiStatus.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode setUserEmojiStatus#e5165bcb: field emoji_status: %w", err) + } + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (s *SetUserEmojiStatusRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if s == nil { + return fmt.Errorf("can't decode setUserEmojiStatus#e5165bcb to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("setUserEmojiStatus"); err != nil { + return fmt.Errorf("unable to decode setUserEmojiStatus#e5165bcb: %w", err) + } + case "user_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode setUserEmojiStatus#e5165bcb: field user_id: %w", err) + } + s.UserID = value + case "emoji_status": + if err := s.EmojiStatus.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode setUserEmojiStatus#e5165bcb: field emoji_status: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// GetUserID returns value of UserID field. +func (s *SetUserEmojiStatusRequest) GetUserID() (value int64) { + if s == nil { + return + } + return s.UserID +} + +// GetEmojiStatus returns value of EmojiStatus field. +func (s *SetUserEmojiStatusRequest) GetEmojiStatus() (value EmojiStatus) { + if s == nil { + return + } + return s.EmojiStatus +} + +// SetUserEmojiStatus invokes method setUserEmojiStatus#e5165bcb returning error if any. +func (c *Client) SetUserEmojiStatus(ctx context.Context, request *SetUserEmojiStatusRequest) error { + var ok Ok + + if err := c.rpc.Invoke(ctx, request, &ok); err != nil { + return err + } + return nil +} diff --git a/tdapi/tl_star_subscription_gen.go b/tdapi/tl_star_subscription_gen.go index 615b46071..9d9e6058e 100644 --- a/tdapi/tl_star_subscription_gen.go +++ b/tdapi/tl_star_subscription_gen.go @@ -31,31 +31,27 @@ var ( _ = tdjson.Encoder{} ) -// StarSubscription represents TL type `starSubscription#6caf0ade`. +// StarSubscription represents TL type `starSubscription#3a3811f5`. type StarSubscription struct { // Unique identifier of the subscription ID string - // Identifier of the channel chat that is subscribed + // Identifier of the chat that is subscribed ChatID int64 // Point in time (Unix timestamp) when the subscription will expire or expired ExpirationDate int32 - // True, if the subscription is active and the user can use the method - // reuseStarSubscription to join the subscribed chat again - CanReuse bool // True, if the subscription was canceled IsCanceled bool // True, if the subscription expires soon and there are no enough Telegram Stars on the // user's balance to extend it IsExpiring bool - // The invite link that can be used to renew the subscription if it has been expired; may - // be empty, if the link isn't available anymore - InviteLink string // The subscription plan Pricing StarSubscriptionPricing + // Type of the subscription + Type StarSubscriptionTypeClass } // StarSubscriptionTypeID is TL type id of StarSubscription. -const StarSubscriptionTypeID = 0x6caf0ade +const StarSubscriptionTypeID = 0x3a3811f5 // Ensuring interfaces in compile-time for StarSubscription. var ( @@ -78,19 +74,16 @@ func (s *StarSubscription) Zero() bool { if !(s.ExpirationDate == 0) { return false } - if !(s.CanReuse == false) { - return false - } if !(s.IsCanceled == false) { return false } if !(s.IsExpiring == false) { return false } - if !(s.InviteLink == "") { + if !(s.Pricing.Zero()) { return false } - if !(s.Pricing.Zero()) { + if !(s.Type == nil) { return false } @@ -141,10 +134,6 @@ func (s *StarSubscription) TypeInfo() tdp.Type { Name: "ExpirationDate", SchemaName: "expiration_date", }, - { - Name: "CanReuse", - SchemaName: "can_reuse", - }, { Name: "IsCanceled", SchemaName: "is_canceled", @@ -153,14 +142,14 @@ func (s *StarSubscription) TypeInfo() tdp.Type { Name: "IsExpiring", SchemaName: "is_expiring", }, - { - Name: "InviteLink", - SchemaName: "invite_link", - }, { Name: "Pricing", SchemaName: "pricing", }, + { + Name: "Type", + SchemaName: "type", + }, } return typ } @@ -168,7 +157,7 @@ func (s *StarSubscription) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (s *StarSubscription) Encode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode starSubscription#6caf0ade as nil") + return fmt.Errorf("can't encode starSubscription#3a3811f5 as nil") } b.PutID(StarSubscriptionTypeID) return s.EncodeBare(b) @@ -177,17 +166,21 @@ func (s *StarSubscription) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (s *StarSubscription) EncodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode starSubscription#6caf0ade as nil") + return fmt.Errorf("can't encode starSubscription#3a3811f5 as nil") } b.PutString(s.ID) b.PutInt53(s.ChatID) b.PutInt32(s.ExpirationDate) - b.PutBool(s.CanReuse) b.PutBool(s.IsCanceled) b.PutBool(s.IsExpiring) - b.PutString(s.InviteLink) if err := s.Pricing.Encode(b); err != nil { - return fmt.Errorf("unable to encode starSubscription#6caf0ade: field pricing: %w", err) + return fmt.Errorf("unable to encode starSubscription#3a3811f5: field pricing: %w", err) + } + if s.Type == nil { + return fmt.Errorf("unable to encode starSubscription#3a3811f5: field type is nil") + } + if err := s.Type.Encode(b); err != nil { + return fmt.Errorf("unable to encode starSubscription#3a3811f5: field type: %w", err) } return nil } @@ -195,10 +188,10 @@ func (s *StarSubscription) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (s *StarSubscription) Decode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode starSubscription#6caf0ade to nil") + return fmt.Errorf("can't decode starSubscription#3a3811f5 to nil") } if err := b.ConsumeID(StarSubscriptionTypeID); err != nil { - return fmt.Errorf("unable to decode starSubscription#6caf0ade: %w", err) + return fmt.Errorf("unable to decode starSubscription#3a3811f5: %w", err) } return s.DecodeBare(b) } @@ -206,61 +199,54 @@ func (s *StarSubscription) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (s *StarSubscription) DecodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode starSubscription#6caf0ade to nil") + return fmt.Errorf("can't decode starSubscription#3a3811f5 to nil") } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode starSubscription#6caf0ade: field id: %w", err) + return fmt.Errorf("unable to decode starSubscription#3a3811f5: field id: %w", err) } s.ID = value } { value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode starSubscription#6caf0ade: field chat_id: %w", err) + return fmt.Errorf("unable to decode starSubscription#3a3811f5: field chat_id: %w", err) } s.ChatID = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode starSubscription#6caf0ade: field expiration_date: %w", err) + return fmt.Errorf("unable to decode starSubscription#3a3811f5: field expiration_date: %w", err) } s.ExpirationDate = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode starSubscription#6caf0ade: field can_reuse: %w", err) - } - s.CanReuse = value - } - { - value, err := b.Bool() - if err != nil { - return fmt.Errorf("unable to decode starSubscription#6caf0ade: field is_canceled: %w", err) + return fmt.Errorf("unable to decode starSubscription#3a3811f5: field is_canceled: %w", err) } s.IsCanceled = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode starSubscription#6caf0ade: field is_expiring: %w", err) + return fmt.Errorf("unable to decode starSubscription#3a3811f5: field is_expiring: %w", err) } s.IsExpiring = value } { - value, err := b.String() - if err != nil { - return fmt.Errorf("unable to decode starSubscription#6caf0ade: field invite_link: %w", err) + if err := s.Pricing.Decode(b); err != nil { + return fmt.Errorf("unable to decode starSubscription#3a3811f5: field pricing: %w", err) } - s.InviteLink = value } { - if err := s.Pricing.Decode(b); err != nil { - return fmt.Errorf("unable to decode starSubscription#6caf0ade: field pricing: %w", err) + value, err := DecodeStarSubscriptionType(b) + if err != nil { + return fmt.Errorf("unable to decode starSubscription#3a3811f5: field type: %w", err) } + s.Type = value } return nil } @@ -268,7 +254,7 @@ func (s *StarSubscription) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (s *StarSubscription) EncodeTDLibJSON(b tdjson.Encoder) error { if s == nil { - return fmt.Errorf("can't encode starSubscription#6caf0ade as nil") + return fmt.Errorf("can't encode starSubscription#3a3811f5 as nil") } b.ObjStart() b.PutID("starSubscription") @@ -282,21 +268,23 @@ func (s *StarSubscription) EncodeTDLibJSON(b tdjson.Encoder) error { b.FieldStart("expiration_date") b.PutInt32(s.ExpirationDate) b.Comma() - b.FieldStart("can_reuse") - b.PutBool(s.CanReuse) - b.Comma() b.FieldStart("is_canceled") b.PutBool(s.IsCanceled) b.Comma() b.FieldStart("is_expiring") b.PutBool(s.IsExpiring) b.Comma() - b.FieldStart("invite_link") - b.PutString(s.InviteLink) - b.Comma() b.FieldStart("pricing") if err := s.Pricing.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode starSubscription#6caf0ade: field pricing: %w", err) + return fmt.Errorf("unable to encode starSubscription#3a3811f5: field pricing: %w", err) + } + b.Comma() + b.FieldStart("type") + if s.Type == nil { + return fmt.Errorf("unable to encode starSubscription#3a3811f5: field type is nil") + } + if err := s.Type.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode starSubscription#3a3811f5: field type: %w", err) } b.Comma() b.StripComma() @@ -307,61 +295,55 @@ func (s *StarSubscription) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (s *StarSubscription) DecodeTDLibJSON(b tdjson.Decoder) error { if s == nil { - return fmt.Errorf("can't decode starSubscription#6caf0ade to nil") + return fmt.Errorf("can't decode starSubscription#3a3811f5 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("starSubscription"); err != nil { - return fmt.Errorf("unable to decode starSubscription#6caf0ade: %w", err) + return fmt.Errorf("unable to decode starSubscription#3a3811f5: %w", err) } case "id": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode starSubscription#6caf0ade: field id: %w", err) + return fmt.Errorf("unable to decode starSubscription#3a3811f5: field id: %w", err) } s.ID = value case "chat_id": value, err := b.Int53() if err != nil { - return fmt.Errorf("unable to decode starSubscription#6caf0ade: field chat_id: %w", err) + return fmt.Errorf("unable to decode starSubscription#3a3811f5: field chat_id: %w", err) } s.ChatID = value case "expiration_date": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode starSubscription#6caf0ade: field expiration_date: %w", err) + return fmt.Errorf("unable to decode starSubscription#3a3811f5: field expiration_date: %w", err) } s.ExpirationDate = value - case "can_reuse": - value, err := b.Bool() - if err != nil { - return fmt.Errorf("unable to decode starSubscription#6caf0ade: field can_reuse: %w", err) - } - s.CanReuse = value case "is_canceled": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode starSubscription#6caf0ade: field is_canceled: %w", err) + return fmt.Errorf("unable to decode starSubscription#3a3811f5: field is_canceled: %w", err) } s.IsCanceled = value case "is_expiring": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode starSubscription#6caf0ade: field is_expiring: %w", err) + return fmt.Errorf("unable to decode starSubscription#3a3811f5: field is_expiring: %w", err) } s.IsExpiring = value - case "invite_link": - value, err := b.String() - if err != nil { - return fmt.Errorf("unable to decode starSubscription#6caf0ade: field invite_link: %w", err) - } - s.InviteLink = value case "pricing": if err := s.Pricing.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode starSubscription#6caf0ade: field pricing: %w", err) + return fmt.Errorf("unable to decode starSubscription#3a3811f5: field pricing: %w", err) + } + case "type": + value, err := DecodeTDLibJSONStarSubscriptionType(b) + if err != nil { + return fmt.Errorf("unable to decode starSubscription#3a3811f5: field type: %w", err) } + s.Type = value default: return b.Skip() } @@ -393,14 +375,6 @@ func (s *StarSubscription) GetExpirationDate() (value int32) { return s.ExpirationDate } -// GetCanReuse returns value of CanReuse field. -func (s *StarSubscription) GetCanReuse() (value bool) { - if s == nil { - return - } - return s.CanReuse -} - // GetIsCanceled returns value of IsCanceled field. func (s *StarSubscription) GetIsCanceled() (value bool) { if s == nil { @@ -417,18 +391,18 @@ func (s *StarSubscription) GetIsExpiring() (value bool) { return s.IsExpiring } -// GetInviteLink returns value of InviteLink field. -func (s *StarSubscription) GetInviteLink() (value string) { +// GetPricing returns value of Pricing field. +func (s *StarSubscription) GetPricing() (value StarSubscriptionPricing) { if s == nil { return } - return s.InviteLink + return s.Pricing } -// GetPricing returns value of Pricing field. -func (s *StarSubscription) GetPricing() (value StarSubscriptionPricing) { +// GetType returns value of Type field. +func (s *StarSubscription) GetType() (value StarSubscriptionTypeClass) { if s == nil { return } - return s.Pricing + return s.Type } diff --git a/tdapi/tl_star_subscription_type_gen.go b/tdapi/tl_star_subscription_type_gen.go new file mode 100644 index 000000000..4f6fabb0d --- /dev/null +++ b/tdapi/tl_star_subscription_type_gen.go @@ -0,0 +1,639 @@ +// 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{} +) + +// StarSubscriptionTypeChannel represents TL type `starSubscriptionTypeChannel#c29ab6f5`. +type StarSubscriptionTypeChannel struct { + // True, if the subscription is active and the user can use the method + // reuseStarSubscription to join the subscribed chat again + CanReuse bool + // The invite link that can be used to renew the subscription if it has been expired; may + // be empty, if the link isn't available anymore + InviteLink string +} + +// StarSubscriptionTypeChannelTypeID is TL type id of StarSubscriptionTypeChannel. +const StarSubscriptionTypeChannelTypeID = 0xc29ab6f5 + +// construct implements constructor of StarSubscriptionTypeClass. +func (s StarSubscriptionTypeChannel) construct() StarSubscriptionTypeClass { return &s } + +// Ensuring interfaces in compile-time for StarSubscriptionTypeChannel. +var ( + _ bin.Encoder = &StarSubscriptionTypeChannel{} + _ bin.Decoder = &StarSubscriptionTypeChannel{} + _ bin.BareEncoder = &StarSubscriptionTypeChannel{} + _ bin.BareDecoder = &StarSubscriptionTypeChannel{} + + _ StarSubscriptionTypeClass = &StarSubscriptionTypeChannel{} +) + +func (s *StarSubscriptionTypeChannel) Zero() bool { + if s == nil { + return true + } + if !(s.CanReuse == false) { + return false + } + if !(s.InviteLink == "") { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *StarSubscriptionTypeChannel) String() string { + if s == nil { + return "StarSubscriptionTypeChannel(nil)" + } + type Alias StarSubscriptionTypeChannel + return fmt.Sprintf("StarSubscriptionTypeChannel%+v", Alias(*s)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*StarSubscriptionTypeChannel) TypeID() uint32 { + return StarSubscriptionTypeChannelTypeID +} + +// TypeName returns name of type in TL schema. +func (*StarSubscriptionTypeChannel) TypeName() string { + return "starSubscriptionTypeChannel" +} + +// TypeInfo returns info about TL type. +func (s *StarSubscriptionTypeChannel) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "starSubscriptionTypeChannel", + ID: StarSubscriptionTypeChannelTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "CanReuse", + SchemaName: "can_reuse", + }, + { + Name: "InviteLink", + SchemaName: "invite_link", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (s *StarSubscriptionTypeChannel) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode starSubscriptionTypeChannel#c29ab6f5 as nil") + } + b.PutID(StarSubscriptionTypeChannelTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *StarSubscriptionTypeChannel) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode starSubscriptionTypeChannel#c29ab6f5 as nil") + } + b.PutBool(s.CanReuse) + b.PutString(s.InviteLink) + return nil +} + +// Decode implements bin.Decoder. +func (s *StarSubscriptionTypeChannel) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode starSubscriptionTypeChannel#c29ab6f5 to nil") + } + if err := b.ConsumeID(StarSubscriptionTypeChannelTypeID); err != nil { + return fmt.Errorf("unable to decode starSubscriptionTypeChannel#c29ab6f5: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *StarSubscriptionTypeChannel) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode starSubscriptionTypeChannel#c29ab6f5 to nil") + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode starSubscriptionTypeChannel#c29ab6f5: field can_reuse: %w", err) + } + s.CanReuse = value + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode starSubscriptionTypeChannel#c29ab6f5: field invite_link: %w", err) + } + s.InviteLink = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (s *StarSubscriptionTypeChannel) EncodeTDLibJSON(b tdjson.Encoder) error { + if s == nil { + return fmt.Errorf("can't encode starSubscriptionTypeChannel#c29ab6f5 as nil") + } + b.ObjStart() + b.PutID("starSubscriptionTypeChannel") + b.Comma() + b.FieldStart("can_reuse") + b.PutBool(s.CanReuse) + b.Comma() + b.FieldStart("invite_link") + b.PutString(s.InviteLink) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (s *StarSubscriptionTypeChannel) DecodeTDLibJSON(b tdjson.Decoder) error { + if s == nil { + return fmt.Errorf("can't decode starSubscriptionTypeChannel#c29ab6f5 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("starSubscriptionTypeChannel"); err != nil { + return fmt.Errorf("unable to decode starSubscriptionTypeChannel#c29ab6f5: %w", err) + } + case "can_reuse": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode starSubscriptionTypeChannel#c29ab6f5: field can_reuse: %w", err) + } + s.CanReuse = value + case "invite_link": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode starSubscriptionTypeChannel#c29ab6f5: field invite_link: %w", err) + } + s.InviteLink = value + default: + return b.Skip() + } + return nil + }) +} + +// GetCanReuse returns value of CanReuse field. +func (s *StarSubscriptionTypeChannel) GetCanReuse() (value bool) { + if s == nil { + return + } + return s.CanReuse +} + +// GetInviteLink returns value of InviteLink field. +func (s *StarSubscriptionTypeChannel) GetInviteLink() (value string) { + if s == nil { + return + } + return s.InviteLink +} + +// StarSubscriptionTypeBot represents TL type `starSubscriptionTypeBot#d78ddd2`. +type StarSubscriptionTypeBot struct { + // True, if the subscription was canceled by the bot and can't be extended + IsCanceledByBot bool + // Subscription invoice title + Title string + // Subscription invoice photo + Photo Photo + // The link to the subscription invoice + InvoiceLink string +} + +// StarSubscriptionTypeBotTypeID is TL type id of StarSubscriptionTypeBot. +const StarSubscriptionTypeBotTypeID = 0xd78ddd2 + +// construct implements constructor of StarSubscriptionTypeClass. +func (s StarSubscriptionTypeBot) construct() StarSubscriptionTypeClass { return &s } + +// Ensuring interfaces in compile-time for StarSubscriptionTypeBot. +var ( + _ bin.Encoder = &StarSubscriptionTypeBot{} + _ bin.Decoder = &StarSubscriptionTypeBot{} + _ bin.BareEncoder = &StarSubscriptionTypeBot{} + _ bin.BareDecoder = &StarSubscriptionTypeBot{} + + _ StarSubscriptionTypeClass = &StarSubscriptionTypeBot{} +) + +func (s *StarSubscriptionTypeBot) Zero() bool { + if s == nil { + return true + } + if !(s.IsCanceledByBot == false) { + return false + } + if !(s.Title == "") { + return false + } + if !(s.Photo.Zero()) { + return false + } + if !(s.InvoiceLink == "") { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (s *StarSubscriptionTypeBot) String() string { + if s == nil { + return "StarSubscriptionTypeBot(nil)" + } + type Alias StarSubscriptionTypeBot + return fmt.Sprintf("StarSubscriptionTypeBot%+v", Alias(*s)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*StarSubscriptionTypeBot) TypeID() uint32 { + return StarSubscriptionTypeBotTypeID +} + +// TypeName returns name of type in TL schema. +func (*StarSubscriptionTypeBot) TypeName() string { + return "starSubscriptionTypeBot" +} + +// TypeInfo returns info about TL type. +func (s *StarSubscriptionTypeBot) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "starSubscriptionTypeBot", + ID: StarSubscriptionTypeBotTypeID, + } + if s == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "IsCanceledByBot", + SchemaName: "is_canceled_by_bot", + }, + { + Name: "Title", + SchemaName: "title", + }, + { + Name: "Photo", + SchemaName: "photo", + }, + { + Name: "InvoiceLink", + SchemaName: "invoice_link", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (s *StarSubscriptionTypeBot) Encode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode starSubscriptionTypeBot#d78ddd2 as nil") + } + b.PutID(StarSubscriptionTypeBotTypeID) + return s.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (s *StarSubscriptionTypeBot) EncodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't encode starSubscriptionTypeBot#d78ddd2 as nil") + } + b.PutBool(s.IsCanceledByBot) + b.PutString(s.Title) + if err := s.Photo.Encode(b); err != nil { + return fmt.Errorf("unable to encode starSubscriptionTypeBot#d78ddd2: field photo: %w", err) + } + b.PutString(s.InvoiceLink) + return nil +} + +// Decode implements bin.Decoder. +func (s *StarSubscriptionTypeBot) Decode(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode starSubscriptionTypeBot#d78ddd2 to nil") + } + if err := b.ConsumeID(StarSubscriptionTypeBotTypeID); err != nil { + return fmt.Errorf("unable to decode starSubscriptionTypeBot#d78ddd2: %w", err) + } + return s.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (s *StarSubscriptionTypeBot) DecodeBare(b *bin.Buffer) error { + if s == nil { + return fmt.Errorf("can't decode starSubscriptionTypeBot#d78ddd2 to nil") + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode starSubscriptionTypeBot#d78ddd2: field is_canceled_by_bot: %w", err) + } + s.IsCanceledByBot = value + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode starSubscriptionTypeBot#d78ddd2: field title: %w", err) + } + s.Title = value + } + { + if err := s.Photo.Decode(b); err != nil { + return fmt.Errorf("unable to decode starSubscriptionTypeBot#d78ddd2: field photo: %w", err) + } + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode starSubscriptionTypeBot#d78ddd2: field invoice_link: %w", err) + } + s.InvoiceLink = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (s *StarSubscriptionTypeBot) EncodeTDLibJSON(b tdjson.Encoder) error { + if s == nil { + return fmt.Errorf("can't encode starSubscriptionTypeBot#d78ddd2 as nil") + } + b.ObjStart() + b.PutID("starSubscriptionTypeBot") + b.Comma() + b.FieldStart("is_canceled_by_bot") + b.PutBool(s.IsCanceledByBot) + b.Comma() + b.FieldStart("title") + b.PutString(s.Title) + b.Comma() + b.FieldStart("photo") + if err := s.Photo.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode starSubscriptionTypeBot#d78ddd2: field photo: %w", err) + } + b.Comma() + b.FieldStart("invoice_link") + b.PutString(s.InvoiceLink) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (s *StarSubscriptionTypeBot) DecodeTDLibJSON(b tdjson.Decoder) error { + if s == nil { + return fmt.Errorf("can't decode starSubscriptionTypeBot#d78ddd2 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("starSubscriptionTypeBot"); err != nil { + return fmt.Errorf("unable to decode starSubscriptionTypeBot#d78ddd2: %w", err) + } + case "is_canceled_by_bot": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode starSubscriptionTypeBot#d78ddd2: field is_canceled_by_bot: %w", err) + } + s.IsCanceledByBot = value + case "title": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode starSubscriptionTypeBot#d78ddd2: field title: %w", err) + } + s.Title = value + case "photo": + if err := s.Photo.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode starSubscriptionTypeBot#d78ddd2: field photo: %w", err) + } + case "invoice_link": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode starSubscriptionTypeBot#d78ddd2: field invoice_link: %w", err) + } + s.InvoiceLink = value + default: + return b.Skip() + } + return nil + }) +} + +// GetIsCanceledByBot returns value of IsCanceledByBot field. +func (s *StarSubscriptionTypeBot) GetIsCanceledByBot() (value bool) { + if s == nil { + return + } + return s.IsCanceledByBot +} + +// GetTitle returns value of Title field. +func (s *StarSubscriptionTypeBot) GetTitle() (value string) { + if s == nil { + return + } + return s.Title +} + +// GetPhoto returns value of Photo field. +func (s *StarSubscriptionTypeBot) GetPhoto() (value Photo) { + if s == nil { + return + } + return s.Photo +} + +// GetInvoiceLink returns value of InvoiceLink field. +func (s *StarSubscriptionTypeBot) GetInvoiceLink() (value string) { + if s == nil { + return + } + return s.InvoiceLink +} + +// StarSubscriptionTypeClassName is schema name of StarSubscriptionTypeClass. +const StarSubscriptionTypeClassName = "StarSubscriptionType" + +// StarSubscriptionTypeClass represents StarSubscriptionType generic type. +// +// Example: +// +// g, err := tdapi.DecodeStarSubscriptionType(buf) +// if err != nil { +// panic(err) +// } +// switch v := g.(type) { +// case *tdapi.StarSubscriptionTypeChannel: // starSubscriptionTypeChannel#c29ab6f5 +// case *tdapi.StarSubscriptionTypeBot: // starSubscriptionTypeBot#d78ddd2 +// default: panic(v) +// } +type StarSubscriptionTypeClass interface { + bin.Encoder + bin.Decoder + bin.BareEncoder + bin.BareDecoder + construct() StarSubscriptionTypeClass + + // 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 +} + +// DecodeStarSubscriptionType implements binary de-serialization for StarSubscriptionTypeClass. +func DecodeStarSubscriptionType(buf *bin.Buffer) (StarSubscriptionTypeClass, error) { + id, err := buf.PeekID() + if err != nil { + return nil, err + } + switch id { + case StarSubscriptionTypeChannelTypeID: + // Decoding starSubscriptionTypeChannel#c29ab6f5. + v := StarSubscriptionTypeChannel{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode StarSubscriptionTypeClass: %w", err) + } + return &v, nil + case StarSubscriptionTypeBotTypeID: + // Decoding starSubscriptionTypeBot#d78ddd2. + v := StarSubscriptionTypeBot{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode StarSubscriptionTypeClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode StarSubscriptionTypeClass: %w", bin.NewUnexpectedID(id)) + } +} + +// DecodeTDLibJSONStarSubscriptionType implements binary de-serialization for StarSubscriptionTypeClass. +func DecodeTDLibJSONStarSubscriptionType(buf tdjson.Decoder) (StarSubscriptionTypeClass, error) { + id, err := buf.FindTypeID() + if err != nil { + return nil, err + } + switch id { + case "starSubscriptionTypeChannel": + // Decoding starSubscriptionTypeChannel#c29ab6f5. + v := StarSubscriptionTypeChannel{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode StarSubscriptionTypeClass: %w", err) + } + return &v, nil + case "starSubscriptionTypeBot": + // Decoding starSubscriptionTypeBot#d78ddd2. + v := StarSubscriptionTypeBot{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode StarSubscriptionTypeClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode StarSubscriptionTypeClass: %w", tdjson.NewUnexpectedID(id)) + } +} + +// StarSubscriptionType boxes the StarSubscriptionTypeClass providing a helper. +type StarSubscriptionTypeBox struct { + StarSubscriptionType StarSubscriptionTypeClass +} + +// Decode implements bin.Decoder for StarSubscriptionTypeBox. +func (b *StarSubscriptionTypeBox) Decode(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("unable to decode StarSubscriptionTypeBox to nil") + } + v, err := DecodeStarSubscriptionType(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.StarSubscriptionType = v + return nil +} + +// Encode implements bin.Encode for StarSubscriptionTypeBox. +func (b *StarSubscriptionTypeBox) Encode(buf *bin.Buffer) error { + if b == nil || b.StarSubscriptionType == nil { + return fmt.Errorf("unable to encode StarSubscriptionTypeClass as nil") + } + return b.StarSubscriptionType.Encode(buf) +} + +// DecodeTDLibJSON implements bin.Decoder for StarSubscriptionTypeBox. +func (b *StarSubscriptionTypeBox) DecodeTDLibJSON(buf tdjson.Decoder) error { + if b == nil { + return fmt.Errorf("unable to decode StarSubscriptionTypeBox to nil") + } + v, err := DecodeTDLibJSONStarSubscriptionType(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.StarSubscriptionType = v + return nil +} + +// EncodeTDLibJSON implements bin.Encode for StarSubscriptionTypeBox. +func (b *StarSubscriptionTypeBox) EncodeTDLibJSON(buf tdjson.Encoder) error { + if b == nil || b.StarSubscriptionType == nil { + return fmt.Errorf("unable to encode StarSubscriptionTypeClass as nil") + } + return b.StarSubscriptionType.EncodeTDLibJSON(buf) +} diff --git a/tdapi/tl_sticker_gen.go b/tdapi/tl_sticker_gen.go index f7da7f5cf..53937c617 100644 --- a/tdapi/tl_sticker_gen.go +++ b/tdapi/tl_sticker_gen.go @@ -31,7 +31,7 @@ var ( _ = tdjson.Encoder{} ) -// Sticker represents TL type `sticker#849ad6a1`. +// Sticker represents TL type `sticker#d96f5d3f`. type Sticker struct { // Unique sticker identifier within the set; 0 if none ID int64 @@ -47,9 +47,6 @@ type Sticker struct { Format StickerFormatClass // Sticker's full type FullType StickerFullTypeClass - // Sticker's outline represented as a list of closed vector paths; may be empty. The - // coordinate system origin is in the upper-left corner - Outline []ClosedVectorPath // Sticker thumbnail in WEBP or JPEG format; may be null Thumbnail Thumbnail // File containing the sticker @@ -57,7 +54,7 @@ type Sticker struct { } // StickerTypeID is TL type id of Sticker. -const StickerTypeID = 0x849ad6a1 +const StickerTypeID = 0xd96f5d3f // Ensuring interfaces in compile-time for Sticker. var ( @@ -92,9 +89,6 @@ func (s *Sticker) Zero() bool { if !(s.FullType == nil) { return false } - if !(s.Outline == nil) { - return false - } if !(s.Thumbnail.Zero()) { return false } @@ -165,10 +159,6 @@ func (s *Sticker) TypeInfo() tdp.Type { Name: "FullType", SchemaName: "full_type", }, - { - Name: "Outline", - SchemaName: "outline", - }, { Name: "Thumbnail", SchemaName: "thumbnail", @@ -184,7 +174,7 @@ func (s *Sticker) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (s *Sticker) Encode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode sticker#849ad6a1 as nil") + return fmt.Errorf("can't encode sticker#d96f5d3f as nil") } b.PutID(StickerTypeID) return s.EncodeBare(b) @@ -193,7 +183,7 @@ func (s *Sticker) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (s *Sticker) EncodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode sticker#849ad6a1 as nil") + return fmt.Errorf("can't encode sticker#d96f5d3f as nil") } b.PutLong(s.ID) b.PutLong(s.SetID) @@ -201,28 +191,22 @@ func (s *Sticker) EncodeBare(b *bin.Buffer) error { b.PutInt32(s.Height) b.PutString(s.Emoji) if s.Format == nil { - return fmt.Errorf("unable to encode sticker#849ad6a1: field format is nil") + return fmt.Errorf("unable to encode sticker#d96f5d3f: field format is nil") } if err := s.Format.Encode(b); err != nil { - return fmt.Errorf("unable to encode sticker#849ad6a1: field format: %w", err) + return fmt.Errorf("unable to encode sticker#d96f5d3f: field format: %w", err) } if s.FullType == nil { - return fmt.Errorf("unable to encode sticker#849ad6a1: field full_type is nil") + return fmt.Errorf("unable to encode sticker#d96f5d3f: field full_type is nil") } if err := s.FullType.Encode(b); err != nil { - return fmt.Errorf("unable to encode sticker#849ad6a1: field full_type: %w", err) - } - b.PutInt(len(s.Outline)) - for idx, v := range s.Outline { - if err := v.EncodeBare(b); err != nil { - return fmt.Errorf("unable to encode bare sticker#849ad6a1: field outline element with index %d: %w", idx, err) - } + return fmt.Errorf("unable to encode sticker#d96f5d3f: field full_type: %w", err) } if err := s.Thumbnail.Encode(b); err != nil { - return fmt.Errorf("unable to encode sticker#849ad6a1: field thumbnail: %w", err) + return fmt.Errorf("unable to encode sticker#d96f5d3f: field thumbnail: %w", err) } if err := s.Sticker.Encode(b); err != nil { - return fmt.Errorf("unable to encode sticker#849ad6a1: field sticker: %w", err) + return fmt.Errorf("unable to encode sticker#d96f5d3f: field sticker: %w", err) } return nil } @@ -230,10 +214,10 @@ func (s *Sticker) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (s *Sticker) Decode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode sticker#849ad6a1 to nil") + return fmt.Errorf("can't decode sticker#d96f5d3f to nil") } if err := b.ConsumeID(StickerTypeID); err != nil { - return fmt.Errorf("unable to decode sticker#849ad6a1: %w", err) + return fmt.Errorf("unable to decode sticker#d96f5d3f: %w", err) } return s.DecodeBare(b) } @@ -241,82 +225,65 @@ func (s *Sticker) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (s *Sticker) DecodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode sticker#849ad6a1 to nil") + return fmt.Errorf("can't decode sticker#d96f5d3f to nil") } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode sticker#849ad6a1: field id: %w", err) + return fmt.Errorf("unable to decode sticker#d96f5d3f: field id: %w", err) } s.ID = value } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode sticker#849ad6a1: field set_id: %w", err) + return fmt.Errorf("unable to decode sticker#d96f5d3f: field set_id: %w", err) } s.SetID = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode sticker#849ad6a1: field width: %w", err) + return fmt.Errorf("unable to decode sticker#d96f5d3f: field width: %w", err) } s.Width = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode sticker#849ad6a1: field height: %w", err) + return fmt.Errorf("unable to decode sticker#d96f5d3f: field height: %w", err) } s.Height = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode sticker#849ad6a1: field emoji: %w", err) + return fmt.Errorf("unable to decode sticker#d96f5d3f: field emoji: %w", err) } s.Emoji = value } { value, err := DecodeStickerFormat(b) if err != nil { - return fmt.Errorf("unable to decode sticker#849ad6a1: field format: %w", err) + return fmt.Errorf("unable to decode sticker#d96f5d3f: field format: %w", err) } s.Format = value } { value, err := DecodeStickerFullType(b) if err != nil { - return fmt.Errorf("unable to decode sticker#849ad6a1: field full_type: %w", err) + return fmt.Errorf("unable to decode sticker#d96f5d3f: field full_type: %w", err) } s.FullType = value } - { - headerLen, err := b.Int() - if err != nil { - return fmt.Errorf("unable to decode sticker#849ad6a1: field outline: %w", err) - } - - if headerLen > 0 { - s.Outline = make([]ClosedVectorPath, 0, headerLen%bin.PreallocateLimit) - } - for idx := 0; idx < headerLen; idx++ { - var value ClosedVectorPath - if err := value.DecodeBare(b); err != nil { - return fmt.Errorf("unable to decode bare sticker#849ad6a1: field outline: %w", err) - } - s.Outline = append(s.Outline, value) - } - } { if err := s.Thumbnail.Decode(b); err != nil { - return fmt.Errorf("unable to decode sticker#849ad6a1: field thumbnail: %w", err) + return fmt.Errorf("unable to decode sticker#d96f5d3f: field thumbnail: %w", err) } } { if err := s.Sticker.Decode(b); err != nil { - return fmt.Errorf("unable to decode sticker#849ad6a1: field sticker: %w", err) + return fmt.Errorf("unable to decode sticker#d96f5d3f: field sticker: %w", err) } } return nil @@ -325,7 +292,7 @@ func (s *Sticker) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (s *Sticker) EncodeTDLibJSON(b tdjson.Encoder) error { if s == nil { - return fmt.Errorf("can't encode sticker#849ad6a1 as nil") + return fmt.Errorf("can't encode sticker#d96f5d3f as nil") } b.ObjStart() b.PutID("sticker") @@ -347,39 +314,28 @@ func (s *Sticker) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("format") if s.Format == nil { - return fmt.Errorf("unable to encode sticker#849ad6a1: field format is nil") + return fmt.Errorf("unable to encode sticker#d96f5d3f: field format is nil") } if err := s.Format.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode sticker#849ad6a1: field format: %w", err) + return fmt.Errorf("unable to encode sticker#d96f5d3f: field format: %w", err) } b.Comma() b.FieldStart("full_type") if s.FullType == nil { - return fmt.Errorf("unable to encode sticker#849ad6a1: field full_type is nil") + return fmt.Errorf("unable to encode sticker#d96f5d3f: field full_type is nil") } if err := s.FullType.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode sticker#849ad6a1: field full_type: %w", err) - } - b.Comma() - b.FieldStart("outline") - b.ArrStart() - for idx, v := range s.Outline { - if err := v.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode sticker#849ad6a1: field outline element with index %d: %w", idx, err) - } - b.Comma() + return fmt.Errorf("unable to encode sticker#d96f5d3f: field full_type: %w", err) } - b.StripComma() - b.ArrEnd() b.Comma() b.FieldStart("thumbnail") if err := s.Thumbnail.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode sticker#849ad6a1: field thumbnail: %w", err) + return fmt.Errorf("unable to encode sticker#d96f5d3f: field thumbnail: %w", err) } b.Comma() b.FieldStart("sticker") if err := s.Sticker.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode sticker#849ad6a1: field sticker: %w", err) + return fmt.Errorf("unable to encode sticker#d96f5d3f: field sticker: %w", err) } b.Comma() b.StripComma() @@ -390,75 +346,64 @@ func (s *Sticker) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (s *Sticker) DecodeTDLibJSON(b tdjson.Decoder) error { if s == nil { - return fmt.Errorf("can't decode sticker#849ad6a1 to nil") + return fmt.Errorf("can't decode sticker#d96f5d3f to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("sticker"); err != nil { - return fmt.Errorf("unable to decode sticker#849ad6a1: %w", err) + return fmt.Errorf("unable to decode sticker#d96f5d3f: %w", err) } case "id": value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode sticker#849ad6a1: field id: %w", err) + return fmt.Errorf("unable to decode sticker#d96f5d3f: field id: %w", err) } s.ID = value case "set_id": value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode sticker#849ad6a1: field set_id: %w", err) + return fmt.Errorf("unable to decode sticker#d96f5d3f: field set_id: %w", err) } s.SetID = value case "width": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode sticker#849ad6a1: field width: %w", err) + return fmt.Errorf("unable to decode sticker#d96f5d3f: field width: %w", err) } s.Width = value case "height": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode sticker#849ad6a1: field height: %w", err) + return fmt.Errorf("unable to decode sticker#d96f5d3f: field height: %w", err) } s.Height = value case "emoji": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode sticker#849ad6a1: field emoji: %w", err) + return fmt.Errorf("unable to decode sticker#d96f5d3f: field emoji: %w", err) } s.Emoji = value case "format": value, err := DecodeTDLibJSONStickerFormat(b) if err != nil { - return fmt.Errorf("unable to decode sticker#849ad6a1: field format: %w", err) + return fmt.Errorf("unable to decode sticker#d96f5d3f: field format: %w", err) } s.Format = value case "full_type": value, err := DecodeTDLibJSONStickerFullType(b) if err != nil { - return fmt.Errorf("unable to decode sticker#849ad6a1: field full_type: %w", err) + return fmt.Errorf("unable to decode sticker#d96f5d3f: field full_type: %w", err) } s.FullType = value - case "outline": - if err := b.Arr(func(b tdjson.Decoder) error { - var value ClosedVectorPath - if err := value.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode sticker#849ad6a1: field outline: %w", err) - } - s.Outline = append(s.Outline, value) - return nil - }); err != nil { - return fmt.Errorf("unable to decode sticker#849ad6a1: field outline: %w", err) - } case "thumbnail": if err := s.Thumbnail.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode sticker#849ad6a1: field thumbnail: %w", err) + return fmt.Errorf("unable to decode sticker#d96f5d3f: field thumbnail: %w", err) } case "sticker": if err := s.Sticker.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode sticker#849ad6a1: field sticker: %w", err) + return fmt.Errorf("unable to decode sticker#d96f5d3f: field sticker: %w", err) } default: return b.Skip() @@ -523,14 +468,6 @@ func (s *Sticker) GetFullType() (value StickerFullTypeClass) { return s.FullType } -// GetOutline returns value of Outline field. -func (s *Sticker) GetOutline() (value []ClosedVectorPath) { - if s == nil { - return - } - return s.Outline -} - // GetThumbnail returns value of Thumbnail field. func (s *Sticker) GetThumbnail() (value Thumbnail) { if s == nil { diff --git a/tdapi/tl_sticker_set_gen.go b/tdapi/tl_sticker_set_gen.go index 07042828e..d85e22952 100644 --- a/tdapi/tl_sticker_set_gen.go +++ b/tdapi/tl_sticker_set_gen.go @@ -31,7 +31,7 @@ var ( _ = tdjson.Encoder{} ) -// StickerSet represents TL type `stickerSet#bcf4d158`. +// StickerSet represents TL type `stickerSet#e3b8a114`. type StickerSet struct { // Identifier of the sticker set ID int64 @@ -42,9 +42,8 @@ type StickerSet struct { // Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be // null. The file can be downloaded only before the thumbnail is changed Thumbnail Thumbnail - // Sticker set thumbnail's outline represented as a list of closed vector paths; may be - // empty. The coordinate system origin is in the upper-left corner - ThumbnailOutline []ClosedVectorPath + // Sticker set thumbnail's outline; may be null if unknown + ThumbnailOutline Outline // True, if the sticker set is owned by the current user IsOwned bool // True, if the sticker set has been installed by the current user @@ -73,7 +72,7 @@ type StickerSet struct { } // StickerSetTypeID is TL type id of StickerSet. -const StickerSetTypeID = 0xbcf4d158 +const StickerSetTypeID = 0xe3b8a114 // Ensuring interfaces in compile-time for StickerSet. var ( @@ -99,7 +98,7 @@ func (s *StickerSet) Zero() bool { if !(s.Thumbnail.Zero()) { return false } - if !(s.ThumbnailOutline == nil) { + if !(s.ThumbnailOutline.Zero()) { return false } if !(s.IsOwned == false) { @@ -235,7 +234,7 @@ func (s *StickerSet) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (s *StickerSet) Encode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode stickerSet#bcf4d158 as nil") + return fmt.Errorf("can't encode stickerSet#e3b8a114 as nil") } b.PutID(StickerSetTypeID) return s.EncodeBare(b) @@ -244,29 +243,26 @@ func (s *StickerSet) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (s *StickerSet) EncodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode stickerSet#bcf4d158 as nil") + return fmt.Errorf("can't encode stickerSet#e3b8a114 as nil") } b.PutLong(s.ID) b.PutString(s.Title) b.PutString(s.Name) if err := s.Thumbnail.Encode(b); err != nil { - return fmt.Errorf("unable to encode stickerSet#bcf4d158: field thumbnail: %w", err) + return fmt.Errorf("unable to encode stickerSet#e3b8a114: field thumbnail: %w", err) } - b.PutInt(len(s.ThumbnailOutline)) - for idx, v := range s.ThumbnailOutline { - if err := v.EncodeBare(b); err != nil { - return fmt.Errorf("unable to encode bare stickerSet#bcf4d158: field thumbnail_outline element with index %d: %w", idx, err) - } + if err := s.ThumbnailOutline.Encode(b); err != nil { + return fmt.Errorf("unable to encode stickerSet#e3b8a114: field thumbnail_outline: %w", err) } b.PutBool(s.IsOwned) b.PutBool(s.IsInstalled) b.PutBool(s.IsArchived) b.PutBool(s.IsOfficial) if s.StickerType == nil { - return fmt.Errorf("unable to encode stickerSet#bcf4d158: field sticker_type is nil") + return fmt.Errorf("unable to encode stickerSet#e3b8a114: field sticker_type is nil") } if err := s.StickerType.Encode(b); err != nil { - return fmt.Errorf("unable to encode stickerSet#bcf4d158: field sticker_type: %w", err) + return fmt.Errorf("unable to encode stickerSet#e3b8a114: field sticker_type: %w", err) } b.PutBool(s.NeedsRepainting) b.PutBool(s.IsAllowedAsChatEmojiStatus) @@ -274,13 +270,13 @@ func (s *StickerSet) EncodeBare(b *bin.Buffer) error { b.PutInt(len(s.Stickers)) for idx, v := range s.Stickers { if err := v.EncodeBare(b); err != nil { - return fmt.Errorf("unable to encode bare stickerSet#bcf4d158: field stickers element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode bare stickerSet#e3b8a114: field stickers element with index %d: %w", idx, err) } } b.PutInt(len(s.Emojis)) for idx, v := range s.Emojis { if err := v.EncodeBare(b); err != nil { - return fmt.Errorf("unable to encode bare stickerSet#bcf4d158: field emojis element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode bare stickerSet#e3b8a114: field emojis element with index %d: %w", idx, err) } } return nil @@ -289,10 +285,10 @@ func (s *StickerSet) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (s *StickerSet) Decode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode stickerSet#bcf4d158 to nil") + return fmt.Errorf("can't decode stickerSet#e3b8a114 to nil") } if err := b.ConsumeID(StickerSetTypeID); err != nil { - return fmt.Errorf("unable to decode stickerSet#bcf4d158: %w", err) + return fmt.Errorf("unable to decode stickerSet#e3b8a114: %w", err) } return s.DecodeBare(b) } @@ -300,111 +296,99 @@ func (s *StickerSet) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (s *StickerSet) DecodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode stickerSet#bcf4d158 to nil") + return fmt.Errorf("can't decode stickerSet#e3b8a114 to nil") } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode stickerSet#bcf4d158: field id: %w", err) + return fmt.Errorf("unable to decode stickerSet#e3b8a114: field id: %w", err) } s.ID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode stickerSet#bcf4d158: field title: %w", err) + return fmt.Errorf("unable to decode stickerSet#e3b8a114: field title: %w", err) } s.Title = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode stickerSet#bcf4d158: field name: %w", err) + return fmt.Errorf("unable to decode stickerSet#e3b8a114: field name: %w", err) } s.Name = value } { if err := s.Thumbnail.Decode(b); err != nil { - return fmt.Errorf("unable to decode stickerSet#bcf4d158: field thumbnail: %w", err) + return fmt.Errorf("unable to decode stickerSet#e3b8a114: field thumbnail: %w", err) } } { - headerLen, err := b.Int() - if err != nil { - return fmt.Errorf("unable to decode stickerSet#bcf4d158: field thumbnail_outline: %w", err) - } - - if headerLen > 0 { - s.ThumbnailOutline = make([]ClosedVectorPath, 0, headerLen%bin.PreallocateLimit) - } - for idx := 0; idx < headerLen; idx++ { - var value ClosedVectorPath - if err := value.DecodeBare(b); err != nil { - return fmt.Errorf("unable to decode bare stickerSet#bcf4d158: field thumbnail_outline: %w", err) - } - s.ThumbnailOutline = append(s.ThumbnailOutline, value) + if err := s.ThumbnailOutline.Decode(b); err != nil { + return fmt.Errorf("unable to decode stickerSet#e3b8a114: field thumbnail_outline: %w", err) } } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSet#bcf4d158: field is_owned: %w", err) + return fmt.Errorf("unable to decode stickerSet#e3b8a114: field is_owned: %w", err) } s.IsOwned = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSet#bcf4d158: field is_installed: %w", err) + return fmt.Errorf("unable to decode stickerSet#e3b8a114: field is_installed: %w", err) } s.IsInstalled = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSet#bcf4d158: field is_archived: %w", err) + return fmt.Errorf("unable to decode stickerSet#e3b8a114: field is_archived: %w", err) } s.IsArchived = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSet#bcf4d158: field is_official: %w", err) + return fmt.Errorf("unable to decode stickerSet#e3b8a114: field is_official: %w", err) } s.IsOfficial = value } { value, err := DecodeStickerType(b) if err != nil { - return fmt.Errorf("unable to decode stickerSet#bcf4d158: field sticker_type: %w", err) + return fmt.Errorf("unable to decode stickerSet#e3b8a114: field sticker_type: %w", err) } s.StickerType = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSet#bcf4d158: field needs_repainting: %w", err) + return fmt.Errorf("unable to decode stickerSet#e3b8a114: field needs_repainting: %w", err) } s.NeedsRepainting = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSet#bcf4d158: field is_allowed_as_chat_emoji_status: %w", err) + return fmt.Errorf("unable to decode stickerSet#e3b8a114: field is_allowed_as_chat_emoji_status: %w", err) } s.IsAllowedAsChatEmojiStatus = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSet#bcf4d158: field is_viewed: %w", err) + return fmt.Errorf("unable to decode stickerSet#e3b8a114: field is_viewed: %w", err) } s.IsViewed = value } { headerLen, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode stickerSet#bcf4d158: field stickers: %w", err) + return fmt.Errorf("unable to decode stickerSet#e3b8a114: field stickers: %w", err) } if headerLen > 0 { @@ -413,7 +397,7 @@ func (s *StickerSet) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { var value Sticker if err := value.DecodeBare(b); err != nil { - return fmt.Errorf("unable to decode bare stickerSet#bcf4d158: field stickers: %w", err) + return fmt.Errorf("unable to decode bare stickerSet#e3b8a114: field stickers: %w", err) } s.Stickers = append(s.Stickers, value) } @@ -421,7 +405,7 @@ func (s *StickerSet) DecodeBare(b *bin.Buffer) error { { headerLen, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode stickerSet#bcf4d158: field emojis: %w", err) + return fmt.Errorf("unable to decode stickerSet#e3b8a114: field emojis: %w", err) } if headerLen > 0 { @@ -430,7 +414,7 @@ func (s *StickerSet) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { var value Emojis if err := value.DecodeBare(b); err != nil { - return fmt.Errorf("unable to decode bare stickerSet#bcf4d158: field emojis: %w", err) + return fmt.Errorf("unable to decode bare stickerSet#e3b8a114: field emojis: %w", err) } s.Emojis = append(s.Emojis, value) } @@ -441,7 +425,7 @@ func (s *StickerSet) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (s *StickerSet) EncodeTDLibJSON(b tdjson.Encoder) error { if s == nil { - return fmt.Errorf("can't encode stickerSet#bcf4d158 as nil") + return fmt.Errorf("can't encode stickerSet#e3b8a114 as nil") } b.ObjStart() b.PutID("stickerSet") @@ -457,19 +441,13 @@ func (s *StickerSet) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("thumbnail") if err := s.Thumbnail.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode stickerSet#bcf4d158: field thumbnail: %w", err) + return fmt.Errorf("unable to encode stickerSet#e3b8a114: field thumbnail: %w", err) } b.Comma() b.FieldStart("thumbnail_outline") - b.ArrStart() - for idx, v := range s.ThumbnailOutline { - if err := v.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode stickerSet#bcf4d158: field thumbnail_outline element with index %d: %w", idx, err) - } - b.Comma() + if err := s.ThumbnailOutline.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode stickerSet#e3b8a114: field thumbnail_outline: %w", err) } - b.StripComma() - b.ArrEnd() b.Comma() b.FieldStart("is_owned") b.PutBool(s.IsOwned) @@ -485,10 +463,10 @@ func (s *StickerSet) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("sticker_type") if s.StickerType == nil { - return fmt.Errorf("unable to encode stickerSet#bcf4d158: field sticker_type is nil") + return fmt.Errorf("unable to encode stickerSet#e3b8a114: field sticker_type is nil") } if err := s.StickerType.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode stickerSet#bcf4d158: field sticker_type: %w", err) + return fmt.Errorf("unable to encode stickerSet#e3b8a114: field sticker_type: %w", err) } b.Comma() b.FieldStart("needs_repainting") @@ -504,7 +482,7 @@ func (s *StickerSet) EncodeTDLibJSON(b tdjson.Encoder) error { b.ArrStart() for idx, v := range s.Stickers { if err := v.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode stickerSet#bcf4d158: field stickers element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode stickerSet#e3b8a114: field stickers element with index %d: %w", idx, err) } b.Comma() } @@ -515,7 +493,7 @@ func (s *StickerSet) EncodeTDLibJSON(b tdjson.Encoder) error { b.ArrStart() for idx, v := range s.Emojis { if err := v.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode stickerSet#bcf4d158: field emojis element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode stickerSet#e3b8a114: field emojis element with index %d: %w", idx, err) } b.Comma() } @@ -530,117 +508,110 @@ func (s *StickerSet) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (s *StickerSet) DecodeTDLibJSON(b tdjson.Decoder) error { if s == nil { - return fmt.Errorf("can't decode stickerSet#bcf4d158 to nil") + return fmt.Errorf("can't decode stickerSet#e3b8a114 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("stickerSet"); err != nil { - return fmt.Errorf("unable to decode stickerSet#bcf4d158: %w", err) + return fmt.Errorf("unable to decode stickerSet#e3b8a114: %w", err) } case "id": value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode stickerSet#bcf4d158: field id: %w", err) + return fmt.Errorf("unable to decode stickerSet#e3b8a114: field id: %w", err) } s.ID = value case "title": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode stickerSet#bcf4d158: field title: %w", err) + return fmt.Errorf("unable to decode stickerSet#e3b8a114: field title: %w", err) } s.Title = value case "name": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode stickerSet#bcf4d158: field name: %w", err) + return fmt.Errorf("unable to decode stickerSet#e3b8a114: field name: %w", err) } s.Name = value case "thumbnail": if err := s.Thumbnail.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode stickerSet#bcf4d158: field thumbnail: %w", err) + return fmt.Errorf("unable to decode stickerSet#e3b8a114: field thumbnail: %w", err) } case "thumbnail_outline": - if err := b.Arr(func(b tdjson.Decoder) error { - var value ClosedVectorPath - if err := value.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode stickerSet#bcf4d158: field thumbnail_outline: %w", err) - } - s.ThumbnailOutline = append(s.ThumbnailOutline, value) - return nil - }); err != nil { - return fmt.Errorf("unable to decode stickerSet#bcf4d158: field thumbnail_outline: %w", err) + if err := s.ThumbnailOutline.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode stickerSet#e3b8a114: field thumbnail_outline: %w", err) } case "is_owned": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSet#bcf4d158: field is_owned: %w", err) + return fmt.Errorf("unable to decode stickerSet#e3b8a114: field is_owned: %w", err) } s.IsOwned = value case "is_installed": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSet#bcf4d158: field is_installed: %w", err) + return fmt.Errorf("unable to decode stickerSet#e3b8a114: field is_installed: %w", err) } s.IsInstalled = value case "is_archived": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSet#bcf4d158: field is_archived: %w", err) + return fmt.Errorf("unable to decode stickerSet#e3b8a114: field is_archived: %w", err) } s.IsArchived = value case "is_official": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSet#bcf4d158: field is_official: %w", err) + return fmt.Errorf("unable to decode stickerSet#e3b8a114: field is_official: %w", err) } s.IsOfficial = value case "sticker_type": value, err := DecodeTDLibJSONStickerType(b) if err != nil { - return fmt.Errorf("unable to decode stickerSet#bcf4d158: field sticker_type: %w", err) + return fmt.Errorf("unable to decode stickerSet#e3b8a114: field sticker_type: %w", err) } s.StickerType = value case "needs_repainting": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSet#bcf4d158: field needs_repainting: %w", err) + return fmt.Errorf("unable to decode stickerSet#e3b8a114: field needs_repainting: %w", err) } s.NeedsRepainting = value case "is_allowed_as_chat_emoji_status": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSet#bcf4d158: field is_allowed_as_chat_emoji_status: %w", err) + return fmt.Errorf("unable to decode stickerSet#e3b8a114: field is_allowed_as_chat_emoji_status: %w", err) } s.IsAllowedAsChatEmojiStatus = value case "is_viewed": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSet#bcf4d158: field is_viewed: %w", err) + return fmt.Errorf("unable to decode stickerSet#e3b8a114: field is_viewed: %w", err) } s.IsViewed = value case "stickers": if err := b.Arr(func(b tdjson.Decoder) error { var value Sticker if err := value.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode stickerSet#bcf4d158: field stickers: %w", err) + return fmt.Errorf("unable to decode stickerSet#e3b8a114: field stickers: %w", err) } s.Stickers = append(s.Stickers, value) return nil }); err != nil { - return fmt.Errorf("unable to decode stickerSet#bcf4d158: field stickers: %w", err) + return fmt.Errorf("unable to decode stickerSet#e3b8a114: field stickers: %w", err) } case "emojis": if err := b.Arr(func(b tdjson.Decoder) error { var value Emojis if err := value.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode stickerSet#bcf4d158: field emojis: %w", err) + return fmt.Errorf("unable to decode stickerSet#e3b8a114: field emojis: %w", err) } s.Emojis = append(s.Emojis, value) return nil }); err != nil { - return fmt.Errorf("unable to decode stickerSet#bcf4d158: field emojis: %w", err) + return fmt.Errorf("unable to decode stickerSet#e3b8a114: field emojis: %w", err) } default: return b.Skip() @@ -682,7 +653,7 @@ func (s *StickerSet) GetThumbnail() (value Thumbnail) { } // GetThumbnailOutline returns value of ThumbnailOutline field. -func (s *StickerSet) GetThumbnailOutline() (value []ClosedVectorPath) { +func (s *StickerSet) GetThumbnailOutline() (value Outline) { if s == nil { return } diff --git a/tdapi/tl_sticker_set_info_gen.go b/tdapi/tl_sticker_set_info_gen.go index 444fb7809..95d4dd9fc 100644 --- a/tdapi/tl_sticker_set_info_gen.go +++ b/tdapi/tl_sticker_set_info_gen.go @@ -31,7 +31,7 @@ var ( _ = tdjson.Encoder{} ) -// StickerSetInfo represents TL type `stickerSetInfo#3cd2cd82`. +// StickerSetInfo represents TL type `stickerSetInfo#58991994`. type StickerSetInfo struct { // Identifier of the sticker set ID int64 @@ -42,9 +42,8 @@ type StickerSetInfo struct { // Sticker set thumbnail in WEBP, TGS, or WEBM format with width and height 100; may be // null. The file can be downloaded only before the thumbnail is changed Thumbnail Thumbnail - // Sticker set thumbnail's outline represented as a list of closed vector paths; may be - // empty. The coordinate system origin is in the upper-left corner - ThumbnailOutline []ClosedVectorPath + // Sticker set thumbnail's outline; may be null if unknown + ThumbnailOutline Outline // True, if the sticker set is owned by the current user IsOwned bool // True, if the sticker set has been installed by the current user @@ -72,7 +71,7 @@ type StickerSetInfo struct { } // StickerSetInfoTypeID is TL type id of StickerSetInfo. -const StickerSetInfoTypeID = 0x3cd2cd82 +const StickerSetInfoTypeID = 0x58991994 // Ensuring interfaces in compile-time for StickerSetInfo. var ( @@ -98,7 +97,7 @@ func (s *StickerSetInfo) Zero() bool { if !(s.Thumbnail.Zero()) { return false } - if !(s.ThumbnailOutline == nil) { + if !(s.ThumbnailOutline.Zero()) { return false } if !(s.IsOwned == false) { @@ -234,7 +233,7 @@ func (s *StickerSetInfo) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (s *StickerSetInfo) Encode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode stickerSetInfo#3cd2cd82 as nil") + return fmt.Errorf("can't encode stickerSetInfo#58991994 as nil") } b.PutID(StickerSetInfoTypeID) return s.EncodeBare(b) @@ -243,29 +242,26 @@ func (s *StickerSetInfo) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (s *StickerSetInfo) EncodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't encode stickerSetInfo#3cd2cd82 as nil") + return fmt.Errorf("can't encode stickerSetInfo#58991994 as nil") } b.PutLong(s.ID) b.PutString(s.Title) b.PutString(s.Name) if err := s.Thumbnail.Encode(b); err != nil { - return fmt.Errorf("unable to encode stickerSetInfo#3cd2cd82: field thumbnail: %w", err) + return fmt.Errorf("unable to encode stickerSetInfo#58991994: field thumbnail: %w", err) } - b.PutInt(len(s.ThumbnailOutline)) - for idx, v := range s.ThumbnailOutline { - if err := v.EncodeBare(b); err != nil { - return fmt.Errorf("unable to encode bare stickerSetInfo#3cd2cd82: field thumbnail_outline element with index %d: %w", idx, err) - } + if err := s.ThumbnailOutline.Encode(b); err != nil { + return fmt.Errorf("unable to encode stickerSetInfo#58991994: field thumbnail_outline: %w", err) } b.PutBool(s.IsOwned) b.PutBool(s.IsInstalled) b.PutBool(s.IsArchived) b.PutBool(s.IsOfficial) if s.StickerType == nil { - return fmt.Errorf("unable to encode stickerSetInfo#3cd2cd82: field sticker_type is nil") + return fmt.Errorf("unable to encode stickerSetInfo#58991994: field sticker_type is nil") } if err := s.StickerType.Encode(b); err != nil { - return fmt.Errorf("unable to encode stickerSetInfo#3cd2cd82: field sticker_type: %w", err) + return fmt.Errorf("unable to encode stickerSetInfo#58991994: field sticker_type: %w", err) } b.PutBool(s.NeedsRepainting) b.PutBool(s.IsAllowedAsChatEmojiStatus) @@ -274,7 +270,7 @@ func (s *StickerSetInfo) EncodeBare(b *bin.Buffer) error { b.PutInt(len(s.Covers)) for idx, v := range s.Covers { if err := v.EncodeBare(b); err != nil { - return fmt.Errorf("unable to encode bare stickerSetInfo#3cd2cd82: field covers element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode bare stickerSetInfo#58991994: field covers element with index %d: %w", idx, err) } } return nil @@ -283,10 +279,10 @@ func (s *StickerSetInfo) EncodeBare(b *bin.Buffer) error { // Decode implements bin.Decoder. func (s *StickerSetInfo) Decode(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode stickerSetInfo#3cd2cd82 to nil") + return fmt.Errorf("can't decode stickerSetInfo#58991994 to nil") } if err := b.ConsumeID(StickerSetInfoTypeID); err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#3cd2cd82: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#58991994: %w", err) } return s.DecodeBare(b) } @@ -294,118 +290,106 @@ func (s *StickerSetInfo) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (s *StickerSetInfo) DecodeBare(b *bin.Buffer) error { if s == nil { - return fmt.Errorf("can't decode stickerSetInfo#3cd2cd82 to nil") + return fmt.Errorf("can't decode stickerSetInfo#58991994 to nil") } { value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#3cd2cd82: field id: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#58991994: field id: %w", err) } s.ID = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#3cd2cd82: field title: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#58991994: field title: %w", err) } s.Title = value } { value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#3cd2cd82: field name: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#58991994: field name: %w", err) } s.Name = value } { if err := s.Thumbnail.Decode(b); err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#3cd2cd82: field thumbnail: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#58991994: field thumbnail: %w", err) } } { - headerLen, err := b.Int() - if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#3cd2cd82: field thumbnail_outline: %w", err) - } - - if headerLen > 0 { - s.ThumbnailOutline = make([]ClosedVectorPath, 0, headerLen%bin.PreallocateLimit) - } - for idx := 0; idx < headerLen; idx++ { - var value ClosedVectorPath - if err := value.DecodeBare(b); err != nil { - return fmt.Errorf("unable to decode bare stickerSetInfo#3cd2cd82: field thumbnail_outline: %w", err) - } - s.ThumbnailOutline = append(s.ThumbnailOutline, value) + if err := s.ThumbnailOutline.Decode(b); err != nil { + return fmt.Errorf("unable to decode stickerSetInfo#58991994: field thumbnail_outline: %w", err) } } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#3cd2cd82: field is_owned: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#58991994: field is_owned: %w", err) } s.IsOwned = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#3cd2cd82: field is_installed: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#58991994: field is_installed: %w", err) } s.IsInstalled = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#3cd2cd82: field is_archived: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#58991994: field is_archived: %w", err) } s.IsArchived = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#3cd2cd82: field is_official: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#58991994: field is_official: %w", err) } s.IsOfficial = value } { value, err := DecodeStickerType(b) if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#3cd2cd82: field sticker_type: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#58991994: field sticker_type: %w", err) } s.StickerType = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#3cd2cd82: field needs_repainting: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#58991994: field needs_repainting: %w", err) } s.NeedsRepainting = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#3cd2cd82: field is_allowed_as_chat_emoji_status: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#58991994: field is_allowed_as_chat_emoji_status: %w", err) } s.IsAllowedAsChatEmojiStatus = value } { value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#3cd2cd82: field is_viewed: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#58991994: field is_viewed: %w", err) } s.IsViewed = value } { value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#3cd2cd82: field size: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#58991994: field size: %w", err) } s.Size = value } { headerLen, err := b.Int() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#3cd2cd82: field covers: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#58991994: field covers: %w", err) } if headerLen > 0 { @@ -414,7 +398,7 @@ func (s *StickerSetInfo) DecodeBare(b *bin.Buffer) error { for idx := 0; idx < headerLen; idx++ { var value Sticker if err := value.DecodeBare(b); err != nil { - return fmt.Errorf("unable to decode bare stickerSetInfo#3cd2cd82: field covers: %w", err) + return fmt.Errorf("unable to decode bare stickerSetInfo#58991994: field covers: %w", err) } s.Covers = append(s.Covers, value) } @@ -425,7 +409,7 @@ func (s *StickerSetInfo) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (s *StickerSetInfo) EncodeTDLibJSON(b tdjson.Encoder) error { if s == nil { - return fmt.Errorf("can't encode stickerSetInfo#3cd2cd82 as nil") + return fmt.Errorf("can't encode stickerSetInfo#58991994 as nil") } b.ObjStart() b.PutID("stickerSetInfo") @@ -441,19 +425,13 @@ func (s *StickerSetInfo) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("thumbnail") if err := s.Thumbnail.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode stickerSetInfo#3cd2cd82: field thumbnail: %w", err) + return fmt.Errorf("unable to encode stickerSetInfo#58991994: field thumbnail: %w", err) } b.Comma() b.FieldStart("thumbnail_outline") - b.ArrStart() - for idx, v := range s.ThumbnailOutline { - if err := v.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode stickerSetInfo#3cd2cd82: field thumbnail_outline element with index %d: %w", idx, err) - } - b.Comma() + if err := s.ThumbnailOutline.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode stickerSetInfo#58991994: field thumbnail_outline: %w", err) } - b.StripComma() - b.ArrEnd() b.Comma() b.FieldStart("is_owned") b.PutBool(s.IsOwned) @@ -469,10 +447,10 @@ func (s *StickerSetInfo) EncodeTDLibJSON(b tdjson.Encoder) error { b.Comma() b.FieldStart("sticker_type") if s.StickerType == nil { - return fmt.Errorf("unable to encode stickerSetInfo#3cd2cd82: field sticker_type is nil") + return fmt.Errorf("unable to encode stickerSetInfo#58991994: field sticker_type is nil") } if err := s.StickerType.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode stickerSetInfo#3cd2cd82: field sticker_type: %w", err) + return fmt.Errorf("unable to encode stickerSetInfo#58991994: field sticker_type: %w", err) } b.Comma() b.FieldStart("needs_repainting") @@ -491,7 +469,7 @@ func (s *StickerSetInfo) EncodeTDLibJSON(b tdjson.Encoder) error { b.ArrStart() for idx, v := range s.Covers { if err := v.EncodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to encode stickerSetInfo#3cd2cd82: field covers element with index %d: %w", idx, err) + return fmt.Errorf("unable to encode stickerSetInfo#58991994: field covers element with index %d: %w", idx, err) } b.Comma() } @@ -506,112 +484,105 @@ func (s *StickerSetInfo) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (s *StickerSetInfo) DecodeTDLibJSON(b tdjson.Decoder) error { if s == nil { - return fmt.Errorf("can't decode stickerSetInfo#3cd2cd82 to nil") + return fmt.Errorf("can't decode stickerSetInfo#58991994 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("stickerSetInfo"); err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#3cd2cd82: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#58991994: %w", err) } case "id": value, err := b.Long() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#3cd2cd82: field id: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#58991994: field id: %w", err) } s.ID = value case "title": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#3cd2cd82: field title: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#58991994: field title: %w", err) } s.Title = value case "name": value, err := b.String() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#3cd2cd82: field name: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#58991994: field name: %w", err) } s.Name = value case "thumbnail": if err := s.Thumbnail.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#3cd2cd82: field thumbnail: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#58991994: field thumbnail: %w", err) } case "thumbnail_outline": - if err := b.Arr(func(b tdjson.Decoder) error { - var value ClosedVectorPath - if err := value.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#3cd2cd82: field thumbnail_outline: %w", err) - } - s.ThumbnailOutline = append(s.ThumbnailOutline, value) - return nil - }); err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#3cd2cd82: field thumbnail_outline: %w", err) + if err := s.ThumbnailOutline.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode stickerSetInfo#58991994: field thumbnail_outline: %w", err) } case "is_owned": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#3cd2cd82: field is_owned: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#58991994: field is_owned: %w", err) } s.IsOwned = value case "is_installed": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#3cd2cd82: field is_installed: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#58991994: field is_installed: %w", err) } s.IsInstalled = value case "is_archived": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#3cd2cd82: field is_archived: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#58991994: field is_archived: %w", err) } s.IsArchived = value case "is_official": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#3cd2cd82: field is_official: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#58991994: field is_official: %w", err) } s.IsOfficial = value case "sticker_type": value, err := DecodeTDLibJSONStickerType(b) if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#3cd2cd82: field sticker_type: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#58991994: field sticker_type: %w", err) } s.StickerType = value case "needs_repainting": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#3cd2cd82: field needs_repainting: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#58991994: field needs_repainting: %w", err) } s.NeedsRepainting = value case "is_allowed_as_chat_emoji_status": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#3cd2cd82: field is_allowed_as_chat_emoji_status: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#58991994: field is_allowed_as_chat_emoji_status: %w", err) } s.IsAllowedAsChatEmojiStatus = value case "is_viewed": value, err := b.Bool() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#3cd2cd82: field is_viewed: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#58991994: field is_viewed: %w", err) } s.IsViewed = value case "size": value, err := b.Int32() if err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#3cd2cd82: field size: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#58991994: field size: %w", err) } s.Size = value case "covers": if err := b.Arr(func(b tdjson.Decoder) error { var value Sticker if err := value.DecodeTDLibJSON(b); err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#3cd2cd82: field covers: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#58991994: field covers: %w", err) } s.Covers = append(s.Covers, value) return nil }); err != nil { - return fmt.Errorf("unable to decode stickerSetInfo#3cd2cd82: field covers: %w", err) + return fmt.Errorf("unable to decode stickerSetInfo#58991994: field covers: %w", err) } default: return b.Skip() @@ -653,7 +624,7 @@ func (s *StickerSetInfo) GetThumbnail() (value Thumbnail) { } // GetThumbnailOutline returns value of ThumbnailOutline field. -func (s *StickerSetInfo) GetThumbnailOutline() (value []ClosedVectorPath) { +func (s *StickerSetInfo) GetThumbnailOutline() (value Outline) { if s == nil { return } diff --git a/tdapi/tl_target_chat_gen.go b/tdapi/tl_target_chat_gen.go index 6bb16b7d2..c333bf9ea 100644 --- a/tdapi/tl_target_chat_gen.go +++ b/tdapi/tl_target_chat_gen.go @@ -162,20 +162,14 @@ func (t *TargetChatCurrent) DecodeTDLibJSON(b tdjson.Decoder) error { }) } -// TargetChatChosen represents TL type `targetChatChosen#edaccad2`. +// TargetChatChosen represents TL type `targetChatChosen#acf8d5a6`. type TargetChatChosen struct { - // True, if private chats with ordinary users are allowed - AllowUserChats bool - // True, if private chats with other bots are allowed - AllowBotChats bool - // True, if basic group and supergroup chats are allowed - AllowGroupChats bool - // True, if channel chats are allowed - AllowChannelChats bool + // Allowed types for the chat + Types TargetChatTypes } // TargetChatChosenTypeID is TL type id of TargetChatChosen. -const TargetChatChosenTypeID = 0xedaccad2 +const TargetChatChosenTypeID = 0xacf8d5a6 // construct implements constructor of TargetChatClass. func (t TargetChatChosen) construct() TargetChatClass { return &t } @@ -194,16 +188,7 @@ func (t *TargetChatChosen) Zero() bool { if t == nil { return true } - if !(t.AllowUserChats == false) { - return false - } - if !(t.AllowBotChats == false) { - return false - } - if !(t.AllowGroupChats == false) { - return false - } - if !(t.AllowChannelChats == false) { + if !(t.Types.Zero()) { return false } @@ -243,20 +228,8 @@ func (t *TargetChatChosen) TypeInfo() tdp.Type { } typ.Fields = []tdp.Field{ { - Name: "AllowUserChats", - SchemaName: "allow_user_chats", - }, - { - Name: "AllowBotChats", - SchemaName: "allow_bot_chats", - }, - { - Name: "AllowGroupChats", - SchemaName: "allow_group_chats", - }, - { - Name: "AllowChannelChats", - SchemaName: "allow_channel_chats", + Name: "Types", + SchemaName: "types", }, } return typ @@ -265,7 +238,7 @@ func (t *TargetChatChosen) TypeInfo() tdp.Type { // Encode implements bin.Encoder. func (t *TargetChatChosen) Encode(b *bin.Buffer) error { if t == nil { - return fmt.Errorf("can't encode targetChatChosen#edaccad2 as nil") + return fmt.Errorf("can't encode targetChatChosen#acf8d5a6 as nil") } b.PutID(TargetChatChosenTypeID) return t.EncodeBare(b) @@ -274,22 +247,21 @@ func (t *TargetChatChosen) Encode(b *bin.Buffer) error { // EncodeBare implements bin.BareEncoder. func (t *TargetChatChosen) EncodeBare(b *bin.Buffer) error { if t == nil { - return fmt.Errorf("can't encode targetChatChosen#edaccad2 as nil") + return fmt.Errorf("can't encode targetChatChosen#acf8d5a6 as nil") + } + if err := t.Types.Encode(b); err != nil { + return fmt.Errorf("unable to encode targetChatChosen#acf8d5a6: field types: %w", err) } - b.PutBool(t.AllowUserChats) - b.PutBool(t.AllowBotChats) - b.PutBool(t.AllowGroupChats) - b.PutBool(t.AllowChannelChats) return nil } // Decode implements bin.Decoder. func (t *TargetChatChosen) Decode(b *bin.Buffer) error { if t == nil { - return fmt.Errorf("can't decode targetChatChosen#edaccad2 to nil") + return fmt.Errorf("can't decode targetChatChosen#acf8d5a6 to nil") } if err := b.ConsumeID(TargetChatChosenTypeID); err != nil { - return fmt.Errorf("unable to decode targetChatChosen#edaccad2: %w", err) + return fmt.Errorf("unable to decode targetChatChosen#acf8d5a6: %w", err) } return t.DecodeBare(b) } @@ -297,35 +269,12 @@ func (t *TargetChatChosen) Decode(b *bin.Buffer) error { // DecodeBare implements bin.BareDecoder. func (t *TargetChatChosen) DecodeBare(b *bin.Buffer) error { if t == nil { - return fmt.Errorf("can't decode targetChatChosen#edaccad2 to nil") + return fmt.Errorf("can't decode targetChatChosen#acf8d5a6 to nil") } { - value, err := b.Bool() - if err != nil { - return fmt.Errorf("unable to decode targetChatChosen#edaccad2: field allow_user_chats: %w", err) - } - t.AllowUserChats = value - } - { - value, err := b.Bool() - if err != nil { - return fmt.Errorf("unable to decode targetChatChosen#edaccad2: field allow_bot_chats: %w", err) - } - t.AllowBotChats = value - } - { - value, err := b.Bool() - if err != nil { - return fmt.Errorf("unable to decode targetChatChosen#edaccad2: field allow_group_chats: %w", err) - } - t.AllowGroupChats = value - } - { - value, err := b.Bool() - if err != nil { - return fmt.Errorf("unable to decode targetChatChosen#edaccad2: field allow_channel_chats: %w", err) + if err := t.Types.Decode(b); err != nil { + return fmt.Errorf("unable to decode targetChatChosen#acf8d5a6: field types: %w", err) } - t.AllowChannelChats = value } return nil } @@ -333,22 +282,15 @@ func (t *TargetChatChosen) DecodeBare(b *bin.Buffer) error { // EncodeTDLibJSON implements tdjson.TDLibEncoder. func (t *TargetChatChosen) EncodeTDLibJSON(b tdjson.Encoder) error { if t == nil { - return fmt.Errorf("can't encode targetChatChosen#edaccad2 as nil") + return fmt.Errorf("can't encode targetChatChosen#acf8d5a6 as nil") } b.ObjStart() b.PutID("targetChatChosen") b.Comma() - b.FieldStart("allow_user_chats") - b.PutBool(t.AllowUserChats) - b.Comma() - b.FieldStart("allow_bot_chats") - b.PutBool(t.AllowBotChats) - b.Comma() - b.FieldStart("allow_group_chats") - b.PutBool(t.AllowGroupChats) - b.Comma() - b.FieldStart("allow_channel_chats") - b.PutBool(t.AllowChannelChats) + b.FieldStart("types") + if err := t.Types.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode targetChatChosen#acf8d5a6: field types: %w", err) + } b.Comma() b.StripComma() b.ObjEnd() @@ -358,39 +300,19 @@ func (t *TargetChatChosen) EncodeTDLibJSON(b tdjson.Encoder) error { // DecodeTDLibJSON implements tdjson.TDLibDecoder. func (t *TargetChatChosen) DecodeTDLibJSON(b tdjson.Decoder) error { if t == nil { - return fmt.Errorf("can't decode targetChatChosen#edaccad2 to nil") + return fmt.Errorf("can't decode targetChatChosen#acf8d5a6 to nil") } return b.Obj(func(b tdjson.Decoder, key []byte) error { switch string(key) { case tdjson.TypeField: if err := b.ConsumeID("targetChatChosen"); err != nil { - return fmt.Errorf("unable to decode targetChatChosen#edaccad2: %w", err) + return fmt.Errorf("unable to decode targetChatChosen#acf8d5a6: %w", err) } - case "allow_user_chats": - value, err := b.Bool() - if err != nil { - return fmt.Errorf("unable to decode targetChatChosen#edaccad2: field allow_user_chats: %w", err) - } - t.AllowUserChats = value - case "allow_bot_chats": - value, err := b.Bool() - if err != nil { - return fmt.Errorf("unable to decode targetChatChosen#edaccad2: field allow_bot_chats: %w", err) + case "types": + if err := t.Types.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode targetChatChosen#acf8d5a6: field types: %w", err) } - t.AllowBotChats = value - case "allow_group_chats": - value, err := b.Bool() - if err != nil { - return fmt.Errorf("unable to decode targetChatChosen#edaccad2: field allow_group_chats: %w", err) - } - t.AllowGroupChats = value - case "allow_channel_chats": - value, err := b.Bool() - if err != nil { - return fmt.Errorf("unable to decode targetChatChosen#edaccad2: field allow_channel_chats: %w", err) - } - t.AllowChannelChats = value default: return b.Skip() } @@ -398,36 +320,12 @@ func (t *TargetChatChosen) DecodeTDLibJSON(b tdjson.Decoder) error { }) } -// GetAllowUserChats returns value of AllowUserChats field. -func (t *TargetChatChosen) GetAllowUserChats() (value bool) { - if t == nil { - return - } - return t.AllowUserChats -} - -// GetAllowBotChats returns value of AllowBotChats field. -func (t *TargetChatChosen) GetAllowBotChats() (value bool) { - if t == nil { - return - } - return t.AllowBotChats -} - -// GetAllowGroupChats returns value of AllowGroupChats field. -func (t *TargetChatChosen) GetAllowGroupChats() (value bool) { - if t == nil { - return - } - return t.AllowGroupChats -} - -// GetAllowChannelChats returns value of AllowChannelChats field. -func (t *TargetChatChosen) GetAllowChannelChats() (value bool) { +// GetTypes returns value of Types field. +func (t *TargetChatChosen) GetTypes() (value TargetChatTypes) { if t == nil { return } - return t.AllowChannelChats + return t.Types } // TargetChatInternalLink represents TL type `targetChatInternalLink#dd788fe0`. @@ -619,7 +517,7 @@ const TargetChatClassName = "TargetChat" // } // switch v := g.(type) { // case *tdapi.TargetChatCurrent: // targetChatCurrent#e729d110 -// case *tdapi.TargetChatChosen: // targetChatChosen#edaccad2 +// case *tdapi.TargetChatChosen: // targetChatChosen#acf8d5a6 // case *tdapi.TargetChatInternalLink: // targetChatInternalLink#dd788fe0 // default: panic(v) // } @@ -660,7 +558,7 @@ func DecodeTargetChat(buf *bin.Buffer) (TargetChatClass, error) { } return &v, nil case TargetChatChosenTypeID: - // Decoding targetChatChosen#edaccad2. + // Decoding targetChatChosen#acf8d5a6. v := TargetChatChosen{} if err := v.Decode(buf); err != nil { return nil, fmt.Errorf("unable to decode TargetChatClass: %w", err) @@ -693,7 +591,7 @@ func DecodeTDLibJSONTargetChat(buf tdjson.Decoder) (TargetChatClass, error) { } return &v, nil case "targetChatChosen": - // Decoding targetChatChosen#edaccad2. + // Decoding targetChatChosen#acf8d5a6. v := TargetChatChosen{} if err := v.DecodeTDLibJSON(buf); err != nil { return nil, fmt.Errorf("unable to decode TargetChatClass: %w", err) diff --git a/tdapi/tl_target_chat_types_gen.go b/tdapi/tl_target_chat_types_gen.go new file mode 100644 index 000000000..86da589f7 --- /dev/null +++ b/tdapi/tl_target_chat_types_gen.go @@ -0,0 +1,295 @@ +// 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{} +) + +// TargetChatTypes represents TL type `targetChatTypes#5a300e51`. +type TargetChatTypes struct { + // True, if private chats with ordinary users are allowed + AllowUserChats bool + // True, if private chats with other bots are allowed + AllowBotChats bool + // True, if basic group and supergroup chats are allowed + AllowGroupChats bool + // True, if channel chats are allowed + AllowChannelChats bool +} + +// TargetChatTypesTypeID is TL type id of TargetChatTypes. +const TargetChatTypesTypeID = 0x5a300e51 + +// Ensuring interfaces in compile-time for TargetChatTypes. +var ( + _ bin.Encoder = &TargetChatTypes{} + _ bin.Decoder = &TargetChatTypes{} + _ bin.BareEncoder = &TargetChatTypes{} + _ bin.BareDecoder = &TargetChatTypes{} +) + +func (t *TargetChatTypes) Zero() bool { + if t == nil { + return true + } + if !(t.AllowUserChats == false) { + return false + } + if !(t.AllowBotChats == false) { + return false + } + if !(t.AllowGroupChats == false) { + return false + } + if !(t.AllowChannelChats == false) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (t *TargetChatTypes) String() string { + if t == nil { + return "TargetChatTypes(nil)" + } + type Alias TargetChatTypes + return fmt.Sprintf("TargetChatTypes%+v", Alias(*t)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*TargetChatTypes) TypeID() uint32 { + return TargetChatTypesTypeID +} + +// TypeName returns name of type in TL schema. +func (*TargetChatTypes) TypeName() string { + return "targetChatTypes" +} + +// TypeInfo returns info about TL type. +func (t *TargetChatTypes) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "targetChatTypes", + ID: TargetChatTypesTypeID, + } + if t == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "AllowUserChats", + SchemaName: "allow_user_chats", + }, + { + Name: "AllowBotChats", + SchemaName: "allow_bot_chats", + }, + { + Name: "AllowGroupChats", + SchemaName: "allow_group_chats", + }, + { + Name: "AllowChannelChats", + SchemaName: "allow_channel_chats", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (t *TargetChatTypes) Encode(b *bin.Buffer) error { + if t == nil { + return fmt.Errorf("can't encode targetChatTypes#5a300e51 as nil") + } + b.PutID(TargetChatTypesTypeID) + return t.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (t *TargetChatTypes) EncodeBare(b *bin.Buffer) error { + if t == nil { + return fmt.Errorf("can't encode targetChatTypes#5a300e51 as nil") + } + b.PutBool(t.AllowUserChats) + b.PutBool(t.AllowBotChats) + b.PutBool(t.AllowGroupChats) + b.PutBool(t.AllowChannelChats) + return nil +} + +// Decode implements bin.Decoder. +func (t *TargetChatTypes) Decode(b *bin.Buffer) error { + if t == nil { + return fmt.Errorf("can't decode targetChatTypes#5a300e51 to nil") + } + if err := b.ConsumeID(TargetChatTypesTypeID); err != nil { + return fmt.Errorf("unable to decode targetChatTypes#5a300e51: %w", err) + } + return t.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (t *TargetChatTypes) DecodeBare(b *bin.Buffer) error { + if t == nil { + return fmt.Errorf("can't decode targetChatTypes#5a300e51 to nil") + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode targetChatTypes#5a300e51: field allow_user_chats: %w", err) + } + t.AllowUserChats = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode targetChatTypes#5a300e51: field allow_bot_chats: %w", err) + } + t.AllowBotChats = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode targetChatTypes#5a300e51: field allow_group_chats: %w", err) + } + t.AllowGroupChats = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode targetChatTypes#5a300e51: field allow_channel_chats: %w", err) + } + t.AllowChannelChats = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (t *TargetChatTypes) EncodeTDLibJSON(b tdjson.Encoder) error { + if t == nil { + return fmt.Errorf("can't encode targetChatTypes#5a300e51 as nil") + } + b.ObjStart() + b.PutID("targetChatTypes") + b.Comma() + b.FieldStart("allow_user_chats") + b.PutBool(t.AllowUserChats) + b.Comma() + b.FieldStart("allow_bot_chats") + b.PutBool(t.AllowBotChats) + b.Comma() + b.FieldStart("allow_group_chats") + b.PutBool(t.AllowGroupChats) + b.Comma() + b.FieldStart("allow_channel_chats") + b.PutBool(t.AllowChannelChats) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (t *TargetChatTypes) DecodeTDLibJSON(b tdjson.Decoder) error { + if t == nil { + return fmt.Errorf("can't decode targetChatTypes#5a300e51 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("targetChatTypes"); err != nil { + return fmt.Errorf("unable to decode targetChatTypes#5a300e51: %w", err) + } + case "allow_user_chats": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode targetChatTypes#5a300e51: field allow_user_chats: %w", err) + } + t.AllowUserChats = value + case "allow_bot_chats": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode targetChatTypes#5a300e51: field allow_bot_chats: %w", err) + } + t.AllowBotChats = value + case "allow_group_chats": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode targetChatTypes#5a300e51: field allow_group_chats: %w", err) + } + t.AllowGroupChats = value + case "allow_channel_chats": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode targetChatTypes#5a300e51: field allow_channel_chats: %w", err) + } + t.AllowChannelChats = value + default: + return b.Skip() + } + return nil + }) +} + +// GetAllowUserChats returns value of AllowUserChats field. +func (t *TargetChatTypes) GetAllowUserChats() (value bool) { + if t == nil { + return + } + return t.AllowUserChats +} + +// GetAllowBotChats returns value of AllowBotChats field. +func (t *TargetChatTypes) GetAllowBotChats() (value bool) { + if t == nil { + return + } + return t.AllowBotChats +} + +// GetAllowGroupChats returns value of AllowGroupChats field. +func (t *TargetChatTypes) GetAllowGroupChats() (value bool) { + if t == nil { + return + } + return t.AllowGroupChats +} + +// GetAllowChannelChats returns value of AllowChannelChats field. +func (t *TargetChatTypes) GetAllowChannelChats() (value bool) { + if t == nil { + return + } + return t.AllowChannelChats +} diff --git a/tdapi/tl_toggle_bot_can_manage_emoji_status_gen.go b/tdapi/tl_toggle_bot_can_manage_emoji_status_gen.go new file mode 100644 index 000000000..1ca529f33 --- /dev/null +++ b/tdapi/tl_toggle_bot_can_manage_emoji_status_gen.go @@ -0,0 +1,238 @@ +// 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{} +) + +// ToggleBotCanManageEmojiStatusRequest represents TL type `toggleBotCanManageEmojiStatus#251a881a`. +type ToggleBotCanManageEmojiStatusRequest struct { + // User identifier of the bot + BotUserID int64 + // Pass true if the bot is allowed to change emoji status of the user; pass false + // otherwise + CanManageEmojiStatus bool +} + +// ToggleBotCanManageEmojiStatusRequestTypeID is TL type id of ToggleBotCanManageEmojiStatusRequest. +const ToggleBotCanManageEmojiStatusRequestTypeID = 0x251a881a + +// Ensuring interfaces in compile-time for ToggleBotCanManageEmojiStatusRequest. +var ( + _ bin.Encoder = &ToggleBotCanManageEmojiStatusRequest{} + _ bin.Decoder = &ToggleBotCanManageEmojiStatusRequest{} + _ bin.BareEncoder = &ToggleBotCanManageEmojiStatusRequest{} + _ bin.BareDecoder = &ToggleBotCanManageEmojiStatusRequest{} +) + +func (t *ToggleBotCanManageEmojiStatusRequest) Zero() bool { + if t == nil { + return true + } + if !(t.BotUserID == 0) { + return false + } + if !(t.CanManageEmojiStatus == false) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (t *ToggleBotCanManageEmojiStatusRequest) String() string { + if t == nil { + return "ToggleBotCanManageEmojiStatusRequest(nil)" + } + type Alias ToggleBotCanManageEmojiStatusRequest + return fmt.Sprintf("ToggleBotCanManageEmojiStatusRequest%+v", Alias(*t)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*ToggleBotCanManageEmojiStatusRequest) TypeID() uint32 { + return ToggleBotCanManageEmojiStatusRequestTypeID +} + +// TypeName returns name of type in TL schema. +func (*ToggleBotCanManageEmojiStatusRequest) TypeName() string { + return "toggleBotCanManageEmojiStatus" +} + +// TypeInfo returns info about TL type. +func (t *ToggleBotCanManageEmojiStatusRequest) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "toggleBotCanManageEmojiStatus", + ID: ToggleBotCanManageEmojiStatusRequestTypeID, + } + if t == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "BotUserID", + SchemaName: "bot_user_id", + }, + { + Name: "CanManageEmojiStatus", + SchemaName: "can_manage_emoji_status", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (t *ToggleBotCanManageEmojiStatusRequest) Encode(b *bin.Buffer) error { + if t == nil { + return fmt.Errorf("can't encode toggleBotCanManageEmojiStatus#251a881a as nil") + } + b.PutID(ToggleBotCanManageEmojiStatusRequestTypeID) + return t.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (t *ToggleBotCanManageEmojiStatusRequest) EncodeBare(b *bin.Buffer) error { + if t == nil { + return fmt.Errorf("can't encode toggleBotCanManageEmojiStatus#251a881a as nil") + } + b.PutInt53(t.BotUserID) + b.PutBool(t.CanManageEmojiStatus) + return nil +} + +// Decode implements bin.Decoder. +func (t *ToggleBotCanManageEmojiStatusRequest) Decode(b *bin.Buffer) error { + if t == nil { + return fmt.Errorf("can't decode toggleBotCanManageEmojiStatus#251a881a to nil") + } + if err := b.ConsumeID(ToggleBotCanManageEmojiStatusRequestTypeID); err != nil { + return fmt.Errorf("unable to decode toggleBotCanManageEmojiStatus#251a881a: %w", err) + } + return t.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (t *ToggleBotCanManageEmojiStatusRequest) DecodeBare(b *bin.Buffer) error { + if t == nil { + return fmt.Errorf("can't decode toggleBotCanManageEmojiStatus#251a881a to nil") + } + { + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode toggleBotCanManageEmojiStatus#251a881a: field bot_user_id: %w", err) + } + t.BotUserID = value + } + { + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode toggleBotCanManageEmojiStatus#251a881a: field can_manage_emoji_status: %w", err) + } + t.CanManageEmojiStatus = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (t *ToggleBotCanManageEmojiStatusRequest) EncodeTDLibJSON(b tdjson.Encoder) error { + if t == nil { + return fmt.Errorf("can't encode toggleBotCanManageEmojiStatus#251a881a as nil") + } + b.ObjStart() + b.PutID("toggleBotCanManageEmojiStatus") + b.Comma() + b.FieldStart("bot_user_id") + b.PutInt53(t.BotUserID) + b.Comma() + b.FieldStart("can_manage_emoji_status") + b.PutBool(t.CanManageEmojiStatus) + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (t *ToggleBotCanManageEmojiStatusRequest) DecodeTDLibJSON(b tdjson.Decoder) error { + if t == nil { + return fmt.Errorf("can't decode toggleBotCanManageEmojiStatus#251a881a to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("toggleBotCanManageEmojiStatus"); err != nil { + return fmt.Errorf("unable to decode toggleBotCanManageEmojiStatus#251a881a: %w", err) + } + case "bot_user_id": + value, err := b.Int53() + if err != nil { + return fmt.Errorf("unable to decode toggleBotCanManageEmojiStatus#251a881a: field bot_user_id: %w", err) + } + t.BotUserID = value + case "can_manage_emoji_status": + value, err := b.Bool() + if err != nil { + return fmt.Errorf("unable to decode toggleBotCanManageEmojiStatus#251a881a: field can_manage_emoji_status: %w", err) + } + t.CanManageEmojiStatus = value + default: + return b.Skip() + } + return nil + }) +} + +// GetBotUserID returns value of BotUserID field. +func (t *ToggleBotCanManageEmojiStatusRequest) GetBotUserID() (value int64) { + if t == nil { + return + } + return t.BotUserID +} + +// GetCanManageEmojiStatus returns value of CanManageEmojiStatus field. +func (t *ToggleBotCanManageEmojiStatusRequest) GetCanManageEmojiStatus() (value bool) { + if t == nil { + return + } + return t.CanManageEmojiStatus +} + +// ToggleBotCanManageEmojiStatus invokes method toggleBotCanManageEmojiStatus#251a881a returning error if any. +func (c *Client) ToggleBotCanManageEmojiStatus(ctx context.Context, request *ToggleBotCanManageEmojiStatusRequest) error { + var ok Ok + + if err := c.rpc.Invoke(ctx, request, &ok); err != nil { + return err + } + return nil +} diff --git a/tdapi/tl_user_gift_gen.go b/tdapi/tl_user_gift_gen.go index d8c89d4bb..d43ce7f2f 100644 --- a/tdapi/tl_user_gift_gen.go +++ b/tdapi/tl_user_gift_gen.go @@ -50,8 +50,8 @@ type UserGift struct { // Identifier of the message with the gift in the chat with the sender of the gift; can // be 0 or an identifier of a deleted message; only for the gift receiver MessageID int64 - // Number of Telegram Stars that can be claimed by the receiver instead of the gift; only - // for the gift receiver + // Number of Telegram Stars that can be claimed by the receiver instead of the gift; 0 if + // the gift can't be sold by the current user SellStarCount int64 } diff --git a/tdapi/tl_user_privacy_setting_gen.go b/tdapi/tl_user_privacy_setting_gen.go index 448059f8f..ec908f764 100644 --- a/tdapi/tl_user_privacy_setting_gen.go +++ b/tdapi/tl_user_privacy_setting_gen.go @@ -1474,6 +1474,137 @@ func (u *UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages) DecodeTDLibJSO }) } +// UserPrivacySettingAutosaveGifts represents TL type `userPrivacySettingAutosaveGifts#709a69cd`. +type UserPrivacySettingAutosaveGifts struct { +} + +// UserPrivacySettingAutosaveGiftsTypeID is TL type id of UserPrivacySettingAutosaveGifts. +const UserPrivacySettingAutosaveGiftsTypeID = 0x709a69cd + +// construct implements constructor of UserPrivacySettingClass. +func (u UserPrivacySettingAutosaveGifts) construct() UserPrivacySettingClass { return &u } + +// Ensuring interfaces in compile-time for UserPrivacySettingAutosaveGifts. +var ( + _ bin.Encoder = &UserPrivacySettingAutosaveGifts{} + _ bin.Decoder = &UserPrivacySettingAutosaveGifts{} + _ bin.BareEncoder = &UserPrivacySettingAutosaveGifts{} + _ bin.BareDecoder = &UserPrivacySettingAutosaveGifts{} + + _ UserPrivacySettingClass = &UserPrivacySettingAutosaveGifts{} +) + +func (u *UserPrivacySettingAutosaveGifts) Zero() bool { + if u == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (u *UserPrivacySettingAutosaveGifts) String() string { + if u == nil { + return "UserPrivacySettingAutosaveGifts(nil)" + } + type Alias UserPrivacySettingAutosaveGifts + return fmt.Sprintf("UserPrivacySettingAutosaveGifts%+v", Alias(*u)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*UserPrivacySettingAutosaveGifts) TypeID() uint32 { + return UserPrivacySettingAutosaveGiftsTypeID +} + +// TypeName returns name of type in TL schema. +func (*UserPrivacySettingAutosaveGifts) TypeName() string { + return "userPrivacySettingAutosaveGifts" +} + +// TypeInfo returns info about TL type. +func (u *UserPrivacySettingAutosaveGifts) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "userPrivacySettingAutosaveGifts", + ID: UserPrivacySettingAutosaveGiftsTypeID, + } + if u == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (u *UserPrivacySettingAutosaveGifts) Encode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode userPrivacySettingAutosaveGifts#709a69cd as nil") + } + b.PutID(UserPrivacySettingAutosaveGiftsTypeID) + return u.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (u *UserPrivacySettingAutosaveGifts) EncodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode userPrivacySettingAutosaveGifts#709a69cd as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (u *UserPrivacySettingAutosaveGifts) Decode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode userPrivacySettingAutosaveGifts#709a69cd to nil") + } + if err := b.ConsumeID(UserPrivacySettingAutosaveGiftsTypeID); err != nil { + return fmt.Errorf("unable to decode userPrivacySettingAutosaveGifts#709a69cd: %w", err) + } + return u.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (u *UserPrivacySettingAutosaveGifts) DecodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode userPrivacySettingAutosaveGifts#709a69cd to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (u *UserPrivacySettingAutosaveGifts) EncodeTDLibJSON(b tdjson.Encoder) error { + if u == nil { + return fmt.Errorf("can't encode userPrivacySettingAutosaveGifts#709a69cd as nil") + } + b.ObjStart() + b.PutID("userPrivacySettingAutosaveGifts") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (u *UserPrivacySettingAutosaveGifts) DecodeTDLibJSON(b tdjson.Decoder) error { + if u == nil { + return fmt.Errorf("can't decode userPrivacySettingAutosaveGifts#709a69cd to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("userPrivacySettingAutosaveGifts"); err != nil { + return fmt.Errorf("unable to decode userPrivacySettingAutosaveGifts#709a69cd: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + // UserPrivacySettingClassName is schema name of UserPrivacySettingClass. const UserPrivacySettingClassName = "UserPrivacySetting" @@ -1497,6 +1628,7 @@ const UserPrivacySettingClassName = "UserPrivacySetting" // case *tdapi.UserPrivacySettingAllowPeerToPeerCalls: // userPrivacySettingAllowPeerToPeerCalls#1502b940 // case *tdapi.UserPrivacySettingAllowFindingByPhoneNumber: // userPrivacySettingAllowFindingByPhoneNumber#91ee6d51 // case *tdapi.UserPrivacySettingAllowPrivateVoiceAndVideoNoteMessages: // userPrivacySettingAllowPrivateVoiceAndVideoNoteMessages#14272e3c +// case *tdapi.UserPrivacySettingAutosaveGifts: // userPrivacySettingAutosaveGifts#709a69cd // default: panic(v) // } type UserPrivacySettingClass interface { @@ -1605,6 +1737,13 @@ func DecodeUserPrivacySetting(buf *bin.Buffer) (UserPrivacySettingClass, error) return nil, fmt.Errorf("unable to decode UserPrivacySettingClass: %w", err) } return &v, nil + case UserPrivacySettingAutosaveGiftsTypeID: + // Decoding userPrivacySettingAutosaveGifts#709a69cd. + v := UserPrivacySettingAutosaveGifts{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode UserPrivacySettingClass: %w", err) + } + return &v, nil default: return nil, fmt.Errorf("unable to decode UserPrivacySettingClass: %w", bin.NewUnexpectedID(id)) } @@ -1694,6 +1833,13 @@ func DecodeTDLibJSONUserPrivacySetting(buf tdjson.Decoder) (UserPrivacySettingCl return nil, fmt.Errorf("unable to decode UserPrivacySettingClass: %w", err) } return &v, nil + case "userPrivacySettingAutosaveGifts": + // Decoding userPrivacySettingAutosaveGifts#709a69cd. + v := UserPrivacySettingAutosaveGifts{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode UserPrivacySettingClass: %w", err) + } + return &v, nil default: return nil, fmt.Errorf("unable to decode UserPrivacySettingClass: %w", tdjson.NewUnexpectedID(id)) } diff --git a/tdapi/tl_user_privacy_setting_rule_gen.go b/tdapi/tl_user_privacy_setting_rule_gen.go index 94bb5acb8..d35ee63c4 100644 --- a/tdapi/tl_user_privacy_setting_rule_gen.go +++ b/tdapi/tl_user_privacy_setting_rule_gen.go @@ -293,6 +293,137 @@ func (u *UserPrivacySettingRuleAllowContacts) DecodeTDLibJSON(b tdjson.Decoder) }) } +// UserPrivacySettingRuleAllowBots represents TL type `userPrivacySettingRuleAllowBots#53b2871d`. +type UserPrivacySettingRuleAllowBots struct { +} + +// UserPrivacySettingRuleAllowBotsTypeID is TL type id of UserPrivacySettingRuleAllowBots. +const UserPrivacySettingRuleAllowBotsTypeID = 0x53b2871d + +// construct implements constructor of UserPrivacySettingRuleClass. +func (u UserPrivacySettingRuleAllowBots) construct() UserPrivacySettingRuleClass { return &u } + +// Ensuring interfaces in compile-time for UserPrivacySettingRuleAllowBots. +var ( + _ bin.Encoder = &UserPrivacySettingRuleAllowBots{} + _ bin.Decoder = &UserPrivacySettingRuleAllowBots{} + _ bin.BareEncoder = &UserPrivacySettingRuleAllowBots{} + _ bin.BareDecoder = &UserPrivacySettingRuleAllowBots{} + + _ UserPrivacySettingRuleClass = &UserPrivacySettingRuleAllowBots{} +) + +func (u *UserPrivacySettingRuleAllowBots) Zero() bool { + if u == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (u *UserPrivacySettingRuleAllowBots) String() string { + if u == nil { + return "UserPrivacySettingRuleAllowBots(nil)" + } + type Alias UserPrivacySettingRuleAllowBots + return fmt.Sprintf("UserPrivacySettingRuleAllowBots%+v", Alias(*u)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*UserPrivacySettingRuleAllowBots) TypeID() uint32 { + return UserPrivacySettingRuleAllowBotsTypeID +} + +// TypeName returns name of type in TL schema. +func (*UserPrivacySettingRuleAllowBots) TypeName() string { + return "userPrivacySettingRuleAllowBots" +} + +// TypeInfo returns info about TL type. +func (u *UserPrivacySettingRuleAllowBots) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "userPrivacySettingRuleAllowBots", + ID: UserPrivacySettingRuleAllowBotsTypeID, + } + if u == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (u *UserPrivacySettingRuleAllowBots) Encode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode userPrivacySettingRuleAllowBots#53b2871d as nil") + } + b.PutID(UserPrivacySettingRuleAllowBotsTypeID) + return u.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (u *UserPrivacySettingRuleAllowBots) EncodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode userPrivacySettingRuleAllowBots#53b2871d as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (u *UserPrivacySettingRuleAllowBots) Decode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode userPrivacySettingRuleAllowBots#53b2871d to nil") + } + if err := b.ConsumeID(UserPrivacySettingRuleAllowBotsTypeID); err != nil { + return fmt.Errorf("unable to decode userPrivacySettingRuleAllowBots#53b2871d: %w", err) + } + return u.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (u *UserPrivacySettingRuleAllowBots) DecodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode userPrivacySettingRuleAllowBots#53b2871d to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (u *UserPrivacySettingRuleAllowBots) EncodeTDLibJSON(b tdjson.Encoder) error { + if u == nil { + return fmt.Errorf("can't encode userPrivacySettingRuleAllowBots#53b2871d as nil") + } + b.ObjStart() + b.PutID("userPrivacySettingRuleAllowBots") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (u *UserPrivacySettingRuleAllowBots) DecodeTDLibJSON(b tdjson.Decoder) error { + if u == nil { + return fmt.Errorf("can't decode userPrivacySettingRuleAllowBots#53b2871d to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("userPrivacySettingRuleAllowBots"); err != nil { + return fmt.Errorf("unable to decode userPrivacySettingRuleAllowBots#53b2871d: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + // UserPrivacySettingRuleAllowPremiumUsers represents TL type `userPrivacySettingRuleAllowPremiumUsers#60ce8541`. type UserPrivacySettingRuleAllowPremiumUsers struct { } @@ -1066,6 +1197,137 @@ func (u *UserPrivacySettingRuleRestrictContacts) DecodeTDLibJSON(b tdjson.Decode }) } +// UserPrivacySettingRuleRestrictBots represents TL type `userPrivacySettingRuleRestrictBots#8e996e5d`. +type UserPrivacySettingRuleRestrictBots struct { +} + +// UserPrivacySettingRuleRestrictBotsTypeID is TL type id of UserPrivacySettingRuleRestrictBots. +const UserPrivacySettingRuleRestrictBotsTypeID = 0x8e996e5d + +// construct implements constructor of UserPrivacySettingRuleClass. +func (u UserPrivacySettingRuleRestrictBots) construct() UserPrivacySettingRuleClass { return &u } + +// Ensuring interfaces in compile-time for UserPrivacySettingRuleRestrictBots. +var ( + _ bin.Encoder = &UserPrivacySettingRuleRestrictBots{} + _ bin.Decoder = &UserPrivacySettingRuleRestrictBots{} + _ bin.BareEncoder = &UserPrivacySettingRuleRestrictBots{} + _ bin.BareDecoder = &UserPrivacySettingRuleRestrictBots{} + + _ UserPrivacySettingRuleClass = &UserPrivacySettingRuleRestrictBots{} +) + +func (u *UserPrivacySettingRuleRestrictBots) Zero() bool { + if u == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (u *UserPrivacySettingRuleRestrictBots) String() string { + if u == nil { + return "UserPrivacySettingRuleRestrictBots(nil)" + } + type Alias UserPrivacySettingRuleRestrictBots + return fmt.Sprintf("UserPrivacySettingRuleRestrictBots%+v", Alias(*u)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*UserPrivacySettingRuleRestrictBots) TypeID() uint32 { + return UserPrivacySettingRuleRestrictBotsTypeID +} + +// TypeName returns name of type in TL schema. +func (*UserPrivacySettingRuleRestrictBots) TypeName() string { + return "userPrivacySettingRuleRestrictBots" +} + +// TypeInfo returns info about TL type. +func (u *UserPrivacySettingRuleRestrictBots) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "userPrivacySettingRuleRestrictBots", + ID: UserPrivacySettingRuleRestrictBotsTypeID, + } + if u == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (u *UserPrivacySettingRuleRestrictBots) Encode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode userPrivacySettingRuleRestrictBots#8e996e5d as nil") + } + b.PutID(UserPrivacySettingRuleRestrictBotsTypeID) + return u.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (u *UserPrivacySettingRuleRestrictBots) EncodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't encode userPrivacySettingRuleRestrictBots#8e996e5d as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (u *UserPrivacySettingRuleRestrictBots) Decode(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode userPrivacySettingRuleRestrictBots#8e996e5d to nil") + } + if err := b.ConsumeID(UserPrivacySettingRuleRestrictBotsTypeID); err != nil { + return fmt.Errorf("unable to decode userPrivacySettingRuleRestrictBots#8e996e5d: %w", err) + } + return u.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (u *UserPrivacySettingRuleRestrictBots) DecodeBare(b *bin.Buffer) error { + if u == nil { + return fmt.Errorf("can't decode userPrivacySettingRuleRestrictBots#8e996e5d to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (u *UserPrivacySettingRuleRestrictBots) EncodeTDLibJSON(b tdjson.Encoder) error { + if u == nil { + return fmt.Errorf("can't encode userPrivacySettingRuleRestrictBots#8e996e5d as nil") + } + b.ObjStart() + b.PutID("userPrivacySettingRuleRestrictBots") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (u *UserPrivacySettingRuleRestrictBots) DecodeTDLibJSON(b tdjson.Decoder) error { + if u == nil { + return fmt.Errorf("can't decode userPrivacySettingRuleRestrictBots#8e996e5d to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("userPrivacySettingRuleRestrictBots"); err != nil { + return fmt.Errorf("unable to decode userPrivacySettingRuleRestrictBots#8e996e5d: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + // UserPrivacySettingRuleRestrictUsers represents TL type `userPrivacySettingRuleRestrictUsers#4d392a91`. type UserPrivacySettingRuleRestrictUsers struct { // The user identifiers, total number of users in all rules must not exceed 1000 @@ -1460,11 +1722,13 @@ const UserPrivacySettingRuleClassName = "UserPrivacySettingRule" // switch v := g.(type) { // case *tdapi.UserPrivacySettingRuleAllowAll: // userPrivacySettingRuleAllowAll#8abf1c3f // case *tdapi.UserPrivacySettingRuleAllowContacts: // userPrivacySettingRuleAllowContacts#8f2f2d10 +// case *tdapi.UserPrivacySettingRuleAllowBots: // userPrivacySettingRuleAllowBots#53b2871d // case *tdapi.UserPrivacySettingRuleAllowPremiumUsers: // userPrivacySettingRuleAllowPremiumUsers#60ce8541 // case *tdapi.UserPrivacySettingRuleAllowUsers: // userPrivacySettingRuleAllowUsers#d1570b70 // case *tdapi.UserPrivacySettingRuleAllowChatMembers: // userPrivacySettingRuleAllowChatMembers#f249b617 // case *tdapi.UserPrivacySettingRuleRestrictAll: // userPrivacySettingRuleRestrictAll#ac2a9550 // case *tdapi.UserPrivacySettingRuleRestrictContacts: // userPrivacySettingRuleRestrictContacts#3c1acd02 +// case *tdapi.UserPrivacySettingRuleRestrictBots: // userPrivacySettingRuleRestrictBots#8e996e5d // case *tdapi.UserPrivacySettingRuleRestrictUsers: // userPrivacySettingRuleRestrictUsers#4d392a91 // case *tdapi.UserPrivacySettingRuleRestrictChatMembers: // userPrivacySettingRuleRestrictChatMembers#fc00b920 // default: panic(v) @@ -1512,6 +1776,13 @@ func DecodeUserPrivacySettingRule(buf *bin.Buffer) (UserPrivacySettingRuleClass, return nil, fmt.Errorf("unable to decode UserPrivacySettingRuleClass: %w", err) } return &v, nil + case UserPrivacySettingRuleAllowBotsTypeID: + // Decoding userPrivacySettingRuleAllowBots#53b2871d. + v := UserPrivacySettingRuleAllowBots{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode UserPrivacySettingRuleClass: %w", err) + } + return &v, nil case UserPrivacySettingRuleAllowPremiumUsersTypeID: // Decoding userPrivacySettingRuleAllowPremiumUsers#60ce8541. v := UserPrivacySettingRuleAllowPremiumUsers{} @@ -1547,6 +1818,13 @@ func DecodeUserPrivacySettingRule(buf *bin.Buffer) (UserPrivacySettingRuleClass, return nil, fmt.Errorf("unable to decode UserPrivacySettingRuleClass: %w", err) } return &v, nil + case UserPrivacySettingRuleRestrictBotsTypeID: + // Decoding userPrivacySettingRuleRestrictBots#8e996e5d. + v := UserPrivacySettingRuleRestrictBots{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode UserPrivacySettingRuleClass: %w", err) + } + return &v, nil case UserPrivacySettingRuleRestrictUsersTypeID: // Decoding userPrivacySettingRuleRestrictUsers#4d392a91. v := UserPrivacySettingRuleRestrictUsers{} @@ -1587,6 +1865,13 @@ func DecodeTDLibJSONUserPrivacySettingRule(buf tdjson.Decoder) (UserPrivacySetti return nil, fmt.Errorf("unable to decode UserPrivacySettingRuleClass: %w", err) } return &v, nil + case "userPrivacySettingRuleAllowBots": + // Decoding userPrivacySettingRuleAllowBots#53b2871d. + v := UserPrivacySettingRuleAllowBots{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode UserPrivacySettingRuleClass: %w", err) + } + return &v, nil case "userPrivacySettingRuleAllowPremiumUsers": // Decoding userPrivacySettingRuleAllowPremiumUsers#60ce8541. v := UserPrivacySettingRuleAllowPremiumUsers{} @@ -1622,6 +1907,13 @@ func DecodeTDLibJSONUserPrivacySettingRule(buf tdjson.Decoder) (UserPrivacySetti return nil, fmt.Errorf("unable to decode UserPrivacySettingRuleClass: %w", err) } return &v, nil + case "userPrivacySettingRuleRestrictBots": + // Decoding userPrivacySettingRuleRestrictBots#8e996e5d. + v := UserPrivacySettingRuleRestrictBots{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode UserPrivacySettingRuleClass: %w", err) + } + return &v, nil case "userPrivacySettingRuleRestrictUsers": // Decoding userPrivacySettingRuleRestrictUsers#4d392a91. v := UserPrivacySettingRuleRestrictUsers{} diff --git a/tdapi/tl_web_app_open_mode_gen.go b/tdapi/tl_web_app_open_mode_gen.go new file mode 100644 index 000000000..20eb7578b --- /dev/null +++ b/tdapi/tl_web_app_open_mode_gen.go @@ -0,0 +1,577 @@ +// 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{} +) + +// WebAppOpenModeCompact represents TL type `webAppOpenModeCompact#6604ffdb`. +type WebAppOpenModeCompact struct { +} + +// WebAppOpenModeCompactTypeID is TL type id of WebAppOpenModeCompact. +const WebAppOpenModeCompactTypeID = 0x6604ffdb + +// construct implements constructor of WebAppOpenModeClass. +func (w WebAppOpenModeCompact) construct() WebAppOpenModeClass { return &w } + +// Ensuring interfaces in compile-time for WebAppOpenModeCompact. +var ( + _ bin.Encoder = &WebAppOpenModeCompact{} + _ bin.Decoder = &WebAppOpenModeCompact{} + _ bin.BareEncoder = &WebAppOpenModeCompact{} + _ bin.BareDecoder = &WebAppOpenModeCompact{} + + _ WebAppOpenModeClass = &WebAppOpenModeCompact{} +) + +func (w *WebAppOpenModeCompact) Zero() bool { + if w == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (w *WebAppOpenModeCompact) String() string { + if w == nil { + return "WebAppOpenModeCompact(nil)" + } + type Alias WebAppOpenModeCompact + return fmt.Sprintf("WebAppOpenModeCompact%+v", Alias(*w)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*WebAppOpenModeCompact) TypeID() uint32 { + return WebAppOpenModeCompactTypeID +} + +// TypeName returns name of type in TL schema. +func (*WebAppOpenModeCompact) TypeName() string { + return "webAppOpenModeCompact" +} + +// TypeInfo returns info about TL type. +func (w *WebAppOpenModeCompact) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "webAppOpenModeCompact", + ID: WebAppOpenModeCompactTypeID, + } + if w == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (w *WebAppOpenModeCompact) Encode(b *bin.Buffer) error { + if w == nil { + return fmt.Errorf("can't encode webAppOpenModeCompact#6604ffdb as nil") + } + b.PutID(WebAppOpenModeCompactTypeID) + return w.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (w *WebAppOpenModeCompact) EncodeBare(b *bin.Buffer) error { + if w == nil { + return fmt.Errorf("can't encode webAppOpenModeCompact#6604ffdb as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (w *WebAppOpenModeCompact) Decode(b *bin.Buffer) error { + if w == nil { + return fmt.Errorf("can't decode webAppOpenModeCompact#6604ffdb to nil") + } + if err := b.ConsumeID(WebAppOpenModeCompactTypeID); err != nil { + return fmt.Errorf("unable to decode webAppOpenModeCompact#6604ffdb: %w", err) + } + return w.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (w *WebAppOpenModeCompact) DecodeBare(b *bin.Buffer) error { + if w == nil { + return fmt.Errorf("can't decode webAppOpenModeCompact#6604ffdb to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (w *WebAppOpenModeCompact) EncodeTDLibJSON(b tdjson.Encoder) error { + if w == nil { + return fmt.Errorf("can't encode webAppOpenModeCompact#6604ffdb as nil") + } + b.ObjStart() + b.PutID("webAppOpenModeCompact") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (w *WebAppOpenModeCompact) DecodeTDLibJSON(b tdjson.Decoder) error { + if w == nil { + return fmt.Errorf("can't decode webAppOpenModeCompact#6604ffdb to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("webAppOpenModeCompact"); err != nil { + return fmt.Errorf("unable to decode webAppOpenModeCompact#6604ffdb: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// WebAppOpenModeFullSize represents TL type `webAppOpenModeFullSize#b48cd41`. +type WebAppOpenModeFullSize struct { +} + +// WebAppOpenModeFullSizeTypeID is TL type id of WebAppOpenModeFullSize. +const WebAppOpenModeFullSizeTypeID = 0xb48cd41 + +// construct implements constructor of WebAppOpenModeClass. +func (w WebAppOpenModeFullSize) construct() WebAppOpenModeClass { return &w } + +// Ensuring interfaces in compile-time for WebAppOpenModeFullSize. +var ( + _ bin.Encoder = &WebAppOpenModeFullSize{} + _ bin.Decoder = &WebAppOpenModeFullSize{} + _ bin.BareEncoder = &WebAppOpenModeFullSize{} + _ bin.BareDecoder = &WebAppOpenModeFullSize{} + + _ WebAppOpenModeClass = &WebAppOpenModeFullSize{} +) + +func (w *WebAppOpenModeFullSize) Zero() bool { + if w == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (w *WebAppOpenModeFullSize) String() string { + if w == nil { + return "WebAppOpenModeFullSize(nil)" + } + type Alias WebAppOpenModeFullSize + return fmt.Sprintf("WebAppOpenModeFullSize%+v", Alias(*w)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*WebAppOpenModeFullSize) TypeID() uint32 { + return WebAppOpenModeFullSizeTypeID +} + +// TypeName returns name of type in TL schema. +func (*WebAppOpenModeFullSize) TypeName() string { + return "webAppOpenModeFullSize" +} + +// TypeInfo returns info about TL type. +func (w *WebAppOpenModeFullSize) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "webAppOpenModeFullSize", + ID: WebAppOpenModeFullSizeTypeID, + } + if w == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (w *WebAppOpenModeFullSize) Encode(b *bin.Buffer) error { + if w == nil { + return fmt.Errorf("can't encode webAppOpenModeFullSize#b48cd41 as nil") + } + b.PutID(WebAppOpenModeFullSizeTypeID) + return w.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (w *WebAppOpenModeFullSize) EncodeBare(b *bin.Buffer) error { + if w == nil { + return fmt.Errorf("can't encode webAppOpenModeFullSize#b48cd41 as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (w *WebAppOpenModeFullSize) Decode(b *bin.Buffer) error { + if w == nil { + return fmt.Errorf("can't decode webAppOpenModeFullSize#b48cd41 to nil") + } + if err := b.ConsumeID(WebAppOpenModeFullSizeTypeID); err != nil { + return fmt.Errorf("unable to decode webAppOpenModeFullSize#b48cd41: %w", err) + } + return w.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (w *WebAppOpenModeFullSize) DecodeBare(b *bin.Buffer) error { + if w == nil { + return fmt.Errorf("can't decode webAppOpenModeFullSize#b48cd41 to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (w *WebAppOpenModeFullSize) EncodeTDLibJSON(b tdjson.Encoder) error { + if w == nil { + return fmt.Errorf("can't encode webAppOpenModeFullSize#b48cd41 as nil") + } + b.ObjStart() + b.PutID("webAppOpenModeFullSize") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (w *WebAppOpenModeFullSize) DecodeTDLibJSON(b tdjson.Decoder) error { + if w == nil { + return fmt.Errorf("can't decode webAppOpenModeFullSize#b48cd41 to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("webAppOpenModeFullSize"); err != nil { + return fmt.Errorf("unable to decode webAppOpenModeFullSize#b48cd41: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// WebAppOpenModeFullScreen represents TL type `webAppOpenModeFullScreen#6f8a019d`. +type WebAppOpenModeFullScreen struct { +} + +// WebAppOpenModeFullScreenTypeID is TL type id of WebAppOpenModeFullScreen. +const WebAppOpenModeFullScreenTypeID = 0x6f8a019d + +// construct implements constructor of WebAppOpenModeClass. +func (w WebAppOpenModeFullScreen) construct() WebAppOpenModeClass { return &w } + +// Ensuring interfaces in compile-time for WebAppOpenModeFullScreen. +var ( + _ bin.Encoder = &WebAppOpenModeFullScreen{} + _ bin.Decoder = &WebAppOpenModeFullScreen{} + _ bin.BareEncoder = &WebAppOpenModeFullScreen{} + _ bin.BareDecoder = &WebAppOpenModeFullScreen{} + + _ WebAppOpenModeClass = &WebAppOpenModeFullScreen{} +) + +func (w *WebAppOpenModeFullScreen) Zero() bool { + if w == nil { + return true + } + + return true +} + +// String implements fmt.Stringer. +func (w *WebAppOpenModeFullScreen) String() string { + if w == nil { + return "WebAppOpenModeFullScreen(nil)" + } + type Alias WebAppOpenModeFullScreen + return fmt.Sprintf("WebAppOpenModeFullScreen%+v", Alias(*w)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*WebAppOpenModeFullScreen) TypeID() uint32 { + return WebAppOpenModeFullScreenTypeID +} + +// TypeName returns name of type in TL schema. +func (*WebAppOpenModeFullScreen) TypeName() string { + return "webAppOpenModeFullScreen" +} + +// TypeInfo returns info about TL type. +func (w *WebAppOpenModeFullScreen) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "webAppOpenModeFullScreen", + ID: WebAppOpenModeFullScreenTypeID, + } + if w == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{} + return typ +} + +// Encode implements bin.Encoder. +func (w *WebAppOpenModeFullScreen) Encode(b *bin.Buffer) error { + if w == nil { + return fmt.Errorf("can't encode webAppOpenModeFullScreen#6f8a019d as nil") + } + b.PutID(WebAppOpenModeFullScreenTypeID) + return w.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (w *WebAppOpenModeFullScreen) EncodeBare(b *bin.Buffer) error { + if w == nil { + return fmt.Errorf("can't encode webAppOpenModeFullScreen#6f8a019d as nil") + } + return nil +} + +// Decode implements bin.Decoder. +func (w *WebAppOpenModeFullScreen) Decode(b *bin.Buffer) error { + if w == nil { + return fmt.Errorf("can't decode webAppOpenModeFullScreen#6f8a019d to nil") + } + if err := b.ConsumeID(WebAppOpenModeFullScreenTypeID); err != nil { + return fmt.Errorf("unable to decode webAppOpenModeFullScreen#6f8a019d: %w", err) + } + return w.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (w *WebAppOpenModeFullScreen) DecodeBare(b *bin.Buffer) error { + if w == nil { + return fmt.Errorf("can't decode webAppOpenModeFullScreen#6f8a019d to nil") + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (w *WebAppOpenModeFullScreen) EncodeTDLibJSON(b tdjson.Encoder) error { + if w == nil { + return fmt.Errorf("can't encode webAppOpenModeFullScreen#6f8a019d as nil") + } + b.ObjStart() + b.PutID("webAppOpenModeFullScreen") + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (w *WebAppOpenModeFullScreen) DecodeTDLibJSON(b tdjson.Decoder) error { + if w == nil { + return fmt.Errorf("can't decode webAppOpenModeFullScreen#6f8a019d to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("webAppOpenModeFullScreen"); err != nil { + return fmt.Errorf("unable to decode webAppOpenModeFullScreen#6f8a019d: %w", err) + } + default: + return b.Skip() + } + return nil + }) +} + +// WebAppOpenModeClassName is schema name of WebAppOpenModeClass. +const WebAppOpenModeClassName = "WebAppOpenMode" + +// WebAppOpenModeClass represents WebAppOpenMode generic type. +// +// Example: +// +// g, err := tdapi.DecodeWebAppOpenMode(buf) +// if err != nil { +// panic(err) +// } +// switch v := g.(type) { +// case *tdapi.WebAppOpenModeCompact: // webAppOpenModeCompact#6604ffdb +// case *tdapi.WebAppOpenModeFullSize: // webAppOpenModeFullSize#b48cd41 +// case *tdapi.WebAppOpenModeFullScreen: // webAppOpenModeFullScreen#6f8a019d +// default: panic(v) +// } +type WebAppOpenModeClass interface { + bin.Encoder + bin.Decoder + bin.BareEncoder + bin.BareDecoder + construct() WebAppOpenModeClass + + // 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 +} + +// DecodeWebAppOpenMode implements binary de-serialization for WebAppOpenModeClass. +func DecodeWebAppOpenMode(buf *bin.Buffer) (WebAppOpenModeClass, error) { + id, err := buf.PeekID() + if err != nil { + return nil, err + } + switch id { + case WebAppOpenModeCompactTypeID: + // Decoding webAppOpenModeCompact#6604ffdb. + v := WebAppOpenModeCompact{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode WebAppOpenModeClass: %w", err) + } + return &v, nil + case WebAppOpenModeFullSizeTypeID: + // Decoding webAppOpenModeFullSize#b48cd41. + v := WebAppOpenModeFullSize{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode WebAppOpenModeClass: %w", err) + } + return &v, nil + case WebAppOpenModeFullScreenTypeID: + // Decoding webAppOpenModeFullScreen#6f8a019d. + v := WebAppOpenModeFullScreen{} + if err := v.Decode(buf); err != nil { + return nil, fmt.Errorf("unable to decode WebAppOpenModeClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode WebAppOpenModeClass: %w", bin.NewUnexpectedID(id)) + } +} + +// DecodeTDLibJSONWebAppOpenMode implements binary de-serialization for WebAppOpenModeClass. +func DecodeTDLibJSONWebAppOpenMode(buf tdjson.Decoder) (WebAppOpenModeClass, error) { + id, err := buf.FindTypeID() + if err != nil { + return nil, err + } + switch id { + case "webAppOpenModeCompact": + // Decoding webAppOpenModeCompact#6604ffdb. + v := WebAppOpenModeCompact{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode WebAppOpenModeClass: %w", err) + } + return &v, nil + case "webAppOpenModeFullSize": + // Decoding webAppOpenModeFullSize#b48cd41. + v := WebAppOpenModeFullSize{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode WebAppOpenModeClass: %w", err) + } + return &v, nil + case "webAppOpenModeFullScreen": + // Decoding webAppOpenModeFullScreen#6f8a019d. + v := WebAppOpenModeFullScreen{} + if err := v.DecodeTDLibJSON(buf); err != nil { + return nil, fmt.Errorf("unable to decode WebAppOpenModeClass: %w", err) + } + return &v, nil + default: + return nil, fmt.Errorf("unable to decode WebAppOpenModeClass: %w", tdjson.NewUnexpectedID(id)) + } +} + +// WebAppOpenMode boxes the WebAppOpenModeClass providing a helper. +type WebAppOpenModeBox struct { + WebAppOpenMode WebAppOpenModeClass +} + +// Decode implements bin.Decoder for WebAppOpenModeBox. +func (b *WebAppOpenModeBox) Decode(buf *bin.Buffer) error { + if b == nil { + return fmt.Errorf("unable to decode WebAppOpenModeBox to nil") + } + v, err := DecodeWebAppOpenMode(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.WebAppOpenMode = v + return nil +} + +// Encode implements bin.Encode for WebAppOpenModeBox. +func (b *WebAppOpenModeBox) Encode(buf *bin.Buffer) error { + if b == nil || b.WebAppOpenMode == nil { + return fmt.Errorf("unable to encode WebAppOpenModeClass as nil") + } + return b.WebAppOpenMode.Encode(buf) +} + +// DecodeTDLibJSON implements bin.Decoder for WebAppOpenModeBox. +func (b *WebAppOpenModeBox) DecodeTDLibJSON(buf tdjson.Decoder) error { + if b == nil { + return fmt.Errorf("unable to decode WebAppOpenModeBox to nil") + } + v, err := DecodeTDLibJSONWebAppOpenMode(buf) + if err != nil { + return fmt.Errorf("unable to decode boxed value: %w", err) + } + b.WebAppOpenMode = v + return nil +} + +// EncodeTDLibJSON implements bin.Encode for WebAppOpenModeBox. +func (b *WebAppOpenModeBox) EncodeTDLibJSON(buf tdjson.Encoder) error { + if b == nil || b.WebAppOpenMode == nil { + return fmt.Errorf("unable to encode WebAppOpenModeClass as nil") + } + return b.WebAppOpenMode.EncodeTDLibJSON(buf) +} diff --git a/tdapi/tl_web_app_open_parameters_gen.go b/tdapi/tl_web_app_open_parameters_gen.go new file mode 100644 index 000000000..62120f0f6 --- /dev/null +++ b/tdapi/tl_web_app_open_parameters_gen.go @@ -0,0 +1,271 @@ +// 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{} +) + +// WebAppOpenParameters represents TL type `webAppOpenParameters#51fa466f`. +type WebAppOpenParameters struct { + // Preferred Web App theme; pass null to use the default theme + Theme ThemeParameters + // Short name of the current application; 0-64 English letters, digits, and underscores + ApplicationName string + // The mode in which the Web App is opened; pass null to open in webAppOpenModeFullSize + Mode WebAppOpenModeClass +} + +// WebAppOpenParametersTypeID is TL type id of WebAppOpenParameters. +const WebAppOpenParametersTypeID = 0x51fa466f + +// Ensuring interfaces in compile-time for WebAppOpenParameters. +var ( + _ bin.Encoder = &WebAppOpenParameters{} + _ bin.Decoder = &WebAppOpenParameters{} + _ bin.BareEncoder = &WebAppOpenParameters{} + _ bin.BareDecoder = &WebAppOpenParameters{} +) + +func (w *WebAppOpenParameters) Zero() bool { + if w == nil { + return true + } + if !(w.Theme.Zero()) { + return false + } + if !(w.ApplicationName == "") { + return false + } + if !(w.Mode == nil) { + return false + } + + return true +} + +// String implements fmt.Stringer. +func (w *WebAppOpenParameters) String() string { + if w == nil { + return "WebAppOpenParameters(nil)" + } + type Alias WebAppOpenParameters + return fmt.Sprintf("WebAppOpenParameters%+v", Alias(*w)) +} + +// TypeID returns type id in TL schema. +// +// See https://core.telegram.org/mtproto/TL-tl#remarks. +func (*WebAppOpenParameters) TypeID() uint32 { + return WebAppOpenParametersTypeID +} + +// TypeName returns name of type in TL schema. +func (*WebAppOpenParameters) TypeName() string { + return "webAppOpenParameters" +} + +// TypeInfo returns info about TL type. +func (w *WebAppOpenParameters) TypeInfo() tdp.Type { + typ := tdp.Type{ + Name: "webAppOpenParameters", + ID: WebAppOpenParametersTypeID, + } + if w == nil { + typ.Null = true + return typ + } + typ.Fields = []tdp.Field{ + { + Name: "Theme", + SchemaName: "theme", + }, + { + Name: "ApplicationName", + SchemaName: "application_name", + }, + { + Name: "Mode", + SchemaName: "mode", + }, + } + return typ +} + +// Encode implements bin.Encoder. +func (w *WebAppOpenParameters) Encode(b *bin.Buffer) error { + if w == nil { + return fmt.Errorf("can't encode webAppOpenParameters#51fa466f as nil") + } + b.PutID(WebAppOpenParametersTypeID) + return w.EncodeBare(b) +} + +// EncodeBare implements bin.BareEncoder. +func (w *WebAppOpenParameters) EncodeBare(b *bin.Buffer) error { + if w == nil { + return fmt.Errorf("can't encode webAppOpenParameters#51fa466f as nil") + } + if err := w.Theme.Encode(b); err != nil { + return fmt.Errorf("unable to encode webAppOpenParameters#51fa466f: field theme: %w", err) + } + b.PutString(w.ApplicationName) + if w.Mode == nil { + return fmt.Errorf("unable to encode webAppOpenParameters#51fa466f: field mode is nil") + } + if err := w.Mode.Encode(b); err != nil { + return fmt.Errorf("unable to encode webAppOpenParameters#51fa466f: field mode: %w", err) + } + return nil +} + +// Decode implements bin.Decoder. +func (w *WebAppOpenParameters) Decode(b *bin.Buffer) error { + if w == nil { + return fmt.Errorf("can't decode webAppOpenParameters#51fa466f to nil") + } + if err := b.ConsumeID(WebAppOpenParametersTypeID); err != nil { + return fmt.Errorf("unable to decode webAppOpenParameters#51fa466f: %w", err) + } + return w.DecodeBare(b) +} + +// DecodeBare implements bin.BareDecoder. +func (w *WebAppOpenParameters) DecodeBare(b *bin.Buffer) error { + if w == nil { + return fmt.Errorf("can't decode webAppOpenParameters#51fa466f to nil") + } + { + if err := w.Theme.Decode(b); err != nil { + return fmt.Errorf("unable to decode webAppOpenParameters#51fa466f: field theme: %w", err) + } + } + { + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode webAppOpenParameters#51fa466f: field application_name: %w", err) + } + w.ApplicationName = value + } + { + value, err := DecodeWebAppOpenMode(b) + if err != nil { + return fmt.Errorf("unable to decode webAppOpenParameters#51fa466f: field mode: %w", err) + } + w.Mode = value + } + return nil +} + +// EncodeTDLibJSON implements tdjson.TDLibEncoder. +func (w *WebAppOpenParameters) EncodeTDLibJSON(b tdjson.Encoder) error { + if w == nil { + return fmt.Errorf("can't encode webAppOpenParameters#51fa466f as nil") + } + b.ObjStart() + b.PutID("webAppOpenParameters") + b.Comma() + b.FieldStart("theme") + if err := w.Theme.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode webAppOpenParameters#51fa466f: field theme: %w", err) + } + b.Comma() + b.FieldStart("application_name") + b.PutString(w.ApplicationName) + b.Comma() + b.FieldStart("mode") + if w.Mode == nil { + return fmt.Errorf("unable to encode webAppOpenParameters#51fa466f: field mode is nil") + } + if err := w.Mode.EncodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to encode webAppOpenParameters#51fa466f: field mode: %w", err) + } + b.Comma() + b.StripComma() + b.ObjEnd() + return nil +} + +// DecodeTDLibJSON implements tdjson.TDLibDecoder. +func (w *WebAppOpenParameters) DecodeTDLibJSON(b tdjson.Decoder) error { + if w == nil { + return fmt.Errorf("can't decode webAppOpenParameters#51fa466f to nil") + } + + return b.Obj(func(b tdjson.Decoder, key []byte) error { + switch string(key) { + case tdjson.TypeField: + if err := b.ConsumeID("webAppOpenParameters"); err != nil { + return fmt.Errorf("unable to decode webAppOpenParameters#51fa466f: %w", err) + } + case "theme": + if err := w.Theme.DecodeTDLibJSON(b); err != nil { + return fmt.Errorf("unable to decode webAppOpenParameters#51fa466f: field theme: %w", err) + } + case "application_name": + value, err := b.String() + if err != nil { + return fmt.Errorf("unable to decode webAppOpenParameters#51fa466f: field application_name: %w", err) + } + w.ApplicationName = value + case "mode": + value, err := DecodeTDLibJSONWebAppOpenMode(b) + if err != nil { + return fmt.Errorf("unable to decode webAppOpenParameters#51fa466f: field mode: %w", err) + } + w.Mode = value + default: + return b.Skip() + } + return nil + }) +} + +// GetTheme returns value of Theme field. +func (w *WebAppOpenParameters) GetTheme() (value ThemeParameters) { + if w == nil { + return + } + return w.Theme +} + +// GetApplicationName returns value of ApplicationName field. +func (w *WebAppOpenParameters) GetApplicationName() (value string) { + if w == nil { + return + } + return w.ApplicationName +} + +// GetMode returns value of Mode field. +func (w *WebAppOpenParameters) GetMode() (value WebAppOpenModeClass) { + if w == nil { + return + } + return w.Mode +}